Skip to content

Commit ba14a9c

Browse files
committed
soc: st: stm32 retrieves the base address of the external memory
Get the CONFIG_FLASH_BASE_ADDRESS when the flash is external xSPI device. Its address is given by the second <reg> of the compatible = "st,stm32-xspi"; Signed-off-by: Francois Ramu <francois.ramu@st.com>
1 parent 4511df4 commit ba14a9c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

soc/st/stm32/Kconfig.defconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ DT_STM32_RCC_CLOCK_FREQ := $(dt_node_int_prop_int,$(DT_STM32_RCC_PATH),clock-fre
2323
DT_ST_PRESCALER := st,prescaler
2424
DT_STM32_LPTIM_PATH := $(dt_nodelabel_path,stm32_lp_tick_source)
2525

26+
DT_CHOSEN_Z_FLASH := zephyr,flash
27+
DT_COMPAT_XSPI := st,stm32-xspi
28+
29+
DT_CHOSEN_FLASH_NODE := $(dt_chosen_path,$(DT_CHOSEN_Z_FLASH))
30+
DT_CHOSEN_FLASH_PARENT := $(dt_node_parent,$(DT_CHOSEN_FLASH_NODE))
31+
DT_FLASH_PARENT_IS_XSPI := $(dt_node_has_compat,$(DT_CHOSEN_FLASH_PARENT),$(DT_COMPAT_XSPI))
32+
2633
config SYS_CLOCK_HW_CYCLES_PER_SEC
2734
default "$(DT_STM32_RCC_CLOCK_FREQ)" if "$(dt_nodelabel_enabled,rcc)"
2835

@@ -70,4 +77,9 @@ config USE_DT_CODE_PARTITION
7077
config BUILD_WITH_TFM
7178
default y if TRUSTED_EXECUTION_NONSECURE
7279

80+
config FLASH_BASE_ADDRESS
81+
default $(dt_node_reg_addr_hex,$(DT_CHOSEN_FLASH_PARENT),1) \
82+
if $(DT_FLASH_PARENT_IS_XSPI)
83+
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH))
84+
7385
endif # SOC_FAMILY_STM32

0 commit comments

Comments
 (0)