Skip to content

Commit ad0466f

Browse files
FRASTMkartben
authored andcommitted
soc: st: stm32 Kconfig to retrieve the external Flash Base address
This commit is retrieving the config FLASH_BASE_ADDRESS from the XSPI node of the stm32 device dtsi <reg> property of the "st,stm32-xspi" node. For example the CONFIG_FLASH_BASE_ADDRESS is 0x90000000 and application is linked for that address. Size is given by the size property of the "st,stm32-xspi-nor" node. Signed-off-by: Francois Ramu <[email protected]>
1 parent 982abad commit ad0466f

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
@@ -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)