aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-shmobile/platsmp-apmu.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c
index 0c6bb458b7a4..933f9b902405 100644
--- a/arch/arm/mach-shmobile/platsmp-apmu.c
+++ b/arch/arm/mach-shmobile/platsmp-apmu.c
@@ -31,9 +31,15 @@ static struct {
31 int bit; 31 int bit;
32} apmu_cpus[NR_CPUS]; 32} apmu_cpus[NR_CPUS];
33 33
34#define WUPCR_OFFS 0x10 34#define WUPCR_OFFS 0x10 /* Wake Up Control Register */
35#define PSTR_OFFS 0x40 35#define PSTR_OFFS 0x40 /* Power Status Register */
36#define CPUNCR_OFFS(n) (0x100 + (0x10 * (n))) 36#define CPUNCR_OFFS(n) (0x100 + (0x10 * (n)))
37 /* CPUn Power Status Control Register */
38
39/* Power Status Register */
40#define CPUNST(r, n) (((r) >> (n * 4)) & 3) /* CPUn Status Bit */
41#define CPUST_RUN 0 /* Run Mode */
42#define CPUST_STANDBY 3 /* CoreStandby Mode */
37 43
38static int __maybe_unused apmu_power_on(void __iomem *p, int bit) 44static int __maybe_unused apmu_power_on(void __iomem *p, int bit)
39{ 45{
@@ -59,7 +65,7 @@ static int __maybe_unused apmu_power_off_poll(void __iomem *p, int bit)
59 int k; 65 int k;
60 66
61 for (k = 0; k < 1000; k++) { 67 for (k = 0; k < 1000; k++) {
62 if (((readl_relaxed(p + PSTR_OFFS) >> (bit * 4)) & 0x03) == 3) 68 if (CPUNST(readl_relaxed(p + PSTR_OFFS), bit) == CPUST_STANDBY)
63 return 1; 69 return 1;
64 70
65 mdelay(1); 71 mdelay(1);