]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
sunxi: binman: Support FIT generation for 32-bit SoCs
authorSamuel Holland <samuel@sholland.org>
Tue, 31 Oct 2023 05:17:40 +0000 (00:17 -0500)
committerAndre Przywara <andre.przywara@arm.com>
Mon, 29 Jan 2024 14:31:00 +0000 (14:31 +0000)
Some 32-bit SoCs can use SCP firmware to implement additional PSCI
functionality, such as system suspend. In order to load this firmware
from SPL, we need to generate and use a FIT instead of a legacy image.

Adjust the binman FIT definition so it does not rely on TF-A BL31, as
this is not used on 32-bit SoCs. Instead, after loading the firmware,
U-Boot proper is executed directly. This requires to provide an
entry point property for the U-Boot image node, which confuses some
loaders like sunxi-fel, so protect that to only be used if we have no
BL31.

Signed-off-by: Samuel Holland <samuel@sholland.org>
[Andre: filter U-Boot entry point property]
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
arch/arm/dts/sunxi-u-boot.dtsi

index 7a8764e463b9fa727f2aa784886a8430bc032a03..0909a67883e59b9f1549a30a3deeccd95cd36dad 100644 (file)
@@ -1,5 +1,11 @@
 #include <config.h>
 
+#ifdef CONFIG_ARM64
+#define ARCH "arm64"
+#else
+#define ARCH "arm"
+#endif
+
 / {
        aliases {
                mmc0 = &mmc0;
                        filename = "spl/sunxi-spl.bin";
                };
 
-#ifdef CONFIG_ARM64
+#ifdef CONFIG_SPL_LOAD_FIT
                fit {
-                       description = "Configuration to load ATF before U-Boot";
+                       description = "Configuration to load U-Boot and firmware";
                        #address-cells = <1>;
                        fit,fdt-list = "of-list";
 
                        images {
                                uboot {
-                                       description = "U-Boot (64-bit)";
+                                       description = "U-Boot";
                                        type = "standalone";
                                        os = "u-boot";
-                                       arch = "arm64";
+                                       arch = ARCH;
                                        compression = "none";
                                        load = <CONFIG_TEXT_BASE>;
+#if CONFIG_SUNXI_BL31_BASE == 0
+                                       entry = <CONFIG_TEXT_BASE>;
+#endif
 
                                        u-boot-nodtb {
                                        };
                                };
 
+#if CONFIG_SUNXI_BL31_BASE
                                atf {
                                        description = "ARM Trusted Firmware";
                                        type = "firmware";
                                        os = "arm-trusted-firmware";
-                                       arch = "arm64";
+                                       arch = ARCH;
                                        compression = "none";
                                        load = <CONFIG_SUNXI_BL31_BASE>;
                                        entry = <CONFIG_SUNXI_BL31_BASE>;
@@ -67,6 +77,7 @@
                                                missing-msg = "atf-bl31-sunxi";
                                        };
                                };
+#endif
 
 #if CONFIG_SUNXI_SCP_BASE
                                scp {
 
                                @config-SEQ {
                                        description = "NAME";
+#if CONFIG_SUNXI_BL31_BASE
                                        firmware = "atf";
+#else
+                                       firmware = "uboot";
+#endif
 #if CONFIG_SUNXI_SCP_BASE
                                        loadables = "scp", "uboot";
 #else