dts: imx8m{m,n,p,q}: Make optee packaging optional
authorYannic Moog <y.moog@phytec.de>
Wed, 6 Aug 2025 12:45:19 +0000 (14:45 +0200)
committerFabio Estevam <festevam@gmail.com>
Thu, 7 Aug 2025 11:16:33 +0000 (08:16 -0300)
binman can omit packaging an optional blob when it is missing.
This allows us to not bother with config options.
The core challenge is the interaction between tf-a and OP-TEE where
U-Boot/binman does not know whether tf-a was built with SPD=opteed or
without. This is important because tf-a might jump into the void when no
optee_os is present, leading to boot failure. Thus by marking it
optional, user is prompted to recheck (due to the warning message)
whether they really have the right combination of tf-a and optee.

Due to a bug in binman, we had to guard binman tee.bin with OPTEE config
as builds would error when tee.bin was not present in path; Even though
optee_os was marked as optional in the binman tree. Since the bug has
been resolved in
commit d4f61eae2ab7 ("Merge patch series "Fix handling of optional blobs in binman"")
we can mark it optional again without getting build errors.

Note that after this commit a warning will be printed when optee is not
present for a binman build.

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

Signed-off-by: Yannic Moog <y.moog@phytec.de>
arch/arm/dts/imx8mm-u-boot.dtsi
arch/arm/dts/imx8mn-u-boot.dtsi
arch/arm/dts/imx8mp-u-boot.dtsi
arch/arm/dts/imx8mq-u-boot.dtsi

index 59453dc..eb5b95a 100644 (file)
                                        };
 #endif
 
-#ifdef CONFIG_OPTEE
                                        tee: tee {
                                                description = "OP-TEE";
                                                type = "tee";
 
                                                tee-os {
                                                        filename = "tee.bin";
+                                                       optional;
                                                };
                                        };
-#endif
 
                                        binman_fip: fip {
                                                arch = "arm64";
                                                fdt = "fdt-SEQ";
                                                firmware = "uboot";
 #ifndef CONFIG_ARMV8_PSCI
-#ifdef CONFIG_OPTEE
                                                loadables = "atf", "tee";
-#else
-                                               loadables = "atf";
-#endif
 #endif
                                        };
                                };
index 96a6df9..4a4498b 100644 (file)
                                        };
 #endif
 
-#ifdef CONFIG_OPTEE
                                        tee: tee {
                                                description = "OP-TEE";
                                                type = "tee";
 
                                                tee-os {
                                                        filename = "tee.bin";
+                                                       optional;
                                                };
                                        };
-#endif
 
                                        binman_fip: fip {
                                                arch = "arm64";
                                                fdt = "fdt-SEQ";
                                                firmware = "uboot";
 #ifndef CONFIG_ARMV8_PSCI
-#ifdef CONFIG_OPTEE
                                                loadables = "atf", "tee";
-#else
-                                               loadables = "atf";
-#endif
 #endif
                                        };
                                };
index 6de9ab5..9ede98a 100644 (file)
                                        };
 #endif
 
-#ifdef CONFIG_OPTEE
                                        tee: tee {
                                                description = "OP-TEE";
                                                type = "tee";
 
                                                tee-os {
                                                        filename = "tee.bin";
+                                                       optional;
                                                };
                                        };
-#endif
 
                                        @fdt-SEQ {
                                                description = "NAME";
                                                fdt = "fdt-SEQ";
                                                firmware = "uboot";
 #ifndef CONFIG_ARMV8_PSCI
-#ifdef CONFIG_OPTEE
                                                loadables = "atf", "tee";
-#else
-                                               loadables = "atf";
-#endif
 #endif
                                        };
                                };
index 8a536b1..93e2ef2 100644 (file)
                                        };
 #endif
 
-#ifdef CONFIG_OPTEE
                                        tee: tee {
                                                description = "OP-TEE";
                                                type = "tee";
 
                                                tee-os {
                                                        filename = "tee.bin";
+                                                       optional;
                                                };
                                        };
-#endif
 
                                        fdt {
                                                compression = "none";
                                                fdt = "fdt";
                                                firmware = "uboot";
 #ifndef CONFIG_ARMV8_PSCI
-#ifdef CONFIG_OPTEE
                                                loadables = "atf", "tee";
-#else
-                                               loadables = "atf";
-#endif
 #endif
                                        };
                                };