Skip to content

Commit d734c37

Browse files
erwangohenrikbrixandersen
authored andcommitted
soc: stm32n6: Compute FLASH_SIZE when XIP=y
In XIP, we need to know FLASH_SIZE. Signed-off-by: Erwan Gouriou <[email protected]>
1 parent 9e46716 commit d734c37

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

soc/st/stm32/stm32n6x/Kconfig.defconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ rsource "Kconfig.defconfig.stm32n6*"
1010
DT_STM32_CPU_CLOCK_PATH := $(dt_nodelabel_path,cpusw)
1111
DT_STM32_CPU_CLOCK_FREQ := $(dt_node_int_prop_int,$(DT_STM32_CPU_CLOCK_PATH),clock-frequency)
1212

13+
DT_CHOSEN_Z_FLASH := zephyr,flash
14+
DT_CHOSEN_FLASH_NODE := $(dt_chosen_path,$(DT_CHOSEN_Z_FLASH))
15+
DT_FLASH_HAS_SIZE_PROP := $(dt_node_has_prop,$(DT_CHOSEN_FLASH_NODE),size)
16+
17+
# When XiP in Ext Flash, get FLASH size from size property of XSPI device node
18+
config FLASH_SIZE
19+
default $(dt_node_int_prop_int,$(DT_CHOSEN_FLASH_NODE),size,kb) \
20+
if $(DT_FLASH_HAS_SIZE_PROP) && XIP
21+
1322
# For STM32N6, override the value defined in STM32 Kconfig to use CPU clock frequency
1423
config SYS_CLOCK_HW_CYCLES_PER_SEC
1524
default "$(DT_STM32_CPU_CLOCK_FREQ)" if "$(dt_nodelabel_enabled,cpusw)"

0 commit comments

Comments
 (0)