Skip to content

Commit 1af8f27

Browse files
danieldegrassecarlescufi
authored andcommitted
soc: arm: add support for FlexSPI1 clock configuration for NXP RT5xx
Add support for configuring FlexSPI1 clock speed to RT5xx soc initialization, so that memory present on FlexSPI1 can be accessed. Note that FlexSPI1 is referred to as FlexSPI2 in the dts files for this SOC. Signed-off-by: Daniel DeGrasse <[email protected]>
1 parent 64a14a8 commit 1af8f27

File tree

1 file changed

+11
-0
lines changed
  • soc/arm/nxp_imx/rt5xx

1 file changed

+11
-0
lines changed

soc/arm/nxp_imx/rt5xx/soc.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,17 @@ static void clock_init(void)
313313
flexspi_setup_clock(FLEXSPI0, 0U, 2U);
314314
#endif
315315

316+
#if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(flexspi2), nxp_imx_flexspi, okay)
317+
/* Power up FlexSPI1 SRAM */
318+
POWER_DisablePD(kPDRUNCFG_APD_FLEXSPI1_SRAM);
319+
POWER_DisablePD(kPDRUNCFG_PPD_FLEXSPI1_SRAM);
320+
POWER_ApplyPD();
321+
/* Setup clock frequency for FlexSPI1 */
322+
CLOCK_AttachClk(kMAIN_CLK_to_FLEXSPI1_CLK);
323+
CLOCK_SetClkDiv(kCLOCK_DivFlexspi1Clk, 1);
324+
/* Reset peripheral module */
325+
RESET_PeripheralReset(kFLEXSPI1_RST_SHIFT_RSTn);
326+
#endif
316327
/* Set SystemCoreClock variable. */
317328
SystemCoreClock = CLOCK_INIT_CORE_CLOCK;
318329

0 commit comments

Comments
 (0)