[v2,43/49] rockchip: Convert evb-rk3288 over to use binman

Message ID 20200613205717.v2.43.I06554267b89630ec9d59afed99fae36458223091@changeid
State New
Headers show
Series
  • rockchip: x86: Support building ROM files automatically with binman
Related show

Commit Message

Simon Glass June 14, 2020, 2:57 a.m.
At present this board uses a custom script to produce the .its file.
Update it to use binman instead. Binman can create all the images that
are needed.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

(no changes since v1)

 Kconfig                         |  2 +-
 arch/arm/dts/rk322x-u-boot.dtsi | 72 +++++++++++++++++++++++++++++++++
 arch/arm/dts/rk322x.dtsi        |  1 +
 arch/arm/dts/rk3288-u-boot.dtsi |  1 +
 configs/evb-rk3288_defconfig    |  2 +-
 5 files changed, 76 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/dts/rk322x-u-boot.dtsi

Patch

diff --git a/Kconfig b/Kconfig
index a548de43fb..6e874709a6 100644
--- a/Kconfig
+++ b/Kconfig
@@ -285,7 +285,7 @@  config BUILD_TARGET
 	default "u-boot-with-spl.sfp" if TARGET_SOCFPGA_GEN5
 	default "u-boot-spl.kwb" if ARCH_MVEBU && SPL
 	default "u-boot-elf.srec" if RCAR_GEN3
-	default "u-boot.itb" if SPL_LOAD_FIT && (ARCH_ROCKCHIP || \
+	default "u-boot.itb" if !BINMAN && SPL_LOAD_FIT && (ARCH_ROCKCHIP || \
 				ARCH_SUNXI || RISCV || ARCH_ZYNQMP)
 	default "u-boot.kwb" if ARCH_KIRKWOOD
 	default "u-boot-with-spl.bin" if ARCH_AT91 && SPL_NAND_SUPPORT
diff --git a/arch/arm/dts/rk322x-u-boot.dtsi b/arch/arm/dts/rk322x-u-boot.dtsi
new file mode 100644
index 0000000000..5a18816d5e
--- /dev/null
+++ b/arch/arm/dts/rk322x-u-boot.dtsi
@@ -0,0 +1,72 @@ 
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2020 Google LLC
+ */
+
+#ifdef CONFIG_SPL_OPTEE
+
+/ {
+	binman: binman {
+		multiple-images;
+	};
+};
+
+#include <config.h>
+
+&binman {
+	itb {
+		filename = "u-boot.itb";
+		fit {
+			fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>;
+			description = "FIT image with OP-TEE support";
+			#address-cells = <1>;
+
+			images {
+				uboot {
+					description = "U-Boot";
+					type = "standalone";
+					os = "U-Boot";
+					arch = "arm";
+					compression = "none";
+					load = <CONFIG_SYS_TEXT_BASE>;
+
+					u-boot-nodtb {
+					};
+				};
+				optee {
+					description = "OP-TEE";
+					type = "firmware";
+					arch = "arm";
+					os = "tee";
+					compression = "none";
+					load = <(CONFIG_SYS_SDRAM_BASE + 0x8400000)>;
+					entry = <(CONFIG_SYS_SDRAM_BASE + 0x8400000)>;
+
+					blob-ext {
+						filename = "tee.bin";
+					};
+				};
+				fdt {
+					description = CONFIG_SYS_BOARD;
+					type = "flat_dt";
+					compression = "none";
+
+					u-boot-dtb {
+					};
+				};
+			};
+
+			configurations {
+				default = "conf";
+				conf {
+					description = CONFIG_SYS_BOARD;
+					firmware = "optee";
+					loadables = "uboot";
+					fdt = "fdt";
+				};
+			};
+		};
+	};
+};
+
+#endif
diff --git a/arch/arm/dts/rk322x.dtsi b/arch/arm/dts/rk322x.dtsi
index 4a8be5dabb..1a2e8d1b99 100644
--- a/arch/arm/dts/rk322x.dtsi
+++ b/arch/arm/dts/rk322x.dtsi
@@ -9,6 +9,7 @@ 
 #include <dt-bindings/pinctrl/rockchip.h>
 #include <dt-bindings/clock/rk3228-cru.h>
 #include <dt-bindings/thermal/thermal.h>
+#include "rk322x-u-boot.dtsi"
 
 / {
 	#address-cells = <1>;
diff --git a/arch/arm/dts/rk3288-u-boot.dtsi b/arch/arm/dts/rk3288-u-boot.dtsi
index 104a5392bf..903bee1bcc 100644
--- a/arch/arm/dts/rk3288-u-boot.dtsi
+++ b/arch/arm/dts/rk3288-u-boot.dtsi
@@ -4,6 +4,7 @@ 
  */
 
 #include "rockchip-u-boot.dtsi"
+#include "rk322x-u-boot.dtsi"
 
 / {
 	chosen {
diff --git a/configs/evb-rk3288_defconfig b/configs/evb-rk3288_defconfig
index 350189fc63..cd03767bd5 100644
--- a/configs/evb-rk3288_defconfig
+++ b/configs/evb-rk3288_defconfig
@@ -14,7 +14,7 @@  CONFIG_DEBUG_UART=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_LOAD_FIT=y
-CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-rockchip/fit_spl_optee.sh"
+# CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_USE_PREBOOT=y
 CONFIG_SILENT_CONSOLE=y
 CONFIG_DEFAULT_FDT_FILE="rk3288-evb-rk808.dtb"