Browse Source

soc: nxp: imxrt: move FLASH_MCUX_FLEXSPI_XIP_MEM_TARGET to SOC level

FLASH_MCUX_FLEXSPI_XIP_MEM_TARGET definition is required to relocate SOC
level files, as well as Flash and MEMC drivers. Therefore, move the
Kconfig definition to the SOC level, and update the dependencies to
better reflect when the definition is needed.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
pull/69687/head
Daniel DeGrasse 1 year ago committed by Carles Cufi
parent
commit
bc8424dd3b
  1. 26
      drivers/flash/Kconfig.mcux
  2. 26
      soc/nxp/imxrt/Kconfig
  3. 2
      soc/nxp/imxrt/imxrt11xx/CMakeLists.txt

26
drivers/flash/Kconfig.mcux

@ -101,30 +101,4 @@ config FLASH_MCUX_FLEXSPI_HYPERFLASH_WRITE_BUFFER @@ -101,30 +101,4 @@ config FLASH_MCUX_FLEXSPI_HYPERFLASH_WRITE_BUFFER
This prevents faults when the data to write would be located on the
flash itself.
if FLASH_MCUX_FLEXSPI_XIP
choice FLASH_MCUX_FLEXSPI_XIP_MEM_TARGET
prompt "FlexSPI drivers relocation target"
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
endif # HAS_MCUX_FLEXSPI

26
soc/nxp/imxrt/Kconfig

@ -26,6 +26,32 @@ config FLASH_MCUX_FLEXSPI_XIP @@ -26,6 +26,32 @@ config FLASH_MCUX_FLEXSPI_XIP
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_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
# Note- When SECOND_CORE_MCUX is set, the dependencies for this Kconfig
# should be set elsewhere, since the determination of which SOC core
# requires the boot header is SOC specific.

2
soc/nxp/imxrt/imxrt11xx/CMakeLists.txt

@ -12,7 +12,7 @@ zephyr_include_directories(.) @@ -12,7 +12,7 @@ zephyr_include_directories(.)
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()

Loading…
Cancel
Save