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 <francois.ramu@st.com>
This commit is contained in:
Francois Ramu 2025-05-05 14:21:45 +02:00 committed by Benjamin Cabé
commit ad0466f423

View file

@ -26,6 +26,13 @@ DT_STM32_RCC_CLOCK_FREQ := $(dt_node_int_prop_int,$(DT_STM32_RCC_PATH),clock-fre
DT_ST_PRESCALER := st,prescaler
DT_STM32_LPTIM_PATH := $(dt_nodelabel_path,stm32_lp_tick_source)
DT_CHOSEN_Z_FLASH := zephyr,flash
DT_COMPAT_XSPI := st,stm32-xspi
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_XSPI := $(dt_node_has_compat,$(DT_CHOSEN_FLASH_PARENT),$(DT_COMPAT_XSPI))
config SYS_CLOCK_HW_CYCLES_PER_SEC
default "$(DT_STM32_RCC_CLOCK_FREQ)" if "$(dt_nodelabel_enabled,rcc)"
@ -73,4 +80,9 @@ config USE_DT_CODE_PARTITION
config BUILD_WITH_TFM
default y if TRUSTED_EXECUTION_NONSECURE
config FLASH_BASE_ADDRESS
default $(dt_node_reg_addr_hex,$(DT_CHOSEN_FLASH_PARENT),1) \
if $(DT_FLASH_PARENT_IS_XSPI)
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH))
endif # SOC_FAMILY_STM32