diff --git a/board/qca/arm/common/cmd_bootqca.c b/board/qca/arm/common/cmd_bootqca.c index ca6049b9ac..0cdf3807c5 100644 --- a/board/qca/arm/common/cmd_bootqca.c +++ b/board/qca/arm/common/cmd_bootqca.c @@ -160,6 +160,11 @@ void dump_func(void) { uint64_t etime; +#ifdef CONFIG_IPQ_ETH_INIT_DEFER + puts("\nNet: "); + eth_initialize(); +#endif + etime = get_timer_masked() + (10 * CONFIG_SYS_HZ); printf("\nCrashdump magic found." "\nHit any key within 10s to stop dump activity..."); diff --git a/common/autoboot.c b/common/autoboot.c index c11fb31236..49bc024602 100644 --- a/common/autoboot.c +++ b/common/autoboot.c @@ -271,7 +271,12 @@ static int abortboot_normal(int bootdelay) if (abort) gd->flags &= ~GD_FLG_SILENT; #endif - +#ifdef CONFIG_IPQ_ETH_INIT_DEFER + if (abort) { + puts("\nNet: "); + eth_initialize(); + } +#endif return abort; } # endif /* CONFIG_AUTOBOOT_KEYED */ diff --git a/common/board_r.c b/common/board_r.c index 75ee43e2d7..44ac8ed6be 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -634,8 +634,10 @@ static int initr_bbmii(void) #ifdef CONFIG_CMD_NET static int initr_net(void) { +#if !defined(CONFIG_IPQ_ETH_INIT_DEFER) puts("Net: "); eth_initialize(); +#endif #if defined(CONFIG_RESET_PHY_R) debug("Reset Ethernet PHY\n"); reset_phy(); diff --git a/include/configs/ipq807x.h b/include/configs/ipq807x.h index ffc7322e7f..b7a67e343f 100644 --- a/include/configs/ipq807x.h +++ b/include/configs/ipq807x.h @@ -266,6 +266,7 @@ extern loff_t board_env_offset; #define CONFIG_CMD_TFTPPUT #define CONFIG_IPQ_MDIO 1 #define CONFIG_QCA8075_PHY 1 +#define CONFIG_IPQ_ETH_INIT_DEFER /* * CRASH DUMP ENABLE diff --git a/net/eth.c b/net/eth.c index 45fe6e3c1c..3d9739522d 100644 --- a/net/eth.c +++ b/net/eth.c @@ -167,6 +167,11 @@ struct udevice *eth_get_dev(void) uc_priv = eth_get_uclass_priv(); if (!uc_priv->current) +#ifdef CONFIG_IPQ_ETH_INIT_DEFER + eth_initialize(); + /* Wait 3s for link to settle down */ + mdelay(3000); +#endif eth_errno = uclass_first_device(UCLASS_ETH, &uc_priv->current); return uc_priv->current;