Hi,

On 5/12/25 19:21, Marek Vasut wrote:
Introduce Kconfig options used by SPL on STM32MP13xx and isolate
the Kconfig options only used in case TFA BL2 is used as a SPL
behind CONFIG_TFABOOT dependency.

Signed-off-by: Marek Vasut <marek.va...@mailbox.org>
---
Cc: Cheick Traore <cheick.tra...@foss.st.com>
Cc: Fabrice Gasnier <fabrice.gasn...@foss.st.com>
Cc: Gatien Chevallier <gatien.chevall...@foss.st.com>
Cc: Lionel Debieve <lionel.debi...@foss.st.com>
Cc: Pascal Zimmermann <pzimmerm...@dh-electronics.com>
Cc: Patrice Chotard <patrice.chot...@foss.st.com>
Cc: Patrick Delaunay <patrick.delau...@foss.st.com>
Cc: Simon Glass <s...@chromium.org>
Cc: Sughosh Ganu <sughosh.g...@linaro.org>
Cc: Tom Rini <tr...@konsulko.com>
Cc: u-b...@dh-electronics.com
Cc: u-boot@lists.denx.de
Cc: uboot-st...@st-md-mailman.stormreply.com
---
  arch/arm/mach-stm32mp/Kconfig     | 7 +++++--
  arch/arm/mach-stm32mp/Kconfig.13x | 3 ++-
  2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-stm32mp/Kconfig b/arch/arm/mach-stm32mp/Kconfig
index 58250901101..3a0ca50e9d6 100644
--- a/arch/arm/mach-stm32mp/Kconfig
+++ b/arch/arm/mach-stm32mp/Kconfig
@@ -40,16 +40,19 @@ choice
  config STM32MP13X
        bool "Support STMicroelectronics STM32MP13x Soc"
        select ARCH_EARLY_INIT_R
-       select ARM_SMCCC
+       select ARM_SMCCC if TFABOOT
+       select ARCH_SUPPORT_PSCI if !TFABOOT
+       select BINMAN if !TFABOOT
        select CPU_V7A
        select CPU_V7_HAS_NONSEC
        select CPU_V7_HAS_VIRT
-       select OF_BOARD
+       select OF_BOARD if TFABOOT
        select OF_BOARD_SETUP
        select PINCTRL_STM32
        select STM32_RCC
        select STM32_RESET
        select STM32_SERIAL
+       select SUPPORT_SPL if !TFABOOT
        select SYS_ARCH_TIMER
        imply CMD_NVEDIT_INFO
        imply OF_UPSTREAM
diff --git a/arch/arm/mach-stm32mp/Kconfig.13x 
b/arch/arm/mach-stm32mp/Kconfig.13x
index bc8b3f8cf77..cecf9e3b8c7 100644
--- a/arch/arm/mach-stm32mp/Kconfig.13x
+++ b/arch/arm/mach-stm32mp/Kconfig.13x
@@ -20,7 +20,8 @@ config TARGET_ST_STM32MP13X
  endchoice
config TEXT_BASE
-       default 0xC0000000
+       default 0xC0000000 if TFABOOT
+       default 0xC0100000 if !TFABOOT
config PRE_CON_BUF_ADDR
        default 0xC0800000


I don't understood  why you modify TEXT_BASE here.

I expect to have the same base address for SPL or for TF-A boot even if we decide to change this address between STM32MP13 and STM32MP15.

the new address avoid potential issue on initial stack size as see on STM32MP15 (limited at 0x100000) and because we have no more issue with STM32CubeProgrammer (previously the flash-layout file was loaded by TF-A at 0xC0000000).

We don't change STM32MP15 just to avoid to break the compatibility...

The default memory is fully described here:

https://wiki.st.com/stm32mpu/wiki/How_to_configure_U-Boot_for_your_board#Before_relocation

For STM32MP13 the default value are

1/ CONFIG_TEXT_BASE = 0xC0000000 (begin of DDR)

2/ CONFIG_CUSTOM_SYS_INIT_SP_ADDR = C0400000


You change the default STM32MP13 base address to keep the SAME description for 
you board ?

        CONFIG_SPL_LOAD_FIT=y
        CONFIG_SPL_LOAD_FIT_ADDRESS=0xc1000000

So FIT is loaded at the same address than U-Boot ?

FIT for STM32MP15 was managed with binman config in 
arch/arm/dts/stm32mp15xx-dhsom-u-boot.dtsi

                        images {
                                uboot {
                                        arch = "arm";
                                        compression = "none";
                                        description = "U-Boot (32-bit)";
                                        entry = <CONFIG_TEXT_BASE>;
                                        load = <CONFIG_TEXT_BASE>;
                                        type = "standalone";

                                        uboot-blob {
                                                filename = "u-boot-nodtb.bin";
                                                type = "blob-ext";
                                        };
                                };

I don't sure it is the same for STM32MP13 after after your serie.....


Anyway I think the better solution to avoid a extra copy is to load FIT after 
final U-Boot location in DDR

CONFIG_SPL_LOAD_FIT_ADDRESS=0xc4000000

=> this address can be identical for STM32MP13 and STM32MP15

and to keep the the default value for CONFIG_TEXT_BASE
- 0xC0000000 for STM32MP13
- 0xC0100000 for STM32MP15

Regards

Patrick

Reply via email to