Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* smp.c: Sparc SMP support. |
| 2 | * |
| 3 | * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) |
| 4 | * Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) |
| 5 | * Copyright (C) 2004 Keith M Wesolowski (wesolows@foobazco.org) |
| 6 | */ |
| 7 | |
| 8 | #include <asm/head.h> |
| 9 | |
| 10 | #include <linux/kernel.h> |
| 11 | #include <linux/sched.h> |
| 12 | #include <linux/threads.h> |
| 13 | #include <linux/smp.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | #include <linux/interrupt.h> |
| 15 | #include <linux/kernel_stat.h> |
| 16 | #include <linux/init.h> |
| 17 | #include <linux/spinlock.h> |
| 18 | #include <linux/mm.h> |
| 19 | #include <linux/fs.h> |
| 20 | #include <linux/seq_file.h> |
| 21 | #include <linux/cache.h> |
| 22 | #include <linux/delay.h> |
| 23 | |
| 24 | #include <asm/ptrace.h> |
| 25 | #include <asm/atomic.h> |
| 26 | |
| 27 | #include <asm/irq.h> |
| 28 | #include <asm/page.h> |
| 29 | #include <asm/pgalloc.h> |
| 30 | #include <asm/pgtable.h> |
| 31 | #include <asm/oplib.h> |
| 32 | #include <asm/cacheflush.h> |
| 33 | #include <asm/tlbflush.h> |
| 34 | #include <asm/cpudata.h> |
Konrad Eisele | 8401707 | 2009-08-31 22:08:13 +0000 | [diff] [blame] | 35 | #include <asm/leon.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | |
Al Viro | 32231a6 | 2007-07-21 19:18:57 -0700 | [diff] [blame] | 37 | #include "irq.h" |
| 38 | |
Al Viro | 409832f | 2008-11-22 17:33:54 +0000 | [diff] [blame] | 39 | volatile unsigned long cpu_callin_map[NR_CPUS] __cpuinitdata = {0,}; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | unsigned char boot_cpu_id = 0; |
| 41 | unsigned char boot_cpu_id4 = 0; /* boot_cpu_id << 2 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 43 | cpumask_t smp_commenced_mask = CPU_MASK_NONE; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | |
| 45 | /* The only guaranteed locking primitive available on all Sparc |
| 46 | * processors is 'ldstub [%reg + immediate], %dest_reg' which atomically |
| 47 | * places the current byte at the effective address into dest_reg and |
| 48 | * places 0xff there afterwards. Pretty lame locking primitive |
| 49 | * compared to the Alpha and the Intel no? Most Sparcs have 'swap' |
| 50 | * instruction which is much better... |
| 51 | */ |
| 52 | |
Bob Breuer | 92d452f | 2006-06-20 00:36:10 -0700 | [diff] [blame] | 53 | void __cpuinit smp_store_cpu_info(int id) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | { |
| 55 | int cpu_node; |
Sam Ravnborg | f486b3d | 2011-04-21 16:35:46 -0700 | [diff] [blame^] | 56 | int mid; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | |
| 58 | cpu_data(id).udelay_val = loops_per_jiffy; |
| 59 | |
| 60 | cpu_find_by_mid(id, &cpu_node); |
| 61 | cpu_data(id).clock_tick = prom_getintdefault(cpu_node, |
| 62 | "clock-frequency", 0); |
| 63 | cpu_data(id).prom_node = cpu_node; |
Sam Ravnborg | f486b3d | 2011-04-21 16:35:46 -0700 | [diff] [blame^] | 64 | mid = cpu_get_hwmid(cpu_node); |
Krzysztof Helt | 650fb83 | 2006-06-10 22:03:43 -0700 | [diff] [blame] | 65 | |
Sam Ravnborg | f486b3d | 2011-04-21 16:35:46 -0700 | [diff] [blame^] | 66 | if (mid < 0) { |
| 67 | printk(KERN_NOTICE "No MID found for CPU%d at node 0x%08d", id, cpu_node); |
| 68 | mid = 0; |
| 69 | } |
| 70 | cpu_data(id).mid = mid; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 71 | } |
| 72 | |
| 73 | void __init smp_cpus_done(unsigned int max_cpus) |
| 74 | { |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 75 | extern void smp4m_smp_done(void); |
Raymond Burns | 8b3c848 | 2006-07-17 21:57:09 -0700 | [diff] [blame] | 76 | extern void smp4d_smp_done(void); |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 77 | unsigned long bogosum = 0; |
Rusty Russell | ec7c14b | 2009-03-16 14:40:24 +1030 | [diff] [blame] | 78 | int cpu, num = 0; |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 79 | |
Rusty Russell | ec7c14b | 2009-03-16 14:40:24 +1030 | [diff] [blame] | 80 | for_each_online_cpu(cpu) { |
| 81 | num++; |
| 82 | bogosum += cpu_data(cpu).udelay_val; |
| 83 | } |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 84 | |
| 85 | printk("Total of %d processors activated (%lu.%02lu BogoMIPS).\n", |
| 86 | num, bogosum/(500000/HZ), |
| 87 | (bogosum/(5000/HZ))%100); |
| 88 | |
Raymond Burns | 8b3c848 | 2006-07-17 21:57:09 -0700 | [diff] [blame] | 89 | switch(sparc_cpu_model) { |
| 90 | case sun4: |
| 91 | printk("SUN4\n"); |
| 92 | BUG(); |
| 93 | break; |
| 94 | case sun4c: |
| 95 | printk("SUN4C\n"); |
| 96 | BUG(); |
| 97 | break; |
| 98 | case sun4m: |
| 99 | smp4m_smp_done(); |
| 100 | break; |
| 101 | case sun4d: |
| 102 | smp4d_smp_done(); |
| 103 | break; |
Konrad Eisele | 8401707 | 2009-08-31 22:08:13 +0000 | [diff] [blame] | 104 | case sparc_leon: |
| 105 | leon_smp_done(); |
| 106 | break; |
Raymond Burns | 8b3c848 | 2006-07-17 21:57:09 -0700 | [diff] [blame] | 107 | case sun4e: |
| 108 | printk("SUN4E\n"); |
| 109 | BUG(); |
| 110 | break; |
| 111 | case sun4u: |
| 112 | printk("SUN4U\n"); |
| 113 | BUG(); |
| 114 | break; |
| 115 | default: |
| 116 | printk("UNKNOWN!\n"); |
| 117 | BUG(); |
| 118 | break; |
| 119 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 120 | } |
| 121 | |
| 122 | void cpu_panic(void) |
| 123 | { |
| 124 | printk("CPU[%d]: Returns from cpu_idle!\n", smp_processor_id()); |
| 125 | panic("SMP bolixed\n"); |
| 126 | } |
| 127 | |
Al Viro | 409832f | 2008-11-22 17:33:54 +0000 | [diff] [blame] | 128 | struct linux_prom_registers smp_penguin_ctable __cpuinitdata = { 0 }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 129 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 130 | void smp_send_reschedule(int cpu) |
| 131 | { |
| 132 | /* See sparc64 */ |
| 133 | } |
| 134 | |
| 135 | void smp_send_stop(void) |
| 136 | { |
| 137 | } |
| 138 | |
| 139 | void smp_flush_cache_all(void) |
| 140 | { |
| 141 | xc0((smpfunc_t) BTFIXUP_CALL(local_flush_cache_all)); |
| 142 | local_flush_cache_all(); |
| 143 | } |
| 144 | |
| 145 | void smp_flush_tlb_all(void) |
| 146 | { |
| 147 | xc0((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_all)); |
| 148 | local_flush_tlb_all(); |
| 149 | } |
| 150 | |
| 151 | void smp_flush_cache_mm(struct mm_struct *mm) |
| 152 | { |
| 153 | if(mm->context != NO_CONTEXT) { |
Rusty Russell | 81f1adf | 2009-03-16 14:40:39 +1030 | [diff] [blame] | 154 | cpumask_t cpu_mask = *mm_cpumask(mm); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 155 | cpu_clear(smp_processor_id(), cpu_mask); |
| 156 | if (!cpus_empty(cpu_mask)) |
| 157 | xc1((smpfunc_t) BTFIXUP_CALL(local_flush_cache_mm), (unsigned long) mm); |
| 158 | local_flush_cache_mm(mm); |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | void smp_flush_tlb_mm(struct mm_struct *mm) |
| 163 | { |
| 164 | if(mm->context != NO_CONTEXT) { |
Rusty Russell | 81f1adf | 2009-03-16 14:40:39 +1030 | [diff] [blame] | 165 | cpumask_t cpu_mask = *mm_cpumask(mm); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 166 | cpu_clear(smp_processor_id(), cpu_mask); |
| 167 | if (!cpus_empty(cpu_mask)) { |
| 168 | xc1((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_mm), (unsigned long) mm); |
| 169 | if(atomic_read(&mm->mm_users) == 1 && current->active_mm == mm) |
Rusty Russell | 81f1adf | 2009-03-16 14:40:39 +1030 | [diff] [blame] | 170 | cpumask_copy(mm_cpumask(mm), |
| 171 | cpumask_of(smp_processor_id())); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 172 | } |
| 173 | local_flush_tlb_mm(mm); |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | void smp_flush_cache_range(struct vm_area_struct *vma, unsigned long start, |
| 178 | unsigned long end) |
| 179 | { |
| 180 | struct mm_struct *mm = vma->vm_mm; |
| 181 | |
| 182 | if (mm->context != NO_CONTEXT) { |
Rusty Russell | 81f1adf | 2009-03-16 14:40:39 +1030 | [diff] [blame] | 183 | cpumask_t cpu_mask = *mm_cpumask(mm); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 184 | cpu_clear(smp_processor_id(), cpu_mask); |
| 185 | if (!cpus_empty(cpu_mask)) |
| 186 | xc3((smpfunc_t) BTFIXUP_CALL(local_flush_cache_range), (unsigned long) vma, start, end); |
| 187 | local_flush_cache_range(vma, start, end); |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | void smp_flush_tlb_range(struct vm_area_struct *vma, unsigned long start, |
| 192 | unsigned long end) |
| 193 | { |
| 194 | struct mm_struct *mm = vma->vm_mm; |
| 195 | |
| 196 | if (mm->context != NO_CONTEXT) { |
Rusty Russell | 81f1adf | 2009-03-16 14:40:39 +1030 | [diff] [blame] | 197 | cpumask_t cpu_mask = *mm_cpumask(mm); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 198 | cpu_clear(smp_processor_id(), cpu_mask); |
| 199 | if (!cpus_empty(cpu_mask)) |
| 200 | xc3((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_range), (unsigned long) vma, start, end); |
| 201 | local_flush_tlb_range(vma, start, end); |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | void smp_flush_cache_page(struct vm_area_struct *vma, unsigned long page) |
| 206 | { |
| 207 | struct mm_struct *mm = vma->vm_mm; |
| 208 | |
| 209 | if(mm->context != NO_CONTEXT) { |
Rusty Russell | 81f1adf | 2009-03-16 14:40:39 +1030 | [diff] [blame] | 210 | cpumask_t cpu_mask = *mm_cpumask(mm); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 211 | cpu_clear(smp_processor_id(), cpu_mask); |
| 212 | if (!cpus_empty(cpu_mask)) |
| 213 | xc2((smpfunc_t) BTFIXUP_CALL(local_flush_cache_page), (unsigned long) vma, page); |
| 214 | local_flush_cache_page(vma, page); |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | void smp_flush_tlb_page(struct vm_area_struct *vma, unsigned long page) |
| 219 | { |
| 220 | struct mm_struct *mm = vma->vm_mm; |
| 221 | |
| 222 | if(mm->context != NO_CONTEXT) { |
Rusty Russell | 81f1adf | 2009-03-16 14:40:39 +1030 | [diff] [blame] | 223 | cpumask_t cpu_mask = *mm_cpumask(mm); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 224 | cpu_clear(smp_processor_id(), cpu_mask); |
| 225 | if (!cpus_empty(cpu_mask)) |
| 226 | xc2((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_page), (unsigned long) vma, page); |
| 227 | local_flush_tlb_page(vma, page); |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | void smp_reschedule_irq(void) |
| 232 | { |
| 233 | set_need_resched(); |
| 234 | } |
| 235 | |
| 236 | void smp_flush_page_to_ram(unsigned long page) |
| 237 | { |
| 238 | /* Current theory is that those who call this are the one's |
| 239 | * who have just dirtied their cache with the pages contents |
| 240 | * in kernel space, therefore we only run this on local cpu. |
| 241 | * |
| 242 | * XXX This experiment failed, research further... -DaveM |
| 243 | */ |
| 244 | #if 1 |
| 245 | xc1((smpfunc_t) BTFIXUP_CALL(local_flush_page_to_ram), page); |
| 246 | #endif |
| 247 | local_flush_page_to_ram(page); |
| 248 | } |
| 249 | |
| 250 | void smp_flush_sig_insns(struct mm_struct *mm, unsigned long insn_addr) |
| 251 | { |
Rusty Russell | 81f1adf | 2009-03-16 14:40:39 +1030 | [diff] [blame] | 252 | cpumask_t cpu_mask = *mm_cpumask(mm); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 253 | cpu_clear(smp_processor_id(), cpu_mask); |
| 254 | if (!cpus_empty(cpu_mask)) |
| 255 | xc2((smpfunc_t) BTFIXUP_CALL(local_flush_sig_insns), (unsigned long) mm, insn_addr); |
| 256 | local_flush_sig_insns(mm, insn_addr); |
| 257 | } |
| 258 | |
| 259 | extern unsigned int lvl14_resolution; |
| 260 | |
| 261 | /* /proc/profile writes can call this, don't __init it please. */ |
| 262 | static DEFINE_SPINLOCK(prof_setup_lock); |
| 263 | |
| 264 | int setup_profiling_timer(unsigned int multiplier) |
| 265 | { |
| 266 | int i; |
| 267 | unsigned long flags; |
| 268 | |
| 269 | /* Prevent level14 ticker IRQ flooding. */ |
| 270 | if((!multiplier) || (lvl14_resolution / multiplier) < 500) |
| 271 | return -EINVAL; |
| 272 | |
| 273 | spin_lock_irqsave(&prof_setup_lock, flags); |
KAMEZAWA Hiroyuki | fff8efe | 2006-04-10 22:52:51 -0700 | [diff] [blame] | 274 | for_each_possible_cpu(i) { |
Andrew Morton | 394e390 | 2006-03-23 03:01:05 -0800 | [diff] [blame] | 275 | load_profile_irq(i, lvl14_resolution / multiplier); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 276 | prof_multiplier(i) = multiplier; |
| 277 | } |
| 278 | spin_unlock_irqrestore(&prof_setup_lock, flags); |
| 279 | |
| 280 | return 0; |
| 281 | } |
| 282 | |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 283 | void __init smp_prepare_cpus(unsigned int max_cpus) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 284 | { |
Al Viro | b4cff84 | 2007-02-01 13:52:33 +0000 | [diff] [blame] | 285 | extern void __init smp4m_boot_cpus(void); |
| 286 | extern void __init smp4d_boot_cpus(void); |
Bob Breuer | 7202fb4 | 2006-06-20 00:30:31 -0700 | [diff] [blame] | 287 | int i, cpuid, extra; |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 288 | |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 289 | printk("Entering SMP Mode...\n"); |
| 290 | |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 291 | extra = 0; |
| 292 | for (i = 0; !cpu_find_by_instance(i, NULL, &cpuid); i++) { |
Bob Breuer | 7202fb4 | 2006-06-20 00:30:31 -0700 | [diff] [blame] | 293 | if (cpuid >= NR_CPUS) |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 294 | extra++; |
| 295 | } |
Bob Breuer | 7202fb4 | 2006-06-20 00:30:31 -0700 | [diff] [blame] | 296 | /* i = number of cpus */ |
| 297 | if (extra && max_cpus > i - extra) |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 298 | printk("Warning: NR_CPUS is too low to start all cpus\n"); |
| 299 | |
| 300 | smp_store_cpu_info(boot_cpu_id); |
| 301 | |
Raymond Burns | 8b3c848 | 2006-07-17 21:57:09 -0700 | [diff] [blame] | 302 | switch(sparc_cpu_model) { |
| 303 | case sun4: |
| 304 | printk("SUN4\n"); |
| 305 | BUG(); |
| 306 | break; |
| 307 | case sun4c: |
| 308 | printk("SUN4C\n"); |
| 309 | BUG(); |
| 310 | break; |
| 311 | case sun4m: |
| 312 | smp4m_boot_cpus(); |
| 313 | break; |
| 314 | case sun4d: |
| 315 | smp4d_boot_cpus(); |
| 316 | break; |
Konrad Eisele | 8401707 | 2009-08-31 22:08:13 +0000 | [diff] [blame] | 317 | case sparc_leon: |
| 318 | leon_boot_cpus(); |
| 319 | break; |
Raymond Burns | 8b3c848 | 2006-07-17 21:57:09 -0700 | [diff] [blame] | 320 | case sun4e: |
| 321 | printk("SUN4E\n"); |
| 322 | BUG(); |
| 323 | break; |
| 324 | case sun4u: |
| 325 | printk("SUN4U\n"); |
| 326 | BUG(); |
| 327 | break; |
| 328 | default: |
| 329 | printk("UNKNOWN!\n"); |
| 330 | BUG(); |
| 331 | break; |
| 332 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 333 | } |
| 334 | |
Bob Breuer | 7202fb4 | 2006-06-20 00:30:31 -0700 | [diff] [blame] | 335 | /* Set this up early so that things like the scheduler can init |
| 336 | * properly. We use the same cpu mask for both the present and |
| 337 | * possible cpu map. |
| 338 | */ |
| 339 | void __init smp_setup_cpu_possible_map(void) |
| 340 | { |
| 341 | int instance, mid; |
| 342 | |
| 343 | instance = 0; |
| 344 | while (!cpu_find_by_instance(instance, NULL, &mid)) { |
| 345 | if (mid < NR_CPUS) { |
Rusty Russell | fe73971 | 2009-03-16 14:40:22 +1030 | [diff] [blame] | 346 | set_cpu_possible(mid, true); |
| 347 | set_cpu_present(mid, true); |
Bob Breuer | 7202fb4 | 2006-06-20 00:30:31 -0700 | [diff] [blame] | 348 | } |
| 349 | instance++; |
| 350 | } |
| 351 | } |
| 352 | |
Bob Breuer | 92d452f | 2006-06-20 00:36:10 -0700 | [diff] [blame] | 353 | void __init smp_prepare_boot_cpu(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 354 | { |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 355 | int cpuid = hard_smp_processor_id(); |
| 356 | |
| 357 | if (cpuid >= NR_CPUS) { |
| 358 | prom_printf("Serious problem, boot cpu id >= NR_CPUS\n"); |
| 359 | prom_halt(); |
| 360 | } |
| 361 | if (cpuid != 0) |
| 362 | printk("boot cpu id != 0, this could work but is untested\n"); |
| 363 | |
| 364 | current_thread_info()->cpu = cpuid; |
Rusty Russell | fe73971 | 2009-03-16 14:40:22 +1030 | [diff] [blame] | 365 | set_cpu_online(cpuid, true); |
| 366 | set_cpu_possible(cpuid, true); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 367 | } |
| 368 | |
Bob Breuer | 92d452f | 2006-06-20 00:36:10 -0700 | [diff] [blame] | 369 | int __cpuinit __cpu_up(unsigned int cpu) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 370 | { |
Al Viro | b4cff84 | 2007-02-01 13:52:33 +0000 | [diff] [blame] | 371 | extern int __cpuinit smp4m_boot_one_cpu(int); |
| 372 | extern int __cpuinit smp4d_boot_one_cpu(int); |
Raymond Burns | 8b3c848 | 2006-07-17 21:57:09 -0700 | [diff] [blame] | 373 | int ret=0; |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 374 | |
Raymond Burns | 8b3c848 | 2006-07-17 21:57:09 -0700 | [diff] [blame] | 375 | switch(sparc_cpu_model) { |
| 376 | case sun4: |
| 377 | printk("SUN4\n"); |
| 378 | BUG(); |
| 379 | break; |
| 380 | case sun4c: |
| 381 | printk("SUN4C\n"); |
| 382 | BUG(); |
| 383 | break; |
| 384 | case sun4m: |
| 385 | ret = smp4m_boot_one_cpu(cpu); |
| 386 | break; |
| 387 | case sun4d: |
| 388 | ret = smp4d_boot_one_cpu(cpu); |
| 389 | break; |
Konrad Eisele | 8401707 | 2009-08-31 22:08:13 +0000 | [diff] [blame] | 390 | case sparc_leon: |
| 391 | ret = leon_boot_one_cpu(cpu); |
| 392 | break; |
Raymond Burns | 8b3c848 | 2006-07-17 21:57:09 -0700 | [diff] [blame] | 393 | case sun4e: |
| 394 | printk("SUN4E\n"); |
| 395 | BUG(); |
| 396 | break; |
| 397 | case sun4u: |
| 398 | printk("SUN4U\n"); |
| 399 | BUG(); |
| 400 | break; |
| 401 | default: |
| 402 | printk("UNKNOWN!\n"); |
| 403 | BUG(); |
| 404 | break; |
| 405 | }; |
Bob Breuer | a54123e | 2006-03-23 22:36:19 -0800 | [diff] [blame] | 406 | |
| 407 | if (!ret) { |
| 408 | cpu_set(cpu, smp_commenced_mask); |
| 409 | while (!cpu_online(cpu)) |
| 410 | mb(); |
| 411 | } |
| 412 | return ret; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 413 | } |
| 414 | |
| 415 | void smp_bogo(struct seq_file *m) |
| 416 | { |
| 417 | int i; |
| 418 | |
Andrew Morton | 394e390 | 2006-03-23 03:01:05 -0800 | [diff] [blame] | 419 | for_each_online_cpu(i) { |
| 420 | seq_printf(m, |
| 421 | "Cpu%dBogo\t: %lu.%02lu\n", |
| 422 | i, |
| 423 | cpu_data(i).udelay_val/(500000/HZ), |
| 424 | (cpu_data(i).udelay_val/(5000/HZ))%100); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 425 | } |
| 426 | } |
| 427 | |
| 428 | void smp_info(struct seq_file *m) |
| 429 | { |
| 430 | int i; |
| 431 | |
| 432 | seq_printf(m, "State:\n"); |
Andrew Morton | 394e390 | 2006-03-23 03:01:05 -0800 | [diff] [blame] | 433 | for_each_online_cpu(i) |
| 434 | seq_printf(m, "CPU%d\t\t: online\n", i); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 435 | } |