From 35849319e0c1b576110e5609b5c69f489531263e Mon Sep 17 00:00:00 2001 From: Benjamin Lemouzy Date: Thu, 29 Jun 2023 11:11:24 +0200 Subject: [PATCH] soc: arm: imx_rt10xx: support enet1 external clock Configure ENET_REF_CLK direction as input when CONFIG_ETH_MCUX_RMII_EXT_CLK is set to allow Ethernet external clock usage. Signed-off-by: Benjamin Lemouzy --- soc/arm/nxp_imx/rt/soc_rt10xx.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/soc/arm/nxp_imx/rt/soc_rt10xx.c b/soc/arm/nxp_imx/rt/soc_rt10xx.c index 7df476a417f312..914d568563f184 100644 --- a/soc/arm/nxp_imx/rt/soc_rt10xx.c +++ b/soc/arm/nxp_imx/rt/soc_rt10xx.c @@ -199,9 +199,14 @@ static ALWAYS_INLINE void clock_init(void) #if DT_NODE_HAS_STATUS(DT_NODELABEL(enet), okay) && CONFIG_NET_L2_ETHERNET +#if CONFIG_ETH_MCUX_RMII_EXT_CLK + /* Enable clock input for ENET1 */ + IOMUXC_EnableMode(IOMUXC_GPR, kIOMUXC_GPR_ENET1TxClkOutputDir, false); +#else /* Enable clock output for ENET1 */ IOMUXC_EnableMode(IOMUXC_GPR, kIOMUXC_GPR_ENET1TxClkOutputDir, true); #endif +#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(enet2), okay) && CONFIG_NET_L2_ETHERNET /* Set ENET2 ref clock to be generated by External OSC,*/