Commit 3df4e71c96e129690cd7a299764433909b0359fd

Authored by Ye Li
1 parent c88d643f24

MLK-23963 imx: mx6/7: Move configure_tzc380 to each SOC arch init

The commit "TEE-520 core: imx: Set TZASC region 0 to non-sec"
added configure_tzc380 function in imx_sec_init to set region 0 to
non-sec, however imx_sec_init is called only on SOCs which has CAAM.
For SOCs use DCP, like 6SLL, 6ULL/6ULZ, 6SL, this function does not
execute, and cause the trustzone won't be configured.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit ab351d816b582382baf82c72546d8b7b3618de29)

Showing 4 changed files with 4 additions and 2 deletions Side-by-side Diff

arch/arm/include/asm/mach-imx/sys_proto.h
... ... @@ -225,5 +225,6 @@
225 225 int add_res_mem_dt_node(void *fdt, const char *name, phys_addr_t pa,
226 226 size_t size);
227 227 int add_dt_path_subnode(void *fdt, const char *path, const char *subnode);
  228 +void configure_tzc380(void);
228 229 #endif
arch/arm/mach-imx/misc.c
... ... @@ -107,7 +107,7 @@
107 107 }
108 108 }
109 109  
110   -static void configure_tzc380(void)
  110 +void configure_tzc380(void)
111 111 {
112 112 #if defined (IP2APB_TZASC1_BASE_ADDR)
113 113 struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
... ... @@ -125,7 +125,6 @@
125 125 #if defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SPL)
126 126 caam_open();
127 127 #endif
128   - configure_tzc380();
129 128 }
130 129  
131 130 static void set_dt_val(void *data, uint32_t cell_size, uint64_t val)
arch/arm/mach-imx/mx6/soc.c
... ... @@ -682,6 +682,7 @@
682 682 /* Secure init function such RNG */
683 683 imx_sec_init();
684 684 #endif
  685 + configure_tzc380();
685 686  
686 687 return 0;
687 688 }
arch/arm/mach-imx/mx7/soc.c
... ... @@ -364,6 +364,7 @@
364 364 /* Secure init function such RNG */
365 365 imx_sec_init();
366 366 #endif
  367 + configure_tzc380();
367 368  
368 369 return 0;
369 370 }