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 <declan.snyder@nxp.com>
This commit is contained in:
parent
6300dc6aa7
commit
a097cdc4fe
19 changed files with 63 additions and 218 deletions
|
@ -31,15 +31,6 @@ config SYS_CLOCK_HW_CYCLES_PER_SEC
|
||||||
default 240000000 if BOARD_MIMXRT1160_EVK_MIMXRT1166_CM4 && CORTEX_M_SYSTICK
|
default 240000000 if BOARD_MIMXRT1160_EVK_MIMXRT1166_CM4 && CORTEX_M_SYSTICK
|
||||||
default 600000000 if BOARD_MIMXRT1160_EVK_MIMXRT1166_CM7 && 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
|
if NETWORKING
|
||||||
|
|
||||||
config NET_L2_ETHERNET
|
config NET_L2_ETHERNET
|
||||||
|
|
|
@ -34,15 +34,6 @@ config IMX_USDHC_DAT3_PWR_TOGGLE
|
||||||
|
|
||||||
endif # DISK_DRIVERS
|
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
|
if NETWORKING
|
||||||
|
|
||||||
config NET_L2_ETHERNET
|
config NET_L2_ETHERNET
|
||||||
|
|
|
@ -8,10 +8,6 @@ if BOARD_MIMXRT595_EVK_MIMXRT595S_CM33
|
||||||
config FLASH_MCUX_FLEXSPI_MX25UM51345G
|
config FLASH_MCUX_FLEXSPI_MX25UM51345G
|
||||||
default y if FLASH
|
default y if FLASH
|
||||||
|
|
||||||
choice FLASH_MCUX_FLEXSPI_XIP_MEM_TARGET
|
|
||||||
default FLASH_MCUX_FLEXSPI_XIP_MEM_SRAM
|
|
||||||
endchoice
|
|
||||||
|
|
||||||
config FXOS8700_DRDY_INT1
|
config FXOS8700_DRDY_INT1
|
||||||
default y
|
default y
|
||||||
depends on FXOS8700_TRIGGER
|
depends on FXOS8700_TRIGGER
|
||||||
|
|
|
@ -18,10 +18,6 @@ choice FLASH_MCUX_FLEXSPI_MX25UM51345G_OPI_MODE
|
||||||
default FLASH_MCUX_FLEXSPI_MX25UM51345G_OPI_STR
|
default FLASH_MCUX_FLEXSPI_MX25UM51345G_OPI_STR
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
choice FLASH_MCUX_FLEXSPI_XIP_MEM_TARGET
|
|
||||||
default FLASH_MCUX_FLEXSPI_XIP_MEM_SRAM
|
|
||||||
endchoice
|
|
||||||
|
|
||||||
config FXOS8700_DRDY_INT1
|
config FXOS8700_DRDY_INT1
|
||||||
default y
|
default y
|
||||||
depends on FXOS8700_TRIGGER
|
depends on FXOS8700_TRIGGER
|
||||||
|
|
|
@ -12,15 +12,6 @@ config IMX_USDHC_DAT3_PWR_TOGGLE
|
||||||
|
|
||||||
endif # DISK_DRIVERS
|
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
|
if NETWORKING
|
||||||
|
|
||||||
config NET_L2_ETHERNET
|
config NET_L2_ETHERNET
|
||||||
|
|
41
soc/nxp/common/Kconfig.flexspi_xip
Normal file
41
soc/nxp/common/Kconfig.flexspi_xip
Normal file
|
@ -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.
|
|
@ -10,47 +10,7 @@ if SOC_FAMILY_NXP_IMXRT
|
||||||
# can override the defaults given here
|
# can override the defaults given here
|
||||||
rsource "*/Kconfig"
|
rsource "*/Kconfig"
|
||||||
|
|
||||||
# Used for default value in FLASH_MCUX_FLEXSPI_XIP
|
rsource "../common/Kconfig.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
|
|
||||||
|
|
||||||
# Note- When SECOND_CORE_MCUX is set, the dependencies for this Kconfig
|
# Note- When SECOND_CORE_MCUX is set, the dependencies for this Kconfig
|
||||||
# should be set elsewhere, since the determination of which SOC core
|
# should be set elsewhere, since the determination of which SOC core
|
||||||
|
|
|
@ -107,29 +107,22 @@ config TEST_EXTRA_STACK_SIZE
|
||||||
default 1024
|
default 1024
|
||||||
endif # MBEDTLS
|
endif # MBEDTLS
|
||||||
|
|
||||||
|
if CPU_CORTEX_M7
|
||||||
|
# defaults specific for the M7 core
|
||||||
|
|
||||||
# Enable cache management features when using M7 core, since these parts
|
# Enable cache management features when using M7 core, since these parts
|
||||||
# have L1 instruction and data caches that should be enabled at boot
|
# have L1 instruction and data caches that should be enabled at boot
|
||||||
config CACHE_MANAGEMENT
|
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
|
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
|
endif # SOC_FAMILY_NXP_IMXRT
|
||||||
|
|
|
@ -18,7 +18,7 @@ endif()
|
||||||
if(CONFIG_MEMC_MCUX_FLEXSPI)
|
if(CONFIG_MEMC_MCUX_FLEXSPI)
|
||||||
zephyr_sources(flexspi.c)
|
zephyr_sources(flexspi.c)
|
||||||
if(CONFIG_FLASH_MCUX_FLEXSPI_XIP)
|
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()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -33,4 +33,5 @@ config NXP_IMXRT_BOOT_HEADER
|
||||||
depends on !(CPU_CORTEX_M4 || BOOTLOADER_MCUBOOT)
|
depends on !(CPU_CORTEX_M4 || BOOTLOADER_MCUBOOT)
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -14,10 +14,6 @@ config NUM_IRQS
|
||||||
config ZTEST_NO_YIELD
|
config ZTEST_NO_YIELD
|
||||||
default y if (PM && ZTEST)
|
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
|
# MBEDTLS is larger but much faster than TinyCrypt so choose wisely
|
||||||
#
|
#
|
||||||
|
|
|
@ -10,10 +10,9 @@ zephyr_compile_definitions_ifdef(CONFIG_USB_DEVICE_DRIVER USB_STACK_USE_DEDICATE
|
||||||
|
|
||||||
zephyr_include_directories(.)
|
zephyr_include_directories(.)
|
||||||
|
|
||||||
zephyr_sources(
|
zephyr_sources(soc.c)
|
||||||
soc.c
|
|
||||||
flash_clock_setup.c
|
zephyr_sources_ifdef(CONFIG_FLASH_MCUX_FLEXSPI_XIP flash_clock_setup.c)
|
||||||
)
|
|
||||||
|
|
||||||
zephyr_sources_ifdef(CONFIG_PM power.c)
|
zephyr_sources_ifdef(CONFIG_PM power.c)
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,6 @@ config SOC_MIMXRT685S_CM33
|
||||||
select CPU_CORTEX_M33
|
select CPU_CORTEX_M33
|
||||||
select CPU_CORTEX_M_HAS_DWT
|
select CPU_CORTEX_M_HAS_DWT
|
||||||
select CLOCK_CONTROL
|
select CLOCK_CONTROL
|
||||||
select CODE_DATA_RELOCATION_SRAM if FLASH_MCUX_FLEXSPI_XIP
|
|
||||||
select PLATFORM_SPECIFIC_INIT
|
select PLATFORM_SPECIFIC_INIT
|
||||||
select HAS_PM
|
select HAS_PM
|
||||||
select CPU_HAS_ARM_SAU
|
select CPU_HAS_ARM_SAU
|
||||||
|
|
|
@ -35,33 +35,6 @@ FLEXSPI_BASE := $(dt_node_reg_addr_hex,/soc/spi@134000,1)
|
||||||
config BUILD_OUTPUT_ADJUST_LMA
|
config BUILD_OUTPUT_ADJUST_LMA
|
||||||
default "$(FLEXSPI_BASE) - $(FLASH_BASE)" if NXP_IMX_RT_ROM_RAMLOADER
|
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
|
# MBEDTLS is larger but much faster than TinyCrypt so choose wisely
|
||||||
#
|
#
|
||||||
|
|
|
@ -49,29 +49,6 @@ config MCUX_CORE_SUFFIX
|
||||||
default "_cm33_core1" if SOC_MCXN947_CPU1
|
default "_cm33_core1" if SOC_MCXN947_CPU1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
DT_CHOSEN_Z_FLASH := zephyr,flash
|
rsource "../../common/Kconfig.flexspi_xip"
|
||||||
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.
|
|
||||||
|
|
||||||
endif # SOC_SERIES_MCXN
|
endif # SOC_SERIES_MCXN
|
||||||
|
|
|
@ -3,18 +3,6 @@
|
||||||
|
|
||||||
if SOC_SERIES_MCXN
|
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
|
config MFD
|
||||||
default y if DT_HAS_NXP_LP_FLEXCOMM_ENABLED
|
default y if DT_HAS_NXP_LP_FLEXCOMM_ENABLED
|
||||||
|
|
||||||
|
|
|
@ -60,20 +60,7 @@ config IMAGE_VECTOR_TABLE_OFFSET
|
||||||
|
|
||||||
endif # NXP_RW6XX_BOOT_HEADER
|
endif # NXP_RW6XX_BOOT_HEADER
|
||||||
|
|
||||||
# Used for default value in FLASH_MCUX_FLEXSPI_XIP
|
rsource "../common/Kconfig.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.
|
|
||||||
|
|
||||||
config NXP_RW_ROM_RAMLOADER
|
config NXP_RW_ROM_RAMLOADER
|
||||||
depends on !FLASH_MCUX_FLEXSPI_XIP
|
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
|
FlexSPI boot device into RAM region. The image will be loaded
|
||||||
from FLEXSPI into the region specified by `zephyr,flash` node.
|
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
|
endif # SOC_SERIES_RW6XX
|
||||||
|
|
|
@ -28,30 +28,9 @@ endif # CORTEX_M_SYSTICK
|
||||||
# FlexSPI base address (if flash node is on a FlexSPI bus)
|
# FlexSPI base address (if flash node is on a FlexSPI bus)
|
||||||
# node reg property (used for memory regions such as SRAM)
|
# 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
|
if NXP_RW_ROM_RAMLOADER
|
||||||
|
|
||||||
|
DT_CHOSEN_Z_FLASH := zephyr,flash
|
||||||
FLASH_BASE := $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH))
|
FLASH_BASE := $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH))
|
||||||
FLEXSPI_BASE := $(dt_node_reg_addr_hex,/soc/spi@134000,1)
|
FLEXSPI_BASE := $(dt_node_reg_addr_hex,/soc/spi@134000,1)
|
||||||
config BUILD_OUTPUT_ADJUST_LMA
|
config BUILD_OUTPUT_ADJUST_LMA
|
||||||
|
@ -59,14 +38,6 @@ config BUILD_OUTPUT_ADJUST_LMA
|
||||||
|
|
||||||
endif # NXP_RW_ROM_RAMLOADER
|
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
|
choice USB_MCUX_CONTROLLER_TYPE
|
||||||
default USB_DC_NXP_EHCI
|
default USB_DC_NXP_EHCI
|
||||||
endchoice
|
endchoice
|
||||||
|
|
|
@ -3,4 +3,4 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
#
|
#
|
||||||
|
|
||||||
CONFIG_FLASH_MCUX_FLEXSPI_XIP_MEM_SRAM=y
|
CONFIG_FLASH_MCUX_FLEXSPI_XIP_MEM="RAM"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue