[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.
Signed-off-by: Jagan Teki jagan@edgeble.ai --- common/spl/Kconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/common/spl/Kconfig b/common/spl/Kconfig index b738c749ff..95a4b8e855 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -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

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"
Signed-off-by: Jagan Teki jagan@edgeble.ai --- 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
diff --git a/arch/arm/dts/px30-u-boot.dtsi b/arch/arm/dts/px30-u-boot.dtsi index 462eaf68f8..7cea48181c 100644 --- a/arch/arm/dts/px30-u-boot.dtsi +++ b/arch/arm/dts/px30-u-boot.dtsi @@ -4,6 +4,7 @@ */
#include "rockchip-u-boot.dtsi" +#include "rockchip-binman.dtsi"
/ { aliases { diff --git a/arch/arm/dts/rk3036-u-boot.dtsi b/arch/arm/dts/rk3036-u-boot.dtsi index 41ac054b81..a49526c63a 100644 --- a/arch/arm/dts/rk3036-u-boot.dtsi +++ b/arch/arm/dts/rk3036-u-boot.dtsi @@ -4,3 +4,4 @@ */
#include "rockchip-u-boot.dtsi" +#include "rockchip-binman.dtsi" diff --git a/arch/arm/dts/rk3066a-u-boot.dtsi b/arch/arm/dts/rk3066a-u-boot.dtsi index bc6e609d02..a85f752477 100644 --- a/arch/arm/dts/rk3066a-u-boot.dtsi +++ b/arch/arm/dts/rk3066a-u-boot.dtsi @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0+
#include "rockchip-u-boot.dtsi" +#include "rockchip-binman.dtsi" #include "rk3xxx-u-boot.dtsi" diff --git a/arch/arm/dts/rk3188-u-boot.dtsi b/arch/arm/dts/rk3188-u-boot.dtsi index 735776c16b..bc028a8c1b 100644 --- a/arch/arm/dts/rk3188-u-boot.dtsi +++ b/arch/arm/dts/rk3188-u-boot.dtsi @@ -4,6 +4,7 @@ */
#include "rockchip-u-boot.dtsi" +#include "rockchip-binman.dtsi" #include "rk3xxx-u-boot.dtsi"
&global_timer { diff --git a/arch/arm/dts/rk322x-u-boot.dtsi b/arch/arm/dts/rk322x-u-boot.dtsi index 79c41e481b..bd31c3bdc4 100644 --- a/arch/arm/dts/rk322x-u-boot.dtsi +++ b/arch/arm/dts/rk322x-u-boot.dtsi @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0+
#include "rockchip-u-boot.dtsi" +#include "rockchip-binman.dtsi"
/ { bus_intmem@10080000 { diff --git a/arch/arm/dts/rk3288-u-boot.dtsi b/arch/arm/dts/rk3288-u-boot.dtsi index e411445ed6..a24d590e20 100644 --- a/arch/arm/dts/rk3288-u-boot.dtsi +++ b/arch/arm/dts/rk3288-u-boot.dtsi @@ -5,6 +5,7 @@
#include "rockchip-u-boot.dtsi" #include "rockchip-optee.dtsi" +#include "rockchip-binman.dtsi"
/ { aliases { diff --git a/arch/arm/dts/rk3308-u-boot.dtsi b/arch/arm/dts/rk3308-u-boot.dtsi index ab5bfc2ce9..665582ddd3 100644 --- a/arch/arm/dts/rk3308-u-boot.dtsi +++ b/arch/arm/dts/rk3308-u-boot.dtsi @@ -4,6 +4,7 @@ */
#include "rockchip-u-boot.dtsi" +#include "rockchip-binman.dtsi"
/ { aliases { diff --git a/arch/arm/dts/rk3326-odroid-go2-u-boot.dtsi b/arch/arm/dts/rk3326-odroid-go2-u-boot.dtsi index 16c33735eb..cd5d43b3c4 100644 --- a/arch/arm/dts/rk3326-odroid-go2-u-boot.dtsi +++ b/arch/arm/dts/rk3326-odroid-go2-u-boot.dtsi @@ -4,6 +4,7 @@ */
#include "rockchip-u-boot.dtsi" +#include "rockchip-binman.dtsi"
/ { chosen { diff --git a/arch/arm/dts/rk3328-u-boot.dtsi b/arch/arm/dts/rk3328-u-boot.dtsi index d4a7540a92..407286b176 100644 --- a/arch/arm/dts/rk3328-u-boot.dtsi +++ b/arch/arm/dts/rk3328-u-boot.dtsi @@ -4,6 +4,7 @@ */
#include "rockchip-u-boot.dtsi" +#include "rockchip-binman.dtsi"
/ { aliases { diff --git a/arch/arm/dts/rk3368-u-boot.dtsi b/arch/arm/dts/rk3368-u-boot.dtsi index 811d59ac34..c33604266a 100644 --- a/arch/arm/dts/rk3368-u-boot.dtsi +++ b/arch/arm/dts/rk3368-u-boot.dtsi @@ -5,6 +5,7 @@
#include <dt-bindings/memory/rk3368-dmc.h> #include "rockchip-u-boot.dtsi" +#include "rockchip-binman.dtsi"
/ { dmc: dmc@ff610000 { diff --git a/arch/arm/dts/rk3399-u-boot.dtsi b/arch/arm/dts/rk3399-u-boot.dtsi index 3c1a15fe51..03a328b295 100644 --- a/arch/arm/dts/rk3399-u-boot.dtsi +++ b/arch/arm/dts/rk3399-u-boot.dtsi @@ -5,6 +5,7 @@ #define USB_CLASS_HUB 9
#include "rockchip-u-boot.dtsi" +#include "rockchip-binman.dtsi"
/ { aliases { diff --git a/arch/arm/dts/rk356x-u-boot.dtsi b/arch/arm/dts/rk356x-u-boot.dtsi index ccb8db0001..8265e1a0bd 100644 --- a/arch/arm/dts/rk356x-u-boot.dtsi +++ b/arch/arm/dts/rk356x-u-boot.dtsi @@ -4,6 +4,7 @@ */
#include "rockchip-u-boot.dtsi" +#include "rockchip-binman.dtsi"
/ { aliases { diff --git a/arch/arm/dts/rockchip-binman.dtsi b/arch/arm/dts/rockchip-binman.dtsi new file mode 100644 index 0000000000..8f7b3ee53b --- /dev/null +++ b/arch/arm/dts/rockchip-binman.dtsi @@ -0,0 +1,67 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019 Jagan Teki jagan@amarulasolutions.com + */ + +#include <config.h> + +#ifdef CONFIG_SPL +&binman { + simple-bin { + filename = "u-boot-rockchip.bin"; + pad-byte = <0xff>; + + mkimage { + filename = "idbloader.img"; + args = "-n", CONFIG_SYS_SOC, "-T", "rksd"; +#ifdef CONFIG_TPL + multiple-data-files; + + u-boot-tpl { + }; +#endif + u-boot-spl { + }; + }; + +#ifdef CONFIG_ARM64 + blob { + filename = "u-boot.itb"; +#else + u-boot-img { +#endif + offset = <CONFIG_SPL_PAD_TO>; + }; + }; + +#ifdef CONFIG_ROCKCHIP_SPI_IMAGE + simple-bin-spi { + filename = "u-boot-rockchip-spi.bin"; + pad-byte = <0xff>; + + mkimage { + filename = "idbloader-spi.img"; + args = "-n", CONFIG_SYS_SOC, "-T", "rkspi"; +#ifdef CONFIG_TPL + multiple-data-files; + + u-boot-tpl { + }; +#endif + u-boot-spl { + }; + }; + +#ifdef CONFIG_ARM64 + blob { + filename = "u-boot.itb"; +#else + u-boot-img { +#endif + /* Sync with u-boot,spl-payload-offset if present */ + offset = <CONFIG_SYS_SPI_U_BOOT_OFFS>; + }; + }; +#endif +}; +#endif diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi index 584f21eb5b..3d55553e44 100644 --- a/arch/arm/dts/rockchip-u-boot.dtsi +++ b/arch/arm/dts/rockchip-u-boot.dtsi @@ -10,64 +10,3 @@ multiple-images; }; }; - -#ifdef CONFIG_SPL -&binman { - simple-bin { - filename = "u-boot-rockchip.bin"; - pad-byte = <0xff>; - - mkimage { - filename = "idbloader.img"; - args = "-n", CONFIG_SYS_SOC, "-T", "rksd"; -#ifdef CONFIG_TPL - multiple-data-files; - - u-boot-tpl { - }; -#endif - u-boot-spl { - }; - }; - -#ifdef CONFIG_ARM64 - blob { - filename = "u-boot.itb"; -#else - u-boot-img { -#endif - offset = <CONFIG_SPL_PAD_TO>; - }; - }; - -#ifdef CONFIG_ROCKCHIP_SPI_IMAGE - simple-bin-spi { - filename = "u-boot-rockchip-spi.bin"; - pad-byte = <0xff>; - - mkimage { - filename = "idbloader-spi.img"; - args = "-n", CONFIG_SYS_SOC, "-T", "rkspi"; -#ifdef CONFIG_TPL - multiple-data-files; - - u-boot-tpl { - }; -#endif - u-boot-spl { - }; - }; - -#ifdef CONFIG_ARM64 - blob { - filename = "u-boot.itb"; -#else - u-boot-img { -#endif - /* Sync with u-boot,spl-payload-offset if present */ - offset = <CONFIG_SYS_SPI_U_BOOT_OFFS>; - }; - }; -#endif -}; -#endif diff --git a/arch/arm/dts/rv1108-u-boot.dtsi b/arch/arm/dts/rv1108-u-boot.dtsi index 6a2098b8d4..e6cb7b2f24 100644 --- a/arch/arm/dts/rv1108-u-boot.dtsi +++ b/arch/arm/dts/rv1108-u-boot.dtsi @@ -4,6 +4,7 @@ */
#include "rockchip-u-boot.dtsi" +#include "rockchip-binman.dtsi"
&grf { u-boot,dm-pre-reloc; diff --git a/arch/arm/dts/rv1126-u-boot.dtsi b/arch/arm/dts/rv1126-u-boot.dtsi index bc77037760..8f635f382b 100644 --- a/arch/arm/dts/rv1126-u-boot.dtsi +++ b/arch/arm/dts/rv1126-u-boot.dtsi @@ -4,6 +4,7 @@ */
#include "rockchip-u-boot.dtsi" +#include "rockchip-binman.dtsi"
/ { chosen {

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.
Signed-off-by: Jagan Teki jagan@edgeble.ai --- arch/arm/dts/rockchip-binman.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/dts/rockchip-binman.dtsi b/arch/arm/dts/rockchip-binman.dtsi index 8f7b3ee53b..48c6e2de4c 100644 --- a/arch/arm/dts/rockchip-binman.dtsi +++ b/arch/arm/dts/rockchip-binman.dtsi @@ -24,7 +24,7 @@ }; };
-#ifdef CONFIG_ARM64 +#if defined(CONFIG_ARM64) || defined(CONFIG_SPL_OPTEE_IMAGE) blob { filename = "u-boot.itb"; #else
participants (1)
-
Jagan Teki