From a097cdc4feb96067642260e988e90dfa03de9cc3 Mon Sep 17 00:00:00 2001 From: Declan Snyder Date: Mon, 12 Aug 2024 14:15:19 -0500 Subject: [PATCH] soc: nxp: Centralize flexspi related configuration Currently this code related to how to configure the flash size and address when using flexspi to XIP is copy pasted in all sort of places and ways all over the tree, let's clean this up and have single point of control over this configuration. Signed-off-by: Declan Snyder --- boards/nxp/mimxrt1160_evk/Kconfig.defconfig | 9 ---- boards/nxp/mimxrt1170_evk/Kconfig.defconfig | 9 ---- boards/nxp/mimxrt595_evk/Kconfig.defconfig | 4 -- boards/nxp/mimxrt685_evk/Kconfig.defconfig | 4 -- boards/nxp/vmu_rt1170/Kconfig.defconfig | 9 ---- soc/nxp/common/Kconfig.flexspi_xip | 41 ++++++++++++++++++ soc/nxp/imxrt/Kconfig | 42 +------------------ soc/nxp/imxrt/Kconfig.defconfig | 31 ++++++-------- soc/nxp/imxrt/imxrt10xx/CMakeLists.txt | 2 +- soc/nxp/imxrt/imxrt11xx/Kconfig.defconfig | 1 + soc/nxp/imxrt/imxrt5xx/Kconfig.defconfig | 4 -- soc/nxp/imxrt/imxrt5xx/cm33/CMakeLists.txt | 7 ++-- soc/nxp/imxrt/imxrt6xx/Kconfig | 1 - soc/nxp/imxrt/imxrt6xx/Kconfig.defconfig | 27 ------------ soc/nxp/mcx/mcxn/Kconfig | 25 +---------- soc/nxp/mcx/mcxn/Kconfig.defconfig | 12 ------ soc/nxp/rw/Kconfig | 20 +-------- soc/nxp/rw/Kconfig.defconfig | 31 +------------- .../flash/common/boards/mimxrt1060_evk.conf | 2 +- 19 files changed, 63 insertions(+), 218 deletions(-) create mode 100644 soc/nxp/common/Kconfig.flexspi_xip diff --git a/boards/nxp/mimxrt1160_evk/Kconfig.defconfig b/boards/nxp/mimxrt1160_evk/Kconfig.defconfig index 340878191a0..d4743f1db06 100644 --- a/boards/nxp/mimxrt1160_evk/Kconfig.defconfig +++ b/boards/nxp/mimxrt1160_evk/Kconfig.defconfig @@ -31,15 +31,6 @@ config SYS_CLOCK_HW_CYCLES_PER_SEC default 240000000 if BOARD_MIMXRT1160_EVK_MIMXRT1166_CM4 && CORTEX_M_SYSTICK default 600000000 if BOARD_MIMXRT1160_EVK_MIMXRT1166_CM7 && CORTEX_M_SYSTICK -if FLASH_MCUX_FLEXSPI_XIP && MEMC_MCUX_FLEXSPI - -choice FLASH_MCUX_FLEXSPI_XIP_MEM_TARGET - default FLASH_MCUX_FLEXSPI_XIP_MEM_ITCM if CPU_CORTEX_M7 - default FLASH_MCUX_FLEXSPI_XIP_MEM_SRAM if CPU_CORTEX_M4 -endchoice - -endif # FLASH_MCUX_FLEXSPI_XIP && MEMC_MCUX_FLEXSPI - if NETWORKING config NET_L2_ETHERNET diff --git a/boards/nxp/mimxrt1170_evk/Kconfig.defconfig b/boards/nxp/mimxrt1170_evk/Kconfig.defconfig index a54b1b8a145..3dcd48449bd 100644 --- a/boards/nxp/mimxrt1170_evk/Kconfig.defconfig +++ b/boards/nxp/mimxrt1170_evk/Kconfig.defconfig @@ -34,15 +34,6 @@ config IMX_USDHC_DAT3_PWR_TOGGLE endif # DISK_DRIVERS -if FLASH_MCUX_FLEXSPI_XIP && MEMC_MCUX_FLEXSPI - -choice FLASH_MCUX_FLEXSPI_XIP_MEM_TARGET - default FLASH_MCUX_FLEXSPI_XIP_MEM_ITCM if CPU_CORTEX_M7 - default FLASH_MCUX_FLEXSPI_XIP_MEM_SRAM if CPU_CORTEX_M4 -endchoice - -endif # FLASH_MCUX_FLEXSPI_XIP && MEMC_MCUX_FLEXSPI - if NETWORKING config NET_L2_ETHERNET diff --git a/boards/nxp/mimxrt595_evk/Kconfig.defconfig b/boards/nxp/mimxrt595_evk/Kconfig.defconfig index 9813fb6bdf1..f5061f58d32 100644 --- a/boards/nxp/mimxrt595_evk/Kconfig.defconfig +++ b/boards/nxp/mimxrt595_evk/Kconfig.defconfig @@ -8,10 +8,6 @@ if BOARD_MIMXRT595_EVK_MIMXRT595S_CM33 config FLASH_MCUX_FLEXSPI_MX25UM51345G default y if FLASH -choice FLASH_MCUX_FLEXSPI_XIP_MEM_TARGET - default FLASH_MCUX_FLEXSPI_XIP_MEM_SRAM -endchoice - config FXOS8700_DRDY_INT1 default y depends on FXOS8700_TRIGGER diff --git a/boards/nxp/mimxrt685_evk/Kconfig.defconfig b/boards/nxp/mimxrt685_evk/Kconfig.defconfig index 02a69187a24..680230281ec 100644 --- a/boards/nxp/mimxrt685_evk/Kconfig.defconfig +++ b/boards/nxp/mimxrt685_evk/Kconfig.defconfig @@ -18,10 +18,6 @@ choice FLASH_MCUX_FLEXSPI_MX25UM51345G_OPI_MODE default FLASH_MCUX_FLEXSPI_MX25UM51345G_OPI_STR endchoice -choice FLASH_MCUX_FLEXSPI_XIP_MEM_TARGET - default FLASH_MCUX_FLEXSPI_XIP_MEM_SRAM -endchoice - config FXOS8700_DRDY_INT1 default y depends on FXOS8700_TRIGGER diff --git a/boards/nxp/vmu_rt1170/Kconfig.defconfig b/boards/nxp/vmu_rt1170/Kconfig.defconfig index 4bf5b362507..7c62ad7ecde 100644 --- a/boards/nxp/vmu_rt1170/Kconfig.defconfig +++ b/boards/nxp/vmu_rt1170/Kconfig.defconfig @@ -12,15 +12,6 @@ config IMX_USDHC_DAT3_PWR_TOGGLE endif # DISK_DRIVERS -if FLASH_MCUX_FLEXSPI_XIP && MEMC_MCUX_FLEXSPI - -choice FLASH_MCUX_FLEXSPI_XIP_MEM_TARGET - default FLASH_MCUX_FLEXSPI_XIP_MEM_ITCM if CPU_CORTEX_M7 - default FLASH_MCUX_FLEXSPI_XIP_MEM_SRAM if CPU_CORTEX_M4 -endchoice - -endif # FLASH_MCUX_FLEXSPI_XIP && MEMC_MCUX_FLEXSPI - if NETWORKING config NET_L2_ETHERNET diff --git a/soc/nxp/common/Kconfig.flexspi_xip b/soc/nxp/common/Kconfig.flexspi_xip new file mode 100644 index 00000000000..a067f0a6a1c --- /dev/null +++ b/soc/nxp/common/Kconfig.flexspi_xip @@ -0,0 +1,41 @@ +# Copyright 2024 NXP +# SPDX-License-Identifier: Apache-2.0 + +DT_CHOSEN_Z_FLASH := zephyr,flash +DT_COMPAT_FLEXSPI := nxp,imx-flexspi + +DT_CHOSEN_FLASH_NODE := $(dt_chosen_path,$(DT_CHOSEN_Z_FLASH)) +DT_CHOSEN_FLASH_PARENT := $(dt_node_parent,$(DT_CHOSEN_FLASH_NODE)) + +DT_FLASH_PARENT_IS_FLEXSPI := $(dt_node_has_compat,$(DT_CHOSEN_FLASH_PARENT),$(DT_COMPAT_FLEXSPI)) +DT_FLASH_HAS_SIZE_PROP := $(dt_node_has_prop,$(DT_CHOSEN_FLASH_NODE),size) + +config FLASH_BASE_ADDRESS + default $(dt_node_reg_addr_hex,$(DT_CHOSEN_FLASH_PARENT),1) \ + if $(DT_FLASH_PARENT_IS_FLEXSPI) + default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH)) + +config FLASH_SIZE + default $(dt_node_int_prop_int,$(DT_CHOSEN_FLASH_NODE),size,Kb) \ + if $(DT_FLASH_HAS_SIZE_PROP) + default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_FLASH),0,K) + +config FLASH_MCUX_FLEXSPI_XIP + bool + default $(DT_FLASH_PARENT_IS_FLEXSPI) + select XIP + help + Allows REfor the soc to safely initialize the clocks for the + FlexSpi when planning to execute code in FlexSpi Memory. + +config CODE_DATA_RELOCATION_SRAM + default y if FLASH_MCUX_FLEXSPI_XIP && MEMC_MCUX_FLEXSPI + +config FLASH_MCUX_FLEXSPI_XIP_MEM + string + prompt "Flexspi drivers memory location" + default "RAM" + depends on MEMC_MCUX_FLEXSPI && FLASH_MCUX_FLEXSPI_XIP + help + Select the location to run the FlexSPI drivers when using + the flash API. diff --git a/soc/nxp/imxrt/Kconfig b/soc/nxp/imxrt/Kconfig index eb367e445b3..b33757ad7f1 100644 --- a/soc/nxp/imxrt/Kconfig +++ b/soc/nxp/imxrt/Kconfig @@ -10,47 +10,7 @@ if SOC_FAMILY_NXP_IMXRT # can override the defaults given here rsource "*/Kconfig" -# Used for default value in FLASH_MCUX_FLEXSPI_XIP -DT_CHOSEN_Z_FLASH := zephyr,flash -DT_COMPAT_FLEXSPI := nxp,imx-flexspi -# Macros to shorten Kconfig definitions -DT_CHOSEN_FLASH_NODE := $(dt_chosen_path,$(DT_CHOSEN_Z_FLASH)) -DT_CHOSEN_FLASH_PARENT := $(dt_node_parent,$(DT_CHOSEN_FLASH_NODE)) - -config FLASH_MCUX_FLEXSPI_XIP - bool "MCUX FlexSPI flash access with xip" - default $(dt_node_has_compat,$(DT_CHOSEN_FLASH_PARENT),$(DT_COMPAT_FLEXSPI)) - select XIP - help - Allows for the soc to safely initialize the clocks for the - FlexSpi when planning to execute code in FlexSpi Memory. - -if FLASH_MCUX_FLEXSPI_XIP && MEMC_MCUX_FLEXSPI - -choice FLASH_MCUX_FLEXSPI_XIP_MEM_TARGET - prompt "FlexSPI drivers relocation target" - default FLASH_MCUX_FLEXSPI_XIP_MEM_SRAM if SOC_MIMXRT1189_CM33 # RT118X_CM33 core lacks ITCM - default FLASH_MCUX_FLEXSPI_XIP_MEM_ITCM - help - Select the location to run the FlexSPI drivers when using - the flash API. - -config FLASH_MCUX_FLEXSPI_XIP_MEM_ITCM - bool "ITCM" - select CODE_DATA_RELOCATION - -config FLASH_MCUX_FLEXSPI_XIP_MEM_SRAM - bool "RAM" - select CODE_DATA_RELOCATION_SRAM - -endchoice - -config FLASH_MCUX_FLEXSPI_XIP_MEM - string - default "ITCM" if FLASH_MCUX_FLEXSPI_XIP_MEM_ITCM - default "RAM" if FLASH_MCUX_FLEXSPI_XIP_MEM_SRAM - -endif # FLASH_MCUX_FLEXSPI_XIP && MEMC_MCUX_FLEXSPI +rsource "../common/Kconfig.flexspi_xip" # Note- When SECOND_CORE_MCUX is set, the dependencies for this Kconfig # should be set elsewhere, since the determination of which SOC core diff --git a/soc/nxp/imxrt/Kconfig.defconfig b/soc/nxp/imxrt/Kconfig.defconfig index fe919a0eb71..7db2d17ba9c 100644 --- a/soc/nxp/imxrt/Kconfig.defconfig +++ b/soc/nxp/imxrt/Kconfig.defconfig @@ -107,29 +107,22 @@ config TEST_EXTRA_STACK_SIZE default 1024 endif # MBEDTLS +if CPU_CORTEX_M7 +# defaults specific for the M7 core + # Enable cache management features when using M7 core, since these parts # have L1 instruction and data caches that should be enabled at boot config CACHE_MANAGEMENT - default y if CPU_CORTEX_M7 + default y + +config FLASH_MCUX_FLEXSPI_XIP_MEM + default "ITCM" + +config CODE_DATA_RELOCATION_SRAM + default n + +endif # CPU_CORTEX_M7 endif # SOC_SERIES_IMXRT10XX || SOC_SERIES_IMXRT11XX || SOC_SERIES_IMXRT118X -# Logic to set flash size for all IMXRT parts -DT_CHOSEN_Z_FLASH := zephyr,flash -DT_COMPAT_FLEXSPI := nxp,imx-flexspi - -DT_CHOSEN_FLASH_NODE := $(dt_chosen_path,$(DT_CHOSEN_Z_FLASH)) -DT_CHOSEN_FLASH_PARENT := $(dt_node_parent,$(DT_CHOSEN_FLASH_NODE)) - -DT_FLASH_PARENT_IS_FLEXSPI := $(dt_node_has_compat,$(DT_CHOSEN_FLASH_PARENT),$(DT_COMPAT_FLEXSPI)) -DT_FLASH_HAS_SIZE_PROP := $(dt_node_has_prop,$(DT_CHOSEN_FLASH_NODE),size) - -config FLASH_BASE_ADDRESS - default $(dt_node_reg_addr_hex,$(DT_CHOSEN_FLASH_PARENT),1) \ - if $(DT_FLASH_PARENT_IS_FLEXSPI) - -config FLASH_SIZE - default $(dt_node_int_prop_int,$(DT_CHOSEN_FLASH_NODE),size,Kb) \ - if $(DT_FLASH_HAS_SIZE_PROP) - endif # SOC_FAMILY_NXP_IMXRT diff --git a/soc/nxp/imxrt/imxrt10xx/CMakeLists.txt b/soc/nxp/imxrt/imxrt10xx/CMakeLists.txt index 5eb0d46c0f3..0689025c9fc 100644 --- a/soc/nxp/imxrt/imxrt10xx/CMakeLists.txt +++ b/soc/nxp/imxrt/imxrt10xx/CMakeLists.txt @@ -18,7 +18,7 @@ endif() if(CONFIG_MEMC_MCUX_FLEXSPI) zephyr_sources(flexspi.c) if(CONFIG_FLASH_MCUX_FLEXSPI_XIP) - zephyr_code_relocate(FILES flexspi.c LOCATION ITCM_TEXT) + zephyr_code_relocate(FILES flexspi.c LOCATION ${CONFIG_FLASH_MCUX_FLEXSPI_XIP_MEM}_TEXT) endif() endif() diff --git a/soc/nxp/imxrt/imxrt11xx/Kconfig.defconfig b/soc/nxp/imxrt/imxrt11xx/Kconfig.defconfig index 9bd744062f4..7751ddf4afb 100644 --- a/soc/nxp/imxrt/imxrt11xx/Kconfig.defconfig +++ b/soc/nxp/imxrt/imxrt11xx/Kconfig.defconfig @@ -33,4 +33,5 @@ config NXP_IMXRT_BOOT_HEADER depends on !(CPU_CORTEX_M4 || BOOTLOADER_MCUBOOT) endif + endif diff --git a/soc/nxp/imxrt/imxrt5xx/Kconfig.defconfig b/soc/nxp/imxrt/imxrt5xx/Kconfig.defconfig index e99289a1320..eb432b781ce 100644 --- a/soc/nxp/imxrt/imxrt5xx/Kconfig.defconfig +++ b/soc/nxp/imxrt/imxrt5xx/Kconfig.defconfig @@ -14,10 +14,6 @@ config NUM_IRQS config ZTEST_NO_YIELD default y if (PM && ZTEST) -# Code relocation is needed for flash clock setup -config CODE_DATA_RELOCATION_SRAM - default y - # # MBEDTLS is larger but much faster than TinyCrypt so choose wisely # diff --git a/soc/nxp/imxrt/imxrt5xx/cm33/CMakeLists.txt b/soc/nxp/imxrt/imxrt5xx/cm33/CMakeLists.txt index c47971c8ccc..dc952c53fa2 100644 --- a/soc/nxp/imxrt/imxrt5xx/cm33/CMakeLists.txt +++ b/soc/nxp/imxrt/imxrt5xx/cm33/CMakeLists.txt @@ -10,10 +10,9 @@ zephyr_compile_definitions_ifdef(CONFIG_USB_DEVICE_DRIVER USB_STACK_USE_DEDICATE zephyr_include_directories(.) -zephyr_sources( - soc.c - flash_clock_setup.c - ) +zephyr_sources(soc.c) + +zephyr_sources_ifdef(CONFIG_FLASH_MCUX_FLEXSPI_XIP flash_clock_setup.c) zephyr_sources_ifdef(CONFIG_PM power.c) diff --git a/soc/nxp/imxrt/imxrt6xx/Kconfig b/soc/nxp/imxrt/imxrt6xx/Kconfig index 48a8d4c2b5a..151e99dde15 100644 --- a/soc/nxp/imxrt/imxrt6xx/Kconfig +++ b/soc/nxp/imxrt/imxrt6xx/Kconfig @@ -6,7 +6,6 @@ config SOC_MIMXRT685S_CM33 select CPU_CORTEX_M33 select CPU_CORTEX_M_HAS_DWT select CLOCK_CONTROL - select CODE_DATA_RELOCATION_SRAM if FLASH_MCUX_FLEXSPI_XIP select PLATFORM_SPECIFIC_INIT select HAS_PM select CPU_HAS_ARM_SAU diff --git a/soc/nxp/imxrt/imxrt6xx/Kconfig.defconfig b/soc/nxp/imxrt/imxrt6xx/Kconfig.defconfig index db741bed0a4..8fcb2e91cf8 100644 --- a/soc/nxp/imxrt/imxrt6xx/Kconfig.defconfig +++ b/soc/nxp/imxrt/imxrt6xx/Kconfig.defconfig @@ -35,33 +35,6 @@ FLEXSPI_BASE := $(dt_node_reg_addr_hex,/soc/spi@134000,1) config BUILD_OUTPUT_ADJUST_LMA default "$(FLEXSPI_BASE) - $(FLASH_BASE)" if NXP_IMX_RT_ROM_RAMLOADER -# The base address is determined from the zephyr,flash node with the following -# precedence: -# FlexSPI base address (if flash node is on a FlexSPI bus) -# node reg property (used for memory regions such as SRAM) - -# Workaround for not being able to have commas in macro arguments - -DT_CHOSEN_Z_FLASH := zephyr,flash -DT_COMPAT_FLEXSPI := nxp,imx-flexspi - -# Macros to shorten Kconfig definitions -DT_CHOSEN_FLASH_NODE := $(dt_chosen_path,$(DT_CHOSEN_Z_FLASH)) -DT_CHOSEN_FLASH_PARENT := $(dt_node_parent,$(DT_CHOSEN_FLASH_NODE)) - -config FLASH_BASE_ADDRESS - default $(dt_node_reg_addr_hex,$(DT_CHOSEN_FLASH_PARENT),1) \ - if $(dt_node_has_compat,$(DT_CHOSEN_FLASH_PARENT),$(DT_COMPAT_FLEXSPI)) - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH)) - -# The RT6xx has no internal flash. If the flash node has a size property, -# use that over the reg property. This is used for the external flash -# present on the board. Otherwise, fallback to the reg property -config FLASH_SIZE - default $(dt_node_int_prop_int,$(DT_CHOSEN_FLASH_NODE),size,Kb) \ - if $(dt_node_has_prop,$(DT_CHOSEN_FLASH_NODE),size) - default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_FLASH),0,K) - # # MBEDTLS is larger but much faster than TinyCrypt so choose wisely # diff --git a/soc/nxp/mcx/mcxn/Kconfig b/soc/nxp/mcx/mcxn/Kconfig index 519f960e6d2..04b41f75ef3 100644 --- a/soc/nxp/mcx/mcxn/Kconfig +++ b/soc/nxp/mcx/mcxn/Kconfig @@ -49,29 +49,6 @@ config MCUX_CORE_SUFFIX default "_cm33_core1" if SOC_MCXN947_CPU1 endif -DT_CHOSEN_Z_FLASH := zephyr,flash -DT_COMPAT_FLEXSPI := nxp,imx-flexspi - -DT_CHOSEN_FLASH_NODE := $(dt_chosen_path,$(DT_CHOSEN_Z_FLASH)) -DT_CHOSEN_FLASH_PARENT := $(dt_node_parent,$(DT_CHOSEN_FLASH_NODE)) - -DT_FLASH_PARENT_IS_FLEXSPI := $(dt_node_has_compat,$(DT_CHOSEN_FLASH_PARENT),$(DT_COMPAT_FLEXSPI)) -DT_FLASH_HAS_SIZE_PROP := $(dt_node_has_prop,$(DT_CHOSEN_FLASH_NODE),size) - -config FLASH_BASE_ADDRESS - default $(dt_node_reg_addr_hex,$(DT_CHOSEN_FLASH_PARENT),1) \ - if $(DT_FLASH_PARENT_IS_FLEXSPI) - -config FLASH_SIZE - default $(dt_node_int_prop_int,$(DT_CHOSEN_FLASH_NODE),size,Kb) \ - if $(DT_FLASH_HAS_SIZE_PROP) - -config FLASH_MCUX_FLEXSPI_XIP - bool - default $(DT_FLASH_PARENT_IS_FLEXSPI) - select XIP - help - Allows for the soc to safely initialize the clocks for the - FlexSpi when planning to execute code in FlexSpi Memory. +rsource "../../common/Kconfig.flexspi_xip" endif # SOC_SERIES_MCXN diff --git a/soc/nxp/mcx/mcxn/Kconfig.defconfig b/soc/nxp/mcx/mcxn/Kconfig.defconfig index 763a2a91a28..4b9a16d18c1 100644 --- a/soc/nxp/mcx/mcxn/Kconfig.defconfig +++ b/soc/nxp/mcx/mcxn/Kconfig.defconfig @@ -3,18 +3,6 @@ if SOC_SERIES_MCXN -if FLASH_MCUX_FLEXSPI_XIP - -# Code relocation is needed when FLASH_MCUX_FLEXSPI_XIP is enabled -config CODE_DATA_RELOCATION_SRAM - default y - -config FLASH_MCUX_FLEXSPI_XIP_MEM - string - default "RAM" - -endif # FLASH_MCUX_FLEXSPI_XIP - config MFD default y if DT_HAS_NXP_LP_FLEXCOMM_ENABLED diff --git a/soc/nxp/rw/Kconfig b/soc/nxp/rw/Kconfig index a072151a05c..c6eb8a01f01 100644 --- a/soc/nxp/rw/Kconfig +++ b/soc/nxp/rw/Kconfig @@ -60,20 +60,7 @@ config IMAGE_VECTOR_TABLE_OFFSET endif # NXP_RW6XX_BOOT_HEADER -# Used for default value in FLASH_MCUX_FLEXSPI_XIP -DT_CHOSEN_Z_FLASH := zephyr,flash -DT_COMPAT_FLEXSPI := nxp,imx-flexspi -# Macros to shorten Kconfig definitions -DT_CHOSEN_FLASH_NODE := $(dt_chosen_path,$(DT_CHOSEN_Z_FLASH)) -DT_CHOSEN_FLASH_PARENT := $(dt_node_parent,$(DT_CHOSEN_FLASH_NODE)) - -config FLASH_MCUX_FLEXSPI_XIP - bool "MCUX FlexSPI flash access with xip" - default $(dt_node_has_compat,$(DT_CHOSEN_FLASH_PARENT),$(DT_COMPAT_FLEXSPI)) - select XIP - help - Allows for the soc to safely initialize the clocks for the - FlexSpi when planning to execute code in FlexSpi Memory. +rsource "../common/Kconfig.flexspi_xip" config NXP_RW_ROM_RAMLOADER depends on !FLASH_MCUX_FLEXSPI_XIP @@ -85,9 +72,4 @@ config NXP_RW_ROM_RAMLOADER FlexSPI boot device into RAM region. The image will be loaded from FLEXSPI into the region specified by `zephyr,flash` node. -config FLASH_MCUX_FLEXSPI_XIP_MEM - string - default "RAM" - depends on MEMC_MCUX_FLEXSPI - endif # SOC_SERIES_RW6XX diff --git a/soc/nxp/rw/Kconfig.defconfig b/soc/nxp/rw/Kconfig.defconfig index eec238cce66..051aa1bbffe 100644 --- a/soc/nxp/rw/Kconfig.defconfig +++ b/soc/nxp/rw/Kconfig.defconfig @@ -28,30 +28,9 @@ endif # CORTEX_M_SYSTICK # FlexSPI base address (if flash node is on a FlexSPI bus) # node reg property (used for memory regions such as SRAM) -# Workaround for not being able to have commas in macro arguments - -DT_CHOSEN_Z_FLASH := zephyr,flash -DT_COMPAT_FLEXSPI := nxp,imx-flexspi - -# Macros to shorten Kconfig definitions -DT_CHOSEN_FLASH_NODE := $(dt_chosen_path,$(DT_CHOSEN_Z_FLASH)) -DT_CHOSEN_FLASH_PARENT := $(dt_node_parent,$(DT_CHOSEN_FLASH_NODE)) - -config FLASH_BASE_ADDRESS - default $(dt_node_reg_addr_hex,$(DT_CHOSEN_FLASH_PARENT),1) \ - if $(dt_node_has_compat,$(DT_CHOSEN_FLASH_PARENT),$(DT_COMPAT_FLEXSPI)) - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH)) - -# The RW6xx has no internal flash. If the flash node has a size property, -# use that over the reg property. This is used for the external flash -# present on the board. Otherwise, fallback to the reg property -config FLASH_SIZE - default $(dt_node_int_prop_int,$(DT_CHOSEN_FLASH_NODE),size,Kb) \ - if $(dt_node_has_prop,$(DT_CHOSEN_FLASH_NODE),size) - default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_FLASH),0,K) - if NXP_RW_ROM_RAMLOADER +DT_CHOSEN_Z_FLASH := zephyr,flash FLASH_BASE := $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH)) FLEXSPI_BASE := $(dt_node_reg_addr_hex,/soc/spi@134000,1) config BUILD_OUTPUT_ADJUST_LMA @@ -59,14 +38,6 @@ config BUILD_OUTPUT_ADJUST_LMA endif # NXP_RW_ROM_RAMLOADER -if FLASH_MCUX_FLEXSPI_XIP - -# Code relocation is needed when MEMC driver is enabled -config CODE_DATA_RELOCATION_SRAM - default y if MEMC - -endif # FLASH_MCUX_FLEXSPI_XIP - choice USB_MCUX_CONTROLLER_TYPE default USB_DC_NXP_EHCI endchoice diff --git a/tests/drivers/flash/common/boards/mimxrt1060_evk.conf b/tests/drivers/flash/common/boards/mimxrt1060_evk.conf index 45b222be802..69cc7d8874b 100644 --- a/tests/drivers/flash/common/boards/mimxrt1060_evk.conf +++ b/tests/drivers/flash/common/boards/mimxrt1060_evk.conf @@ -3,4 +3,4 @@ # SPDX-License-Identifier: Apache-2.0 # -CONFIG_FLASH_MCUX_FLEXSPI_XIP_MEM_SRAM=y +CONFIG_FLASH_MCUX_FLEXSPI_XIP_MEM="RAM"