ARM: OMAP2+: Add omap_secure_init callback hook for secure initialization
authorAndrew F. Davis <afd@ti.com>
Thu, 2 Jan 2020 21:19:40 +0000 (16:19 -0500)
committerTony Lindgren <tony@atomide.com>
Mon, 13 Jan 2020 18:02:43 +0000 (10:02 -0800)
This can be used for detecting secure features or making early device
init sequence changes based on device security type.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/io.c
arch/arm/mach-omap2/omap-secure.c
arch/arm/mach-omap2/omap-secure.h

index 349e48042982285af8eefc2ab4791e57ea6ed76d..f280472336657dbbb1fe544d27e08ddfc2277cfa 100644 (file)
@@ -51,6 +51,7 @@
 #include "prm33xx.h"
 #include "prm44xx.h"
 #include "opp2xxx.h"
+#include "omap-secure.h"
 
 /*
  * omap_clk_soc_init: points to a function that does the SoC-specific
@@ -430,6 +431,7 @@ void __init omap2420_init_early(void)
        omap_hwmod_init_postsetup();
        omap_clk_soc_init = omap2420_dt_clk_init;
        rate_table = omap2420_rate_table;
+       omap_secure_init();
 }
 
 void __init omap2420_init_late(void)
@@ -454,6 +456,7 @@ void __init omap2430_init_early(void)
        omap_hwmod_init_postsetup();
        omap_clk_soc_init = omap2430_dt_clk_init;
        rate_table = omap2430_rate_table;
+       omap_secure_init();
 }
 
 void __init omap2430_init_late(void)
@@ -481,6 +484,7 @@ void __init omap3_init_early(void)
        omap3xxx_clockdomains_init();
        omap3xxx_hwmod_init();
        omap_hwmod_init_postsetup();
+       omap_secure_init();
 }
 
 void __init omap3430_init_early(void)
@@ -533,6 +537,7 @@ void __init ti814x_init_early(void)
        dm814x_hwmod_init();
        omap_hwmod_init_postsetup();
        omap_clk_soc_init = dm814x_dt_clk_init;
+       omap_secure_init();
 }
 
 void __init ti816x_init_early(void)
@@ -549,6 +554,7 @@ void __init ti816x_init_early(void)
        dm816x_hwmod_init();
        omap_hwmod_init_postsetup();
        omap_clk_soc_init = dm816x_dt_clk_init;
+       omap_secure_init();
 }
 #endif
 
@@ -566,6 +572,7 @@ void __init am33xx_init_early(void)
        am33xx_hwmod_init();
        omap_hwmod_init_postsetup();
        omap_clk_soc_init = am33xx_dt_clk_init;
+       omap_secure_init();
 }
 
 void __init am33xx_init_late(void)
@@ -589,6 +596,7 @@ void __init am43xx_init_early(void)
        omap_hwmod_init_postsetup();
        omap_l2_cache_init();
        omap_clk_soc_init = am43xx_dt_clk_init;
+       omap_secure_init();
 }
 
 void __init am43xx_init_late(void)
@@ -617,6 +625,7 @@ void __init omap4430_init_early(void)
        omap_hwmod_init_postsetup();
        omap_l2_cache_init();
        omap_clk_soc_init = omap4xxx_dt_clk_init;
+       omap_secure_init();
 }
 
 void __init omap4430_init_late(void)
@@ -643,6 +652,7 @@ void __init omap5_init_early(void)
        omap54xx_hwmod_init();
        omap_hwmod_init_postsetup();
        omap_clk_soc_init = omap5xxx_dt_clk_init;
+       omap_secure_init();
 }
 
 void __init omap5_init_late(void)
@@ -666,6 +676,7 @@ void __init dra7xx_init_early(void)
        dra7xx_hwmod_init();
        omap_hwmod_init_postsetup();
        omap_clk_soc_init = dra7xx_dt_clk_init;
+       omap_secure_init();
 }
 
 void __init dra7xx_init_late(void)
index 24298e47b9f1717cac9992655091c376e01a75eb..e936732cdc4f4d48169976ba77758efef9706b39 100644 (file)
@@ -163,3 +163,7 @@ u32 rx51_secure_rng_call(u32 ptr, u32 count, u32 flag)
                                      NO_FLAG,
                                      3, ptr, count, flag, 0);
 }
+
+void __init omap_secure_init(void)
+{
+}
index 20046e8f8ecbe4478b8f575dd6c6b45d0482ea72..9aeeb236a2244b6c5fda75dd7f2510bd32e80888 100644 (file)
@@ -72,6 +72,8 @@ extern u32 rx51_secure_dispatcher(u32 idx, u32 process, u32 flag, u32 nargs,
 extern u32 rx51_secure_update_aux_cr(u32 set_bits, u32 clear_bits);
 extern u32 rx51_secure_rng_call(u32 ptr, u32 count, u32 flag);
 
+void omap_secure_init(void);
+
 #ifdef CONFIG_SOC_HAS_REALTIME_COUNTER
 void set_cntfreq(void);
 #else