]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
sunxi: binman: Move BL31 and SCP firmware addresses to Kconfig
authorSamuel Holland <samuel@sholland.org>
Tue, 31 Oct 2023 05:17:39 +0000 (00:17 -0500)
committerAndre Przywara <andre.przywara@arm.com>
Mon, 29 Jan 2024 14:30:59 +0000 (14:30 +0000)
This is easier to read than the #ifdef staircase, provides better
visibility into the memory map (alongside the other Kconfig
definitions), and allows these addresses to be reused from code.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
arch/arm/dts/sunxi-u-boot.dtsi
arch/arm/mach-sunxi/Kconfig

index a0c8abb703395aa2a2e5366a377a037b68a62075..7a8764e463b9fa727f2aa784886a8430bc032a03 100644 (file)
@@ -1,15 +1,5 @@
 #include <config.h>
 
-#ifdef CONFIG_MACH_SUN50I_H6
-#define BL31_ADDR 0x104000
-#define  SCP_ADDR 0x114000
-#elif defined(CONFIG_MACH_SUN50I_H616)
-#define BL31_ADDR 0x40000000
-#else
-#define BL31_ADDR  0x44000
-#define  SCP_ADDR  0x50000
-#endif
-
 / {
        aliases {
                mmc0 = &mmc0;
@@ -69,8 +59,8 @@
                                        os = "arm-trusted-firmware";
                                        arch = "arm64";
                                        compression = "none";
-                                       load = <BL31_ADDR>;
-                                       entry = <BL31_ADDR>;
+                                       load = <CONFIG_SUNXI_BL31_BASE>;
+                                       entry = <CONFIG_SUNXI_BL31_BASE>;
 
                                        atf-bl31 {
                                                filename = "bl31.bin";
                                        };
                                };
 
-#ifdef SCP_ADDR
+#if CONFIG_SUNXI_SCP_BASE
                                scp {
                                        description = "SCP firmware";
                                        type = "firmware";
                                        arch = "or1k";
                                        compression = "none";
-                                       load = <SCP_ADDR>;
+                                       load = <CONFIG_SUNXI_SCP_BASE>;
 
                                        scp {
                                                filename = "scp.bin";
                                @config-SEQ {
                                        description = "NAME";
                                        firmware = "atf";
-#ifndef SCP_ADDR
-                                       loadables = "uboot";
-#else
+#if CONFIG_SUNXI_SCP_BASE
                                        loadables = "scp", "uboot";
+#else
+                                       loadables = "uboot";
 #endif
                                        fdt = "fdt-SEQ";
                                };
index 421a48bc357f248a00e51a44b2592a249fbe7e56..fe89aec6b9a888bdbb486575561b1303d4451fd7 100644 (file)
@@ -161,6 +161,23 @@ config SUNXI_RVBAR_ALTERNATIVE
        for all other SoCs, so the content of the SRAM_VER_REG becomes
        irrelevant there, and we can use the same code.
 
+config SUNXI_BL31_BASE
+       hex
+       default 0x00044000 if MACH_SUN50I || MACH_SUN50I_H5
+       default 0x00104000 if MACH_SUN50I_H6
+       default 0x40000000 if MACH_SUN50I_H616
+       default 0x0
+       help
+         Address where BL31 (TF-A) is loaded, or zero if BL31 is not used.
+
+config SUNXI_SCP_BASE
+       hex
+       default 0x00050000 if MACH_SUN50I || MACH_SUN50I_H5
+       default 0x00114000 if MACH_SUN50I_H6
+       default 0x0
+       help
+         Address where SCP firmware is loaded, or zero if it is not used.
+
 config SUNXI_A64_TIMER_ERRATUM
        bool