[U-Boot] [PATCH 10/11] board: ls2080a: Initialize eth before mcinitcmd

The mcinitcmd usually boots the MC, and also patches the DPC with u-boot environment MAC addresses for the MAC phy interfaces. In order for this to work, the board phy interfaces must be initialized before this point.
Signed-off-by: Bogdan Purcareata bogdan.purcareata@nxp.com --- board/freescale/ls2080aqds/eth.c | 2 +- board/freescale/ls2080ardb/eth_ls2080rdb.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/board/freescale/ls2080aqds/eth.c b/board/freescale/ls2080aqds/eth.c index 59361e9..d051dd8 100644 --- a/board/freescale/ls2080aqds/eth.c +++ b/board/freescale/ls2080aqds/eth.c @@ -902,10 +902,10 @@ int board_eth_init(bd_t *bis) } }
+ error = cpu_eth_init(bis); mc_boot_env_var = getenv(MC_BOOT_ENV_VAR); if (mc_boot_env_var) run_command_list(mc_boot_env_var, -1, 0); - error = cpu_eth_init(bis);
if (hwconfig_f("xqsgmii", env_hwconfig)) { if (serdes1_prtcl == 0x7) diff --git a/board/freescale/ls2080ardb/eth_ls2080rdb.c b/board/freescale/ls2080ardb/eth_ls2080rdb.c index 799799c..5f5c304 100644 --- a/board/freescale/ls2080ardb/eth_ls2080rdb.c +++ b/board/freescale/ls2080ardb/eth_ls2080rdb.c @@ -91,10 +91,10 @@ int board_eth_init(bd_t *bis) } }
+ cpu_eth_init(bis); mc_boot_env_var = getenv(MC_BOOT_ENV_VAR); if (mc_boot_env_var) run_command_list(mc_boot_env_var, -1, 0); - cpu_eth_init(bis); #endif /* CONFIG_FMAN_ENET */
#ifdef CONFIG_PHY_AQUANTIA

MC might boot before MAC addresses are assigned to eth_devices from the u-boot environment. Write them when booting the MC so that they are available for the DPC fixup.
Signed-off-by: Bogdan Purcareata bogdan.purcareata@nxp.com --- drivers/net/fsl-mc/mc.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c index 9f69d75..18cb63c 100644 --- a/drivers/net/fsl-mc/mc.c +++ b/drivers/net/fsl-mc/mc.c @@ -164,6 +164,14 @@ static int mc_fixup_dpc_mac_addr(void *blob, int noff, int dpmac_id,
sprintf(mac_name, "mac@%d", dpmac_id);
+ /* MC might boot before eth MAC addresses have been initialized */ + err = eth_write_hwaddr(eth_dev, "eth", eth_dev->index); + if (err) { + printf("eth_write_hwaddr: err=%s\n", + fdt_strerror(err)); + return err; + } + /* node not found - create it */ nodeoffset = fdt_subnode_offset(blob, noff, (const char *) mac_name); if (nodeoffset < 0) {
participants (1)
-
Bogdan Purcareata