From 859f9389758876c6d3e81b5738bd2c2d347b038d Mon Sep 17 00:00:00 2001 From: Sarthak Pandey Date: Fri, 16 Oct 2026 01:58:25 +0530 Subject: [PATCH] arch/arm/imxrt: fix PHY address scan and YT8512 macro typo - In imxrt_determine_phy(), save the detected phyaddr into priv->current_phy_address so address ranges in BOARD_ETH0_PHY_LIST work properly. - In imxrt_phyintenable(), fix CONFIG_ETH0_YT8512 to CONFIG_ETH0_PHY_YT8512 to match the Kconfig symbol name. Fixes #20692 Signed-off-by: Sarthak Pandey --- arch/arm/src/imxrt/imxrt_enet.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/src/imxrt/imxrt_enet.c b/arch/arm/src/imxrt/imxrt_enet.c index a62ca540e88d0..143f415cf3eb9 100644 --- a/arch/arm/src/imxrt/imxrt_enet.c +++ b/arch/arm/src/imxrt/imxrt_enet.c @@ -2031,7 +2031,7 @@ static int imxrt_phyintenable(struct imxrt_driver_s *priv) { #if defined(CONFIG_ETH0_PHY_KSZ8051) || defined(CONFIG_ETH0_PHY_KSZ8061) || \ defined(CONFIG_ETH0_PHY_KSZ8081) || defined(CONFIG_ETH0_PHY_DP83825I) || \ - defined(CONFIG_ETH0_YT8512) || defined(CONFIG_ETH0_PHY_LAN8720) || \ + defined(CONFIG_ETH0_PHY_YT8512) || defined(CONFIG_ETH0_PHY_LAN8720) || \ defined(CONFIG_ETH0_PHY_LAN8742A) || defined(CONFIG_ETH0_PHY_MULTI) uint16_t phyval; @@ -2044,7 +2044,7 @@ static int imxrt_phyintenable(struct imxrt_driver_s *priv) uint8_t wreg = rreg; /* Compile time YT8512 defaults */ -# if defined(CONFIG_ETH0_YT8512) +# if defined(CONFIG_ETH0_PHY_YT8512) mask = MII_YT8512_IMR_LD_EN | MII_YT8512_IMR_LU_EN; rreg = MII_YT8512_ISR; wreg = MII_YT8512_IMR; @@ -2312,6 +2312,7 @@ static int imxrt_determine_phy(struct imxrt_driver_s *priv) (phydata & 0xfff0) == (g_board_phys[priv->current_phy].id2 & 0xfff0)) { + priv->current_phy_address = phyaddr; return OK; } }