diff options
Diffstat (limited to 'arch/ppc/platforms')
| -rw-r--r-- | arch/ppc/platforms/4xx/ebony.c | 13 | ||||
| -rw-r--r-- | arch/ppc/platforms/hdpu.c | 2 | ||||
| -rw-r--r-- | arch/ppc/platforms/pmac_sleep.S | 4 | ||||
| -rw-r--r-- | arch/ppc/platforms/pmac_smp.c | 85 |
4 files changed, 62 insertions, 42 deletions
diff --git a/arch/ppc/platforms/4xx/ebony.c b/arch/ppc/platforms/4xx/ebony.c index 0fd3442f5131..d6b2b1965dcb 100644 --- a/arch/ppc/platforms/4xx/ebony.c +++ b/arch/ppc/platforms/4xx/ebony.c | |||
| @@ -91,15 +91,10 @@ ebony_calibrate_decr(void) | |||
| 91 | * on Rev. C silicon then errata forces us to | 91 | * on Rev. C silicon then errata forces us to |
| 92 | * use the internal clock. | 92 | * use the internal clock. |
| 93 | */ | 93 | */ |
| 94 | switch (PVR_REV(mfspr(SPRN_PVR))) { | 94 | if (strcmp(cur_cpu_spec[0]->cpu_name, "440GP Rev. B") == 0) |
| 95 | case PVR_REV(PVR_440GP_RB): | 95 | freq = EBONY_440GP_RB_SYSCLK; |
| 96 | freq = EBONY_440GP_RB_SYSCLK; | 96 | else |
| 97 | break; | 97 | freq = EBONY_440GP_RC_SYSCLK; |
| 98 | case PVR_REV(PVR_440GP_RC1): | ||
| 99 | default: | ||
| 100 | freq = EBONY_440GP_RC_SYSCLK; | ||
| 101 | break; | ||
| 102 | } | ||
| 103 | 98 | ||
| 104 | ibm44x_calibrate_decr(freq); | 99 | ibm44x_calibrate_decr(freq); |
| 105 | } | 100 | } |
diff --git a/arch/ppc/platforms/hdpu.c b/arch/ppc/platforms/hdpu.c index b659d7b3d747..ff3796860123 100644 --- a/arch/ppc/platforms/hdpu.c +++ b/arch/ppc/platforms/hdpu.c | |||
| @@ -58,7 +58,7 @@ static void parse_bootinfo(unsigned long r3, | |||
| 58 | static void hdpu_set_l1pe(void); | 58 | static void hdpu_set_l1pe(void); |
| 59 | static void hdpu_cpustate_set(unsigned char new_state); | 59 | static void hdpu_cpustate_set(unsigned char new_state); |
| 60 | #ifdef CONFIG_SMP | 60 | #ifdef CONFIG_SMP |
| 61 | static spinlock_t timebase_lock = SPIN_LOCK_UNLOCKED; | 61 | static DEFINE_SPINLOCK(timebase_lock); |
| 62 | static unsigned int timebase_upper = 0, timebase_lower = 0; | 62 | static unsigned int timebase_upper = 0, timebase_lower = 0; |
| 63 | extern int smp_tb_synchronized; | 63 | extern int smp_tb_synchronized; |
| 64 | 64 | ||
diff --git a/arch/ppc/platforms/pmac_sleep.S b/arch/ppc/platforms/pmac_sleep.S index 016a74649155..88419c77ac43 100644 --- a/arch/ppc/platforms/pmac_sleep.S +++ b/arch/ppc/platforms/pmac_sleep.S | |||
| @@ -17,7 +17,7 @@ | |||
| 17 | #include <asm/cputable.h> | 17 | #include <asm/cputable.h> |
| 18 | #include <asm/cache.h> | 18 | #include <asm/cache.h> |
| 19 | #include <asm/thread_info.h> | 19 | #include <asm/thread_info.h> |
| 20 | #include <asm/offsets.h> | 20 | #include <asm/asm-offsets.h> |
| 21 | 21 | ||
| 22 | #define MAGIC 0x4c617273 /* 'Lars' */ | 22 | #define MAGIC 0x4c617273 /* 'Lars' */ |
| 23 | 23 | ||
| @@ -161,6 +161,8 @@ _GLOBAL(low_sleep_handler) | |||
| 161 | addi r3,r3,sleep_storage@l | 161 | addi r3,r3,sleep_storage@l |
| 162 | stw r5,0(r3) | 162 | stw r5,0(r3) |
| 163 | 163 | ||
| 164 | .globl low_cpu_die | ||
| 165 | low_cpu_die: | ||
| 164 | /* Flush & disable all caches */ | 166 | /* Flush & disable all caches */ |
| 165 | bl flush_disable_caches | 167 | bl flush_disable_caches |
| 166 | 168 | ||
diff --git a/arch/ppc/platforms/pmac_smp.c b/arch/ppc/platforms/pmac_smp.c index 8e049dab4e63..794a23994b82 100644 --- a/arch/ppc/platforms/pmac_smp.c +++ b/arch/ppc/platforms/pmac_smp.c | |||
| @@ -33,6 +33,7 @@ | |||
| 33 | #include <linux/spinlock.h> | 33 | #include <linux/spinlock.h> |
| 34 | #include <linux/errno.h> | 34 | #include <linux/errno.h> |
| 35 | #include <linux/hardirq.h> | 35 | #include <linux/hardirq.h> |
| 36 | #include <linux/cpu.h> | ||
| 36 | 37 | ||
| 37 | #include <asm/ptrace.h> | 38 | #include <asm/ptrace.h> |
| 38 | #include <asm/atomic.h> | 39 | #include <asm/atomic.h> |
| @@ -55,9 +56,7 @@ | |||
| 55 | * Powersurge (old powermac SMP) support. | 56 | * Powersurge (old powermac SMP) support. |
| 56 | */ | 57 | */ |
| 57 | 58 | ||
| 58 | extern void __secondary_start_psurge(void); | 59 | extern void __secondary_start_pmac_0(void); |
| 59 | extern void __secondary_start_psurge2(void); /* Temporary horrible hack */ | ||
| 60 | extern void __secondary_start_psurge3(void); /* Temporary horrible hack */ | ||
| 61 | 60 | ||
| 62 | /* Addresses for powersurge registers */ | 61 | /* Addresses for powersurge registers */ |
| 63 | #define HAMMERHEAD_BASE 0xf8000000 | 62 | #define HAMMERHEAD_BASE 0xf8000000 |
| @@ -119,7 +118,7 @@ static volatile int sec_tb_reset = 0; | |||
| 119 | static unsigned int pri_tb_hi, pri_tb_lo; | 118 | static unsigned int pri_tb_hi, pri_tb_lo; |
| 120 | static unsigned int pri_tb_stamp; | 119 | static unsigned int pri_tb_stamp; |
| 121 | 120 | ||
| 122 | static void __init core99_init_caches(int cpu) | 121 | static void __devinit core99_init_caches(int cpu) |
| 123 | { | 122 | { |
| 124 | if (!cpu_has_feature(CPU_FTR_L2CR)) | 123 | if (!cpu_has_feature(CPU_FTR_L2CR)) |
| 125 | return; | 124 | return; |
| @@ -346,7 +345,7 @@ static int __init smp_psurge_probe(void) | |||
| 346 | 345 | ||
| 347 | static void __init smp_psurge_kick_cpu(int nr) | 346 | static void __init smp_psurge_kick_cpu(int nr) |
| 348 | { | 347 | { |
| 349 | void (*start)(void) = __secondary_start_psurge; | 348 | unsigned long start = __pa(__secondary_start_pmac_0) + nr * 8; |
| 350 | unsigned long a; | 349 | unsigned long a; |
| 351 | 350 | ||
| 352 | /* may need to flush here if secondary bats aren't setup */ | 351 | /* may need to flush here if secondary bats aren't setup */ |
| @@ -356,17 +355,7 @@ static void __init smp_psurge_kick_cpu(int nr) | |||
| 356 | 355 | ||
| 357 | if (ppc_md.progress) ppc_md.progress("smp_psurge_kick_cpu", 0x353); | 356 | if (ppc_md.progress) ppc_md.progress("smp_psurge_kick_cpu", 0x353); |
| 358 | 357 | ||
| 359 | /* setup entry point of secondary processor */ | 358 | out_be32(psurge_start, start); |
| 360 | switch (nr) { | ||
| 361 | case 2: | ||
| 362 | start = __secondary_start_psurge2; | ||
| 363 | break; | ||
| 364 | case 3: | ||
| 365 | start = __secondary_start_psurge3; | ||
| 366 | break; | ||
| 367 | } | ||
| 368 | |||
| 369 | out_be32(psurge_start, __pa(start)); | ||
| 370 | mb(); | 359 | mb(); |
| 371 | 360 | ||
| 372 | psurge_set_ipi(nr); | 361 | psurge_set_ipi(nr); |
| @@ -500,14 +489,14 @@ static int __init smp_core99_probe(void) | |||
| 500 | return ncpus; | 489 | return ncpus; |
| 501 | } | 490 | } |
| 502 | 491 | ||
| 503 | static void __init smp_core99_kick_cpu(int nr) | 492 | static void __devinit smp_core99_kick_cpu(int nr) |
| 504 | { | 493 | { |
| 505 | unsigned long save_vector, new_vector; | 494 | unsigned long save_vector, new_vector; |
| 506 | unsigned long flags; | 495 | unsigned long flags; |
| 507 | 496 | ||
| 508 | volatile unsigned long *vector | 497 | volatile unsigned long *vector |
| 509 | = ((volatile unsigned long *)(KERNELBASE+0x100)); | 498 | = ((volatile unsigned long *)(KERNELBASE+0x100)); |
| 510 | if (nr < 1 || nr > 3) | 499 | if (nr < 0 || nr > 3) |
| 511 | return; | 500 | return; |
| 512 | if (ppc_md.progress) ppc_md.progress("smp_core99_kick_cpu", 0x346); | 501 | if (ppc_md.progress) ppc_md.progress("smp_core99_kick_cpu", 0x346); |
| 513 | 502 | ||
| @@ -518,19 +507,9 @@ static void __init smp_core99_kick_cpu(int nr) | |||
| 518 | save_vector = *vector; | 507 | save_vector = *vector; |
| 519 | 508 | ||
| 520 | /* Setup fake reset vector that does | 509 | /* Setup fake reset vector that does |
| 521 | * b __secondary_start_psurge - KERNELBASE | 510 | * b __secondary_start_pmac_0 + nr*8 - KERNELBASE |
| 522 | */ | 511 | */ |
| 523 | switch(nr) { | 512 | new_vector = (unsigned long) __secondary_start_pmac_0 + nr * 8; |
| 524 | case 1: | ||
| 525 | new_vector = (unsigned long)__secondary_start_psurge; | ||
| 526 | break; | ||
| 527 | case 2: | ||
| 528 | new_vector = (unsigned long)__secondary_start_psurge2; | ||
| 529 | break; | ||
| 530 | case 3: | ||
| 531 | new_vector = (unsigned long)__secondary_start_psurge3; | ||
| 532 | break; | ||
| 533 | } | ||
| 534 | *vector = 0x48000002 + new_vector - KERNELBASE; | 513 | *vector = 0x48000002 + new_vector - KERNELBASE; |
| 535 | 514 | ||
| 536 | /* flush data cache and inval instruction cache */ | 515 | /* flush data cache and inval instruction cache */ |
| @@ -554,7 +533,7 @@ static void __init smp_core99_kick_cpu(int nr) | |||
| 554 | if (ppc_md.progress) ppc_md.progress("smp_core99_kick_cpu done", 0x347); | 533 | if (ppc_md.progress) ppc_md.progress("smp_core99_kick_cpu done", 0x347); |
| 555 | } | 534 | } |
| 556 | 535 | ||
| 557 | static void __init smp_core99_setup_cpu(int cpu_nr) | 536 | static void __devinit smp_core99_setup_cpu(int cpu_nr) |
| 558 | { | 537 | { |
| 559 | /* Setup L2/L3 */ | 538 | /* Setup L2/L3 */ |
| 560 | if (cpu_nr != 0) | 539 | if (cpu_nr != 0) |
| @@ -668,3 +647,47 @@ struct smp_ops_t core99_smp_ops __pmacdata = { | |||
| 668 | .give_timebase = smp_core99_give_timebase, | 647 | .give_timebase = smp_core99_give_timebase, |
| 669 | .take_timebase = smp_core99_take_timebase, | 648 | .take_timebase = smp_core99_take_timebase, |
| 670 | }; | 649 | }; |
| 650 | |||
| 651 | #ifdef CONFIG_HOTPLUG_CPU | ||
| 652 | |||
| 653 | int __cpu_disable(void) | ||
| 654 | { | ||
| 655 | cpu_clear(smp_processor_id(), cpu_online_map); | ||
| 656 | |||
| 657 | /* XXX reset cpu affinity here */ | ||
| 658 | openpic_set_priority(0xf); | ||
| 659 | asm volatile("mtdec %0" : : "r" (0x7fffffff)); | ||
| 660 | mb(); | ||
| 661 | udelay(20); | ||
| 662 | asm volatile("mtdec %0" : : "r" (0x7fffffff)); | ||
| 663 | return 0; | ||
| 664 | } | ||
| 665 | |||
| 666 | extern void low_cpu_die(void) __attribute__((noreturn)); /* in pmac_sleep.S */ | ||
| 667 | static int cpu_dead[NR_CPUS]; | ||
| 668 | |||
| 669 | void cpu_die(void) | ||
| 670 | { | ||
| 671 | local_irq_disable(); | ||
| 672 | cpu_dead[smp_processor_id()] = 1; | ||
| 673 | mb(); | ||
| 674 | low_cpu_die(); | ||
| 675 | } | ||
| 676 | |||
| 677 | void __cpu_die(unsigned int cpu) | ||
| 678 | { | ||
| 679 | int timeout; | ||
| 680 | |||
| 681 | timeout = 1000; | ||
| 682 | while (!cpu_dead[cpu]) { | ||
| 683 | if (--timeout == 0) { | ||
| 684 | printk("CPU %u refused to die!\n", cpu); | ||
| 685 | break; | ||
| 686 | } | ||
| 687 | msleep(1); | ||
| 688 | } | ||
| 689 | cpu_callin_map[cpu] = 0; | ||
| 690 | cpu_dead[cpu] = 0; | ||
| 691 | } | ||
| 692 | |||
| 693 | #endif | ||
