[PATCH rtems] bsps/imx: Enable clock of ETH2

Christian Mauderer christian.mauderer at embedded-brains.de
Mon May 23 12:22:31 UTC 2022


---
 bsps/arm/imx/start/bspstart.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/bsps/arm/imx/start/bspstart.c b/bsps/arm/imx/start/bspstart.c
index 04d48d1558..e9cca49200 100644
--- a/bsps/arm/imx/start/bspstart.c
+++ b/bsps/arm/imx/start/bspstart.c
@@ -161,6 +161,18 @@ static void imx_find_gic(const void *fdt)
 #endif
 }
 
+static void imx_ccm_enable_eth2_clk(void)
+{
+  const void *fdt = bsp_fdt_get();
+
+  if (imx_is_imx6(fdt)) {
+    volatile uint32_t *ccm_pll_enet_set = (void *)0x020c80e4;
+    const uint32_t ccm_pll_enet_enet2_125m_en = (1 << 20);
+
+    *ccm_pll_enet_set = ccm_pll_enet_enet2_125m_en;
+  }
+}
+
 void bsp_start(void)
 {
   imx_find_gic(bsp_fdt_get());
@@ -169,4 +181,5 @@ void bsp_start(void)
     bsp_section_nocacheheap_begin,
     (uintptr_t) bsp_section_nocacheheap_size
   );
+  imx_ccm_enable_eth2_clk();
 }
-- 
2.35.3



More information about the devel mailing list