aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/omap-smp.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/omap-smp.c')
-rw-r--r--arch/arm/mach-omap2/omap-smp.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c
index 4890bcf4dadd..38153e5fbca0 100644
--- a/arch/arm/mach-omap2/omap-smp.c
+++ b/arch/arm/mach-omap2/omap-smp.c
@@ -17,19 +17,15 @@
17 */ 17 */
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/device.h> 19#include <linux/device.h>
20#include <linux/jiffies.h>
21#include <linux/smp.h> 20#include <linux/smp.h>
22#include <linux/io.h> 21#include <linux/io.h>
23 22
23#include <asm/cacheflush.h>
24#include <asm/localtimer.h> 24#include <asm/localtimer.h>
25#include <asm/smp_scu.h> 25#include <asm/smp_scu.h>
26#include <mach/hardware.h> 26#include <mach/hardware.h>
27#include <plat/common.h> 27#include <plat/common.h>
28 28
29/* Registers used for communicating startup information */
30static void __iomem *omap4_auxcoreboot_reg0;
31static void __iomem *omap4_auxcoreboot_reg1;
32
33/* SCU base address */ 29/* SCU base address */
34static void __iomem *scu_base; 30static void __iomem *scu_base;
35 31
@@ -65,8 +61,6 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
65 61
66int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) 62int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
67{ 63{
68 unsigned long timeout;
69
70 /* 64 /*
71 * Set synchronisation state between this boot processor 65 * Set synchronisation state between this boot processor
72 * and the secondary one 66 * and the secondary one
@@ -74,18 +68,15 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
74 spin_lock(&boot_lock); 68 spin_lock(&boot_lock);
75 69
76 /* 70 /*
77 * Update the AuxCoreBoot1 with boot state for secondary core. 71 * Update the AuxCoreBoot0 with boot state for secondary core.
78 * omap_secondary_startup() routine will hold the secondary core till 72 * omap_secondary_startup() routine will hold the secondary core till
79 * the AuxCoreBoot1 register is updated with cpu state 73 * the AuxCoreBoot1 register is updated with cpu state
80 * A barrier is added to ensure that write buffer is drained 74 * A barrier is added to ensure that write buffer is drained
81 */ 75 */
82 __raw_writel(cpu, omap4_auxcoreboot_reg1); 76 omap_modify_auxcoreboot0(0x200, 0x0);
77 flush_cache_all();
83 smp_wmb(); 78 smp_wmb();
84 79
85 timeout = jiffies + (1 * HZ);
86 while (time_before(jiffies, timeout))
87 ;
88
89 /* 80 /*
90 * Now the secondary core is starting up let it run its 81 * Now the secondary core is starting up let it run its
91 * calibrations, then wait for it to finish 82 * calibrations, then wait for it to finish
@@ -99,17 +90,18 @@ static void __init wakeup_secondary(void)
99{ 90{
100 /* 91 /*
101 * Write the address of secondary startup routine into the 92 * Write the address of secondary startup routine into the
102 * AuxCoreBoot0 where ROM code will jump and start executing 93 * AuxCoreBoot1 where ROM code will jump and start executing
103 * on secondary core once out of WFE 94 * on secondary core once out of WFE
104 * A barrier is added to ensure that write buffer is drained 95 * A barrier is added to ensure that write buffer is drained
105 */ 96 */
106 __raw_writel(virt_to_phys(omap_secondary_startup), \ 97 omap_auxcoreboot_addr(virt_to_phys(omap_secondary_startup));
107 omap4_auxcoreboot_reg0);
108 smp_wmb(); 98 smp_wmb();
109 99
110 /* 100 /*
111 * Send a 'sev' to wake the secondary core from WFE. 101 * Send a 'sev' to wake the secondary core from WFE.
102 * Drain the outstanding writes to memory
112 */ 103 */
104 dsb();
113 set_event(); 105 set_event();
114 mb(); 106 mb();
115} 107}
@@ -136,7 +128,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
136{ 128{
137 unsigned int ncores = get_core_count(); 129 unsigned int ncores = get_core_count();
138 unsigned int cpu = smp_processor_id(); 130 unsigned int cpu = smp_processor_id();
139 void __iomem *omap4_wkupgen_base;
140 int i; 131 int i;
141 132
142 /* sanity check */ 133 /* sanity check */
@@ -168,12 +159,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
168 for (i = 0; i < max_cpus; i++) 159 for (i = 0; i < max_cpus; i++)
169 set_cpu_present(i, true); 160 set_cpu_present(i, true);
170 161
171 /* Never released */
172 omap4_wkupgen_base = ioremap(OMAP44XX_WKUPGEN_BASE, SZ_4K);
173 BUG_ON(!omap4_wkupgen_base);
174 omap4_auxcoreboot_reg0 = omap4_wkupgen_base + 0x800;
175 omap4_auxcoreboot_reg1 = omap4_wkupgen_base + 0x804;
176
177 if (max_cpus > 1) { 162 if (max_cpus > 1) {
178 /* 163 /*
179 * Enable the local timer or broadcast device for the 164 * Enable the local timer or broadcast device for the