diff options
author | Silvano di Ninno <silvano.dininno@nxp.com> | 2020-01-29 17:52:00 +0100 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2022-04-06 18:03:29 +0800 |
commit | 4f59a0eaa323110d06fa40c09b4da36c83540204 (patch) | |
tree | 09318b336c912965f2e012869c153234cf4733f4 /arch/arm/mach-imx/imx8m | |
parent | 8759f34486647a94cb4c3b647ad66d049a95bb85 (diff) |
TEE-502 imx: refactor optee bindings addition
- Remove code duplication betwee imx8 and imx8m support
- add reserved memory node to prevent Linux accessing optee reserved memory
Signed-off-by: Silvano di Ninno <silvano.dininno@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 8beac7ef22c16b72ad337b44a0516436a4a0d00c)
(cherry picked from commit 07be6f855bdcbca200e4685ea557b2529187e29f)
(cherry picked from commit 1bfbbac316e3d7ac051f81264b66425a86d95c4d)
(cherry picked from commit 6a27dd9792900a6512b05eca85d22aab120c74a6)
Diffstat (limited to 'arch/arm/mach-imx/imx8m')
-rw-r--r-- | arch/arm/mach-imx/imx8m/soc.c | 49 |
1 files changed, 1 insertions, 48 deletions
diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index b8bb9e86c9..e1bf2b1d34 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -16,6 +16,7 @@ #include <asm/arch/sys_proto.h> #include <asm/mach-imx/hab.h> #include <asm/mach-imx/boot_mode.h> +#include <asm/mach-imx/optee.h> #include <asm/mach-imx/syscounter.h> #include <asm/ptrace.h> #include <asm/armv8/mmu.h> @@ -1129,54 +1130,6 @@ static int disable_cpu_nodes(void *blob, u32 disabled_cores) return 0; } -static int ft_add_optee_node(void *fdt, struct bd_info *bd) -{ - const char *path, *subpath; - int offs; - - /* - * No TEE space allocated indicating no TEE running, so no - * need to add optee node in dts - */ - if (!rom_pointer[1]) - return 0; - - offs = fdt_increase_size(fdt, 512); - if (offs) { - printf("No Space for dtb\n"); - return 1; - } - - path = "/firmware"; - offs = fdt_path_offset(fdt, path); - if (offs < 0) { - path = "/"; - offs = fdt_path_offset(fdt, path); - - if (offs < 0) { - printf("Could not find root node.\n"); - return 1; - } - - subpath = "firmware"; - offs = fdt_add_subnode(fdt, offs, subpath); - if (offs < 0) { - printf("Could not create %s node.\n", subpath); - } - } - - subpath = "optee"; - offs = fdt_add_subnode(fdt, offs, subpath); - if (offs < 0) { - printf("Could not create %s node.\n", subpath); - } - - fdt_setprop_string(fdt, offs, "compatible", "linaro,optee-tz"); - fdt_setprop_string(fdt, offs, "method", "smc"); - - return 0; -} - int ft_system_setup(void *blob, struct bd_info *bd) { #ifdef CONFIG_IMX8MQ |