dts: arm: nxp: nxp_imx8m_m4: Add ECSPI devices

Add device tree instances for ECSPI devices,
update SoC code to enable clocks.

Signed-off-by: Peter Fecher <p.fecher@phytec.de>
This commit is contained in:
Peter Fecher 2024-08-27 16:47:45 +02:00 committed by Carles Cufí
commit 6560128418
2 changed files with 53 additions and 0 deletions

View file

@ -128,6 +128,29 @@ static void SOC_ClockInit(void)
/* Set root clock to 80MHZ/ 1= 80MHZ */
CLOCK_SetRootDivider(kCLOCK_RootUart4, 1U, 1U);
#endif
#endif
#if defined(CONFIG_SPI_MCUX_ECSPI)
#if DT_NODE_HAS_STATUS(DT_NODELABEL(ecspi1), okay)
/* Set ECSPI1 source to SYSTEM PLL1 800MHZ */
CLOCK_SetRootMux(kCLOCK_RootEcspi1, kCLOCK_EcspiRootmuxSysPll1);
/* Set root clock to 800MHZ / 10 = 80MHZ */
CLOCK_SetRootDivider(kCLOCK_RootEcspi1, 2U, 5U);
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(ecspi2), okay)
/* Set ECSPI2 source to SYSTEM PLL1 800MHZ */
CLOCK_SetRootMux(kCLOCK_RootEcspi2, kCLOCK_EcspiRootmuxSysPll1);
/* Set root clock to 800MHZ / 10 = 80MHZ */
CLOCK_SetRootDivider(kCLOCK_RootEcspi2, 2U, 5U);
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(ecspi3), okay)
/* Set ECSPI3 source to SYSTEM PLL1 800MHZ */
CLOCK_SetRootMux(kCLOCK_RootEcspi3, kCLOCK_EcspiRootmuxSysPll1);
/* Set root clock to 800MHZ / 10 = 80MHZ */
CLOCK_SetRootDivider(kCLOCK_RootEcspi3, 2U, 5U);
#endif
#endif
/* Enable RDC clock */