diff options
author | Santosh Shilimkar <santosh.shilimkar@ti.com> | 2013-06-10 12:20:17 -0400 |
---|---|---|
committer | Santosh Shilimkar <santosh.shilimkar@ti.com> | 2013-06-17 18:35:35 -0400 |
commit | f07cb6a089644e2334c3523af589d9233cc18c74 (patch) | |
tree | 916c2c2ee1e558b7369d565e7d0fbe8443f153b8 /arch/arm/mach-keystone | |
parent | 828989ad87af15b555f783a70efa2cc526b35b3f (diff) |
ARM: keystone: Enable SMP support on Keystone machines
Add basic SMP support for Keystone machines. This does not
include support for CPU hotplug for now.
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: arm@kernel.org
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Diffstat (limited to 'arch/arm/mach-keystone')
-rw-r--r-- | arch/arm/mach-keystone/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-keystone/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-keystone/keystone.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-keystone/keystone.h | 17 | ||||
-rw-r--r-- | arch/arm/mach-keystone/platsmp.c | 52 |
5 files changed, 75 insertions, 0 deletions
diff --git a/arch/arm/mach-keystone/Kconfig b/arch/arm/mach-keystone/Kconfig index aebe8cdd88fc..2dbd4ce3653c 100644 --- a/arch/arm/mach-keystone/Kconfig +++ b/arch/arm/mach-keystone/Kconfig | |||
@@ -4,6 +4,7 @@ config ARCH_KEYSTONE | |||
4 | select CPU_V7 | 4 | select CPU_V7 |
5 | select ARM_GIC | 5 | select ARM_GIC |
6 | select HAVE_ARM_ARCH_TIMER | 6 | select HAVE_ARM_ARCH_TIMER |
7 | select HAVE_SMP | ||
7 | select CLKSRC_MMIO | 8 | select CLKSRC_MMIO |
8 | select GENERIC_CLOCKEVENTS | 9 | select GENERIC_CLOCKEVENTS |
9 | select HAVE_SCHED_CLOCK | 10 | select HAVE_SCHED_CLOCK |
diff --git a/arch/arm/mach-keystone/Makefile b/arch/arm/mach-keystone/Makefile index d4671d55215a..3f6b8ab82235 100644 --- a/arch/arm/mach-keystone/Makefile +++ b/arch/arm/mach-keystone/Makefile | |||
@@ -1 +1,2 @@ | |||
1 | obj-y := keystone.o | 1 | obj-y := keystone.o |
2 | obj-$(CONFIG_SMP) += platsmp.o | ||
diff --git a/arch/arm/mach-keystone/keystone.c b/arch/arm/mach-keystone/keystone.c index a67c19b8be20..fe4d9ff93a7e 100644 --- a/arch/arm/mach-keystone/keystone.c +++ b/arch/arm/mach-keystone/keystone.c | |||
@@ -19,6 +19,9 @@ | |||
19 | #include <asm/mach/map.h> | 19 | #include <asm/mach/map.h> |
20 | #include <asm/mach/arch.h> | 20 | #include <asm/mach/arch.h> |
21 | #include <asm/mach/time.h> | 21 | #include <asm/mach/time.h> |
22 | #include <asm/smp_plat.h> | ||
23 | |||
24 | #include "keystone.h" | ||
22 | 25 | ||
23 | #define PLL_RESET_WRITE_KEY_MASK 0xffff0000 | 26 | #define PLL_RESET_WRITE_KEY_MASK 0xffff0000 |
24 | #define PLL_RESET_WRITE_KEY 0x5a69 | 27 | #define PLL_RESET_WRITE_KEY 0x5a69 |
@@ -65,6 +68,7 @@ void keystone_restart(char mode, const char *cmd) | |||
65 | } | 68 | } |
66 | 69 | ||
67 | DT_MACHINE_START(KEYSTONE, "Keystone") | 70 | DT_MACHINE_START(KEYSTONE, "Keystone") |
71 | .smp = smp_ops(keystone_smp_ops), | ||
68 | .init_machine = keystone_init, | 72 | .init_machine = keystone_init, |
69 | .dt_compat = keystone_match, | 73 | .dt_compat = keystone_match, |
70 | .restart = keystone_restart, | 74 | .restart = keystone_restart, |
diff --git a/arch/arm/mach-keystone/keystone.h b/arch/arm/mach-keystone/keystone.h new file mode 100644 index 000000000000..43a1b4789a6e --- /dev/null +++ b/arch/arm/mach-keystone/keystone.h | |||
@@ -0,0 +1,17 @@ | |||
1 | /* | ||
2 | * Copyright 2013 Texas Instruments, Inc. | ||
3 | * Cyril Chemparathy <cyril@ti.com> | ||
4 | * Santosh Shilimkar <santosh.shillimkar@ti.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms and conditions of the GNU General Public License, | ||
8 | * version 2, as published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __KEYSTONE_H__ | ||
12 | #define __KEYSTONE_H__ | ||
13 | |||
14 | extern struct smp_operations keystone_smp_ops; | ||
15 | extern void secondary_startup(void); | ||
16 | |||
17 | #endif /* __KEYSTONE_H__ */ | ||
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 | }; | ||