diff options
Diffstat (limited to 'arch/arm/mach-keystone/platsmp.c')
-rw-r--r-- | arch/arm/mach-keystone/platsmp.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/arch/arm/mach-keystone/platsmp.c b/arch/arm/mach-keystone/platsmp.c new file mode 100644 index 000000000000..630ab3bd5f78 --- /dev/null +++ b/arch/arm/mach-keystone/platsmp.c | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * Keystone SOC SMP platform code | ||
3 | * | ||
4 | * Copyright 2013 Texas Instruments, Inc. | ||
5 | * Cyril Chemparathy <cyril@ti.com> | ||
6 | * Santosh Shilimkar <santosh.shillimkar@ti.com> | ||
7 | * | ||
8 | * Based on platsmp.c, Copyright (C) 2002 ARM Ltd. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify it | ||
11 | * under the terms and conditions of the GNU General Public License, | ||
12 | * version 2, as published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | #include <linux/init.h> | ||
16 | #include <linux/smp.h> | ||
17 | #include <linux/io.h> | ||
18 | |||
19 | #include <asm/smp_plat.h> | ||
20 | #include <asm/prom.h> | ||
21 | |||
22 | #include "keystone.h" | ||
23 | |||
24 | static int __cpuinit keystone_smp_boot_secondary(unsigned int cpu, | ||
25 | struct task_struct *idle) | ||
26 | { | ||
27 | unsigned long start = virt_to_phys(&secondary_startup); | ||
28 | int error; | ||
29 | |||
30 | pr_debug("keystone-smp: booting cpu %d, vector %08lx\n", | ||
31 | cpu, start); | ||
32 | |||
33 | asm volatile ( | ||
34 | "mov r0, #0\n" /* power on cmd */ | ||
35 | "mov r1, %1\n" /* cpu */ | ||
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 | |||
46 | return error; | ||
47 | } | ||
48 | |||
49 | struct smp_operations keystone_smp_ops __initdata = { | ||
50 | .smp_init_cpus = arm_dt_init_cpu_maps, | ||
51 | .smp_boot_secondary = keystone_smp_boot_secondary, | ||
52 | }; | ||