TrustZone: Add Support Trust OS
authorqjb <qjb@rock-chips.com>
Wed, 7 Jan 2015 07:15:31 +0000 (15:15 +0800)
committerqjb <qjb@rock-chips.com>
Wed, 7 Jan 2015 09:49:49 +0000 (17:49 +0800)
if Trust OS running ,
          - disable ddr_freq
          - disable fiq debug

arch/arm/mach-rockchip/Kconfig
arch/arm/mach-rockchip/Makefile
arch/arm/mach-rockchip/pm-rk312x.c
arch/arm/mach-rockchip/rk3288.c
arch/arm/mm/Kconfig

index 24b25bc5cf9551d55ed18102edaaccaa3b243e27..c5d853b61e5be18c30442110ac9fbd4259eca293 100755 (executable)
@@ -20,8 +20,8 @@ config ARCH_ROCKCHIP
        select DMADEVICES
        select PL330_DMA
        select FIQ_GLUE
-       select ARM_ERRATA_818325
-       select ARM_ERRATA_821420
+       select ARM_ERRATA_818325 if !ARM_TRUSTZONE
+       select ARM_ERRATA_821420 if !ARM_TRUSTZONE
 
 if ARCH_ROCKCHIP
 
index 4bfe9f1fd0093586fb068f1e2da36a3e780d84d0..561cb6f9425c9ed501381225ab215f49e719dac9 100755 (executable)
@@ -5,7 +5,7 @@ obj-y += rk312x.o
 obj-y += rk3126b.o
 obj-y += rk3188.o
 obj-y += rk3288.o
-obj-y += ddr_freq.o
+obj-$(!CONFIG_ARM_TRUSTZONE) += ddr_freq.o
 obj-y += efuse.o
 obj-y += pvtm.o
 obj-y += rk_system_status.o
index ba10025ba823642f363387da0ece4cd5321f7779..475f6d0e2b0c9c570f814506511ac95b1cf79856 100644 (file)
@@ -841,7 +841,9 @@ void fiq_glue_resume(void);
 static inline void  rkpm_peri_resume(u32 power_mode)
 {
        rkpm_gic_dist_resume(&slp_gic_save[0]);
+#ifndef CONFIG_ARM_TRUSTZONE
        fiq_glue_resume();
+#endif
 }
 
 static void rkpm_save_setting_resume(void)
index d44709321c6235fcd2cc69093600ffd2a542663e..de229db2a63a0079498c21a31264ec44d03b6ec9 100755 (executable)
@@ -146,7 +146,9 @@ static void __init rk3288_dt_map_io(void)
        writel_relaxed(0x00010001, RK_GRF_VIRT + RK3288_GRF_SOC_CON2);
 
        /* disable address remap */
+#ifndef CONFIG_ARM_TRUSTZONE
        writel_relaxed(0x08000000, RK_SGRF_VIRT + RK3288_SGRF_SOC_CON0);
+#endif
 
        /* enable timer7 for core */
        writel_relaxed(0, RK3288_TIMER7_VIRT + 0x10);
@@ -162,7 +164,9 @@ static void __init rk3288_dt_map_io(void)
        writel_relaxed(24, RK_PMU_VIRT + RK3288_PMU_GPU_PWRUP_CNT);
 
        rk3288_boot_mode_init();
+#ifndef CONFIG_ARM_TRUSTZONE
        rockchip_efuse_init();
+#endif
 }
 
 static const u8 pmu_st_map[] = {
@@ -667,7 +671,11 @@ static int  __init rk3288_pm_dbg(void)
 
 static int __init rk3288_ddr_init(void)
 {
-    if (cpu_is_rk3288())
+    if (cpu_is_rk3288()
+#ifdef CONFIG_ARM_TRUSTZONE
+       && false
+#endif
+       )
     {
        ddr_change_freq = _ddr_change_freq;
        ddr_round_rate = _ddr_round_rate;
index 36e9f24e03b0213cb1682ab131a0f0b9c2176998..af54f6daba1d3589b5d8cb08425eb90295ce2bc9 100644 (file)
@@ -596,6 +596,16 @@ config IO_36
 
 comment "Processor Features"
 
+config ARM_TRUSTZONE
+       bool "Support TrustZone-enabled Trusted Execution Environment"
+       default n
+       help
+         Select if you want a kernel to be executed at non-secure world.
+         This option should be used with related secure bootloader and
+         TrustZone software.
+
+         If you don't know about TrustZone, say 'N'.
+
 config ARM_LPAE
        bool "Support for the Large Physical Address Extension"
        depends on MMU && CPU_32v7 && !CPU_32v6 && !CPU_32v5 && \