aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/platsmp-apmu.c
diff options
context:
space:
mode:
authorMagnus Damm <damm+renesas@opensource.se>2014-06-06 03:20:18 -0400
committerSimon Horman <horms+renesas@verge.net.au>2014-06-26 02:51:51 -0400
commit784500be40a0eabcee1e48c70927aea9c9accb1e (patch)
tree38a4df1ebe1b86db8566f15c522f2a9868a56f54 /arch/arm/mach-shmobile/platsmp-apmu.c
parent8b438bcb9009609a15e5480ab1947acff6fb9005 (diff)
ARM: shmobile: Adjust APMU code to build for non-SMP
Adjust the APMU code to allow build when CONFIG_SMP=n. Signed-off-by: Magnus Damm <damm+renesas@opensource.se> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/arm/mach-shmobile/platsmp-apmu.c')
-rw-r--r--arch/arm/mach-shmobile/platsmp-apmu.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c
index 590e35c22a60..ce07eb9f5cd5 100644
--- a/arch/arm/mach-shmobile/platsmp-apmu.c
+++ b/arch/arm/mach-shmobile/platsmp-apmu.c
@@ -15,6 +15,7 @@
15#include <linux/of_address.h> 15#include <linux/of_address.h>
16#include <linux/smp.h> 16#include <linux/smp.h>
17#include <linux/suspend.h> 17#include <linux/suspend.h>
18#include <linux/threads.h>
18#include <asm/cacheflush.h> 19#include <asm/cacheflush.h>
19#include <asm/cp15.h> 20#include <asm/cp15.h>
20#include <asm/proc-fns.h> 21#include <asm/proc-fns.h>
@@ -25,13 +26,13 @@
25static struct { 26static struct {
26 void __iomem *iomem; 27 void __iomem *iomem;
27 int bit; 28 int bit;
28} apmu_cpus[CONFIG_NR_CPUS]; 29} apmu_cpus[NR_CPUS];
29 30
30#define WUPCR_OFFS 0x10 31#define WUPCR_OFFS 0x10
31#define PSTR_OFFS 0x40 32#define PSTR_OFFS 0x40
32#define CPUNCR_OFFS(n) (0x100 + (0x10 * (n))) 33#define CPUNCR_OFFS(n) (0x100 + (0x10 * (n)))
33 34
34static int apmu_power_on(void __iomem *p, int bit) 35static int __maybe_unused apmu_power_on(void __iomem *p, int bit)
35{ 36{
36 /* request power on */ 37 /* request power on */
37 writel_relaxed(BIT(bit), p + WUPCR_OFFS); 38 writel_relaxed(BIT(bit), p + WUPCR_OFFS);
@@ -50,7 +51,7 @@ static int apmu_power_off(void __iomem *p, int bit)
50 return 0; 51 return 0;
51} 52}
52 53
53static int apmu_power_off_poll(void __iomem *p, int bit) 54static int __maybe_unused apmu_power_off_poll(void __iomem *p, int bit)
54{ 55{
55 int k; 56 int k;
56 57
@@ -73,7 +74,7 @@ static int apmu_wrap(int cpu, int (*fn)(void __iomem *p, int cpu))
73 74
74static void apmu_init_cpu(struct resource *res, int cpu, int bit) 75static void apmu_init_cpu(struct resource *res, int cpu, int bit)
75{ 76{
76 if (apmu_cpus[cpu].iomem) 77 if ((cpu >= ARRAY_SIZE(apmu_cpus)) || apmu_cpus[cpu].iomem)
77 return; 78 return;
78 79
79 apmu_cpus[cpu].iomem = ioremap_nocache(res->start, resource_size(res)); 80 apmu_cpus[cpu].iomem = ioremap_nocache(res->start, resource_size(res));
@@ -137,6 +138,7 @@ void __init shmobile_smp_apmu_prepare_cpus(unsigned int max_cpus)
137 apmu_parse_cfg(apmu_init_cpu); 138 apmu_parse_cfg(apmu_init_cpu);
138} 139}
139 140
141#ifdef CONFIG_SMP
140int shmobile_smp_apmu_boot_secondary(unsigned int cpu, struct task_struct *idle) 142int shmobile_smp_apmu_boot_secondary(unsigned int cpu, struct task_struct *idle)
141{ 143{
142 /* For this particular CPU register boot vector */ 144 /* For this particular CPU register boot vector */
@@ -144,6 +146,7 @@ int shmobile_smp_apmu_boot_secondary(unsigned int cpu, struct task_struct *idle)
144 146
145 return apmu_wrap(cpu, apmu_power_on); 147 return apmu_wrap(cpu, apmu_power_on);
146} 148}
149#endif
147 150
148#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_SUSPEND) 151#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_SUSPEND)
149/* nicked from arch/arm/mach-exynos/hotplug.c */ 152/* nicked from arch/arm/mach-exynos/hotplug.c */