]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
sunxi: Convert 64-bit boards to use binman
authorSimon Glass <sjg@chromium.org>
Tue, 1 Sep 2020 11:14:01 +0000 (05:14 -0600)
committerSimon Glass <sjg@chromium.org>
Tue, 22 Sep 2020 18:50:43 +0000 (12:50 -0600)
At present 64-bit sunxi boards use the Makefile to create a FIT, using
USE_SPL_FIT_GENERATOR. This is deprecated.

Update sunxi to use binman instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Kconfig
Makefile
arch/arm/dts/sunxi-u-boot.dtsi

diff --git a/Kconfig b/Kconfig
index 883e3f71d01da2f83efbaf197e4aa50a8640fea5..837b2f517aeb202594ea5459a3fedb459ac2b778 100644 (file)
--- a/Kconfig
+++ b/Kconfig
@@ -659,12 +659,11 @@ config SPL_FIT_SOURCE
 
 config USE_SPL_FIT_GENERATOR
        bool "Use a script to generate the .its script"
-       default y if SPL_FIT
+       default y if SPL_FIT && !ARCH_SUNXI
 
 config SPL_FIT_GENERATOR
        string ".its file generator script for U-Boot FIT image"
        depends on USE_SPL_FIT_GENERATOR
-       default "board/sunxi/mksunxi_fit_atf.sh" if SPL_LOAD_FIT && ARCH_SUNXI
        default "arch/arm/mach-rockchip/make_fit_atf.py" if SPL_LOAD_FIT && ARCH_ROCKCHIP
        default "arch/arm/mach-zynqmp/mkimage_fit_atf.sh" if SPL_LOAD_FIT && ARCH_ZYNQMP
        default "arch/riscv/lib/mkimage_fit_opensbi.sh" if SPL_LOAD_FIT && RISCV
index 5ddb64f92b2481ca9ccca97fde8f592286800407..07cd28f3a618f02bb80cefa6741ff613d1fdab99 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -923,11 +923,6 @@ INPUTS-$(CONFIG_REMAKE_ELF) += u-boot.elf
 INPUTS-$(CONFIG_EFI_APP) += u-boot-app.efi
 INPUTS-$(CONFIG_EFI_STUB) += u-boot-payload.efi
 
-# Build a combined spl + u-boot image for sunxi
-ifeq ($(CONFIG_ARCH_SUNXI)$(CONFIG_ARM64)$(CONFIG_SPL),yyy)
-INPUTS-y += u-boot-sunxi-with-spl.bin
-endif
-
 # Generate this input file for binman
 ifeq ($(CONFIG_SPL),)
 INPUTS-$(CONFIG_ARCH_MEDIATEK) += u-boot-mtk.bin
@@ -1024,13 +1019,9 @@ PHONY += inputs
 inputs: $(INPUTS-y)
 
 all: .binman_stamp inputs
-# Hack for sunxi which doesn't have a proper binman definition for
-# 64-bit boards
-ifneq ($(CONFIG_ARCH_SUNXI)$(CONFIG_ARM64),yy)
 ifeq ($(CONFIG_BINMAN),y)
        $(call if_changed,binman)
 endif
-endif
 
 # Timestamp file to make sure that binman always runs
 .binman_stamp: FORCE
@@ -1336,6 +1327,8 @@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \
                $(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \
                build -u -d u-boot.dtb -O . -m --allow-missing \
                -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \
+               -I arch/$(ARCH)/dts -a of-list=$(CONFIG_OF_LIST) \
+               -a atf-bl31-path=${BL31} \
                $(BINMAN_$(@F))
 
 OBJCOPYFLAGS_u-boot.ldr.hex := -I binary -O ihex
@@ -1625,13 +1618,6 @@ u-boot-x86-reset16.bin: u-boot FORCE
 
 endif # CONFIG_X86
 
-ifneq ($(CONFIG_ARCH_SUNXI),)
-ifeq ($(CONFIG_ARM64),y)
-u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.itb FORCE
-       $(call if_changed,cat)
-endif
-endif
-
 OBJCOPYFLAGS_u-boot-app.efi := $(OBJCOPYFLAGS_EFI)
 u-boot-app.efi: u-boot FORCE
        $(call if_changed,zobjcopy)
index fdd4c80aa461458ad4b5363b61b78c1a3907bd58..1d1c36910997d3f6b9b5044cb6da071ca9a073d3 100644 (file)
@@ -5,14 +5,73 @@
                mmc1 = &mmc2;
        };
 
-       binman {
+       binman: binman {
+               multiple-images;
+       };
+};
+
+&binman {
+       u-boot-sunxi-with-spl {
                filename = "u-boot-sunxi-with-spl.bin";
                pad-byte = <0xff>;
                blob {
                        filename = "spl/sunxi-spl.bin";
                };
+#ifdef CONFIG_ARM64
+               fit {
+                       description = "Configuration to load ATF before U-Boot";
+                       #address-cells = <1>;
+                       fit,fdt-list = "of-list";
+
+                       images {
+                               uboot {
+                                       description = "U-Boot (64-bit)";
+                                       type = "standalone";
+                                       arch = "arm64";
+                                       compression = "none";
+                                       load = <0x4a000000>;
+
+                                       u-boot-nodtb {
+                                       };
+                               };
+                               atf {
+                                       description = "ARM Trusted Firmware";
+                                       type = "firmware";
+                                       arch = "arm64";
+                                       compression = "none";
+/* TODO: Do this with an overwrite in this board's dtb? */
+#ifdef CONFIG_MACH_SUN50I_H6
+                                       load = <0x104000>;
+                                       entry = <0x104000>;
+#else
+                                       load = <0x44000>;
+                                       entry = <0x44000>;
+#endif
+                                       atf-bl31 {
+                                       };
+                               };
+
+                               @fdt-SEQ {
+                                       description = "NAME";
+                                       type = "flat_dt";
+                                       compression = "none";
+                               };
+                       };
+
+                       configurations {
+                               default = "config-1";
+                               @config-SEQ {
+                                       description = "NAME";
+                                       firmware = "uboot";
+                                       loadables = "atf";
+                                       fdt = "fdt-SEQ";
+                               };
+                       };
+               };
+#else
                u-boot-img {
                        offset = <CONFIG_SPL_PAD_TO>;
                };
+#endif
        };
 };