arm: imx8m: add OP-TEE node
authorYannic Moog <y.moog@phytec.de>
Fri, 10 Jan 2025 12:35:33 +0000 (13:35 +0100)
committerFabio Estevam <festevam@gmail.com>
Thu, 16 Jan 2025 13:16:02 +0000 (10:16 -0300)
Add tee node in SoC u-boot device trees. Use a kconfig entry to specify
load and entry addresses for the op-tee image in the respective
defconfig.
Default IMX8M_OPTEE_LOAD_ADDR is supplied. To keep it simple, the same
addresses are used for each SoC as are defined in upstream tf-a
(BL32_BASE) [1].

[1] https://github.com/ARM-software/arm-trusted-firmware/tree/master/plat/imx/imx8m

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
arch/arm/mach-imx/imx8m/Kconfig

index d31bc82..ecc2319 100644 (file)
                                        };
 #endif
 
+                                       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";
+                                                       optional;
+                                               };
+                                       };
+
                                        binman_fip: fip {
                                                arch = "arm64";
                                                compression = "none";
                                                fdt = "fdt-SEQ";
                                                firmware = "uboot";
 #ifndef CONFIG_ARMV8_PSCI
-                                               loadables = "atf";
+                                               loadables = "atf", "tee";
 #endif
                                        };
                                };
index 6d80d85..4a4498b 100644 (file)
                                        };
 #endif
 
+                                       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";
+                                                       optional;
+                                               };
+                                       };
+
                                        binman_fip: fip {
                                                arch = "arm64";
                                                compression = "none";
                                                fdt = "fdt-SEQ";
                                                firmware = "uboot";
 #ifndef CONFIG_ARMV8_PSCI
-                                               loadables = "atf";
+                                               loadables = "atf", "tee";
 #endif
                                        };
                                };
index 56749cc..9ede98a 100644 (file)
                                        };
 #endif
 
+                                       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";
+                                                       optional;
+                                               };
+                                       };
+
                                        @fdt-SEQ {
                                                description = "NAME";
                                                type = "flat_dt";
                                                fdt = "fdt-SEQ";
                                                firmware = "uboot";
 #ifndef CONFIG_ARMV8_PSCI
-                                               loadables = "atf";
+                                               loadables = "atf", "tee";
 #endif
                                        };
                                };
index d7a83a7..93e2ef2 100644 (file)
                                        };
 #endif
 
+                                       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";
+                                                       optional;
+                                               };
+                                       };
+
                                        fdt {
                                                compression = "none";
                                                description = "NAME";
                                                fdt = "fdt";
                                                firmware = "uboot";
 #ifndef CONFIG_ARMV8_PSCI
-                                               loadables = "atf";
+                                               loadables = "atf", "tee";
 #endif
                                        };
                                };
index 76a8be7..0fe9c46 100644 (file)
@@ -37,6 +37,17 @@ config SYS_HAS_ARMV8_SECURE_BASE
          If enabled, please also define the value for ARMV8_SECURE_BASE,
          for i.MX8M, it could be some address in OCRAM.
 
+config IMX8M_OPTEE_LOAD_ADDR
+       hex "Load address of OPTEE image"
+       default 0xbe000000 if IMX8MM
+       default 0xbe000000 if IMX8MN
+       default 0x56000000 if IMX8MP
+       default 0xfe000000 if IMX8MQ
+       help
+         The load and entry address for the OPTEE image. This value defaults to
+         the one defined in tf-a if not provided in the board defconfig file.
+
+
 choice
        prompt "NXP i.MX8M board select"
        optional