imx8m: Guard binman nodes with CONFIG_OPTEE
Subsystems (2)
Fabio Estevam
reviewerPATCH v2 1/1 imx8m: Guard binman nodes with CONFIG_OPTEE
From: Fabio Estevam <[email protected]>
Guard binman nodes with CONFIG_OPTEE to fix the following error when building without optee support:
BINMAN .binman_stamp
Image 'image' has faked external blobs and is non-functional: tee.bin
Image 'image' is missing optional external blobs but is still functional: tee-os
/binman/section/fit/images/tee/tee-os (tee.bin):
See the documentation for your board. You may need to build Open Portable Trusted Execution Environment (OP-TEE) and build with TEE=/path/to/tee.bin
Some images are invalid
make: *** [Makefile:1135: .binman_stamp] Error 103
While at it, only pass tee to the loadables lines when CONFIG_OPTEE is defined.
---
Changes since v1:
- Also guard the loadables line. (Tim)
arch/arm/dts/imx8mm-u-boot.dtsi | 6 ++++++ arch/arm/dts/imx8mn-u-boot.dtsi | 6 ++++++ arch/arm/dts/imx8mp-u-boot.dtsi | 6 ++++++ arch/arm/dts/imx8mq-u-boot.dtsi | 6 ++++++ 4 files changed, 24 insertions(+)
arch/arm/dts/imx8mm-u-boot.dtsi +6 -0
@@ -164,6 +164,7 @@ }; #endif +#ifdef CONFIG_OPTEE tee: tee { description = "OP-TEE"; type = "tee";
@@ -178,6 +179,7 @@ optional; }; }; +#endif binman_fip: fip { arch = "arm64";
@@ -207,7 +209,11 @@ fdt = "fdt-SEQ"; firmware = "uboot"; #ifndef CONFIG_ARMV8_PSCI +#ifdef CONFIG_OPTEE loadables = "atf", "tee"; +#else + loadables = "atf"; +#endif #endif }; };
arch/arm/dts/imx8mn-u-boot.dtsi +6 -0
@@ -240,6 +240,7 @@ }; #endif +#ifdef CONFIG_OPTEE tee: tee { description = "OP-TEE"; type = "tee";
@@ -254,6 +255,7 @@ optional; }; }; +#endif binman_fip: fip { arch = "arm64";
@@ -283,7 +285,11 @@ fdt = "fdt-SEQ"; firmware = "uboot"; #ifndef CONFIG_ARMV8_PSCI +#ifdef CONFIG_OPTEE loadables = "atf", "tee"; +#else + loadables = "atf"; +#endif #endif }; };
arch/arm/dts/imx8mp-u-boot.dtsi +6 -0
@@ -185,6 +185,7 @@ }; #endif +#ifdef CONFIG_OPTEE tee: tee { description = "OP-TEE"; type = "tee";
@@ -199,6 +200,7 @@ optional; }; }; +#endif @fdt-SEQ { description = "NAME";
@@ -219,7 +221,11 @@ fdt = "fdt-SEQ"; firmware = "uboot"; #ifndef CONFIG_ARMV8_PSCI +#ifdef CONFIG_OPTEE loadables = "atf", "tee"; +#else + loadables = "atf"; +#endif #endif }; };
arch/arm/dts/imx8mq-u-boot.dtsi +6 -0
@@ -144,6 +144,7 @@ }; #endif +#ifdef CONFIG_OPTEE tee: tee { description = "OP-TEE"; type = "tee";
@@ -158,6 +159,7 @@ optional; }; }; +#endif fdt { compression = "none";
@@ -179,7 +181,11 @@ fdt = "fdt"; firmware = "uboot"; #ifndef CONFIG_ARMV8_PSCI +#ifdef CONFIG_OPTEE loadables = "atf", "tee"; +#else + loadables = "atf"; +#endif #endif }; };
Signature · 1 line
2.34.1
Quoted 22 lines
Subject: [PATCH v2] imx8m: Guard binman nodes with
CONFIG_OPTEEFrom: Fabio Estevam <[email protected]>
Guard binman nodes with
CONFIG_OPTEEto fix the following error when building without optee support:BINMAN .binman_stamp
Image 'image' has faked external blobs and is non-functional: tee.binImage 'image' is missing optional external blobs but is still functional:
tee-os/binman/section/fit/images/tee/tee-os (tee.bin):
See the documentation for your board. You may need to build Open
Portable
Trusted Execution Environment (OP-TEE) and build with
TEE=/path/to/tee.binSome images are invalid
make: *** [Makefile:1135: .binman_stamp] Error 103
Quoted 6 lines
While at it, only pass tee to the loadables lines when
CONFIG_OPTEEis defined.Reported-by Tim Harvey <[email protected]>Signed-off-by Fabio Estevam <[email protected]>Reviewed-by Tom Rini <[email protected]>
Hi Fabio,
Quoted 17 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
Guard binman nodes with
CONFIG_OPTEEto fix the following error when building without optee support:BINMAN .binman_stamp
Image 'image' has faked external blobs and is non-functional: tee.binImage 'image' is missing optional external blobs but is still functional: tee-os
/binman/section/fit/images/tee/tee-os (tee.bin):
See the documentation for your board. You may need to build Open Portable Trusted Execution Environment (OP-TEE) and build with TEE=/path/to/tee.binSome images are invalid
make: *** [Makefile:1135: .binman_stamp] Error 103
Quoted 6 lines
While at it, only pass tee to the loadables lines when
CONFIG_OPTEEis defined.Reported-by Tim Harvey <[email protected]>Signed-off-by Fabio Estevam <[email protected]>Reviewed-by Tom Rini <[email protected]>
Tested on phycore-imx8mp.
This patch does solve the problem as reported by Tim.
I have a question:
Since tee.bin is marked as optional, we still get the same behaviour when OPTEE is set but no tee.bin is supplied.
What do you suggest to do to remedy this?
We could remove the optional. Given that we guard it with CONFIG_OPTEE it makes sense that the tee binary must then be supplied and should no longer be considered optional.
On the other hand we could fix the build error when it is marked as optional and not present. This could allow us to remove the guard introduced here.
Further, we could combine these two ideas and add a guard that requires tee.bin when CONFIG_OPTEE is set and marks it as optional when CONFIG_OPTEE is not set like so
tee: tee {
description = "OP-TEE";
type = "tee";
arch = "arm64";
compression = "none";
os = "tee";
load = <CONFIG_IMX8M_OPTEE_LOAD_ADDR>;
entry = <CONFIG_IMX8M_OPTEE_LOAD_ADDR>;
tee-os {
filename = "tee.bin";
#ifndef CONFIG_OPTEE
optional;
#endif
};
};Yannic
Quoted 43 lines
---
Changes since v1:
- Also guard the loadables line. (Tim)arch/arm/dts/imx8mm-u-boot.dtsi | 6 ++++++ arch/arm/dts/imx8mn-u-boot.dtsi | 6 ++++++ arch/arm/dts/imx8mp-u-boot.dtsi | 6 ++++++ arch/arm/dts/imx8mq-u-boot.dtsi | 6 ++++++ 4 files changed, 24 insertions(+)arch/arm/dts/imx8mm-u-boot.dtsi +0
-0@@ -164,6 +164,7 @@ }; #endif
+#ifdefCONFIG_OPTEE
tee: tee { description = "OP-TEE"; type = "tee";arch/arm/dts/imx8mm-u-boot.dtsi +1
-0@@ -178,6 +179,7 @@ optional; }; }; +#endif
binman_fip: fip { arch = "arm64";arch/arm/dts/imx8mm-u-boot.dtsi +4
-0@@ -207,7 +209,11 @@ fdt = "fdt-SEQ"; firmware = "uboot"; #ifndef CONFIG_ARMV8_PSCI +#ifdef CONFIG_OPTEE loadables = "atf", "tee"; +#else + loadables = "atf"; +#endif #endif }; };
[...]
Fabio Estevam
reviewerHi Yannic,
Quoted 7 lines · Yannic Moog
I have a question:
Since tee.bin is marked as optional, we still get the same behaviour when OPTEE is set but no tee.bin is supplied.
What do you suggest to do to remedy this?We could remove the optional. Given that we guard it with
CONFIG_OPTEEit makes sense that the tee binary must then be supplied and should no longer be considered optional.
Yes, this makes sense.
Would you mind sending a patch?
Thanks
Quoted 9 lines · Fabio Estevam
Hi Yannic,
Quoted 5 lines · Yannic Moog
I have a question:
Since tee.bin is marked as optional, we still get the same behaviour when OPTEE is set but no tee.bin is supplied.
What do you suggest to do to remedy this?
Quoted 7 lines
Quoted 3 lines
We could remove the optional. Given that we guard it with
CONFIG_OPTEEit makes sense that the tee
binary must then be supplied and should no longer be considered optional.Yes, this makes sense.
Would you mind sending a patch?
Will do
Yannic
Quoted 2 lines
Thanks
Quoted 17 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
Quoted 1 line
Guard binman nodes with
CONFIG_OPTEEto fix the following errorwhen building without optee support:
BINMAN .binman_stamp
Image 'image' has faked external blobs and is non-functional: tee.binImage 'image' is missing optional external blobs but is still functional: tee-os
/binman/section/fit/images/tee/tee-os (tee.bin):
See the documentation for your board. You may need to build Open Portable Trusted Execution Environment (OP-TEE) and build with TEE=/path/to/tee.binSome images are invalid
make: *** [Makefile:1135: .binman_stamp] Error 103
Quoted 6 lines
While at it, only pass tee to the loadables lines when
CONFIG_OPTEEis defined.Reported-by Tim Harvey <[email protected]>Signed-off-by Fabio Estevam <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied, thanks.