Skip to contentSkip to conversation

rockchip: Convert to use FIT generator for optee

PATCH New Kever Yang 1 participant 3 messages Nov 15, 2019

Subsystems (3)
lore
Share & tools
lore

Kever Yang

author
#0 lore raw

PATCH 1/3 rockchip: Convert to use FIT generator for optee

Use generator script so that we can use environment for TEE source. $TEE for tee.bin, and if file not exist, the script can report a warning, and meke the build success without a error.

---

 arch/arm/mach-rockchip/fit_spl_optee.its | 50 ---------------
 arch/arm/mach-rockchip/fit_spl_optee.sh  | 78 ++++++++++++++++++++++++
 configs/evb-rk3229_defconfig             |  2 +-
 3 files changed, 79 insertions(+), 51 deletions(-)
 delete mode 100644 arch/arm/mach-rockchip/fit_spl_optee.its
 create mode 100755 arch/arm/mach-rockchip/fit_spl_optee.sh
arch/arm/mach-rockchip/fit_spl_optee.its deleted +0 -50
deleted file mode 100644
index 6ed5d486f2..0000000000
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2017 Rockchip Electronic Co.,Ltd
- *
- * Simple U-boot fit source file containing U-Boot, dtb and optee
- */
-
-/dts-v1/;
-
-/ {
-	description = "Simple image with OP-TEE support";
-	#address-cells = <1>;
-
-	images {
-		uboot {
-			description = "U-Boot";
-			data = /incbin/("../../../u-boot-nodtb.bin");
-			type = "standalone";
-			os = "U-Boot";
-			arch = "arm";
-			compression = "none";
-			load = <0x61000000>;
-		};
-		optee {
-			description = "OP-TEE";
-			data = /incbin/("../../../tee.bin");
-			type = "firmware";
-			arch = "arm";
-			os = "tee";
-			compression = "none";
-			load = <0x68400000>;
-			entry = <0x68400000>;
-		};
-		fdt {
-			description = "dtb";
-			data = /incbin/("../../../u-boot.dtb");
-			type = "flat_dt";
-			compression = "none";
-		};
-	};
-
-	configurations {
-		default = "conf";
-		conf {
-			description = "Rockchip armv7 with OP-TEE";
-			firmware = "optee";
-			loadables = "uboot";
-			fdt = "fdt";
-		};
-	};
-};
arch/arm/mach-rockchip/fit_spl_optee.sh new file +78 -0

78 lines not on this page · raw message

configs/evb-rk3229_defconfig +1 -1
index 745fdd1c0f..11a2d01847 100644
@@ -14,7 +14,7 @@ CONFIG_SPL_TEXT_BASE=0x60000000
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_LOAD_FIT=y
-CONFIG_SPL_FIT_SOURCE="arch/arm/mach-rockchip/fit_spl_optee.its"
+CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-rockchip/fit_spl_optee.sh"
 CONFIG_USE_PREBOOT=y
 CONFIG_DEFAULT_FDT_FILE="rk3229-evb.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 2/3 rockchip: lion-rk3368: Migrate to use common FIT generator

The RK3368 lion board ATF can use bl31.elf like RK3399 and get the FIT source with generic FIT generator script at:
arch/arm/mach-rockchip/make_fit_atf.py

And then we can use 'BL31' environment to get the path of bl31.elf instead of copy it into U-Boot folder.

CC Philipp Tomsich <[email protected]>

---

 .../lion_rk3368/fit_spl_atf.its               | 52 -------------------
 configs/lion-rk3368_defconfig                 |  1 -
 2 files changed, 53 deletions(-)
 delete mode 100644 board/theobroma-systems/lion_rk3368/fit_spl_atf.its
board/theobroma-systems/lion_rk3368/fit_spl_atf.its deleted +0 -52
deleted file mode 100644
index 6b04fbc7da..0000000000
@@ -1,52 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ OR X11 */
-/*
- * Copyright (C) 2017 Theobroma Systems Design und Consulting GmbH
- *
- * Minimal dts for a SPL FIT image payload.
- */
-
-/dts-v1/;
-
-/ {
-	description = "FIT image with U-Boot proper, ATF bl31, DTB";
-	#address-cells = <1>;
-
-	images {
-		uboot {
-			description = "U-Boot (64-bit)";
-			data = /incbin/("../../../u-boot-nodtb.bin");
-			type = "standalone";
-			os = "U-Boot";
-			arch = "arm64";
-			compression = "none";
-			load = <0x00200000>;
-		};
-		atf {
-			description = "ARM Trusted Firmware";
-			data = /incbin/("../../../bl31-rk3368.bin");
-			type = "firmware";
-			os = "arm-trusted-firmware";
-			arch = "arm64";
-			compression = "none";
-			load = <0x00100000>;
-			entry = <0x00100000>;
-		};
-
-		fdt {
-			description = "RK3368-uQ7 (Lion) flat device-tree";
-			data = /incbin/("../../../u-boot.dtb");
-			type = "flat_dt";
-			compression = "none";
-		};
-	};
-
-	configurations {
-		default = "conf";
-		conf {
-			description = "Theobroma Systems RK3368-uQ7 (Puma) SoM";
-			firmware = "atf";
-			loadables = "uboot";
-			fdt = "fdt";
-		};
-	};
-};
configs/lion-rk3368_defconfig +0 -1
index 1d02d65a37..c66b28eda1 100644
@@ -20,7 +20,6 @@ CONFIG_ANDROID_BOOT_IMAGE=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SPL_LOAD_FIT=y
-CONFIG_SPL_FIT_SOURCE="board/theobroma-systems/lion_rk3368/fit_spl_atf.its"
 CONFIG_BOOTSTAGE=y
 CONFIG_SPL_BOOTSTAGE=y
 CONFIG_BOOTSTAGE_REPORT=y
Signature · 1 line
2.17.1
author
#2 lore raw

PATCH 3/3 Kconfig: Enable building of u-boot.itb on Rockchip platform

In reply to Kever Yang

For all the Rockchip SoCs with SPL_LOAD_FIT enable, we need to build u-boot.itb with U-Boot proper and ATF/OPTEE.

All the Rockchip boards with SPL_LOAD_FIT now supports FIT generator to get ATF/OPTEE binary path from environment and pass the build even if no ATF/OPTEE binary exist, so we can enable this feature for the rockchip platform.

---

 Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Kconfig +1 -1
index cda4f58ff7..e22417ec44 100644
@@ -252,7 +252,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 && (ROCKCHIP_RK3399 || \
+	default "u-boot.itb" if SPL_LOAD_FIT && (ARCH_ROCKCHIP || \
 				ARCH_SUNXI || RISCV)
 	default "u-boot.kwb" if KIRKWOOD
 	default "u-boot-with-spl.bin" if ARCH_AT91 && SPL_NAND_SUPPORT
Signature · 1 line
2.17.1