Skip to content

Commit ac713ad

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 <[email protected]>
1 parent b6998fc commit ac713ad

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

soc/st/stm32/Kconfig.defconfig

+12
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ DT_STM32_RCC_CLOCK_FREQ := $(dt_node_int_prop_int,$(DT_STM32_RCC_PATH),clock-fre
2626
DT_ST_PRESCALER := st,prescaler
2727
DT_STM32_LPTIM_PATH := $(dt_nodelabel_path,stm32_lp_tick_source)
2828

29+
DT_CHOSEN_Z_FLASH := zephyr,flash
30+
DT_COMPAT_XSPI := st,stm32-xspi
31+
32+
DT_CHOSEN_FLASH_NODE := $(dt_chosen_path,$(DT_CHOSEN_Z_FLASH))
33+
DT_CHOSEN_FLASH_PARENT := $(dt_node_parent,$(DT_CHOSEN_FLASH_NODE))
34+
DT_FLASH_PARENT_IS_XSPI := $(dt_node_has_compat,$(DT_CHOSEN_FLASH_PARENT),$(DT_COMPAT_XSPI))
35+
2936
config SYS_CLOCK_HW_CYCLES_PER_SEC
3037
default "$(DT_STM32_RCC_CLOCK_FREQ)" if "$(dt_nodelabel_enabled,rcc)"
3138

@@ -73,4 +80,9 @@ config USE_DT_CODE_PARTITION
7380
config BUILD_WITH_TFM
7481
default y if TRUSTED_EXECUTION_NONSECURE
7582

83+
config FLASH_BASE_ADDRESS
84+
default $(dt_node_reg_addr_hex,$(DT_CHOSEN_FLASH_PARENT),1) \
85+
if $(DT_FLASH_PARENT_IS_XSPI)
86+
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH))
87+
7688
endif # SOC_FAMILY_STM32

0 commit comments

Comments
 (0)