aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-keystone/Makefile6
-rw-r--r--arch/arm/mach-keystone/keystone.h6
-rw-r--r--arch/arm/mach-keystone/platsmp.c15
-rw-r--r--arch/arm/mach-keystone/smc.S29
4 files changed, 43 insertions, 13 deletions
diff --git a/arch/arm/mach-keystone/Makefile b/arch/arm/mach-keystone/Makefile
index 3f6b8ab82235..ddc52b05dc84 100644
--- a/arch/arm/mach-keystone/Makefile
+++ b/arch/arm/mach-keystone/Makefile
@@ -1,2 +1,6 @@
1obj-y := keystone.o 1obj-y := keystone.o smc.o
2
3plus_sec := $(call as-instr,.arch_extension sec,+sec)
4AFLAGS_smc.o :=-Wa,-march=armv7-a$(plus_sec)
5
2obj-$(CONFIG_SMP) += platsmp.o 6obj-$(CONFIG_SMP) += platsmp.o
diff --git a/arch/arm/mach-keystone/keystone.h b/arch/arm/mach-keystone/keystone.h
index 43a1b4789a6e..60bef9dedb12 100644
--- a/arch/arm/mach-keystone/keystone.h
+++ b/arch/arm/mach-keystone/keystone.h
@@ -11,7 +11,13 @@
11#ifndef __KEYSTONE_H__ 11#ifndef __KEYSTONE_H__
12#define __KEYSTONE_H__ 12#define __KEYSTONE_H__
13 13
14#define KEYSTONE_MON_CPU_UP_IDX 0x00
15
16#ifndef __ASSEMBLER__
17
14extern struct smp_operations keystone_smp_ops; 18extern struct smp_operations keystone_smp_ops;
15extern void secondary_startup(void); 19extern void secondary_startup(void);
20extern u32 keystone_cpu_smc(u32 command, u32 cpu, u32 addr);
16 21
22#endif /* __ASSEMBLER__ */
17#endif /* __KEYSTONE_H__ */ 23#endif /* __KEYSTONE_H__ */
diff --git a/arch/arm/mach-keystone/platsmp.c b/arch/arm/mach-keystone/platsmp.c
index 630ab3bd5f78..1d4181e1daf2 100644
--- a/arch/arm/mach-keystone/platsmp.c
+++ b/arch/arm/mach-keystone/platsmp.c
@@ -30,18 +30,9 @@ static int __cpuinit keystone_smp_boot_secondary(unsigned int cpu,
30 pr_debug("keystone-smp: booting cpu %d, vector %08lx\n", 30 pr_debug("keystone-smp: booting cpu %d, vector %08lx\n",
31 cpu, start); 31 cpu, start);
32 32
33 asm volatile ( 33 error = keystone_cpu_smc(KEYSTONE_MON_CPU_UP_IDX, cpu, start);
34 "mov r0, #0\n" /* power on cmd */ 34 if (error)
35 "mov r1, %1\n" /* cpu */ 35 pr_err("CPU %d bringup failed with %d\n", cpu, error);
36 "mov r2, %2\n" /* start */
37 ".inst 0xe1600070\n" /* smc #0 */
38 "mov %0, r0\n"
39 : "=r" (error)
40 : "r"(cpu), "r"(start)
41 : "cc", "r0", "r1", "r2", "memory"
42 );
43
44 pr_debug("keystone-smp: monitor returned %d\n", error);
45 36
46 return error; 37 return error;
47} 38}
diff --git a/arch/arm/mach-keystone/smc.S b/arch/arm/mach-keystone/smc.S
new file mode 100644
index 000000000000..9b9e4f7b241e
--- /dev/null
+++ b/arch/arm/mach-keystone/smc.S
@@ -0,0 +1,29 @@
1/*
2 * Keystone Secure APIs
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 * Santosh Shilimkar <santosh.shilimkar@ti.com>
6 *
7 * This program is free software,you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/linkage.h>
13
14/**
15 * u32 keystone_cpu_smc(u32 command, u32 cpu, u32 addr)
16 *
17 * Low level CPU monitor API
18 * @command: Monitor command.
19 * @cpu: CPU Number
20 * @addr: Kernel jump address for boot CPU
21 *
22 * Return: Non zero value on failure
23 */
24ENTRY(keystone_cpu_smc)
25 stmfd sp!, {r4-r12, lr}
26 smc #0
27 dsb
28 ldmfd sp!, {r4-r12, pc}
29ENDPROC(keystone_cpu_smc)