From: Simon Glass <sjg@chromium.org>
Date: Sat, 26 Nov 2016 03:16:01 +0000 (-0700)
Subject: sunxi: Use binman for sunxi boards
X-Git-Tag: v2025.01-rc5-pxa1908~7843^2~2
X-Git-Url: http://git.dujemihanovic.xyz/img/html/index.html?a=commitdiff_plain;h=61b994a386eb6f631dc1c2194d4cce9b1a43542c;p=u-boot.git

sunxi: Use binman for sunxi boards

Move sunxi boards to use binman. This involves adding the image definition
to the device tree and using it in the Makefile.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
---

diff --git a/Makefile b/Makefile
index 7688e87533..f5f82d203c 100644
--- a/Makefile
+++ b/Makefile
@@ -1114,10 +1114,8 @@ u-boot-x86-16bit.bin: u-boot FORCE
 endif
 
 ifneq ($(CONFIG_ARCH_SUNXI),)
-OBJCOPYFLAGS_u-boot-sunxi-with-spl.bin = -I binary -O binary \
-				   --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff
-u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img FORCE
-	$(call if_changed,pad_cat)
+u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb FORCE
+	$(call if_changed,binman)
 endif
 
 ifneq ($(CONFIG_TEGRA),)
diff --git a/arch/arm/dts/sunxi-u-boot.dtsi b/arch/arm/dts/sunxi-u-boot.dtsi
new file mode 100644
index 0000000000..5adfd9bca2
--- /dev/null
+++ b/arch/arm/dts/sunxi-u-boot.dtsi
@@ -0,0 +1,14 @@
+#include <config.h>
+
+/ {
+	binman {
+		filename = "u-boot-sunxi-with-spl.bin";
+		pad-byte = <0xff>;
+		blob {
+			filename = "spl/sunxi-spl.bin";
+		};
+		u-boot-img {
+			pos = <CONFIG_SPL_PAD_TO>;
+		};
+	};
+};
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 60265f4d32..348de2dbf8 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -310,8 +310,8 @@ quiet_cmd_dtc = DTC     $@
 # Modified for U-Boot
 # Bring in any U-Boot-specific include after the '/dts-v1/;' header
 cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
-	cat $< $(if $(u-boot-dtsi),\
-		| sed 's%^/ {$$%\#include \"$(u-boot-dtsi)\"\n&%')  | \
+	cat $< $(if $(u_boot_dtsi),\
+		| sed 's%^/ {$$%\#include \"$(u_boot_dtsi)\"\n&%')  | \
 		$(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \
 	$(DTC) -O dtb -o $@ -b 0 \
 		-i $(dir $<) $(DTC_FLAGS) \