From 2ba6ba849485a64c957aa7ebb25712152d928072 Mon Sep 17 00:00:00 2001 From: Declan Snyder Date: Tue, 28 Jan 2025 09:15:56 -0600 Subject: [PATCH] drivers: nxp_enet: Re-add EXT RMII CLK config This config was missed when converting from eth_mcux to nxp_enet driver, re-add it and use new one instead of old one. Signed-off-by: Declan Snyder --- boards/nxp/vmu_rt1170/Kconfig.defconfig | 2 +- boards/segger/ip_k66f/Kconfig.defconfig | 7 ++----- drivers/ethernet/nxp_enet/Kconfig | 6 ++++++ soc/nxp/imxrt/imxrt10xx/soc.c | 2 +- soc/nxp/imxrt/imxrt11xx/soc.c | 4 ++-- soc/nxp/kinetis/k6x/soc.c | 2 +- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/boards/nxp/vmu_rt1170/Kconfig.defconfig b/boards/nxp/vmu_rt1170/Kconfig.defconfig index 7c62ad7ecde..35cd885fe66 100644 --- a/boards/nxp/vmu_rt1170/Kconfig.defconfig +++ b/boards/nxp/vmu_rt1170/Kconfig.defconfig @@ -17,7 +17,7 @@ if NETWORKING config NET_L2_ETHERNET default y if CPU_CORTEX_M7 # No cache memory support is required for driver -config ETH_MCUX_RMII_EXT_CLK +config ETH_NXP_ENET_RMII_EXT_CLK default y endif # NETWORKING diff --git a/boards/segger/ip_k66f/Kconfig.defconfig b/boards/segger/ip_k66f/Kconfig.defconfig index 06952ee0707..8d1d7ca0e21 100644 --- a/boards/segger/ip_k66f/Kconfig.defconfig +++ b/boards/segger/ip_k66f/Kconfig.defconfig @@ -22,11 +22,8 @@ if NETWORKING config NET_L2_ETHERNET default y -config ETH_MCUX_RMII_EXT_CLK - default y if ETH_MCUX - -config ETH_MCUX_NO_PHY_SMI - default y if ETH_MCUX +config ETH_NXP_ENET_RMII_EXT_CLK + default y endif # NETWORKING diff --git a/drivers/ethernet/nxp_enet/Kconfig b/drivers/ethernet/nxp_enet/Kconfig index 848d44b4856..d3203e870cf 100644 --- a/drivers/ethernet/nxp_enet/Kconfig +++ b/drivers/ethernet/nxp_enet/Kconfig @@ -88,6 +88,12 @@ config ETH_NXP_ENET_RX_THREAD_PRIORITY ENET MAC Driver handles RX in cooperative workqueue thread. This options sets the priority of that thread. +config ETH_NXP_ENET_RMII_EXT_CLK + bool "RMII clock from external sources" + help + Setting this option will configure ENET clock block to feed RMII + reference clock from external source (ENET_1588_CLKIN) + endif # ETH_NXP_ENET if ETH_MCUX diff --git a/soc/nxp/imxrt/imxrt10xx/soc.c b/soc/nxp/imxrt/imxrt10xx/soc.c index 554b4d57ed0..cbc93b10d87 100644 --- a/soc/nxp/imxrt/imxrt10xx/soc.c +++ b/soc/nxp/imxrt/imxrt10xx/soc.c @@ -227,7 +227,7 @@ __weak void clock_init(void) #if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(enet)) && CONFIG_NET_L2_ETHERNET -#if CONFIG_ETH_MCUX_RMII_EXT_CLK +#if CONFIG_ETH_NXP_ENET_RMII_EXT_CLK /* Enable clock input for ENET1 */ IOMUXC_EnableMode(IOMUXC_GPR, kIOMUXC_GPR_ENET1TxClkOutputDir, false); #else diff --git a/soc/nxp/imxrt/imxrt11xx/soc.c b/soc/nxp/imxrt/imxrt11xx/soc.c index a75297fe296..7a3b9788529 100644 --- a/soc/nxp/imxrt/imxrt11xx/soc.c +++ b/soc/nxp/imxrt/imxrt11xx/soc.c @@ -414,7 +414,7 @@ __weak void clock_init(void) rootCfg.mux = kCLOCK_ENET1_ClockRoot_MuxSysPll1Div2; rootCfg.div = 10; CLOCK_SetRootClock(kCLOCK_Root_Enet1, &rootCfg); -#if CONFIG_ETH_MCUX_RMII_EXT_CLK +#if CONFIG_ETH_NXP_ENET_RMII_EXT_CLK /* Set ENET_REF_CLK as an input driven by PHY */ IOMUXC_GPR->GPR4 &= ~IOMUXC_GPR_GPR4_ENET_REF_CLK_DIR(0x01U); IOMUXC_GPR->GPR4 |= IOMUXC_GPR_GPR4_ENET_TX_CLK_SEL(0x1U); @@ -442,7 +442,7 @@ __weak void clock_init(void) */ rootCfg.div = 10; CLOCK_SetRootClock(kCLOCK_Root_Enet2, &rootCfg); -#if CONFIG_ETH_MCUX_RMII_EXT_CLK +#if CONFIG_ETH_NXP_ENET_RMII_EXT_CLK /* Set ENET1G_REF_CLK as an input driven by PHY */ IOMUXC_GPR->GPR5 &= ~IOMUXC_GPR_GPR5_ENET1G_REF_CLK_DIR(0x01U); IOMUXC_GPR->GPR5 |= IOMUXC_GPR_GPR5_ENET1G_TX_CLK_SEL(0x1U); diff --git a/soc/nxp/kinetis/k6x/soc.c b/soc/nxp/kinetis/k6x/soc.c index 7f95d7d8f1c..6c48d448bb7 100644 --- a/soc/nxp/kinetis/k6x/soc.c +++ b/soc/nxp/kinetis/k6x/soc.c @@ -108,7 +108,7 @@ __weak void clock_init(void) #if CONFIG_ETH_MCUX || CONFIG_ETH_NXP_ENET CLOCK_SetEnetTime0Clock(TIMESRC_OSCERCLK); #endif -#if CONFIG_ETH_MCUX_RMII_EXT_CLK +#if CONFIG_ETH_NXP_ENET_RMII_EXT_CLK CLOCK_SetRmii0Clock(1); #endif #if CONFIG_USB_KINETIS || CONFIG_UDC_KINETIS