diff options
author | Magnus Damm <damm@opensource.se> | 2013-07-31 03:07:59 -0400 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-08-06 05:07:25 -0400 |
commit | 352e57a3af195825767d0f638cb9ec3517f93de4 (patch) | |
tree | 4bc4ea02accf4c22b51e2b3f2a4950ef92a677e7 /arch/arm/mach-shmobile | |
parent | e7b1c96384181d690950530f5a64167965226744 (diff) |
ARM: shmobile: Use shared SCU CPU Hotplug code on sh73a0
Update the sh73a0 specific CPU Hotplug code to make use of
the recently introduced shared SCU functions. The sh73a0
power control hardware relies on SCU_PM_POWEROFF with WFI
so the shared SCU code will as-is power down the hardware
as expected.
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r-- | arch/arm/mach-shmobile/smp-sh73a0.c | 41 |
1 files changed, 3 insertions, 38 deletions
diff --git a/arch/arm/mach-shmobile/smp-sh73a0.c b/arch/arm/mach-shmobile/smp-sh73a0.c index 1096b0eb6c5e..8b3b9777056b 100644 --- a/arch/arm/mach-shmobile/smp-sh73a0.c +++ b/arch/arm/mach-shmobile/smp-sh73a0.c | |||
@@ -20,14 +20,11 @@ | |||
20 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
22 | #include <linux/smp.h> | 22 | #include <linux/smp.h> |
23 | #include <linux/spinlock.h> | ||
24 | #include <linux/io.h> | 23 | #include <linux/io.h> |
25 | #include <linux/delay.h> | 24 | #include <linux/delay.h> |
26 | #include <mach/common.h> | 25 | #include <mach/common.h> |
27 | #include <asm/cacheflush.h> | ||
28 | #include <asm/smp_plat.h> | ||
29 | #include <mach/sh73a0.h> | 26 | #include <mach/sh73a0.h> |
30 | #include <asm/smp_scu.h> | 27 | #include <asm/smp_plat.h> |
31 | #include <asm/smp_twd.h> | 28 | #include <asm/smp_twd.h> |
32 | 29 | ||
33 | #define WUPCR IOMEM(0xe6151010) | 30 | #define WUPCR IOMEM(0xe6151010) |
@@ -36,8 +33,6 @@ | |||
36 | #define SBAR IOMEM(0xe6180020) | 33 | #define SBAR IOMEM(0xe6180020) |
37 | #define APARMBAREA IOMEM(0xe6f10020) | 34 | #define APARMBAREA IOMEM(0xe6f10020) |
38 | 35 | ||
39 | #define PSTR_SHUTDOWN_MODE 3 | ||
40 | |||
41 | #define SH73A0_SCU_BASE 0xf0000000 | 36 | #define SH73A0_SCU_BASE 0xf0000000 |
42 | 37 | ||
43 | #ifdef CONFIG_HAVE_ARM_TWD | 38 | #ifdef CONFIG_HAVE_ARM_TWD |
@@ -77,36 +72,6 @@ static void __init sh73a0_smp_prepare_cpus(unsigned int max_cpus) | |||
77 | } | 72 | } |
78 | 73 | ||
79 | #ifdef CONFIG_HOTPLUG_CPU | 74 | #ifdef CONFIG_HOTPLUG_CPU |
80 | static int sh73a0_cpu_kill(unsigned int cpu) | ||
81 | { | ||
82 | |||
83 | int k; | ||
84 | u32 pstr; | ||
85 | |||
86 | /* | ||
87 | * wait until the power status register confirms the shutdown of the | ||
88 | * offline target | ||
89 | */ | ||
90 | for (k = 0; k < 1000; k++) { | ||
91 | pstr = (__raw_readl(PSTR) >> (4 * cpu)) & 3; | ||
92 | if (pstr == PSTR_SHUTDOWN_MODE) | ||
93 | return 1; | ||
94 | |||
95 | mdelay(1); | ||
96 | } | ||
97 | |||
98 | return 0; | ||
99 | } | ||
100 | |||
101 | static void sh73a0_cpu_die(unsigned int cpu) | ||
102 | { | ||
103 | /* Set power off mode. This takes the CPU out of the MP cluster */ | ||
104 | scu_power_mode(shmobile_scu_base, SCU_PM_POWEROFF); | ||
105 | |||
106 | /* Enter shutdown mode */ | ||
107 | cpu_do_idle(); | ||
108 | } | ||
109 | |||
110 | static int sh73a0_cpu_disable(unsigned int cpu) | 75 | static int sh73a0_cpu_disable(unsigned int cpu) |
111 | { | 76 | { |
112 | return 0; /* CPU0 and CPU1 supported */ | 77 | return 0; /* CPU0 and CPU1 supported */ |
@@ -117,8 +82,8 @@ struct smp_operations sh73a0_smp_ops __initdata = { | |||
117 | .smp_prepare_cpus = sh73a0_smp_prepare_cpus, | 82 | .smp_prepare_cpus = sh73a0_smp_prepare_cpus, |
118 | .smp_boot_secondary = sh73a0_boot_secondary, | 83 | .smp_boot_secondary = sh73a0_boot_secondary, |
119 | #ifdef CONFIG_HOTPLUG_CPU | 84 | #ifdef CONFIG_HOTPLUG_CPU |
120 | .cpu_kill = sh73a0_cpu_kill, | ||
121 | .cpu_die = sh73a0_cpu_die, | ||
122 | .cpu_disable = sh73a0_cpu_disable, | 85 | .cpu_disable = sh73a0_cpu_disable, |
86 | .cpu_die = shmobile_smp_scu_cpu_die, | ||
87 | .cpu_kill = shmobile_smp_scu_cpu_kill, | ||
123 | #endif | 88 | #endif |
124 | }; | 89 | }; |