Skip to content

i.MX RT10xx boards fail to initialize when Ethernet is enabled #38186

@MaureenHelm

Description

@MaureenHelm

Describe the bug
The kernel fails to initialize on i.MX RT10xx boards when Ethernet is enabled because the board-level PHY reset routine mimxrt1064_evk_phy_reset() never completes.

The PHY reset occurs in PRE_KERNEL_2 and invokes k_busy_wait().

The system clock driver is initialized in PRE_KERNEL_2.

Commit f0b3146 affected the relative order of these two operations, causing the PHY reset to occur before the system clock driver is initialized.

Found while experimenting with #37863

To Reproduce

$ west build -p auto -b mimxrt1064_evk samples/net/dhcpv4_client
$ west flash

No output on the console.

Expected behavior
Boot banner and assigned IP address to print on the console.

Impact
Affects all i.MX RT boards that currently support Ethernet: mimxrt1020_evk, mimxrt1050_evk, mimxrt1060_evk, mimxrt1064_evk

Logs and console output
There is no console output.

Environment (please complete the following information):

  • OS: Linux
  • Toolchain zephyr-sdk-0.13.0
  • Commit fd864c6

Additional context
The following is a cheap fix, but there may be a more robust way to do it.

$ git diff
diff --git a/boards/arm/mimxrt1064_evk/pinmux.c b/boards/arm/mimxrt1064_evk/pinmux.c
index 484a9a9ca6..ce31f5c2d9 100644
--- a/boards/arm/mimxrt1064_evk/pinmux.c
+++ b/boards/arm/mimxrt1064_evk/pinmux.c
@@ -351,5 +351,5 @@ static int mimxrt1064_evk_phy_reset(const struct device *dev)
 
 SYS_INIT(mimxrt1064_evk_init, PRE_KERNEL_1, 0);
 #if DT_NODE_HAS_STATUS(DT_NODELABEL(enet), okay) && CONFIG_NET_L2_ETHERNET
-SYS_INIT(mimxrt1064_evk_phy_reset, PRE_KERNEL_2, 0);
+SYS_INIT(mimxrt1064_evk_phy_reset, PRE_KERNEL_2, 1);
 #endif

cc: @dleach02 @mmahadevan108 @hakehuang @dcpleung @aunsbjerg

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions