Skip to content

Commit

Permalink
Update to the Hailo BSP v1.6.0
Browse files Browse the repository at this point in the history
Changes:
- Updated poky version
- Added SR SoM rev 1.1
- Added support of the SoM rev 1.0 as an overlay
  • Loading branch information
mdanikin committed Feb 11, 2025
1 parent 2f8cb88 commit 8af18ff
Show file tree
Hide file tree
Showing 35 changed files with 3,942 additions and 3,022 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ jobs:
cp $BUILD_PATH/u-boot-tfa.itb deploy/
cp $BUILD_PATH/hailo15_uart_recovery_fw.bin deploy/
cp $BUILD_PATH/hailo-update-image-hailo15-solidrun.swu deploy/
cp $SDK_PATH/poky-glibc-x86_64-core-image-minimal-armv8a-hailo15-solidrun-toolchain-4.0.2.sh deploy/
cp $SDK_PATH/poky-glibc-x86_64-core-image-minimal-armv8a-hailo15-solidrun-toolchain-*.sh deploy/
cp hailo15_board_tools*.whl deploy/
- name: Deploy to the local minio storage
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recipes-bsp/hailo-secureboot-assets
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ source poky/oe-init-build-env
bitbake core-image-minimal
```

### 2. Build the update package
#### Build the update package
```bash
bitbake hailo-update-image
```
Expand Down
7 changes: 4 additions & 3 deletions conf/machine/hailo15-solidrun.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require conf/machine/hailo15-base.inc
require conf/machine/include/hailo15-base.inc
require conf/machine/include/hailo-vpu-base.inc

MACHINEOVERRIDES =. "hailo15-solidrun:"
UBOOT_MACHINE = "hailo15_solidrun_defconfig"
Expand All @@ -11,8 +12,8 @@ MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-module-brcmfmac \
"
MACHINE_FEATURES += "bluetooth wifi"

KERNEL_DEVICETREE:append = " \
${LINUX_YOCTO_HAILO_BOARD_VENDOR}/hailo15-solidrun-hb-pro.dtb \
KERNEL_OVERLAYS:hailo15-solidrun = " \
${LINUX_YOCTO_HAILO_BOARD_VENDOR}/hailo15-sr-som-v1-overlay.dtbo \
"

INITRAMFS_IMAGE = "core-image-flashing-ramdisk"
2 changes: 2 additions & 0 deletions kas/hailo15-solidrun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ local_conf_header:
meta-solidrun-arm-hailo: |
require conf/includes/sr_image.conf
require conf/includes/hailo_demo.conf
DISTRO_FEATURES:append = " hailo-core"
DISTRO_FEATURES:append = " hailo-dev-pkg"
repos:
meta-solidrun-arm-hailo:
Expand Down
6 changes: 3 additions & 3 deletions kas/meta-hailo-soc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ header:
repos:
meta-hailo-soc:
url: https://github.com/hailo-ai/meta-hailo-soc/
commit: 658be45b11e753f0a969ebd29a49eb6e47743e26
commit: 0b8779e5bf9770a24578efe75ee5918bc1df8b00
layers:
meta-hailo-bsp-examples:
meta-hailo-bsp:
meta-hailo-dsp:
meta-hailo-imaging:
meta-hailo-linux:
meta-hailo-media-library:
meta-hailo-tappas:

meta-hailo:
url: "https://github.com/hailo-ai/meta-hailo.git"
branch: kirkstone-vpu
branch: kirkstone
layers:
meta-hailo-libhailort:
meta-hailo-vpu:
meta-hailo-tappas:
8 changes: 4 additions & 4 deletions kas/yocto-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ distro: poky
repos:
meta-openembedded:
url: "https://git.openembedded.org/meta-openembedded"
commit: fcc7d7eae82be4c180f2e8fa3db90a8ab3be07b7
commit: 4ad41baed6236d499804cbfc4f174042d84fce97
layers:
meta-filesystems:
meta-networking:
Expand All @@ -15,20 +15,20 @@ repos:

poky:
url: "https://git.yoctoproject.org/poky"
commit: a5ea426b1da472fc8549459fff3c1b8c6e02f4b5
commit: 8e092852b63e998d990b8f8e1aa91297dec4430f
layers:
meta:
meta-poky:
meta-yocto-bsp:

meta-swupdate:
url: "https://github.com/sbabic/meta-swupdate.git"
commit: 58878bb980877f51b607d71c3648bd479d68e2a5
commit: 6918be849ddf1fed5b7a0173e51c7a136e8d4101
layers:
.:
meta-arm:
url: "https://git.yoctoproject.org/meta-arm"
commit: c39bb4ce3b60b73d35c5fb06af012432e70d6b38
commit: bf98ef902e6e7042e46a69fb2df6c68d00de2764
layers:
meta-arm-toolchain:
meta-arm:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 0ecbb27c4fc13445210aea068b6c1d6816283f26 Mon Sep 17 00:00:00 2001
From 376a7885805cb109fd61493d3a6c9272bd855c77 Mon Sep 17 00:00:00 2001
From: Nate Drude <[email protected]>
Date: Wed, 12 Jul 2023 15:48:49 -0500
Subject: [PATCH 1/3] phy: mxl-8611x: add driver for MaxLinear mxl-8611x PHYs
Subject: [PATCH 01/20] phy: mxl-8611x: add driver for MaxLinear mxl-8611x PHYs

The MxL86110 is a low power Ethernet PHY transceiver integrated
circuit following the IEEE 802.3 [1] standard. It offers a
Expand Down Expand Up @@ -333,266 +333,5 @@ index 0000000000..467edc5bb5
+ .writeext = mxl8611x_extwrite,
+};
--
2.44.0


From 8e533d896aeca30248a1e97686300d5a4b30a8a5 Mon Sep 17 00:00:00 2001
From: Jon Nettleton <[email protected]>
Date: Wed, 1 Nov 2023 15:29:33 +0100
Subject: [PATCH 2/3] Merge with initial patch for backporting

Signed-off-by: Jon Nettleton <[email protected]>
---
drivers/net/phy/mxl-8611x.c | 19 ++++++++++++++-----
drivers/net/phy/phy.c | 3 +++
2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/drivers/net/phy/mxl-8611x.c b/drivers/net/phy/mxl-8611x.c
index 467edc5bb5..15ee8056c5 100644
--- a/drivers/net/phy/mxl-8611x.c
+++ b/drivers/net/phy/mxl-8611x.c
@@ -1,11 +1,14 @@
// SPDX-License-Identifier: GPL-2.0+
/**
- * Driver for MaxLinear MXL861100 Ethernet PHY
+ * Driver for MaxLinear MXL8611X Ethernet PHYs
*
* Copyright 2023 Variscite Ltd.
* Copyright 2023 MaxLinear Inc.
+ * Copyright 2023 SolidRun Ltd.
* Author: Nate Drude <[email protected]>
+ * Author: Jon Nettleton <[email protected]>
*/
+
#include <common.h>
#include <phy.h>
#include <linux/bitops.h>
@@ -236,17 +239,15 @@ static int mxl8611x_config(struct phy_device *phydev)

static int mxl86110_config(struct phy_device *phydev)
{
- printf("MXL86110 PHY detected at addr %d\n", phydev->addr);
return mxl8611x_config(phydev);
}

static int mxl86111_config(struct phy_device *phydev)
{
- printf("MXL86111 PHY detected at addr %d\n", phydev->addr);
return mxl8611x_config(phydev);
}

-U_BOOT_PHY_DRIVER(mxl86110) = {
+static struct phy_driver MXL86110_driver = {
.name = "MXL86110",
.uid = PHY_ID_MXL86110,
.mask = 0xffffffff,
@@ -258,7 +259,7 @@ U_BOOT_PHY_DRIVER(mxl86110) = {
.writeext = mxl8611x_extwrite,
};

-U_BOOT_PHY_DRIVER(mxl86111) = {
+static struct phy_driver MXL86111_driver = {
.name = "MXL86111",
.uid = PHY_ID_MXL86111,
.mask = 0xffffffff,
@@ -269,3 +270,11 @@ U_BOOT_PHY_DRIVER(mxl86111) = {
.readext = mxl8611x_extread,
.writeext = mxl8611x_extwrite,
};
+
+int phy_mxl8611x_init(void)
+{
+ phy_register(&MXL86110_driver);
+ phy_register(&MXL86111_driver);
+
+ return 0;
+}
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index c9fc20855b..1d87fb8859 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -526,6 +526,9 @@ int phy_init(void)
#ifdef CONFIG_PHY_MESON_GXL
phy_meson_gxl_init();
#endif
+#ifdef CONFIG_PHY_MXL8611X
+ phy_mxl8611x_init();
+#endif
#ifdef CONFIG_PHY_NATSEMI
phy_natsemi_init();
#endif
--
2.44.0


From 3a756d69aaf024384958dc7e0a90b6d4d3198778 Mon Sep 17 00:00:00 2001
From: Jon Nettleton <[email protected]>
Date: Wed, 1 Nov 2023 15:30:20 +0100
Subject: [PATCH 3/3] Fixup for device-tree patch

Signed-off-by: Jon Nettleton <[email protected]>
---
drivers/net/phy/mxl-8611x.c | 98 ++++++++++++++++++-------------------
1 file changed, 47 insertions(+), 51 deletions(-)

diff --git a/drivers/net/phy/mxl-8611x.c b/drivers/net/phy/mxl-8611x.c
index 15ee8056c5..19eb56567a 100644
--- a/drivers/net/phy/mxl-8611x.c
+++ b/drivers/net/phy/mxl-8611x.c
@@ -11,8 +11,9 @@

#include <common.h>
#include <phy.h>
-#include <linux/bitops.h>
+#include <dm/device_compat.h>
#include <linux/bitfield.h>
+#include <linux/bitops.h>

/* PHY IDs */
#define PHY_ID_MXL86110 0xC1335580
@@ -35,49 +36,14 @@
#define MXL8611X_LED1_CFG_REG 0xA00D
#define MXL8611X_LED2_CFG_REG 0xA00E

-/**
- * struct mxl8611x_cfg_reg_map - map a config value to aregister value
- * @cfg value in device configuration
- * @reg value in the register
- */
-struct mxl8611x_cfg_reg_map {
- int cfg;
- int reg;
-};
-
-static const struct mxl8611x_cfg_reg_map mxl8611x_rgmii_delays[] = {
- { 0, 0 },
- { 150, 1 },
- { 300, 2 },
- { 450, 3 },
- { 600, 4 },
- { 750, 5 },
- { 900, 6 },
- { 1050, 7 },
- { 1200, 8 },
- { 1350, 9 },
- { 1500, 10 },
- { 1650, 11 },
- { 1800, 12 },
- { 1950, 13 },
- { 2100, 14 },
- { 2250, 15 },
- { 0, 0 } // Marks the end of the array
-};
-
-static int mxl8611x_lookup_reg_value(const struct mxl8611x_cfg_reg_map *tbl,
- const int cfg, int *reg)
+static int mxl8611x_convert_ps_to_reg(int of_value, int *reg)
{
- size_t i;
+ if (of_value < 0 || of_value > 2250)
+ return -EINVAL;

- for (i = 0; i == 0 || tbl[i].cfg; i++) {
- if (tbl[i].cfg == cfg) {
- *reg = tbl[i].reg;
- return 0;
- }
- }
+ *reg = DIV_ROUND_CLOSEST(of_value, 150);

- return -EINVAL;
+ return 0;
}

static u16 mxl8611x_ext_read(struct phy_device *phydev, const u32 regnum)
@@ -115,27 +81,42 @@ static int mxl8611x_extwrite(struct phy_device *phydev, int addr,

static int mxl8611x_led_cfg(struct phy_device *phydev)
{
- int ret = 0;
+ int ret;
int i;
char propname[25];
- u32 val;
+ u32 of_val;

ofnode node = phy_get_ofnode(phydev);

if (!ofnode_valid(node)) {
- printf("%s: failed to get node\n", __func__);
+ dev_err(phydev->dev, "%s: failed to get node\n", __func__);
+ return -EINVAL;
+ }
+
+ /* Get property from dts */
+ ret = ofnode_read_u32(node, "phy-handle", &of_val);
+ if (ret) {
+ dev_err(phydev->dev, "%s: failed to get phy-handle\n", __func__);
+ return ret;
+ }
+
+ node = ofnode_get_by_phandle(of_val);
+
+ if (!ofnode_valid(node)) {
+ dev_err(phydev->dev, "%s: failed to get phandle node\n", __func__);
return -EINVAL;
}

/* Loop through three the LED registers */
for (i = 0; i < 3; i++) {
/* Read property from device tree */
- ret = snprintf(propname, 25, "mxl-8611x,led%d_cfg", i);
- if (ofnode_read_u32(node, propname, &val))
+ ret = snprintf(propname, sizeof(propname), "mxl-8611x,led%d_cfg", i);
+ if (ofnode_read_u32(node, propname, &of_val))
continue;

+ printf("setting %s to 0x%x\n", propname, of_val);
/* Update PHY LED register */
- mxl8611x_ext_write(phydev, MXL8611X_LED0_CFG_REG + i, val);
+ mxl8611x_ext_write(phydev, MXL8611X_LED0_CFG_REG + i, of_val);
}

return 0;
@@ -149,19 +130,34 @@ static int mxl8611x_rgmii_cfg_of_delay(struct phy_device *phydev, const char *pr
ofnode node = phy_get_ofnode(phydev);

if (!ofnode_valid(node)) {
- printf("%s: failed to get node\n", __func__);
+ dev_err(phydev->dev, "%s: failed to get node\n", __func__);
+ return -EINVAL;
+ }
+
+ /* Get property from dts */
+ ret = ofnode_read_u32(node, "phy-handle", &of_val);
+ if (ret) {
+ dev_err(phydev->dev, "%s: failed to get phy-handle\n", __func__);
+ return ret;
+ }
+
+ node = ofnode_get_by_phandle(of_val);
+
+ if (!ofnode_valid(node)) {
+ dev_err(phydev->dev, "%s: failed to get phandle node\n", __func__);
return -EINVAL;
}

/* Get property from dts */
ret = ofnode_read_u32(node, property, &of_val);
- if (ret)
+ if (ret) {
return ret;
+ }

/* Convert delay in ps to register value */
- ret = mxl8611x_lookup_reg_value(mxl8611x_rgmii_delays, of_val, val);
+ ret = mxl8611x_convert_ps_to_reg(of_val, val);
if (ret)
- printf("%s: Error: %s = %d is invalid, using default value\n",
+ dev_err(phydev->dev, "%s: %s = %d is invalid, using default value\n",
__func__, property, of_val);

return ret;
--
2.44.0
2.47.1

Loading

0 comments on commit 8af18ff

Please sign in to comment.