diff options
Diffstat (limited to 'arch/arm/mach-shmobile/smp-sh73a0.c')
-rw-r--r-- | arch/arm/mach-shmobile/smp-sh73a0.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/arch/arm/mach-shmobile/smp-sh73a0.c b/arch/arm/mach-shmobile/smp-sh73a0.c index 2d0d4212be41..14ad8b052f1a 100644 --- a/arch/arm/mach-shmobile/smp-sh73a0.c +++ b/arch/arm/mach-shmobile/smp-sh73a0.c | |||
@@ -28,11 +28,11 @@ | |||
28 | #include <asm/smp_twd.h> | 28 | #include <asm/smp_twd.h> |
29 | #include <asm/hardware/gic.h> | 29 | #include <asm/hardware/gic.h> |
30 | 30 | ||
31 | #define WUPCR 0xe6151010 | 31 | #define WUPCR IOMEM(0xe6151010) |
32 | #define SRESCR 0xe6151018 | 32 | #define SRESCR IOMEM(0xe6151018) |
33 | #define PSTR 0xe6151040 | 33 | #define PSTR IOMEM(0xe6151040) |
34 | #define SBAR 0xe6180020 | 34 | #define SBAR IOMEM(0xe6180020) |
35 | #define APARMBAREA 0xe6f10020 | 35 | #define APARMBAREA IOMEM(0xe6f10020) |
36 | 36 | ||
37 | static void __iomem *scu_base_addr(void) | 37 | static void __iomem *scu_base_addr(void) |
38 | { | 38 | { |
@@ -42,6 +42,8 @@ static void __iomem *scu_base_addr(void) | |||
42 | static DEFINE_SPINLOCK(scu_lock); | 42 | static DEFINE_SPINLOCK(scu_lock); |
43 | static unsigned long tmp; | 43 | static unsigned long tmp; |
44 | 44 | ||
45 | static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29); | ||
46 | |||
45 | static void modify_scu_cpu_psr(unsigned long set, unsigned long clr) | 47 | static void modify_scu_cpu_psr(unsigned long set, unsigned long clr) |
46 | { | 48 | { |
47 | void __iomem *scu_base = scu_base_addr(); | 49 | void __iomem *scu_base = scu_base_addr(); |
@@ -60,11 +62,7 @@ unsigned int __init sh73a0_get_core_count(void) | |||
60 | { | 62 | { |
61 | void __iomem *scu_base = scu_base_addr(); | 63 | void __iomem *scu_base = scu_base_addr(); |
62 | 64 | ||
63 | #ifdef CONFIG_HAVE_ARM_TWD | 65 | shmobile_twd_init(&twd_local_timer); |
64 | /* twd_base needs to be initialized before percpu_timer_setup() */ | ||
65 | twd_base = (void __iomem *)0xf0000600; | ||
66 | #endif | ||
67 | |||
68 | return scu_get_core_count(scu_base); | 66 | return scu_get_core_count(scu_base); |
69 | } | 67 | } |
70 | 68 | ||
@@ -80,10 +78,10 @@ int __cpuinit sh73a0_boot_secondary(unsigned int cpu) | |||
80 | /* enable cache coherency */ | 78 | /* enable cache coherency */ |
81 | modify_scu_cpu_psr(0, 3 << (cpu * 8)); | 79 | modify_scu_cpu_psr(0, 3 << (cpu * 8)); |
82 | 80 | ||
83 | if (((__raw_readl(__io(PSTR)) >> (4 * cpu)) & 3) == 3) | 81 | if (((__raw_readl(PSTR) >> (4 * cpu)) & 3) == 3) |
84 | __raw_writel(1 << cpu, __io(WUPCR)); /* wake up */ | 82 | __raw_writel(1 << cpu, WUPCR); /* wake up */ |
85 | else | 83 | else |
86 | __raw_writel(1 << cpu, __io(SRESCR)); /* reset */ | 84 | __raw_writel(1 << cpu, SRESCR); /* reset */ |
87 | 85 | ||
88 | return 0; | 86 | return 0; |
89 | } | 87 | } |
@@ -95,8 +93,8 @@ void __init sh73a0_smp_prepare_cpus(void) | |||
95 | scu_enable(scu_base_addr()); | 93 | scu_enable(scu_base_addr()); |
96 | 94 | ||
97 | /* Map the reset vector (in headsmp.S) */ | 95 | /* Map the reset vector (in headsmp.S) */ |
98 | __raw_writel(0, __io(APARMBAREA)); /* 4k */ | 96 | __raw_writel(0, APARMBAREA); /* 4k */ |
99 | __raw_writel(__pa(shmobile_secondary_vector), __io(SBAR)); | 97 | __raw_writel(__pa(shmobile_secondary_vector), SBAR); |
100 | 98 | ||
101 | /* enable cache coherency on CPU0 */ | 99 | /* enable cache coherency on CPU0 */ |
102 | modify_scu_cpu_psr(0, 3 << (cpu * 8)); | 100 | modify_scu_cpu_psr(0, 3 << (cpu * 8)); |