Skip to content

Commit af8ef35

Browse files
danieldegrassecarlescufi
authored andcommitted
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 <[email protected]>
1 parent 9cebaaf commit af8ef35

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

drivers/flash/Kconfig.mcux

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -101,30 +101,4 @@ config FLASH_MCUX_FLEXSPI_HYPERFLASH_WRITE_BUFFER
101101
This prevents faults when the data to write would be located on the
102102
flash itself.
103103

104-
if FLASH_MCUX_FLEXSPI_XIP
105-
106-
choice FLASH_MCUX_FLEXSPI_XIP_MEM_TARGET
107-
prompt "FlexSPI drivers relocation target"
108-
default FLASH_MCUX_FLEXSPI_XIP_MEM_ITCM
109-
help
110-
Select the location to run the FlexSPI drivers when using
111-
the flash API.
112-
113-
config FLASH_MCUX_FLEXSPI_XIP_MEM_ITCM
114-
bool "ITCM"
115-
select CODE_DATA_RELOCATION
116-
117-
config FLASH_MCUX_FLEXSPI_XIP_MEM_SRAM
118-
bool "RAM"
119-
select CODE_DATA_RELOCATION_SRAM
120-
121-
endchoice
122-
123-
config FLASH_MCUX_FLEXSPI_XIP_MEM
124-
string
125-
default "ITCM" if FLASH_MCUX_FLEXSPI_XIP_MEM_ITCM
126-
default "RAM" if FLASH_MCUX_FLEXSPI_XIP_MEM_SRAM
127-
128-
endif # FLASH_MCUX_FLEXSPI_XIP
129-
130104
endif # HAS_MCUX_FLEXSPI

soc/nxp/imxrt/Kconfig

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,32 @@ config FLASH_MCUX_FLEXSPI_XIP
2626
Allows for the soc to safely initialize the clocks for the
2727
FlexSpi when planning to execute code in FlexSpi Memory.
2828

29+
if FLASH_MCUX_FLEXSPI_XIP && MEMC_MCUX_FLEXSPI
30+
31+
choice FLASH_MCUX_FLEXSPI_XIP_MEM_TARGET
32+
prompt "FlexSPI drivers relocation target"
33+
default FLASH_MCUX_FLEXSPI_XIP_MEM_ITCM
34+
help
35+
Select the location to run the FlexSPI drivers when using
36+
the flash API.
37+
38+
config FLASH_MCUX_FLEXSPI_XIP_MEM_ITCM
39+
bool "ITCM"
40+
select CODE_DATA_RELOCATION
41+
42+
config FLASH_MCUX_FLEXSPI_XIP_MEM_SRAM
43+
bool "RAM"
44+
select CODE_DATA_RELOCATION_SRAM
45+
46+
endchoice
47+
48+
config FLASH_MCUX_FLEXSPI_XIP_MEM
49+
string
50+
default "ITCM" if FLASH_MCUX_FLEXSPI_XIP_MEM_ITCM
51+
default "RAM" if FLASH_MCUX_FLEXSPI_XIP_MEM_SRAM
52+
53+
endif # FLASH_MCUX_FLEXSPI_XIP && MEMC_MCUX_FLEXSPI
54+
2955
# Note- When SECOND_CORE_MCUX is set, the dependencies for this Kconfig
3056
# should be set elsewhere, since the determination of which SOC core
3157
# requires the boot header is SOC specific.

soc/nxp/imxrt/imxrt11xx/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ zephyr_include_directories(.)
1212
if(CONFIG_MEMC_MCUX_FLEXSPI)
1313
zephyr_sources(flexspi.c)
1414
if(CONFIG_FLASH_MCUX_FLEXSPI_XIP)
15-
zephyr_code_relocate(FILES flexspi.c LOCATION ITCM_TEXT)
15+
zephyr_code_relocate(FILES flexspi.c LOCATION ${CONFIG_FLASH_MCUX_FLEXSPI_XIP_MEM}_TEXT)
1616
endif()
1717
endif()
1818

0 commit comments

Comments
 (0)