Skip to content

Commit

Permalink
boards: frdm_mcxn947: Add clock setup for FlexSPI
Browse files Browse the repository at this point in the history
The MEMC driver in memc_mcux_flexspi.c is initialized
before the FlexSPI driver (flash_mcux_flexspi_nor.c)
and hangs during FlexSPI init. Initialize the FlexSPI
clock to 50MHz before the speed is set to the optimum
speed by the FlexSPI driver.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
  • Loading branch information
mmahadevan108 authored and fabiobaltieri committed Apr 25, 2024
1 parent aa2b72d commit 4968021
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions boards/nxp/frdm_mcxn947/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/
#include <zephyr/init.h>
#include <zephyr/device.h>
#include <zephyr/dt-bindings/clock/mcux_lpc_syscon_clock.h>
#include <fsl_clock.h>
#include <fsl_spc.h>
#include <soc.h>
Expand Down Expand Up @@ -191,6 +192,14 @@ static int frdm_mcxn947_init(void)
CLOCK_AttachClk(kPLL0_to_CTIMER4);
#endif

#if CONFIG_FLASH_MCUX_FLEXSPI_NOR
/* We downclock the FlexSPI to 50MHz, it will be set to the
* optimum speed supported by the Flash device during FLEXSPI
* Init
*/
flexspi_clock_set_freq(MCUX_FLEXSPI_CLK, MHZ(50));
#endif

/* Set SystemCoreClock variable. */
SystemCoreClock = CLOCK_INIT_CORE_CLOCK;

Expand Down

0 comments on commit 4968021

Please sign in to comment.