Skip to content

Commit 86b346e

Browse files
AllenZhang-NXPjhedberg
authored andcommitted
drivers: flash: Added clear_flash_caches function for MCXW2XX
MCXW2XX ROMAPI provide the function FLASH_CacheClear to clear the cache. The SMSCM is not supported on MCXW2XX platform. Signed-off-by: Allen Zhang <[email protected]>
1 parent 499102f commit 86b346e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/flash/soc_flash_mcux.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,12 @@ static status_t is_area_readable(uint32_t addr, size_t len)
119119

120120
#define SOC_FLASH_NEED_CLEAR_CACHES 1
121121
#ifdef CONFIG_SOC_FAMILY_MCXW
122+
#ifdef CONFIG_SOC_SERIES_MCXW2XX
123+
static void clear_flash_caches(void)
124+
{
125+
FLASH_CacheClear();
126+
}
127+
#elif
122128
static void clear_flash_caches(void)
123129
{
124130
volatile uint32_t *const smscm_ocmdr0 = (volatile uint32_t *)0x40015400;
@@ -128,6 +134,7 @@ static void clear_flash_caches(void)
128134
/* this bit clears the code cache */
129135
*mcm_cpcr2 |= BIT(0);
130136
}
137+
#endif
131138
#elif CONFIG_SOC_FAMILY_MCXN
132139
static void clear_flash_caches(void)
133140
{

0 commit comments

Comments
 (0)