Skip to content

Commit

Permalink
soc: nxp: ke1xf: enable code cache
Browse files Browse the repository at this point in the history
Add option for enabling the Code Cache present on the NXP Kinetis
KE1xF SoC series and enable it by default.

Signed-off-by: Henrik Brix Andersen <[email protected]>
  • Loading branch information
henrikbrixandersen authored and MaureenHelm committed May 21, 2019
1 parent 5c29d0e commit a5e929a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions ext/hal/nxp/mcux/drivers/kinetis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ zephyr_library_compile_definitions_ifdef(
CONFIG_PTP_CLOCK_MCUX ENET_ENHANCEDBUFFERDESCRIPTOR_MODE
)

zephyr_sources_ifdef(CONFIG_HAS_MCUX_CACHE fsl_cache.c)
zephyr_sources_ifdef(CONFIG_ADC_MCUX_ADC16 fsl_adc16.c)
zephyr_sources_ifdef(CONFIG_ETH_MCUX fsl_enet.c)
zephyr_sources_ifdef(CONFIG_I2C_MCUX fsl_i2c.c)
Expand Down
1 change: 1 addition & 0 deletions soc/arm/nxp_kinetis/ke1xf/Kconfig.series
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ config SOC_SERIES_KINETIS_KE1XF
select CPU_HAS_FPU
select CLOCK_CONTROL
select HAS_MCUX
select HAS_MCUX_CACHE
select HAS_MCUX_FTFX
select HAS_MCUX_LPUART
select HAS_MCUX_PCC
Expand Down
4 changes: 4 additions & 0 deletions soc/arm/nxp_kinetis/ke1xf/Kconfig.soc
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,8 @@ config WDOG_INIT
requires that the watchdog be configured during reset
handling.

config KINETIS_KE1XF_ENABLE_CODE_CACHE
bool "Enable the code cache"
default y

endif # SOC_SERIES_KINETIS_KE1XF
4 changes: 4 additions & 0 deletions soc/arm/nxp_kinetis/ke1xf/soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <device.h>
#include <init.h>
#include <fsl_clock.h>
#include <fsl_cache.h>
#include <cortex_m/exc.h>

/*
Expand Down Expand Up @@ -241,6 +242,9 @@ static int ke1xf_init(struct device *arg)
*/
NMI_INIT();

#ifdef CONFIG_KINETIS_KE1XF_ENABLE_CODE_CACHE
L1CACHE_EnableCodeCache();
#endif
/* Restore interrupt state */
irq_unlock(old_level);

Expand Down

0 comments on commit a5e929a

Please sign in to comment.