arch/arm64/imx9: Configure ENET clock

Configure ENET clock to 125MHz in clock init

Signed-off-by: Jouni Ukkonen <jouni.ukkonen@unikie.com>
This commit is contained in:
Jouni Ukkonen
2024-08-21 12:31:41 +03:00
committed by Xiang Xiao
parent 3f82050623
commit 101c2f0421
2 changed files with 22 additions and 0 deletions
@@ -730,6 +730,8 @@ static const int g_ccm_root_mux[][ROOT_MUX_MAX] =
#define CCM_NIC_APB_CLK_ROOT 66
#define CCM_DRAM_ALT_CLK_ROOT 76
#define CCM_DRAM_APB_CLK_ROOT 77
#define CCM_ENET_TIMER_CLK_ROOT 87
#define CCM_ENET_REF_CLK_ROOT 89
#define CCM_CLK_ROOT_NUM 95
#define CCM_OSCPLL_END 19
+20
View File
@@ -556,5 +556,25 @@ int imx9_ccm_clock_init(void)
return ret;
}
/* ENET to 125MHz */
imx9_ccm_gate_on(CCM_LPCG_ENET1, false);
ret = imx9_ccm_configure_root_clock(CCM_ENET_REF_CLK_ROOT,
SYS_PLL1PFD0DIV2, 2);
if (ret != 0)
{
return ret;
}
ret = imx9_ccm_configure_root_clock(CCM_ENET_TIMER_CLK_ROOT,
SYS_PLL1PFD0DIV2, 5);
if (ret != 0)
{
return ret;
}
imx9_ccm_gate_on(CCM_LPCG_ENET1, true);
return OK;
}