ARM: rockchip-psci: add interface for ion to set memory secured
authorJianqun Xu <jay.xu@rock-chips.com>
Tue, 20 Oct 2015 00:42:59 +0000 (08:42 +0800)
committerGerrit Code Review <gerrit@rock-chips.com>
Thu, 29 Oct 2015 01:35:34 +0000 (09:35 +0800)
Add function "psci_set_memory_secure" for device to set memory
region secured.

Change-Id: Ife807c91d37ae66a5e1a0a3d8263c68cd601937d
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
arch/arm/mach-rockchip/psci.c
include/linux/rockchip/psci.h

index 82293468e3c9041e11303d1d2b7bf47cd27f9fd5..3132c2d4c467ff752a046bfa93d975f6b070321d 100644 (file)
@@ -187,6 +187,11 @@ u32 rockchip_psci_smc_get_tf_ver(void)
        return reg_rd_fn(PSCI_SIP_RKTF_VER, 0, 0, 0, NULL);
 }
 
+u32 psci_set_memory_secure(bool val)
+{
+       return reg_wr_fn(PSCI_SIP_SMEM_CONFIG, val, 0, 0);
+}
+
 /*************************** fiq debug *****************************/
 #ifdef CONFIG_ARM64
 static u64 ft_fiq_mem_phy;
index 2ce8ae73e4cdf182286e507c03aaeb1d177bd385..7a3eed6f98530bb491a8a5f171c82b2061d903cc 100644 (file)
@@ -63,4 +63,13 @@ u32 psci_fiq_debugger_switch_cpu(u32 cpu);
 void psci_fiq_debugger_uart_irq_tf_init(u32 irq_id, void *callback);
 void psci_fiq_debugger_enable_debug(bool val);
 
+#if defined(CONFIG_ARM_PSCI) || defined(CONFIG_ARM64)
+u32 psci_set_memory_secure(bool val);
+#else
+static inline u32 psci_set_memory_secure(bool val)
+{
+       return 0;
+}
+#endif
+
 #endif /* __ROCKCHIP_PSCI_H */