aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitaly Andrianov2015-01-14 08:37:30 -0600
committerVitaly Andrianov2015-01-20 12:59:30 -0600
commit90507d089c2ac53041fb8e2d4db78e013902bc6c (patch)
tree945fb9e06c9932a3fd4dc0d643f2035b4b0c6239
parent00f8dc74f2cd0d2a64481eacc4d01dbee3375aad (diff)
downloadlinux-90507d089c2ac53041fb8e2d4db78e013902bc6c.tar.gz
linux-90507d089c2ac53041fb8e2d4db78e013902bc6c.tar.xz
linux-90507d089c2ac53041fb8e2d4db78e013902bc6c.zip
keystone: psci: adds cpu_die implementation
This commit add cpu_die implementation using psci api Signed-off-by: Vitaly Andrianov <vitalya@ti.com>
-rw-r--r--arch/arm/mach-keystone/platsmp.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/arch/arm/mach-keystone/platsmp.c b/arch/arm/mach-keystone/platsmp.c
index 0d400f52c34..beeb8d83b8d 100644
--- a/arch/arm/mach-keystone/platsmp.c
+++ b/arch/arm/mach-keystone/platsmp.c
@@ -26,8 +26,10 @@
26#include <asm/cacheflush.h> 26#include <asm/cacheflush.h>
27#include <asm/tlbflush.h> 27#include <asm/tlbflush.h>
28#include <asm/memory.h> 28#include <asm/memory.h>
29#include <asm/psci.h>
29 30
30#include "keystone.h" 31#include "keystone.h"
32asm(".arch_extension sec\n\t");
31 33
32static void __cpuinit keystone_smp_secondary_initmem(void) 34static void __cpuinit keystone_smp_secondary_initmem(void)
33{ 35{
@@ -56,7 +58,7 @@ keystone_smp_boot_secondary(unsigned int cpu, struct task_struct *idle)
56 "mov r0, #0\n" /* power on cmd */ 58 "mov r0, #0\n" /* power on cmd */
57 "mov r1, %1\n" /* cpu */ 59 "mov r1, %1\n" /* cpu */
58 "mov r2, %2\n" /* start */ 60 "mov r2, %2\n" /* start */
59 ".inst 0xe1600070\n" /* SMI */ 61 "smc #0\n" /* SMI */
60 "mov %0, r0\n" 62 "mov %0, r0\n"
61 : "=r" (error) 63 : "=r" (error)
62 : "r"(cpu), "r"(start) 64 : "r"(cpu), "r"(start)
@@ -69,18 +71,29 @@ keystone_smp_boot_secondary(unsigned int cpu, struct task_struct *idle)
69} 71}
70 72
71#ifdef CONFIG_HOTPLUG_CPU 73#ifdef CONFIG_HOTPLUG_CPU
72static int keystone_cpu_kill(unsigned int cpu) 74static void keystone_cpu_die(unsigned int cpu)
73{ 75{
74 BUG(); 76#ifdef CONFIG_ARM_PSCI
75} 77 struct psci_power_state pwr_state = {0, 0, 0};
76 78
77static int keystone_cpu_die(unsigned int cpu) 79 printk(KERN_INFO "keystone_cpu_die(%d) from %d using PSCI\n", cpu,
78{ 80 smp_processor_id());
79 BUG(); 81
80} 82 if (psci_ops.cpu_off)
81static int keystone_cpu_disable(unsigned int cpu) 83 psci_ops.cpu_off(pwr_state);
82{ 84#else
83 BUG(); 85 /*
86 * We may want to add here a direct smc call to monitor
87 * if the kernel doesn't support PSCI API
88 */
89#endif
90
91 /*
92 * we shouldn't come here. But in case something went
93 * wrong the code below prevents kernel from crush
94 */
95 while (1)
96 cpu_do_idle();
84} 97}
85#endif 98#endif
86 99
@@ -88,8 +101,6 @@ struct smp_operations keystone_smp_ops __initdata = {
88 .smp_secondary_init = keystone_smp_secondary_init, 101 .smp_secondary_init = keystone_smp_secondary_init,
89 .smp_boot_secondary = keystone_smp_boot_secondary, 102 .smp_boot_secondary = keystone_smp_boot_secondary,
90#ifdef CONFIG_HOTPLUG_CPU 103#ifdef CONFIG_HOTPLUG_CPU
91 .cpu_kill = keystone_cpu_kill,
92 .cpu_die = keystone_cpu_die, 104 .cpu_die = keystone_cpu_die,
93 .cpu_disable = keystone_cpu_disable,
94#endif 105#endif
95}; 106};