Skip to contentSkip to conversation

spl: Kconfig: Fix SPL_OPTEE_IMAGE dependency

PATCH Superseded Jagan Teki 1 participant 3 messages Nov 3, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jagan Teki

author
#0 lore raw

PATCH 1/3 spl: Kconfig: Fix SPL_OPTEE_IMAGE dependency

fdt_addr will build as part of SPL_LOAD_FIT or SPL_LOAD_FIT_FULL which is indeed required to build optee image support in SPL.

common/spl/spl.c: In function ‘jump_to_image_optee’:
common/spl/spl.c:220:46: error: ‘struct spl_image_info’ has no member named ‘fdt_addr’
220 | spl_optee_entry(NULL, NULL, spl_image->fdt_addr,

Fix the dependency support.

---
 common/spl/Kconfig | 1 +
 1 file changed, 1 insertion(+)
common/spl/Kconfig +1 -0
index b738c749ff..95a4b8e855 100644
@@ -1479,6 +1479,7 @@ config SPL_AM33XX_ENABLE_RTC32K_OSC
 config SPL_OPTEE_IMAGE
 	bool "Support OP-TEE Trusted OS image in SPL"
 	depends on ARM
+	depends on SPL_LOAD_FIT || SPL_LOAD_FIT_FULL
 	help
 	  OP-TEE is an open source Trusted OS which is loaded by SPL.
 	  More detail at: https://github.com/OP-TEE/optee_os
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH 2/3 arm: dts: rockchip: Separate rockchip-binman.dtsi

rockchip-u-boot.dtsi has the FIT image for the final stage of binman image creation.

If the actual binman node is part of this dtsi then there are build issues to use optee as input to this final stage binman image since optee is built via another binman image creation unlike ATF built via tools like make_fit_atf.py.

binman: Filename 'u-boot.itb' not found in input path

Fix this by separating binman FIT image in rockchip-binman.dtsi

rockchip-u-boot.dtsi: binman node
rockchip-binman.dtsi: binman FIT image node

The inclusion of rockchip-binman.dtsi is always to be last in included files as it has a FIT image node for final image creation.

Sample example of optee used rk3288 looks like
b/arch/arm/dts/rk3288-u-boot.dtsi
#include "rockchip-u-boot.dtsi"
#include "rockchip-optee.dtsi"
#include "rockchip-binman.dtsi"

---
 arch/arm/dts/px30-u-boot.dtsi              |  1 +
 arch/arm/dts/rk3036-u-boot.dtsi            |  1 +
 arch/arm/dts/rk3066a-u-boot.dtsi           |  1 +
 arch/arm/dts/rk3188-u-boot.dtsi            |  1 +
 arch/arm/dts/rk322x-u-boot.dtsi            |  1 +
 arch/arm/dts/rk3288-u-boot.dtsi            |  1 +
 arch/arm/dts/rk3308-u-boot.dtsi            |  1 +
 arch/arm/dts/rk3326-odroid-go2-u-boot.dtsi |  1 +
 arch/arm/dts/rk3328-u-boot.dtsi            |  1 +
 arch/arm/dts/rk3368-u-boot.dtsi            |  1 +
 arch/arm/dts/rk3399-u-boot.dtsi            |  1 +
 arch/arm/dts/rk356x-u-boot.dtsi            |  1 +
 arch/arm/dts/rockchip-binman.dtsi          | 67 ++++++++++++++++++++++
 arch/arm/dts/rockchip-u-boot.dtsi          | 61 --------------------
 arch/arm/dts/rv1108-u-boot.dtsi            |  1 +
 arch/arm/dts/rv1126-u-boot.dtsi            |  1 +
 16 files changed, 81 insertions(+), 61 deletions(-)
 create mode 100644 arch/arm/dts/rockchip-binman.dtsi
arch/arm/dts/px30-u-boot.dtsi +1 -0
index 462eaf68f8..7cea48181c 100644
@@ -4,6 +4,7 @@
  */
 
 #include "rockchip-u-boot.dtsi"
+#include "rockchip-binman.dtsi"
 
 / {
 	aliases {
arch/arm/dts/rk3036-u-boot.dtsi +1 -0
index 41ac054b81..a49526c63a 100644
@@ -4,3 +4,4 @@
  */
 
 #include "rockchip-u-boot.dtsi"
+#include "rockchip-binman.dtsi"
arch/arm/dts/rk3066a-u-boot.dtsi +1 -0
index bc6e609d02..a85f752477 100644
@@ -1,4 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 
 #include "rockchip-u-boot.dtsi"
+#include "rockchip-binman.dtsi"
 #include "rk3xxx-u-boot.dtsi"
arch/arm/dts/rk3188-u-boot.dtsi +1 -0
index 735776c16b..bc028a8c1b 100644
@@ -4,6 +4,7 @@
  */
 
 #include "rockchip-u-boot.dtsi"
+#include "rockchip-binman.dtsi"
 #include "rk3xxx-u-boot.dtsi"
 
 &global_timer {
arch/arm/dts/rk322x-u-boot.dtsi +1 -0
index 79c41e481b..bd31c3bdc4 100644
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 
 #include "rockchip-u-boot.dtsi"
+#include "rockchip-binman.dtsi"
 
 / {
 	bus_intmem@10080000 {
arch/arm/dts/rk3288-u-boot.dtsi +1 -0
index e411445ed6..a24d590e20 100644
@@ -5,6 +5,7 @@
 
 #include "rockchip-u-boot.dtsi"
 #include "rockchip-optee.dtsi"
+#include "rockchip-binman.dtsi"
 
 / {
 	aliases {
arch/arm/dts/rk3308-u-boot.dtsi +1 -0
index ab5bfc2ce9..665582ddd3 100644
@@ -4,6 +4,7 @@
  */
 
 #include "rockchip-u-boot.dtsi"
+#include "rockchip-binman.dtsi"
 
 / {
 	aliases {
arch/arm/dts/rk3326-odroid-go2-u-boot.dtsi +1 -0
index 16c33735eb..cd5d43b3c4 100644
@@ -4,6 +4,7 @@
  */
 
 #include "rockchip-u-boot.dtsi"
+#include "rockchip-binman.dtsi"
 
 / {
 	chosen {
arch/arm/dts/rk3328-u-boot.dtsi +1 -0
index d4a7540a92..407286b176 100644
@@ -4,6 +4,7 @@
  */
 
 #include "rockchip-u-boot.dtsi"
+#include "rockchip-binman.dtsi"
 
 / {
 	aliases {
arch/arm/dts/rk3368-u-boot.dtsi +1 -0
index 811d59ac34..c33604266a 100644
@@ -5,6 +5,7 @@
 
 #include <dt-bindings/memory/rk3368-dmc.h>
 #include "rockchip-u-boot.dtsi"
+#include "rockchip-binman.dtsi"
 
 / {
 	dmc: dmc@ff610000 {
arch/arm/dts/rk3399-u-boot.dtsi +1 -0
index 3c1a15fe51..03a328b295 100644
@@ -5,6 +5,7 @@
 #define USB_CLASS_HUB			9
 
 #include "rockchip-u-boot.dtsi"
+#include "rockchip-binman.dtsi"
 
 / {
 	aliases {
arch/arm/dts/rk356x-u-boot.dtsi +1 -0
index ccb8db0001..8265e1a0bd 100644
@@ -4,6 +4,7 @@
  */
 
 #include "rockchip-u-boot.dtsi"
+#include "rockchip-binman.dtsi"
 
 / {
 	aliases {
arch/arm/dts/rockchip-binman.dtsi new file +67 -0

67 lines not on this page · raw message

arch/arm/dts/rockchip-u-boot.dtsi +0 -61

64 lines not on this page · raw message

arch/arm/dts/rv1108-u-boot.dtsi +1 -0
index 6a2098b8d4..e6cb7b2f24 100644
@@ -4,6 +4,7 @@
  */
 
 #include "rockchip-u-boot.dtsi"
+#include "rockchip-binman.dtsi"
 
 &grf {
 	u-boot,dm-pre-reloc;
arch/arm/dts/rv1126-u-boot.dtsi +1 -0
index bc77037760..8f635f382b 100644
@@ -4,6 +4,7 @@
  */
 
 #include "rockchip-u-boot.dtsi"
+#include "rockchip-binman.dtsi"
 
 / {
 	chosen {
Signature · 1 line
2.25.1
author
#2 lore raw

PATCH 3/3 arm: dts: rockchip: Build binman image for SPL_OPTEE_IMAGE

In reply to Jagan Teki

Like ARM64 the u-boot.itb is also built when SPL_OPTEE_IMAGE is defined.

So, add SPL_OPTEE_IMAGE check for u-boot.itb blob so-that OPTEE is part of u-boot-rockchip.bin.

---
 arch/arm/dts/rockchip-binman.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/dts/rockchip-binman.dtsi +1 -1
index 8f7b3ee53b..48c6e2de4c 100644
@@ -24,7 +24,7 @@
 			};
 		};
 
-#ifdef CONFIG_ARM64
+#if defined(CONFIG_ARM64) || defined(CONFIG_SPL_OPTEE_IMAGE)
 		blob {
 			filename = "u-boot.itb";
 #else
Signature · 1 line
2.25.1