All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3] rockchip: Convert to use FIT generator for optee
@ 2019-11-15  2:58 Kever Yang
  2019-11-15  2:58 ` [U-Boot] [PATCH 2/3] rockchip: lion-rk3368: Migrate to use common FIT generator Kever Yang
  2019-11-15  2:58 ` [U-Boot] [PATCH 3/3] Kconfig: Enable building of u-boot.itb on Rockchip platform Kever Yang
  0 siblings, 2 replies; 3+ messages in thread
From: Kever Yang @ 2019-11-15  2:58 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 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

diff --git a/arch/arm/mach-rockchip/fit_spl_optee.its b/arch/arm/mach-rockchip/fit_spl_optee.its
deleted file mode 100644
index 6ed5d486f2..0000000000
--- a/arch/arm/mach-rockchip/fit_spl_optee.its
+++ /dev/null
@@ -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";
-		};
-	};
-};
diff --git a/arch/arm/mach-rockchip/fit_spl_optee.sh b/arch/arm/mach-rockchip/fit_spl_optee.sh
new file mode 100755
index 0000000000..5e6618df2b
--- /dev/null
+++ b/arch/arm/mach-rockchip/fit_spl_optee.sh
@@ -0,0 +1,78 @@
+#!/bin/sh
+# SPDX-License-Identifier:      GPL-2.0+
+#
+# Copyright (C) 2019 Rockchip Electronic Co.,Ltd
+#
+# Script to generate FIT image source for 32-bit Rockchip SoCs with
+# U-Boot proper, OPTEE, and devicetree.
+#
+# usage: $0 <dt_name>
+
+[ -z "$TEE" ] && TEE="tee.bin"
+
+if [ ! -f $TEE ]; then
+	echo "WARNING: TEE file $TEE NOT found, U-Boot.itb is non-functional" >&2
+	echo "Please export path for TEE or copy tee.bin to U-Boot folder" >&2
+	TEE=/dev/null
+fi
+
+dtname=$1
+echo $dtname
+cat << __HEADER_EOF
+/*
+ * Copyright (C) 2017-2019 Rockchip Electronic Co.,Ltd
+ *
+ * Simple U-boot FIT source file containing U-Boot, dtb and optee
+ */
+
+/dts-v1/;
+
+/ {
+	description = "FIT 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");
+			type = "firmware";
+			arch = "arm";
+			os = "tee";
+			compression = "none";
+			load = <0x68400000>;
+			entry = <0x68400000>;
+		};
+		fdt {
+			description = "$(basename $dtname .dtb)";
+			data = /incbin/("$dtname");
+			type = "flat_dt";
+			compression = "none";
+		};
+__HEADER_EOF
+
+cat << __CONF_HEADER_EOF
+	};
+
+	configurations {
+		default = "conf";
+		conf {
+			description = "$(basename $dtname .dtb)";
+			firmware = "optee";
+			loadables = "uboot";
+			fdt = "fdt";
+		};
+__CONF_HEADER_EOF
+
+cat << __ITS_EOF
+	};
+};
+__ITS_EOF
diff --git a/configs/evb-rk3229_defconfig b/configs/evb-rk3229_defconfig
index 745fdd1c0f..11a2d01847 100644
--- a/configs/evb-rk3229_defconfig
+++ b/configs/evb-rk3229_defconfig
@@ -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
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH 2/3] rockchip: lion-rk3368: Migrate to use common FIT generator
  2019-11-15  2:58 [U-Boot] [PATCH 1/3] rockchip: Convert to use FIT generator for optee Kever Yang
@ 2019-11-15  2:58 ` Kever Yang
  2019-11-15  2:58 ` [U-Boot] [PATCH 3/3] Kconfig: Enable building of u-boot.itb on Rockchip platform Kever Yang
  1 sibling, 0 replies; 3+ messages in thread
From: Kever Yang @ 2019-11-15  2:58 UTC (permalink / raw)
  To: u-boot

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 <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 .../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

diff --git a/board/theobroma-systems/lion_rk3368/fit_spl_atf.its b/board/theobroma-systems/lion_rk3368/fit_spl_atf.its
deleted file mode 100644
index 6b04fbc7da..0000000000
--- a/board/theobroma-systems/lion_rk3368/fit_spl_atf.its
+++ /dev/null
@@ -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";
-		};
-	};
-};
diff --git a/configs/lion-rk3368_defconfig b/configs/lion-rk3368_defconfig
index 1d02d65a37..c66b28eda1 100644
--- a/configs/lion-rk3368_defconfig
+++ b/configs/lion-rk3368_defconfig
@@ -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
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH 3/3] Kconfig: Enable building of u-boot.itb on Rockchip platform
  2019-11-15  2:58 [U-Boot] [PATCH 1/3] rockchip: Convert to use FIT generator for optee Kever Yang
  2019-11-15  2:58 ` [U-Boot] [PATCH 2/3] rockchip: lion-rk3368: Migrate to use common FIT generator Kever Yang
@ 2019-11-15  2:58 ` Kever Yang
  1 sibling, 0 replies; 3+ messages in thread
From: Kever Yang @ 2019-11-15  2:58 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Kconfig b/Kconfig
index cda4f58ff7..e22417ec44 100644
--- a/Kconfig
+++ b/Kconfig
@@ -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
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-15  2:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-15  2:58 [U-Boot] [PATCH 1/3] rockchip: Convert to use FIT generator for optee Kever Yang
2019-11-15  2:58 ` [U-Boot] [PATCH 2/3] rockchip: lion-rk3368: Migrate to use common FIT generator Kever Yang
2019-11-15  2:58 ` [U-Boot] [PATCH 3/3] Kconfig: Enable building of u-boot.itb on Rockchip platform Kever Yang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.