diff options
Diffstat (limited to 'arch/arm/mach-omap2/omap-smp.c')
-rw-r--r-- | arch/arm/mach-omap2/omap-smp.c | 66 |
1 files changed, 15 insertions, 51 deletions
diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c index 9e9f70e18e3c..9fed631ba046 100644 --- a/arch/arm/mach-omap2/omap-smp.c +++ b/arch/arm/mach-omap2/omap-smp.c | |||
@@ -21,7 +21,6 @@ | |||
21 | #include <linux/io.h> | 21 | #include <linux/io.h> |
22 | 22 | ||
23 | #include <asm/cacheflush.h> | 23 | #include <asm/cacheflush.h> |
24 | #include <asm/localtimer.h> | ||
25 | #include <asm/smp_scu.h> | 24 | #include <asm/smp_scu.h> |
26 | #include <mach/hardware.h> | 25 | #include <mach/hardware.h> |
27 | #include <mach/omap4-common.h> | 26 | #include <mach/omap4-common.h> |
@@ -29,22 +28,10 @@ | |||
29 | /* SCU base address */ | 28 | /* SCU base address */ |
30 | static void __iomem *scu_base; | 29 | static void __iomem *scu_base; |
31 | 30 | ||
32 | /* | ||
33 | * Use SCU config register to count number of cores | ||
34 | */ | ||
35 | static inline unsigned int get_core_count(void) | ||
36 | { | ||
37 | if (scu_base) | ||
38 | return scu_get_core_count(scu_base); | ||
39 | return 1; | ||
40 | } | ||
41 | |||
42 | static DEFINE_SPINLOCK(boot_lock); | 31 | static DEFINE_SPINLOCK(boot_lock); |
43 | 32 | ||
44 | void __cpuinit platform_secondary_init(unsigned int cpu) | 33 | void __cpuinit platform_secondary_init(unsigned int cpu) |
45 | { | 34 | { |
46 | trace_hardirqs_off(); | ||
47 | |||
48 | /* | 35 | /* |
49 | * If any interrupts are already enabled for the primary | 36 | * If any interrupts are already enabled for the primary |
50 | * core (e.g. timer irq), then they will not have been enabled | 37 | * core (e.g. timer irq), then they will not have been enabled |
@@ -76,7 +63,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
76 | omap_modify_auxcoreboot0(0x200, 0xfffffdff); | 63 | omap_modify_auxcoreboot0(0x200, 0xfffffdff); |
77 | flush_cache_all(); | 64 | flush_cache_all(); |
78 | smp_wmb(); | 65 | smp_wmb(); |
79 | smp_cross_call(cpumask_of(cpu)); | 66 | smp_cross_call(cpumask_of(cpu), 1); |
80 | 67 | ||
81 | /* | 68 | /* |
82 | * Now the secondary core is starting up let it run its | 69 | * Now the secondary core is starting up let it run its |
@@ -118,25 +105,9 @@ void __init smp_init_cpus(void) | |||
118 | scu_base = ioremap(OMAP44XX_SCU_BASE, SZ_256); | 105 | scu_base = ioremap(OMAP44XX_SCU_BASE, SZ_256); |
119 | BUG_ON(!scu_base); | 106 | BUG_ON(!scu_base); |
120 | 107 | ||
121 | ncores = get_core_count(); | 108 | ncores = scu_get_core_count(scu_base); |
122 | |||
123 | for (i = 0; i < ncores; i++) | ||
124 | set_cpu_possible(i, true); | ||
125 | } | ||
126 | |||
127 | void __init smp_prepare_cpus(unsigned int max_cpus) | ||
128 | { | ||
129 | unsigned int ncores = get_core_count(); | ||
130 | unsigned int cpu = smp_processor_id(); | ||
131 | int i; | ||
132 | 109 | ||
133 | /* sanity check */ | 110 | /* sanity check */ |
134 | if (ncores == 0) { | ||
135 | printk(KERN_ERR | ||
136 | "OMAP4: strange core count of 0? Default to 1\n"); | ||
137 | ncores = 1; | ||
138 | } | ||
139 | |||
140 | if (ncores > NR_CPUS) { | 111 | if (ncores > NR_CPUS) { |
141 | printk(KERN_WARNING | 112 | printk(KERN_WARNING |
142 | "OMAP4: no. of cores (%d) greater than configured " | 113 | "OMAP4: no. of cores (%d) greater than configured " |
@@ -144,13 +115,14 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
144 | ncores, NR_CPUS); | 115 | ncores, NR_CPUS); |
145 | ncores = NR_CPUS; | 116 | ncores = NR_CPUS; |
146 | } | 117 | } |
147 | smp_store_cpu_info(cpu); | ||
148 | 118 | ||
149 | /* | 119 | for (i = 0; i < ncores; i++) |
150 | * are we trying to boot more cores than exist? | 120 | set_cpu_possible(i, true); |
151 | */ | 121 | } |
152 | if (max_cpus > ncores) | 122 | |
153 | max_cpus = ncores; | 123 | void __init platform_smp_prepare_cpus(unsigned int max_cpus) |
124 | { | ||
125 | int i; | ||
154 | 126 | ||
155 | /* | 127 | /* |
156 | * Initialise the present map, which describes the set of CPUs | 128 | * Initialise the present map, which describes the set of CPUs |
@@ -159,18 +131,10 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
159 | for (i = 0; i < max_cpus; i++) | 131 | for (i = 0; i < max_cpus; i++) |
160 | set_cpu_present(i, true); | 132 | set_cpu_present(i, true); |
161 | 133 | ||
162 | if (max_cpus > 1) { | 134 | /* |
163 | /* | 135 | * Initialise the SCU and wake up the secondary core using |
164 | * Enable the local timer or broadcast device for the | 136 | * wakeup_secondary(). |
165 | * boot CPU, but only if we have more than one CPU. | 137 | */ |
166 | */ | 138 | scu_enable(scu_base); |
167 | percpu_timer_setup(); | 139 | wakeup_secondary(); |
168 | |||
169 | /* | ||
170 | * Initialise the SCU and wake up the secondary core using | ||
171 | * wakeup_secondary(). | ||
172 | */ | ||
173 | scu_enable(scu_base); | ||
174 | wakeup_secondary(); | ||
175 | } | ||
176 | } | 140 | } |