ARM: EXYNOS: Add smc call to support trustzone feature
Subsystems (3)
PATCH v2 1/1 ARM: EXYNOS: Add smc call to support trustzone feature
From: Kyungmin Park <[email protected]>
Linux runs in non-secure mode on some boards, so we need secure monitor calls
Signed-off-by Kyungmin Park <[email protected]>
---
arch/arm/mach-exynos/Makefile +5 -0
@@ -30,6 +30,11 @@ obj-$(CONFIG_EXYNOS4_MCT) += mct.o obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o +obj-$(CONFIG_ARM_TRUSTZONE) += exynos-smc.o + +plus_sec := $(call as-instr,.arch_extension sec,+sec) +AFLAGS_exynos-smc.o :=-Wa,-march=armv7-a$(plus_sec) + # machine support obj-$(CONFIG_MACH_SMDKC210) += mach-smdkv310.o
arch/arm/mach-exynos/common.h +2 -0
@@ -21,6 +21,8 @@ void exynos4_restart(char mode, const char *cmd);void exynos5_restart (char mode,const char *cmd);void exynos_init_late (void ); +extern void exynos_smc (u32 cmd,u32 arg1,u32 arg2,u32 arg3); +#ifdef CONFIG_PM_GENERIC_DOMAINS int exynos_pm_late_initcall (void );#else
arch/arm/mach-exynos/exynos-smc.S new file +22 -0
@@ -0,0 +1,22 @@ +/* + * Copyright (C) 2012 Samsung Electronics. + * + * Copied from omap-smc.S Copyright (C) 2010 Texas Instruments, Inc. + * + * This program is free software,you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include <linux/linkage.h> + +/* + * Function signature: void exynos_smc(u32 cmd, u32 arg1, u32 arg2, u32 arg3) + */ + +ENTRY(exynos_smc) + stmfd sp!, {r4-r11, lr} + dsb + smc #0 + ldmfd sp!, {r4-r11, pc} +ENDPROC(exynos_smc)