soc: arm: Fix condition to set lpc55xxx flash wait states

Commit f5c6afeccb attempted to avoid
accessing lpc55xxx flash registers in nonsecure mode by conditionalizing
part of the SoC clock initialization routine on whether the flash driver
was enabled. This caused secure applications without the flash driver
enabled (e.g., hello_world on lpcxpresso55s69_cpu0) to not boot or show
any console output. Fix this by changing the condition to depend on
whether we are building a nonsecure image.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
This commit is contained in:
Maureen Helm 2021-05-27 09:17:43 -05:00 committed by Kumar Gala
commit 5531525f17

View file

@ -50,7 +50,7 @@ static ALWAYS_INLINE void clock_init(void)
/* Enable FRO HF(96MHz) output */ /* Enable FRO HF(96MHz) output */
CLOCK_SetupFROClocking(96000000U); CLOCK_SetupFROClocking(96000000U);
#if defined(CONFIG_SOC_FLASH_MCUX) #if !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE)
/*!< Set FLASH wait states for core */ /*!< Set FLASH wait states for core */
CLOCK_SetFLASHAccessCyclesForFreq(96000000U); CLOCK_SetFLASHAccessCyclesForFreq(96000000U);
#endif #endif