diff options
Diffstat (limited to 'arch')
36 files changed, 449 insertions, 534 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 967ecf92d6a7..1c44a1dac421 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -278,6 +278,7 @@ config PPC_PSERIES | |||
278 | select PPC_I8259 | 278 | select PPC_I8259 |
279 | select PPC_RTAS | 279 | select PPC_RTAS |
280 | select RTAS_ERROR_LOGGING | 280 | select RTAS_ERROR_LOGGING |
281 | select RTAS_FW | ||
281 | default y | 282 | default y |
282 | 283 | ||
283 | config PPC_CHRP | 284 | config PPC_CHRP |
@@ -319,10 +320,12 @@ config PPC_MAPLE | |||
319 | This option enables support for the Maple 970FX Evaluation Board. | 320 | This option enables support for the Maple 970FX Evaluation Board. |
320 | For more informations, refer to <http://www.970eval.com> | 321 | For more informations, refer to <http://www.970eval.com> |
321 | 322 | ||
322 | config PPC_BPA | 323 | config PPC_CELL |
323 | bool " Broadband Processor Architecture" | 324 | bool " Cell Broadband Processor Architecture" |
324 | depends on PPC_MULTIPLATFORM && PPC64 | 325 | depends on PPC_MULTIPLATFORM && PPC64 |
325 | select PPC_RTAS | 326 | select PPC_RTAS |
327 | select RTAS_FW | ||
328 | select MMIO_NVRAM | ||
326 | 329 | ||
327 | config PPC_OF | 330 | config PPC_OF |
328 | bool | 331 | bool |
@@ -353,13 +356,22 @@ config RTAS_ERROR_LOGGING | |||
353 | depends on PPC_RTAS | 356 | depends on PPC_RTAS |
354 | default n | 357 | default n |
355 | 358 | ||
359 | config RTAS_FW | ||
360 | bool | ||
361 | depends on PPC_RTAS | ||
362 | default n | ||
363 | |||
364 | config MMIO_NVRAM | ||
365 | bool | ||
366 | default n | ||
367 | |||
356 | config MPIC_BROKEN_U3 | 368 | config MPIC_BROKEN_U3 |
357 | bool | 369 | bool |
358 | depends on PPC_MAPLE | 370 | depends on PPC_MAPLE |
359 | default y | 371 | default y |
360 | 372 | ||
361 | config BPA_IIC | 373 | config CELL_IIC |
362 | depends on PPC_BPA | 374 | depends on PPC_CELL |
363 | bool | 375 | bool |
364 | default y | 376 | default y |
365 | 377 | ||
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index 572d4f5eaacb..abad3059a21a 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile | |||
@@ -18,6 +18,7 @@ obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o | |||
18 | obj-$(CONFIG_POWER4) += idle_power4.o | 18 | obj-$(CONFIG_POWER4) += idle_power4.o |
19 | obj-$(CONFIG_PPC_OF) += of_device.o | 19 | obj-$(CONFIG_PPC_OF) += of_device.o |
20 | obj-$(CONFIG_PPC_RTAS) += rtas.o | 20 | obj-$(CONFIG_PPC_RTAS) += rtas.o |
21 | obj-$(CONFIG_RTAS_FW) += rtas_fw.o | ||
21 | obj-$(CONFIG_IBMVIO) += vio.o | 22 | obj-$(CONFIG_IBMVIO) += vio.o |
22 | 23 | ||
23 | ifeq ($(CONFIG_PPC_MERGE),y) | 24 | ifeq ($(CONFIG_PPC_MERGE),y) |
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c index 8bc540337ba0..47d6f7e2ea9f 100644 --- a/arch/powerpc/kernel/ppc_ksyms.c +++ b/arch/powerpc/kernel/ppc_ksyms.c | |||
@@ -81,15 +81,6 @@ EXPORT_SYMBOL(_prep_type); | |||
81 | EXPORT_SYMBOL(ucSystemType); | 81 | EXPORT_SYMBOL(ucSystemType); |
82 | #endif | 82 | #endif |
83 | 83 | ||
84 | #if !defined(__INLINE_BITOPS) | ||
85 | EXPORT_SYMBOL(set_bit); | ||
86 | EXPORT_SYMBOL(clear_bit); | ||
87 | EXPORT_SYMBOL(change_bit); | ||
88 | EXPORT_SYMBOL(test_and_set_bit); | ||
89 | EXPORT_SYMBOL(test_and_clear_bit); | ||
90 | EXPORT_SYMBOL(test_and_change_bit); | ||
91 | #endif /* __INLINE_BITOPS */ | ||
92 | |||
93 | EXPORT_SYMBOL(strcpy); | 84 | EXPORT_SYMBOL(strcpy); |
94 | EXPORT_SYMBOL(strncpy); | 85 | EXPORT_SYMBOL(strncpy); |
95 | EXPORT_SYMBOL(strcat); | 86 | EXPORT_SYMBOL(strcat); |
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index 9750b3cd8ecd..c758b6624d7b 100644 --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c | |||
@@ -2000,7 +2000,7 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4, | |||
2000 | #endif | 2000 | #endif |
2001 | 2001 | ||
2002 | /* | 2002 | /* |
2003 | * On pSeries and BPA, copy the CPU hold code | 2003 | * Copy the CPU hold code |
2004 | */ | 2004 | */ |
2005 | if (RELOC(of_platform) != PLATFORM_POWERMAC) | 2005 | if (RELOC(of_platform) != PLATFORM_POWERMAC) |
2006 | copy_and_flush(0, KERNELBASE + offset, 0x100, 0); | 2006 | copy_and_flush(0, KERNELBASE + offset, 0x100, 0); |
diff --git a/arch/powerpc/platforms/pseries/rtas-fw.c b/arch/powerpc/kernel/rtas_fw.c index 15d81d758ca0..448922e8af1b 100644 --- a/arch/powerpc/platforms/pseries/rtas-fw.c +++ b/arch/powerpc/kernel/rtas_fw.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * | 2 | * |
3 | * Procedures for firmware flash updates on pSeries systems. | 3 | * Procedures for firmware flash updates. |
4 | * | 4 | * |
5 | * Peter Bergner, IBM March 2001. | 5 | * Peter Bergner, IBM March 2001. |
6 | * Copyright (C) 2001 IBM. | 6 | * Copyright (C) 2001 IBM. |
@@ -31,8 +31,6 @@ | |||
31 | #include <asm/uaccess.h> | 31 | #include <asm/uaccess.h> |
32 | #include <asm/systemcfg.h> | 32 | #include <asm/systemcfg.h> |
33 | 33 | ||
34 | #include "rtas-fw.h" | ||
35 | |||
36 | struct flash_block_list_header rtas_firmware_flash_list = {0, NULL}; | 34 | struct flash_block_list_header rtas_firmware_flash_list = {0, NULL}; |
37 | 35 | ||
38 | #define FLASH_BLOCK_LIST_VERSION (1UL) | 36 | #define FLASH_BLOCK_LIST_VERSION (1UL) |
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 1292460fcde2..14ebe3bc48c3 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c | |||
@@ -201,11 +201,11 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
201 | #ifdef CONFIG_TAU_AVERAGE | 201 | #ifdef CONFIG_TAU_AVERAGE |
202 | /* more straightforward, but potentially misleading */ | 202 | /* more straightforward, but potentially misleading */ |
203 | seq_printf(m, "temperature \t: %u C (uncalibrated)\n", | 203 | seq_printf(m, "temperature \t: %u C (uncalibrated)\n", |
204 | cpu_temp(i)); | 204 | cpu_temp(cpu_id)); |
205 | #else | 205 | #else |
206 | /* show the actual temp sensor range */ | 206 | /* show the actual temp sensor range */ |
207 | u32 temp; | 207 | u32 temp; |
208 | temp = cpu_temp_both(i); | 208 | temp = cpu_temp_both(cpu_id); |
209 | seq_printf(m, "temperature \t: %u-%u C (uncalibrated)\n", | 209 | seq_printf(m, "temperature \t: %u-%u C (uncalibrated)\n", |
210 | temp & 0xff, temp >> 16); | 210 | temp & 0xff, temp >> 16); |
211 | #endif | 211 | #endif |
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index 079867e18145..d4a3c5dd1a21 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
@@ -296,7 +296,7 @@ static void __init setup_cpu_maps(void) | |||
296 | extern struct machdep_calls pSeries_md; | 296 | extern struct machdep_calls pSeries_md; |
297 | extern struct machdep_calls pmac_md; | 297 | extern struct machdep_calls pmac_md; |
298 | extern struct machdep_calls maple_md; | 298 | extern struct machdep_calls maple_md; |
299 | extern struct machdep_calls bpa_md; | 299 | extern struct machdep_calls cell_md; |
300 | extern struct machdep_calls iseries_md; | 300 | extern struct machdep_calls iseries_md; |
301 | 301 | ||
302 | /* Ultimately, stuff them in an elf section like initcalls... */ | 302 | /* Ultimately, stuff them in an elf section like initcalls... */ |
@@ -310,8 +310,8 @@ static struct machdep_calls __initdata *machines[] = { | |||
310 | #ifdef CONFIG_PPC_MAPLE | 310 | #ifdef CONFIG_PPC_MAPLE |
311 | &maple_md, | 311 | &maple_md, |
312 | #endif /* CONFIG_PPC_MAPLE */ | 312 | #endif /* CONFIG_PPC_MAPLE */ |
313 | #ifdef CONFIG_PPC_BPA | 313 | #ifdef CONFIG_PPC_CELL |
314 | &bpa_md, | 314 | &cell_md, |
315 | #endif | 315 | #endif |
316 | #ifdef CONFIG_PPC_ISERIES | 316 | #ifdef CONFIG_PPC_ISERIES |
317 | &iseries_md, | 317 | &iseries_md, |
@@ -631,23 +631,6 @@ static int ppc64_panic_event(struct notifier_block *this, | |||
631 | return NOTIFY_DONE; | 631 | return NOTIFY_DONE; |
632 | } | 632 | } |
633 | 633 | ||
634 | #ifdef CONFIG_PPC_ISERIES | ||
635 | /* | ||
636 | * On iSeries we just parse the mem=X option from the command line. | ||
637 | * On pSeries it's a bit more complicated, see prom_init_mem() | ||
638 | */ | ||
639 | static int __init early_parsemem(char *p) | ||
640 | { | ||
641 | if (!p) | ||
642 | return 0; | ||
643 | |||
644 | memory_limit = ALIGN(memparse(p, &p), PAGE_SIZE); | ||
645 | |||
646 | return 0; | ||
647 | } | ||
648 | early_param("mem", early_parsemem); | ||
649 | #endif /* CONFIG_PPC_ISERIES */ | ||
650 | |||
651 | #ifdef CONFIG_IRQSTACKS | 634 | #ifdef CONFIG_IRQSTACKS |
652 | static void __init irqstack_early_init(void) | 635 | static void __init irqstack_early_init(void) |
653 | { | 636 | { |
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 5d638ecddbd0..07e5ee40b870 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c | |||
@@ -147,8 +147,8 @@ int die(const char *str, struct pt_regs *regs, long err) | |||
147 | printk("POWERMAC "); | 147 | printk("POWERMAC "); |
148 | nl = 1; | 148 | nl = 1; |
149 | break; | 149 | break; |
150 | case PLATFORM_BPA: | 150 | case PLATFORM_CELL: |
151 | printk("BPA "); | 151 | printk("CELL "); |
152 | nl = 1; | 152 | nl = 1; |
153 | break; | 153 | break; |
154 | } | 154 | } |
@@ -749,22 +749,22 @@ static int check_bug_trap(struct pt_regs *regs) | |||
749 | if (bug->line & BUG_WARNING_TRAP) { | 749 | if (bug->line & BUG_WARNING_TRAP) { |
750 | /* this is a WARN_ON rather than BUG/BUG_ON */ | 750 | /* this is a WARN_ON rather than BUG/BUG_ON */ |
751 | #ifdef CONFIG_XMON | 751 | #ifdef CONFIG_XMON |
752 | xmon_printf(KERN_ERR "Badness in %s at %s:%d\n", | 752 | xmon_printf(KERN_ERR "Badness in %s at %s:%ld\n", |
753 | bug->function, bug->file, | 753 | bug->function, bug->file, |
754 | bug->line & ~BUG_WARNING_TRAP); | 754 | bug->line & ~BUG_WARNING_TRAP); |
755 | #endif /* CONFIG_XMON */ | 755 | #endif /* CONFIG_XMON */ |
756 | printk(KERN_ERR "Badness in %s at %s:%d\n", | 756 | printk(KERN_ERR "Badness in %s at %s:%ld\n", |
757 | bug->function, bug->file, | 757 | bug->function, bug->file, |
758 | bug->line & ~BUG_WARNING_TRAP); | 758 | bug->line & ~BUG_WARNING_TRAP); |
759 | dump_stack(); | 759 | dump_stack(); |
760 | return 1; | 760 | return 1; |
761 | } | 761 | } |
762 | #ifdef CONFIG_XMON | 762 | #ifdef CONFIG_XMON |
763 | xmon_printf(KERN_CRIT "kernel BUG in %s at %s:%d!\n", | 763 | xmon_printf(KERN_CRIT "kernel BUG in %s at %s:%ld!\n", |
764 | bug->function, bug->file, bug->line); | 764 | bug->function, bug->file, bug->line); |
765 | xmon(regs); | 765 | xmon(regs); |
766 | #endif /* CONFIG_XMON */ | 766 | #endif /* CONFIG_XMON */ |
767 | printk(KERN_CRIT "kernel BUG in %s at %s:%d!\n", | 767 | printk(KERN_CRIT "kernel BUG in %s at %s:%ld!\n", |
768 | bug->function, bug->file, bug->line); | 768 | bug->function, bug->file, bug->line); |
769 | 769 | ||
770 | return 0; | 770 | return 0; |
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile index e6b2be3bcec1..34f5c2e074c9 100644 --- a/arch/powerpc/lib/Makefile +++ b/arch/powerpc/lib/Makefile | |||
@@ -3,13 +3,14 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | ifeq ($(CONFIG_PPC_MERGE),y) | 5 | ifeq ($(CONFIG_PPC_MERGE),y) |
6 | obj-y := string.o | 6 | obj-y := string.o strcase.o |
7 | obj-$(CONFIG_PPC32) += div64.o copy_32.o checksum_32.o | ||
7 | endif | 8 | endif |
8 | 9 | ||
9 | obj-y += strcase.o | 10 | obj-y += bitops.o |
10 | obj-$(CONFIG_PPC32) += div64.o copy_32.o checksum_32.o | ||
11 | obj-$(CONFIG_PPC64) += checksum_64.o copypage_64.o copyuser_64.o \ | 11 | obj-$(CONFIG_PPC64) += checksum_64.o copypage_64.o copyuser_64.o \ |
12 | memcpy_64.o usercopy_64.o mem_64.o | 12 | memcpy_64.o usercopy_64.o mem_64.o string.o \ |
13 | strcase.o | ||
13 | obj-$(CONFIG_PPC_ISERIES) += e2a.o | 14 | obj-$(CONFIG_PPC_ISERIES) += e2a.o |
14 | obj-$(CONFIG_XMON) += sstep.o | 15 | obj-$(CONFIG_XMON) += sstep.o |
15 | 16 | ||
diff --git a/arch/ppc64/kernel/bitops.c b/arch/powerpc/lib/bitops.c index ae329e8b4acb..b67ce3004ebf 100644 --- a/arch/ppc64/kernel/bitops.c +++ b/arch/powerpc/lib/bitops.c | |||
@@ -1,93 +1,97 @@ | |||
1 | /* | 1 | #include <linux/types.h> |
2 | * These are too big to be inlined. | ||
3 | */ | ||
4 | |||
5 | #include <linux/kernel.h> | ||
6 | #include <linux/module.h> | 2 | #include <linux/module.h> |
7 | #include <linux/bitops.h> | ||
8 | #include <asm/byteorder.h> | 3 | #include <asm/byteorder.h> |
4 | #include <asm/bitops.h> | ||
9 | 5 | ||
10 | unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size, | 6 | /** |
11 | unsigned long offset) | 7 | * find_next_bit - find the next set bit in a memory region |
8 | * @addr: The address to base the search on | ||
9 | * @offset: The bitnumber to start searching at | ||
10 | * @size: The maximum size to search | ||
11 | */ | ||
12 | unsigned long find_next_bit(const unsigned long *addr, unsigned long size, | ||
13 | unsigned long offset) | ||
12 | { | 14 | { |
13 | const unsigned long *p = addr + (offset >> 6); | 15 | const unsigned long *p = addr + BITOP_WORD(offset); |
14 | unsigned long result = offset & ~63UL; | 16 | unsigned long result = offset & ~(BITS_PER_LONG-1); |
15 | unsigned long tmp; | 17 | unsigned long tmp; |
16 | 18 | ||
17 | if (offset >= size) | 19 | if (offset >= size) |
18 | return size; | 20 | return size; |
19 | size -= result; | 21 | size -= result; |
20 | offset &= 63UL; | 22 | offset %= BITS_PER_LONG; |
21 | if (offset) { | 23 | if (offset) { |
22 | tmp = *(p++); | 24 | tmp = *(p++); |
23 | tmp |= ~0UL >> (64 - offset); | 25 | tmp &= (~0UL << offset); |
24 | if (size < 64) | 26 | if (size < BITS_PER_LONG) |
25 | goto found_first; | 27 | goto found_first; |
26 | if (~tmp) | 28 | if (tmp) |
27 | goto found_middle; | 29 | goto found_middle; |
28 | size -= 64; | 30 | size -= BITS_PER_LONG; |
29 | result += 64; | 31 | result += BITS_PER_LONG; |
30 | } | 32 | } |
31 | while (size & ~63UL) { | 33 | while (size & ~(BITS_PER_LONG-1)) { |
32 | if (~(tmp = *(p++))) | 34 | if ((tmp = *(p++))) |
33 | goto found_middle; | 35 | goto found_middle; |
34 | result += 64; | 36 | result += BITS_PER_LONG; |
35 | size -= 64; | 37 | size -= BITS_PER_LONG; |
36 | } | 38 | } |
37 | if (!size) | 39 | if (!size) |
38 | return result; | 40 | return result; |
39 | tmp = *p; | 41 | tmp = *p; |
40 | 42 | ||
41 | found_first: | 43 | found_first: |
42 | tmp |= ~0UL << size; | 44 | tmp &= (~0UL >> (64 - size)); |
43 | if (tmp == ~0UL) /* Are any bits zero? */ | 45 | if (tmp == 0UL) /* Are any bits set? */ |
44 | return result + size; /* Nope. */ | 46 | return result + size; /* Nope. */ |
45 | found_middle: | 47 | found_middle: |
46 | return result + ffz(tmp); | 48 | return result + __ffs(tmp); |
47 | } | 49 | } |
50 | EXPORT_SYMBOL(find_next_bit); | ||
48 | 51 | ||
49 | EXPORT_SYMBOL(find_next_zero_bit); | 52 | /* |
50 | 53 | * This implementation of find_{first,next}_zero_bit was stolen from | |
51 | unsigned long find_next_bit(const unsigned long *addr, unsigned long size, | 54 | * Linus' asm-alpha/bitops.h. |
52 | unsigned long offset) | 55 | */ |
56 | unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size, | ||
57 | unsigned long offset) | ||
53 | { | 58 | { |
54 | const unsigned long *p = addr + (offset >> 6); | 59 | const unsigned long *p = addr + BITOP_WORD(offset); |
55 | unsigned long result = offset & ~63UL; | 60 | unsigned long result = offset & ~(BITS_PER_LONG-1); |
56 | unsigned long tmp; | 61 | unsigned long tmp; |
57 | 62 | ||
58 | if (offset >= size) | 63 | if (offset >= size) |
59 | return size; | 64 | return size; |
60 | size -= result; | 65 | size -= result; |
61 | offset &= 63UL; | 66 | offset %= BITS_PER_LONG; |
62 | if (offset) { | 67 | if (offset) { |
63 | tmp = *(p++); | 68 | tmp = *(p++); |
64 | tmp &= (~0UL << offset); | 69 | tmp |= ~0UL >> (BITS_PER_LONG - offset); |
65 | if (size < 64) | 70 | if (size < BITS_PER_LONG) |
66 | goto found_first; | 71 | goto found_first; |
67 | if (tmp) | 72 | if (~tmp) |
68 | goto found_middle; | 73 | goto found_middle; |
69 | size -= 64; | 74 | size -= BITS_PER_LONG; |
70 | result += 64; | 75 | result += BITS_PER_LONG; |
71 | } | 76 | } |
72 | while (size & ~63UL) { | 77 | while (size & ~(BITS_PER_LONG-1)) { |
73 | if ((tmp = *(p++))) | 78 | if (~(tmp = *(p++))) |
74 | goto found_middle; | 79 | goto found_middle; |
75 | result += 64; | 80 | result += BITS_PER_LONG; |
76 | size -= 64; | 81 | size -= BITS_PER_LONG; |
77 | } | 82 | } |
78 | if (!size) | 83 | if (!size) |
79 | return result; | 84 | return result; |
80 | tmp = *p; | 85 | tmp = *p; |
81 | 86 | ||
82 | found_first: | 87 | found_first: |
83 | tmp &= (~0UL >> (64 - size)); | 88 | tmp |= ~0UL << size; |
84 | if (tmp == 0UL) /* Are any bits set? */ | 89 | if (tmp == ~0UL) /* Are any bits zero? */ |
85 | return result + size; /* Nope. */ | 90 | return result + size; /* Nope. */ |
86 | found_middle: | 91 | found_middle: |
87 | return result + __ffs(tmp); | 92 | return result + ffz(tmp); |
88 | } | 93 | } |
89 | 94 | EXPORT_SYMBOL(find_next_zero_bit); | |
90 | EXPORT_SYMBOL(find_next_bit); | ||
91 | 95 | ||
92 | static inline unsigned int ext2_ilog2(unsigned int x) | 96 | static inline unsigned int ext2_ilog2(unsigned int x) |
93 | { | 97 | { |
@@ -106,8 +110,8 @@ static inline unsigned int ext2_ffz(unsigned int x) | |||
106 | return rc; | 110 | return rc; |
107 | } | 111 | } |
108 | 112 | ||
109 | unsigned long find_next_zero_le_bit(const unsigned long *addr, unsigned long size, | 113 | unsigned long find_next_zero_le_bit(const unsigned long *addr, |
110 | unsigned long offset) | 114 | unsigned long size, unsigned long offset) |
111 | { | 115 | { |
112 | const unsigned int *p = ((const unsigned int *)addr) + (offset >> 5); | 116 | const unsigned int *p = ((const unsigned int *)addr) + (offset >> 5); |
113 | unsigned int result = offset & ~31; | 117 | unsigned int result = offset & ~31; |
@@ -143,5 +147,4 @@ found_first: | |||
143 | found_middle: | 147 | found_middle: |
144 | return result + ext2_ffz(tmp); | 148 | return result + ext2_ffz(tmp); |
145 | } | 149 | } |
146 | |||
147 | EXPORT_SYMBOL(find_next_zero_le_bit); | 150 | EXPORT_SYMBOL(find_next_zero_le_bit); |
diff --git a/arch/powerpc/platforms/Makefile b/arch/powerpc/platforms/Makefile index 172c0db63504..8836b3a00668 100644 --- a/arch/powerpc/platforms/Makefile +++ b/arch/powerpc/platforms/Makefile | |||
@@ -11,3 +11,4 @@ obj-$(CONFIG_85xx) += 85xx/ | |||
11 | obj-$(CONFIG_PPC_PSERIES) += pseries/ | 11 | obj-$(CONFIG_PPC_PSERIES) += pseries/ |
12 | obj-$(CONFIG_PPC_ISERIES) += iseries/ | 12 | obj-$(CONFIG_PPC_ISERIES) += iseries/ |
13 | obj-$(CONFIG_PPC_MAPLE) += maple/ | 13 | obj-$(CONFIG_PPC_MAPLE) += maple/ |
14 | obj-$(CONFIG_PPC_CELL) += cell/ | ||
diff --git a/arch/powerpc/platforms/cell/Makefile b/arch/powerpc/platforms/cell/Makefile new file mode 100644 index 000000000000..55e094b96bc0 --- /dev/null +++ b/arch/powerpc/platforms/cell/Makefile | |||
@@ -0,0 +1,2 @@ | |||
1 | obj-y += interrupt.o iommu.o setup.o spider-pic.o | ||
2 | obj-$(CONFIG_SMP) += smp.o | ||
diff --git a/arch/ppc64/kernel/bpa_iic.c b/arch/powerpc/platforms/cell/interrupt.c index 0aaa878e19d3..7fbe78a9327d 100644 --- a/arch/ppc64/kernel/bpa_iic.c +++ b/arch/powerpc/platforms/cell/interrupt.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * BPA Internal Interrupt Controller | 2 | * Cell Internal Interrupt Controller |
3 | * | 3 | * |
4 | * (C) Copyright IBM Deutschland Entwicklung GmbH 2005 | 4 | * (C) Copyright IBM Deutschland Entwicklung GmbH 2005 |
5 | * | 5 | * |
@@ -31,7 +31,7 @@ | |||
31 | #include <asm/prom.h> | 31 | #include <asm/prom.h> |
32 | #include <asm/ptrace.h> | 32 | #include <asm/ptrace.h> |
33 | 33 | ||
34 | #include "bpa_iic.h" | 34 | #include "interrupt.h" |
35 | 35 | ||
36 | struct iic_pending_bits { | 36 | struct iic_pending_bits { |
37 | u32 data; | 37 | u32 data; |
@@ -89,7 +89,7 @@ static void iic_end(unsigned int irq) | |||
89 | } | 89 | } |
90 | 90 | ||
91 | static struct hw_interrupt_type iic_pic = { | 91 | static struct hw_interrupt_type iic_pic = { |
92 | .typename = " BPA-IIC ", | 92 | .typename = " CELL-IIC ", |
93 | .startup = iic_startup, | 93 | .startup = iic_startup, |
94 | .enable = iic_enable, | 94 | .enable = iic_enable, |
95 | .disable = iic_disable, | 95 | .disable = iic_disable, |
@@ -106,7 +106,7 @@ static int iic_external_get_irq(struct iic_pending_bits pending) | |||
106 | irq = -1; | 106 | irq = -1; |
107 | 107 | ||
108 | /* | 108 | /* |
109 | * This mapping is specific to the Broadband | 109 | * This mapping is specific to the Cell Broadband |
110 | * Engine. We might need to get the numbers | 110 | * Engine. We might need to get the numbers |
111 | * from the device tree to support future CPUs. | 111 | * from the device tree to support future CPUs. |
112 | */ | 112 | */ |
diff --git a/arch/ppc64/kernel/bpa_iic.h b/arch/powerpc/platforms/cell/interrupt.h index 6833c3022166..37d58e6fd0c6 100644 --- a/arch/ppc64/kernel/bpa_iic.h +++ b/arch/powerpc/platforms/cell/interrupt.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef ASM_BPA_IIC_H | 1 | #ifndef ASM_CELL_PIC_H |
2 | #define ASM_BPA_IIC_H | 2 | #define ASM_CELL_PIC_H |
3 | #ifdef __KERNEL__ | 3 | #ifdef __KERNEL__ |
4 | /* | 4 | /* |
5 | * Mapping of IIC pending bits into per-node | 5 | * Mapping of IIC pending bits into per-node |
@@ -21,7 +21,7 @@ | |||
21 | * + node number | 21 | * + node number |
22 | * * don't care | 22 | * * don't care |
23 | * | 23 | * |
24 | * A node consists of a Broadband Engine and an optional | 24 | * A node consists of a Cell Broadband Engine and an optional |
25 | * south bridge device providing a maximum of 64 IRQs. | 25 | * south bridge device providing a maximum of 64 IRQs. |
26 | * The south bridge may be connected to either IOIF0 | 26 | * The south bridge may be connected to either IOIF0 |
27 | * or IOIF1. | 27 | * or IOIF1. |
@@ -59,4 +59,4 @@ extern void spider_init_IRQ(void); | |||
59 | extern int spider_get_irq(unsigned long int_pending); | 59 | extern int spider_get_irq(unsigned long int_pending); |
60 | 60 | ||
61 | #endif | 61 | #endif |
62 | #endif /* ASM_BPA_IIC_H */ | 62 | #endif /* ASM_CELL_PIC_H */ |
diff --git a/arch/ppc64/kernel/bpa_iommu.c b/arch/powerpc/platforms/cell/iommu.c index da1b4b7a3269..74f999b4ac9e 100644 --- a/arch/ppc64/kernel/bpa_iommu.c +++ b/arch/powerpc/platforms/cell/iommu.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * IOMMU implementation for Broadband Processor Architecture | 2 | * IOMMU implementation for Cell Broadband Processor Architecture |
3 | * We just establish a linear mapping at boot by setting all the | 3 | * We just establish a linear mapping at boot by setting all the |
4 | * IOPT cache entries in the CPU. | 4 | * IOPT cache entries in the CPU. |
5 | * The mapping functions should be identical to pci_direct_iommu, | 5 | * The mapping functions should be identical to pci_direct_iommu, |
@@ -41,7 +41,7 @@ | |||
41 | #include <asm/system.h> | 41 | #include <asm/system.h> |
42 | #include <asm/ppc-pci.h> | 42 | #include <asm/ppc-pci.h> |
43 | 43 | ||
44 | #include "bpa_iommu.h" | 44 | #include "iommu.h" |
45 | 45 | ||
46 | static inline unsigned long | 46 | static inline unsigned long |
47 | get_iopt_entry(unsigned long real_address, unsigned long ioid, | 47 | get_iopt_entry(unsigned long real_address, unsigned long ioid, |
@@ -276,7 +276,7 @@ static void iommu_dev_setup_null(struct pci_dev *d) { } | |||
276 | * for each DMA window used by any device. For now, we | 276 | * for each DMA window used by any device. For now, we |
277 | * happen to know that there is only one DMA window in use, | 277 | * happen to know that there is only one DMA window in use, |
278 | * starting at iopt_phys_offset. */ | 278 | * starting at iopt_phys_offset. */ |
279 | static void bpa_map_iommu(void) | 279 | static void cell_map_iommu(void) |
280 | { | 280 | { |
281 | unsigned long address; | 281 | unsigned long address; |
282 | void __iomem *base; | 282 | void __iomem *base; |
@@ -309,7 +309,7 @@ static void bpa_map_iommu(void) | |||
309 | } | 309 | } |
310 | 310 | ||
311 | 311 | ||
312 | static void *bpa_alloc_coherent(struct device *hwdev, size_t size, | 312 | static void *cell_alloc_coherent(struct device *hwdev, size_t size, |
313 | dma_addr_t *dma_handle, gfp_t flag) | 313 | dma_addr_t *dma_handle, gfp_t flag) |
314 | { | 314 | { |
315 | void *ret; | 315 | void *ret; |
@@ -317,65 +317,65 @@ static void *bpa_alloc_coherent(struct device *hwdev, size_t size, | |||
317 | ret = (void *)__get_free_pages(flag, get_order(size)); | 317 | ret = (void *)__get_free_pages(flag, get_order(size)); |
318 | if (ret != NULL) { | 318 | if (ret != NULL) { |
319 | memset(ret, 0, size); | 319 | memset(ret, 0, size); |
320 | *dma_handle = virt_to_abs(ret) | BPA_DMA_VALID; | 320 | *dma_handle = virt_to_abs(ret) | CELL_DMA_VALID; |
321 | } | 321 | } |
322 | return ret; | 322 | return ret; |
323 | } | 323 | } |
324 | 324 | ||
325 | static void bpa_free_coherent(struct device *hwdev, size_t size, | 325 | static void cell_free_coherent(struct device *hwdev, size_t size, |
326 | void *vaddr, dma_addr_t dma_handle) | 326 | void *vaddr, dma_addr_t dma_handle) |
327 | { | 327 | { |
328 | free_pages((unsigned long)vaddr, get_order(size)); | 328 | free_pages((unsigned long)vaddr, get_order(size)); |
329 | } | 329 | } |
330 | 330 | ||
331 | static dma_addr_t bpa_map_single(struct device *hwdev, void *ptr, | 331 | static dma_addr_t cell_map_single(struct device *hwdev, void *ptr, |
332 | size_t size, enum dma_data_direction direction) | 332 | size_t size, enum dma_data_direction direction) |
333 | { | 333 | { |
334 | return virt_to_abs(ptr) | BPA_DMA_VALID; | 334 | return virt_to_abs(ptr) | CELL_DMA_VALID; |
335 | } | 335 | } |
336 | 336 | ||
337 | static void bpa_unmap_single(struct device *hwdev, dma_addr_t dma_addr, | 337 | static void cell_unmap_single(struct device *hwdev, dma_addr_t dma_addr, |
338 | size_t size, enum dma_data_direction direction) | 338 | size_t size, enum dma_data_direction direction) |
339 | { | 339 | { |
340 | } | 340 | } |
341 | 341 | ||
342 | static int bpa_map_sg(struct device *hwdev, struct scatterlist *sg, | 342 | static int cell_map_sg(struct device *hwdev, struct scatterlist *sg, |
343 | int nents, enum dma_data_direction direction) | 343 | int nents, enum dma_data_direction direction) |
344 | { | 344 | { |
345 | int i; | 345 | int i; |
346 | 346 | ||
347 | for (i = 0; i < nents; i++, sg++) { | 347 | for (i = 0; i < nents; i++, sg++) { |
348 | sg->dma_address = (page_to_phys(sg->page) + sg->offset) | 348 | sg->dma_address = (page_to_phys(sg->page) + sg->offset) |
349 | | BPA_DMA_VALID; | 349 | | CELL_DMA_VALID; |
350 | sg->dma_length = sg->length; | 350 | sg->dma_length = sg->length; |
351 | } | 351 | } |
352 | 352 | ||
353 | return nents; | 353 | return nents; |
354 | } | 354 | } |
355 | 355 | ||
356 | static void bpa_unmap_sg(struct device *hwdev, struct scatterlist *sg, | 356 | static void cell_unmap_sg(struct device *hwdev, struct scatterlist *sg, |
357 | int nents, enum dma_data_direction direction) | 357 | int nents, enum dma_data_direction direction) |
358 | { | 358 | { |
359 | } | 359 | } |
360 | 360 | ||
361 | static int bpa_dma_supported(struct device *dev, u64 mask) | 361 | static int cell_dma_supported(struct device *dev, u64 mask) |
362 | { | 362 | { |
363 | return mask < 0x100000000ull; | 363 | return mask < 0x100000000ull; |
364 | } | 364 | } |
365 | 365 | ||
366 | void bpa_init_iommu(void) | 366 | void cell_init_iommu(void) |
367 | { | 367 | { |
368 | bpa_map_iommu(); | 368 | cell_map_iommu(); |
369 | 369 | ||
370 | /* Direct I/O, IOMMU off */ | 370 | /* Direct I/O, IOMMU off */ |
371 | ppc_md.iommu_dev_setup = iommu_dev_setup_null; | 371 | ppc_md.iommu_dev_setup = iommu_dev_setup_null; |
372 | ppc_md.iommu_bus_setup = iommu_bus_setup_null; | 372 | ppc_md.iommu_bus_setup = iommu_bus_setup_null; |
373 | 373 | ||
374 | pci_dma_ops.alloc_coherent = bpa_alloc_coherent; | 374 | pci_dma_ops.alloc_coherent = cell_alloc_coherent; |
375 | pci_dma_ops.free_coherent = bpa_free_coherent; | 375 | pci_dma_ops.free_coherent = cell_free_coherent; |
376 | pci_dma_ops.map_single = bpa_map_single; | 376 | pci_dma_ops.map_single = cell_map_single; |
377 | pci_dma_ops.unmap_single = bpa_unmap_single; | 377 | pci_dma_ops.unmap_single = cell_unmap_single; |
378 | pci_dma_ops.map_sg = bpa_map_sg; | 378 | pci_dma_ops.map_sg = cell_map_sg; |
379 | pci_dma_ops.unmap_sg = bpa_unmap_sg; | 379 | pci_dma_ops.unmap_sg = cell_unmap_sg; |
380 | pci_dma_ops.dma_supported = bpa_dma_supported; | 380 | pci_dma_ops.dma_supported = cell_dma_supported; |
381 | } | 381 | } |
diff --git a/arch/ppc64/kernel/bpa_iommu.h b/arch/powerpc/platforms/cell/iommu.h index e547d77dfa04..490d77abfe85 100644 --- a/arch/ppc64/kernel/bpa_iommu.h +++ b/arch/powerpc/platforms/cell/iommu.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef BPA_IOMMU_H | 1 | #ifndef CELL_IOMMU_H |
2 | #define BPA_IOMMU_H | 2 | #define CELL_IOMMU_H |
3 | 3 | ||
4 | /* some constants */ | 4 | /* some constants */ |
5 | enum { | 5 | enum { |
@@ -55,11 +55,11 @@ enum { | |||
55 | 55 | ||
56 | /* The high bit needs to be set on every DMA address, | 56 | /* The high bit needs to be set on every DMA address, |
57 | only 2GB are addressable */ | 57 | only 2GB are addressable */ |
58 | BPA_DMA_VALID = 0x80000000, | 58 | CELL_DMA_VALID = 0x80000000, |
59 | BPA_DMA_MASK = 0x7fffffff, | 59 | CELL_DMA_MASK = 0x7fffffff, |
60 | }; | 60 | }; |
61 | 61 | ||
62 | 62 | ||
63 | void bpa_init_iommu(void); | 63 | void cell_init_iommu(void); |
64 | 64 | ||
65 | #endif | 65 | #endif |
diff --git a/arch/ppc64/kernel/bpa_setup.c b/arch/powerpc/platforms/cell/setup.c index c2dc8f282eb8..9a495634d0c2 100644 --- a/arch/ppc64/kernel/bpa_setup.c +++ b/arch/powerpc/platforms/cell/setup.c | |||
@@ -1,11 +1,11 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/ppc/kernel/bpa_setup.c | 2 | * linux/arch/powerpc/platforms/cell/cell_setup.c |
3 | * | 3 | * |
4 | * Copyright (C) 1995 Linus Torvalds | 4 | * Copyright (C) 1995 Linus Torvalds |
5 | * Adapted from 'alpha' version by Gary Thomas | 5 | * Adapted from 'alpha' version by Gary Thomas |
6 | * Modified by Cort Dougan (cort@cs.nmt.edu) | 6 | * Modified by Cort Dougan (cort@cs.nmt.edu) |
7 | * Modified by PPC64 Team, IBM Corp | 7 | * Modified by PPC64 Team, IBM Corp |
8 | * Modified by BPA Team, IBM Deutschland Entwicklung GmbH | 8 | * Modified by Cell Team, IBM Deutschland Entwicklung GmbH |
9 | * | 9 | * |
10 | * This program is free software; you can redistribute it and/or | 10 | * This program is free software; you can redistribute it and/or |
11 | * modify it under the terms of the GNU General Public License | 11 | * modify it under the terms of the GNU General Public License |
@@ -46,8 +46,8 @@ | |||
46 | #include <asm/ppc-pci.h> | 46 | #include <asm/ppc-pci.h> |
47 | #include <asm/irq.h> | 47 | #include <asm/irq.h> |
48 | 48 | ||
49 | #include "bpa_iic.h" | 49 | #include "interrupt.h" |
50 | #include "bpa_iommu.h" | 50 | #include "iommu.h" |
51 | 51 | ||
52 | #ifdef DEBUG | 52 | #ifdef DEBUG |
53 | #define DBG(fmt...) udbg_printf(fmt) | 53 | #define DBG(fmt...) udbg_printf(fmt) |
@@ -55,7 +55,7 @@ | |||
55 | #define DBG(fmt...) | 55 | #define DBG(fmt...) |
56 | #endif | 56 | #endif |
57 | 57 | ||
58 | void bpa_show_cpuinfo(struct seq_file *m) | 58 | void cell_show_cpuinfo(struct seq_file *m) |
59 | { | 59 | { |
60 | struct device_node *root; | 60 | struct device_node *root; |
61 | const char *model = ""; | 61 | const char *model = ""; |
@@ -63,22 +63,22 @@ void bpa_show_cpuinfo(struct seq_file *m) | |||
63 | root = of_find_node_by_path("/"); | 63 | root = of_find_node_by_path("/"); |
64 | if (root) | 64 | if (root) |
65 | model = get_property(root, "model", NULL); | 65 | model = get_property(root, "model", NULL); |
66 | seq_printf(m, "machine\t\t: BPA %s\n", model); | 66 | seq_printf(m, "machine\t\t: CHRP %s\n", model); |
67 | of_node_put(root); | 67 | of_node_put(root); |
68 | } | 68 | } |
69 | 69 | ||
70 | static void bpa_progress(char *s, unsigned short hex) | 70 | static void cell_progress(char *s, unsigned short hex) |
71 | { | 71 | { |
72 | printk("*** %04x : %s\n", hex, s ? s : ""); | 72 | printk("*** %04x : %s\n", hex, s ? s : ""); |
73 | } | 73 | } |
74 | 74 | ||
75 | static void __init bpa_setup_arch(void) | 75 | static void __init cell_setup_arch(void) |
76 | { | 76 | { |
77 | ppc_md.init_IRQ = iic_init_IRQ; | 77 | ppc_md.init_IRQ = iic_init_IRQ; |
78 | ppc_md.get_irq = iic_get_irq; | 78 | ppc_md.get_irq = iic_get_irq; |
79 | 79 | ||
80 | #ifdef CONFIG_SMP | 80 | #ifdef CONFIG_SMP |
81 | smp_init_pSeries(); | 81 | smp_init_cell(); |
82 | #endif | 82 | #endif |
83 | 83 | ||
84 | /* init to some ~sane value until calibrate_delay() runs */ | 84 | /* init to some ~sane value until calibrate_delay() runs */ |
@@ -97,39 +97,39 @@ static void __init bpa_setup_arch(void) | |||
97 | conswitchp = &dummy_con; | 97 | conswitchp = &dummy_con; |
98 | #endif | 98 | #endif |
99 | 99 | ||
100 | bpa_nvram_init(); | 100 | mmio_nvram_init(); |
101 | } | 101 | } |
102 | 102 | ||
103 | /* | 103 | /* |
104 | * Early initialization. Relocation is on but do not reference unbolted pages | 104 | * Early initialization. Relocation is on but do not reference unbolted pages |
105 | */ | 105 | */ |
106 | static void __init bpa_init_early(void) | 106 | static void __init cell_init_early(void) |
107 | { | 107 | { |
108 | DBG(" -> bpa_init_early()\n"); | 108 | DBG(" -> cell_init_early()\n"); |
109 | 109 | ||
110 | hpte_init_native(); | 110 | hpte_init_native(); |
111 | 111 | ||
112 | bpa_init_iommu(); | 112 | cell_init_iommu(); |
113 | 113 | ||
114 | ppc64_interrupt_controller = IC_BPA_IIC; | 114 | ppc64_interrupt_controller = IC_CELL_PIC; |
115 | 115 | ||
116 | DBG(" <- bpa_init_early()\n"); | 116 | DBG(" <- cell_init_early()\n"); |
117 | } | 117 | } |
118 | 118 | ||
119 | 119 | ||
120 | static int __init bpa_probe(int platform) | 120 | static int __init cell_probe(int platform) |
121 | { | 121 | { |
122 | if (platform != PLATFORM_BPA) | 122 | if (platform != PLATFORM_CELL) |
123 | return 0; | 123 | return 0; |
124 | 124 | ||
125 | return 1; | 125 | return 1; |
126 | } | 126 | } |
127 | 127 | ||
128 | struct machdep_calls __initdata bpa_md = { | 128 | struct machdep_calls __initdata cell_md = { |
129 | .probe = bpa_probe, | 129 | .probe = cell_probe, |
130 | .setup_arch = bpa_setup_arch, | 130 | .setup_arch = cell_setup_arch, |
131 | .init_early = bpa_init_early, | 131 | .init_early = cell_init_early, |
132 | .show_cpuinfo = bpa_show_cpuinfo, | 132 | .show_cpuinfo = cell_show_cpuinfo, |
133 | .restart = rtas_restart, | 133 | .restart = rtas_restart, |
134 | .power_off = rtas_power_off, | 134 | .power_off = rtas_power_off, |
135 | .halt = rtas_halt, | 135 | .halt = rtas_halt, |
@@ -137,5 +137,5 @@ struct machdep_calls __initdata bpa_md = { | |||
137 | .get_rtc_time = rtas_get_rtc_time, | 137 | .get_rtc_time = rtas_get_rtc_time, |
138 | .set_rtc_time = rtas_set_rtc_time, | 138 | .set_rtc_time = rtas_set_rtc_time, |
139 | .calibrate_decr = generic_calibrate_decr, | 139 | .calibrate_decr = generic_calibrate_decr, |
140 | .progress = bpa_progress, | 140 | .progress = cell_progress, |
141 | }; | 141 | }; |
diff --git a/arch/powerpc/platforms/cell/smp.c b/arch/powerpc/platforms/cell/smp.c new file mode 100644 index 000000000000..de96eadf419d --- /dev/null +++ b/arch/powerpc/platforms/cell/smp.c | |||
@@ -0,0 +1,230 @@ | |||
1 | /* | ||
2 | * SMP support for BPA machines. | ||
3 | * | ||
4 | * Dave Engebretsen, Peter Bergner, and | ||
5 | * Mike Corrigan {engebret|bergner|mikec}@us.ibm.com | ||
6 | * | ||
7 | * Plus various changes from other IBM teams... | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * as published by the Free Software Foundation; either version | ||
12 | * 2 of the License, or (at your option) any later version. | ||
13 | */ | ||
14 | |||
15 | #undef DEBUG | ||
16 | |||
17 | #include <linux/config.h> | ||
18 | #include <linux/kernel.h> | ||
19 | #include <linux/module.h> | ||
20 | #include <linux/sched.h> | ||
21 | #include <linux/smp.h> | ||
22 | #include <linux/interrupt.h> | ||
23 | #include <linux/delay.h> | ||
24 | #include <linux/init.h> | ||
25 | #include <linux/spinlock.h> | ||
26 | #include <linux/cache.h> | ||
27 | #include <linux/err.h> | ||
28 | #include <linux/sysdev.h> | ||
29 | #include <linux/cpu.h> | ||
30 | |||
31 | #include <asm/ptrace.h> | ||
32 | #include <asm/atomic.h> | ||
33 | #include <asm/irq.h> | ||
34 | #include <asm/page.h> | ||
35 | #include <asm/pgtable.h> | ||
36 | #include <asm/io.h> | ||
37 | #include <asm/prom.h> | ||
38 | #include <asm/smp.h> | ||
39 | #include <asm/paca.h> | ||
40 | #include <asm/time.h> | ||
41 | #include <asm/machdep.h> | ||
42 | #include <asm/cputable.h> | ||
43 | #include <asm/firmware.h> | ||
44 | #include <asm/system.h> | ||
45 | #include <asm/rtas.h> | ||
46 | |||
47 | #include "interrupt.h" | ||
48 | |||
49 | #ifdef DEBUG | ||
50 | #define DBG(fmt...) udbg_printf(fmt) | ||
51 | #else | ||
52 | #define DBG(fmt...) | ||
53 | #endif | ||
54 | |||
55 | /* | ||
56 | * The primary thread of each non-boot processor is recorded here before | ||
57 | * smp init. | ||
58 | */ | ||
59 | static cpumask_t of_spin_map; | ||
60 | |||
61 | extern void pSeries_secondary_smp_init(unsigned long); | ||
62 | |||
63 | /** | ||
64 | * smp_startup_cpu() - start the given cpu | ||
65 | * | ||
66 | * At boot time, there is nothing to do for primary threads which were | ||
67 | * started from Open Firmware. For anything else, call RTAS with the | ||
68 | * appropriate start location. | ||
69 | * | ||
70 | * Returns: | ||
71 | * 0 - failure | ||
72 | * 1 - success | ||
73 | */ | ||
74 | static inline int __devinit smp_startup_cpu(unsigned int lcpu) | ||
75 | { | ||
76 | int status; | ||
77 | unsigned long start_here = __pa((u32)*((unsigned long *) | ||
78 | pSeries_secondary_smp_init)); | ||
79 | unsigned int pcpu; | ||
80 | int start_cpu; | ||
81 | |||
82 | if (cpu_isset(lcpu, of_spin_map)) | ||
83 | /* Already started by OF and sitting in spin loop */ | ||
84 | return 1; | ||
85 | |||
86 | pcpu = get_hard_smp_processor_id(lcpu); | ||
87 | |||
88 | /* Fixup atomic count: it exited inside IRQ handler. */ | ||
89 | paca[lcpu].__current->thread_info->preempt_count = 0; | ||
90 | |||
91 | /* | ||
92 | * If the RTAS start-cpu token does not exist then presume the | ||
93 | * cpu is already spinning. | ||
94 | */ | ||
95 | start_cpu = rtas_token("start-cpu"); | ||
96 | if (start_cpu == RTAS_UNKNOWN_SERVICE) | ||
97 | return 1; | ||
98 | |||
99 | status = rtas_call(start_cpu, 3, 1, NULL, pcpu, start_here, lcpu); | ||
100 | if (status != 0) { | ||
101 | printk(KERN_ERR "start-cpu failed: %i\n", status); | ||
102 | return 0; | ||
103 | } | ||
104 | |||
105 | return 1; | ||
106 | } | ||
107 | |||
108 | static void smp_iic_message_pass(int target, int msg) | ||
109 | { | ||
110 | unsigned int i; | ||
111 | |||
112 | if (target < NR_CPUS) { | ||
113 | iic_cause_IPI(target, msg); | ||
114 | } else { | ||
115 | for_each_online_cpu(i) { | ||
116 | if (target == MSG_ALL_BUT_SELF | ||
117 | && i == smp_processor_id()) | ||
118 | continue; | ||
119 | iic_cause_IPI(i, msg); | ||
120 | } | ||
121 | } | ||
122 | } | ||
123 | |||
124 | static int __init smp_iic_probe(void) | ||
125 | { | ||
126 | iic_request_IPIs(); | ||
127 | |||
128 | return cpus_weight(cpu_possible_map); | ||
129 | } | ||
130 | |||
131 | static void __devinit smp_iic_setup_cpu(int cpu) | ||
132 | { | ||
133 | if (cpu != boot_cpuid) | ||
134 | iic_setup_cpu(); | ||
135 | } | ||
136 | |||
137 | static DEFINE_SPINLOCK(timebase_lock); | ||
138 | static unsigned long timebase = 0; | ||
139 | |||
140 | static void __devinit cell_give_timebase(void) | ||
141 | { | ||
142 | spin_lock(&timebase_lock); | ||
143 | rtas_call(rtas_token("freeze-time-base"), 0, 1, NULL); | ||
144 | timebase = get_tb(); | ||
145 | spin_unlock(&timebase_lock); | ||
146 | |||
147 | while (timebase) | ||
148 | barrier(); | ||
149 | rtas_call(rtas_token("thaw-time-base"), 0, 1, NULL); | ||
150 | } | ||
151 | |||
152 | static void __devinit cell_take_timebase(void) | ||
153 | { | ||
154 | while (!timebase) | ||
155 | barrier(); | ||
156 | spin_lock(&timebase_lock); | ||
157 | set_tb(timebase >> 32, timebase & 0xffffffff); | ||
158 | timebase = 0; | ||
159 | spin_unlock(&timebase_lock); | ||
160 | } | ||
161 | |||
162 | static void __devinit smp_cell_kick_cpu(int nr) | ||
163 | { | ||
164 | BUG_ON(nr < 0 || nr >= NR_CPUS); | ||
165 | |||
166 | if (!smp_startup_cpu(nr)) | ||
167 | return; | ||
168 | |||
169 | /* | ||
170 | * The processor is currently spinning, waiting for the | ||
171 | * cpu_start field to become non-zero After we set cpu_start, | ||
172 | * the processor will continue on to secondary_start | ||
173 | */ | ||
174 | paca[nr].cpu_start = 1; | ||
175 | } | ||
176 | |||
177 | static int smp_cell_cpu_bootable(unsigned int nr) | ||
178 | { | ||
179 | /* Special case - we inhibit secondary thread startup | ||
180 | * during boot if the user requests it. Odd-numbered | ||
181 | * cpus are assumed to be secondary threads. | ||
182 | */ | ||
183 | if (system_state < SYSTEM_RUNNING && | ||
184 | cpu_has_feature(CPU_FTR_SMT) && | ||
185 | !smt_enabled_at_boot && nr % 2 != 0) | ||
186 | return 0; | ||
187 | |||
188 | return 1; | ||
189 | } | ||
190 | static struct smp_ops_t bpa_iic_smp_ops = { | ||
191 | .message_pass = smp_iic_message_pass, | ||
192 | .probe = smp_iic_probe, | ||
193 | .kick_cpu = smp_cell_kick_cpu, | ||
194 | .setup_cpu = smp_iic_setup_cpu, | ||
195 | .cpu_bootable = smp_cell_cpu_bootable, | ||
196 | }; | ||
197 | |||
198 | /* This is called very early */ | ||
199 | void __init smp_init_cell(void) | ||
200 | { | ||
201 | int i; | ||
202 | |||
203 | DBG(" -> smp_init_cell()\n"); | ||
204 | |||
205 | smp_ops = &bpa_iic_smp_ops; | ||
206 | |||
207 | /* Mark threads which are still spinning in hold loops. */ | ||
208 | if (cpu_has_feature(CPU_FTR_SMT)) { | ||
209 | for_each_present_cpu(i) { | ||
210 | if (i % 2 == 0) | ||
211 | /* | ||
212 | * Even-numbered logical cpus correspond to | ||
213 | * primary threads. | ||
214 | */ | ||
215 | cpu_set(i, of_spin_map); | ||
216 | } | ||
217 | } else { | ||
218 | of_spin_map = cpu_present_map; | ||
219 | } | ||
220 | |||
221 | cpu_clear(boot_cpuid, of_spin_map); | ||
222 | |||
223 | /* Non-lpar has additional take/give timebase */ | ||
224 | if (rtas_token("freeze-time-base") != RTAS_UNKNOWN_SERVICE) { | ||
225 | smp_ops->give_timebase = cell_give_timebase; | ||
226 | smp_ops->take_timebase = cell_take_timebase; | ||
227 | } | ||
228 | |||
229 | DBG(" <- smp_init_cell()\n"); | ||
230 | } | ||
diff --git a/arch/ppc64/kernel/spider-pic.c b/arch/powerpc/platforms/cell/spider-pic.c index d5c9a02fb119..e74132188bdf 100644 --- a/arch/ppc64/kernel/spider-pic.c +++ b/arch/powerpc/platforms/cell/spider-pic.c | |||
@@ -27,7 +27,7 @@ | |||
27 | #include <asm/prom.h> | 27 | #include <asm/prom.h> |
28 | #include <asm/io.h> | 28 | #include <asm/io.h> |
29 | 29 | ||
30 | #include "bpa_iic.h" | 30 | #include "interrupt.h" |
31 | 31 | ||
32 | /* register layout taken from Spider spec, table 7.4-4 */ | 32 | /* register layout taken from Spider spec, table 7.4-4 */ |
33 | enum { | 33 | enum { |
diff --git a/arch/powerpc/platforms/chrp/nvram.c b/arch/powerpc/platforms/chrp/nvram.c index 4ac7125aa09c..65266b46db9b 100644 --- a/arch/powerpc/platforms/chrp/nvram.c +++ b/arch/powerpc/platforms/chrp/nvram.c | |||
@@ -34,7 +34,8 @@ static unsigned char chrp_nvram_read(int addr) | |||
34 | return 0xff; | 34 | return 0xff; |
35 | } | 35 | } |
36 | spin_lock_irqsave(&nvram_lock, flags); | 36 | spin_lock_irqsave(&nvram_lock, flags); |
37 | if ((call_rtas("nvram-fetch", 3, 2, &done, addr, __pa(nvram_buf), 1) != 0) || 1 != done) | 37 | if ((rtas_call(rtas_token("nvram-fetch"), 3, 2, &done, addr, |
38 | __pa(nvram_buf), 1) != 0) || 1 != done) | ||
38 | ret = 0xff; | 39 | ret = 0xff; |
39 | else | 40 | else |
40 | ret = nvram_buf[0]; | 41 | ret = nvram_buf[0]; |
@@ -54,7 +55,8 @@ static void chrp_nvram_write(int addr, unsigned char val) | |||
54 | } | 55 | } |
55 | spin_lock_irqsave(&nvram_lock, flags); | 56 | spin_lock_irqsave(&nvram_lock, flags); |
56 | nvram_buf[0] = val; | 57 | nvram_buf[0] = val; |
57 | if ((call_rtas("nvram-store", 3, 2, &done, addr, __pa(nvram_buf), 1) != 0) || 1 != done) | 58 | if ((rtas_call(rtas_token("nvram-store"), 3, 2, &done, addr, |
59 | __pa(nvram_buf), 1) != 0) || 1 != done) | ||
58 | printk(KERN_DEBUG "rtas IO error storing 0x%02x at %d", val, addr); | 60 | printk(KERN_DEBUG "rtas IO error storing 0x%02x at %d", val, addr); |
59 | spin_unlock_irqrestore(&nvram_lock, flags); | 61 | spin_unlock_irqrestore(&nvram_lock, flags); |
60 | } | 62 | } |
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c index d955e950a74c..8e5ef62715bb 100644 --- a/arch/powerpc/platforms/iseries/setup.c +++ b/arch/powerpc/platforms/iseries/setup.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/kdev_t.h> | 27 | #include <linux/kdev_t.h> |
28 | #include <linux/major.h> | 28 | #include <linux/major.h> |
29 | #include <linux/root_dev.h> | 29 | #include <linux/root_dev.h> |
30 | #include <linux/kernel.h> | ||
30 | 31 | ||
31 | #include <asm/processor.h> | 32 | #include <asm/processor.h> |
32 | #include <asm/machdep.h> | 33 | #include <asm/machdep.h> |
@@ -94,6 +95,8 @@ extern unsigned long iSeries_recal_titan; | |||
94 | 95 | ||
95 | static int mf_initialized; | 96 | static int mf_initialized; |
96 | 97 | ||
98 | static unsigned long cmd_mem_limit; | ||
99 | |||
97 | struct MemoryBlock { | 100 | struct MemoryBlock { |
98 | unsigned long absStart; | 101 | unsigned long absStart; |
99 | unsigned long absEnd; | 102 | unsigned long absEnd; |
@@ -341,23 +344,6 @@ static void __init iSeries_init_early(void) | |||
341 | */ | 344 | */ |
342 | iommu_init_early_iSeries(); | 345 | iommu_init_early_iSeries(); |
343 | 346 | ||
344 | iSeries_get_cmdline(); | ||
345 | |||
346 | /* Save unparsed command line copy for /proc/cmdline */ | ||
347 | strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE); | ||
348 | |||
349 | /* Parse early parameters, in particular mem=x */ | ||
350 | parse_early_param(); | ||
351 | |||
352 | if (memory_limit) { | ||
353 | if (memory_limit < systemcfg->physicalMemorySize) | ||
354 | systemcfg->physicalMemorySize = memory_limit; | ||
355 | else { | ||
356 | printk("Ignoring mem=%lu >= ram_top.\n", memory_limit); | ||
357 | memory_limit = 0; | ||
358 | } | ||
359 | } | ||
360 | |||
361 | /* Initialize machine-dependency vectors */ | 347 | /* Initialize machine-dependency vectors */ |
362 | #ifdef CONFIG_SMP | 348 | #ifdef CONFIG_SMP |
363 | smp_init_iSeries(); | 349 | smp_init_iSeries(); |
@@ -971,6 +957,8 @@ void build_flat_dt(struct iseries_flat_dt *dt) | |||
971 | /* /chosen */ | 957 | /* /chosen */ |
972 | dt_start_node(dt, "chosen"); | 958 | dt_start_node(dt, "chosen"); |
973 | dt_prop_u32(dt, "linux,platform", PLATFORM_ISERIES_LPAR); | 959 | dt_prop_u32(dt, "linux,platform", PLATFORM_ISERIES_LPAR); |
960 | if (cmd_mem_limit) | ||
961 | dt_prop_u64(dt, "linux,memory-limit", cmd_mem_limit); | ||
974 | dt_end_node(dt); | 962 | dt_end_node(dt); |
975 | 963 | ||
976 | dt_cpus(dt); | 964 | dt_cpus(dt); |
@@ -990,7 +978,27 @@ void * __init iSeries_early_setup(void) | |||
990 | */ | 978 | */ |
991 | build_iSeries_Memory_Map(); | 979 | build_iSeries_Memory_Map(); |
992 | 980 | ||
981 | iSeries_get_cmdline(); | ||
982 | |||
983 | /* Save unparsed command line copy for /proc/cmdline */ | ||
984 | strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE); | ||
985 | |||
986 | /* Parse early parameters, in particular mem=x */ | ||
987 | parse_early_param(); | ||
988 | |||
993 | build_flat_dt(&iseries_dt); | 989 | build_flat_dt(&iseries_dt); |
994 | 990 | ||
995 | return (void *) __pa(&iseries_dt); | 991 | return (void *) __pa(&iseries_dt); |
996 | } | 992 | } |
993 | |||
994 | /* | ||
995 | * On iSeries we just parse the mem=X option from the command line. | ||
996 | * On pSeries it's a bit more complicated, see prom_init_mem() | ||
997 | */ | ||
998 | static int __init early_parsemem(char *p) | ||
999 | { | ||
1000 | if (p) | ||
1001 | cmd_mem_limit = ALIGN(memparse(p, &p), PAGE_SIZE); | ||
1002 | return 0; | ||
1003 | } | ||
1004 | early_param("mem", early_parsemem); | ||
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c index 0037a8c8c81f..83a49e80ac29 100644 --- a/arch/powerpc/platforms/powermac/pic.c +++ b/arch/powerpc/platforms/powermac/pic.c | |||
@@ -576,7 +576,7 @@ void __init pmac_pic_init(void) | |||
576 | #endif /* CONFIG_PPC32 */ | 576 | #endif /* CONFIG_PPC32 */ |
577 | } | 577 | } |
578 | 578 | ||
579 | #ifdef CONFIG_PM | 579 | #if defined(CONFIG_PM) && defined(CONFIG_PPC32) |
580 | /* | 580 | /* |
581 | * These procedures are used in implementing sleep on the powerbooks. | 581 | * These procedures are used in implementing sleep on the powerbooks. |
582 | * sleep_save_intrs() saves the states of all interrupt enables | 582 | * sleep_save_intrs() saves the states of all interrupt enables |
@@ -643,7 +643,7 @@ static int pmacpic_resume(struct sys_device *sysdev) | |||
643 | return 0; | 643 | return 0; |
644 | } | 644 | } |
645 | 645 | ||
646 | #endif /* CONFIG_PM */ | 646 | #endif /* CONFIG_PM && CONFIG_PPC32 */ |
647 | 647 | ||
648 | static struct sysdev_class pmacpic_sysclass = { | 648 | static struct sysdev_class pmacpic_sysclass = { |
649 | set_kset_name("pmac_pic"), | 649 | set_kset_name("pmac_pic"), |
@@ -655,10 +655,10 @@ static struct sys_device device_pmacpic = { | |||
655 | }; | 655 | }; |
656 | 656 | ||
657 | static struct sysdev_driver driver_pmacpic = { | 657 | static struct sysdev_driver driver_pmacpic = { |
658 | #ifdef CONFIG_PM | 658 | #if defined(CONFIG_PM) && defined(CONFIG_PPC32) |
659 | .suspend = &pmacpic_suspend, | 659 | .suspend = &pmacpic_suspend, |
660 | .resume = &pmacpic_resume, | 660 | .resume = &pmacpic_resume, |
661 | #endif /* CONFIG_PM */ | 661 | #endif /* CONFIG_PM && CONFIG_PPC32 */ |
662 | }; | 662 | }; |
663 | 663 | ||
664 | static int __init init_pmacpic_sysfs(void) | 664 | static int __init init_pmacpic_sysfs(void) |
diff --git a/arch/powerpc/platforms/pseries/Makefile b/arch/powerpc/platforms/pseries/Makefile index 5ef494e3a70f..91909a844736 100644 --- a/arch/powerpc/platforms/pseries/Makefile +++ b/arch/powerpc/platforms/pseries/Makefile | |||
@@ -1,5 +1,5 @@ | |||
1 | obj-y := pci.o lpar.o hvCall.o nvram.o reconfig.o \ | 1 | obj-y := pci.o lpar.o hvCall.o nvram.o reconfig.o \ |
2 | setup.o iommu.o rtas-fw.o ras.o | 2 | setup.o iommu.o ras.o |
3 | obj-$(CONFIG_SMP) += smp.o | 3 | obj-$(CONFIG_SMP) += smp.o |
4 | obj-$(CONFIG_IBMVIO) += vio.o | 4 | obj-$(CONFIG_IBMVIO) += vio.o |
5 | obj-$(CONFIG_XICS) += xics.o | 5 | obj-$(CONFIG_XICS) += xics.o |
diff --git a/arch/powerpc/platforms/pseries/rtas-fw.h b/arch/powerpc/platforms/pseries/rtas-fw.h deleted file mode 100644 index e70fa69974a3..000000000000 --- a/arch/powerpc/platforms/pseries/rtas-fw.h +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | void rtas_fw_restart(char *cmd); | ||
2 | void rtas_fw_power_off(void); | ||
3 | void rtas_fw_halt(void); | ||
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index 10cb0f2d9b5b..c0a3d918148a 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -67,8 +67,6 @@ | |||
67 | #include <asm/i8259.h> | 67 | #include <asm/i8259.h> |
68 | #include <asm/udbg.h> | 68 | #include <asm/udbg.h> |
69 | 69 | ||
70 | #include "rtas-fw.h" | ||
71 | |||
72 | #ifdef DEBUG | 70 | #ifdef DEBUG |
73 | #define DBG(fmt...) udbg_printf(fmt) | 71 | #define DBG(fmt...) udbg_printf(fmt) |
74 | #else | 72 | #else |
diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile index 8acd21dee05d..6b7efcfc352a 100644 --- a/arch/powerpc/sysdev/Makefile +++ b/arch/powerpc/sysdev/Makefile | |||
@@ -5,3 +5,4 @@ obj-$(CONFIG_PPC_MPC106) += grackle.o | |||
5 | obj-$(CONFIG_BOOKE) += dcr.o | 5 | obj-$(CONFIG_BOOKE) += dcr.o |
6 | obj-$(CONFIG_40x) += dcr.o | 6 | obj-$(CONFIG_40x) += dcr.o |
7 | obj-$(CONFIG_U3_DART) += u3_iommu.o | 7 | obj-$(CONFIG_U3_DART) += u3_iommu.o |
8 | obj-$(CONFIG_MMIO_NVRAM) += mmio_nvram.o | ||
diff --git a/arch/ppc64/kernel/bpa_nvram.c b/arch/powerpc/sysdev/mmio_nvram.c index 06a119cfceb5..74e0d31a3559 100644 --- a/arch/ppc64/kernel/bpa_nvram.c +++ b/arch/powerpc/sysdev/mmio_nvram.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * NVRAM for CPBW | 2 | * memory mapped NVRAM |
3 | * | 3 | * |
4 | * (C) Copyright IBM Corp. 2005 | 4 | * (C) Copyright IBM Corp. 2005 |
5 | * | 5 | * |
@@ -30,54 +30,54 @@ | |||
30 | #include <asm/nvram.h> | 30 | #include <asm/nvram.h> |
31 | #include <asm/prom.h> | 31 | #include <asm/prom.h> |
32 | 32 | ||
33 | static void __iomem *bpa_nvram_start; | 33 | static void __iomem *mmio_nvram_start; |
34 | static long bpa_nvram_len; | 34 | static long mmio_nvram_len; |
35 | static spinlock_t bpa_nvram_lock = SPIN_LOCK_UNLOCKED; | 35 | static spinlock_t mmio_nvram_lock = SPIN_LOCK_UNLOCKED; |
36 | 36 | ||
37 | static ssize_t bpa_nvram_read(char *buf, size_t count, loff_t *index) | 37 | static ssize_t mmio_nvram_read(char *buf, size_t count, loff_t *index) |
38 | { | 38 | { |
39 | unsigned long flags; | 39 | unsigned long flags; |
40 | 40 | ||
41 | if (*index >= bpa_nvram_len) | 41 | if (*index >= mmio_nvram_len) |
42 | return 0; | 42 | return 0; |
43 | if (*index + count > bpa_nvram_len) | 43 | if (*index + count > mmio_nvram_len) |
44 | count = bpa_nvram_len - *index; | 44 | count = mmio_nvram_len - *index; |
45 | 45 | ||
46 | spin_lock_irqsave(&bpa_nvram_lock, flags); | 46 | spin_lock_irqsave(&mmio_nvram_lock, flags); |
47 | 47 | ||
48 | memcpy_fromio(buf, bpa_nvram_start + *index, count); | 48 | memcpy_fromio(buf, mmio_nvram_start + *index, count); |
49 | 49 | ||
50 | spin_unlock_irqrestore(&bpa_nvram_lock, flags); | 50 | spin_unlock_irqrestore(&mmio_nvram_lock, flags); |
51 | 51 | ||
52 | *index += count; | 52 | *index += count; |
53 | return count; | 53 | return count; |
54 | } | 54 | } |
55 | 55 | ||
56 | static ssize_t bpa_nvram_write(char *buf, size_t count, loff_t *index) | 56 | static ssize_t mmio_nvram_write(char *buf, size_t count, loff_t *index) |
57 | { | 57 | { |
58 | unsigned long flags; | 58 | unsigned long flags; |
59 | 59 | ||
60 | if (*index >= bpa_nvram_len) | 60 | if (*index >= mmio_nvram_len) |
61 | return 0; | 61 | return 0; |
62 | if (*index + count > bpa_nvram_len) | 62 | if (*index + count > mmio_nvram_len) |
63 | count = bpa_nvram_len - *index; | 63 | count = mmio_nvram_len - *index; |
64 | 64 | ||
65 | spin_lock_irqsave(&bpa_nvram_lock, flags); | 65 | spin_lock_irqsave(&mmio_nvram_lock, flags); |
66 | 66 | ||
67 | memcpy_toio(bpa_nvram_start + *index, buf, count); | 67 | memcpy_toio(mmio_nvram_start + *index, buf, count); |
68 | 68 | ||
69 | spin_unlock_irqrestore(&bpa_nvram_lock, flags); | 69 | spin_unlock_irqrestore(&mmio_nvram_lock, flags); |
70 | 70 | ||
71 | *index += count; | 71 | *index += count; |
72 | return count; | 72 | return count; |
73 | } | 73 | } |
74 | 74 | ||
75 | static ssize_t bpa_nvram_get_size(void) | 75 | static ssize_t mmio_nvram_get_size(void) |
76 | { | 76 | { |
77 | return bpa_nvram_len; | 77 | return mmio_nvram_len; |
78 | } | 78 | } |
79 | 79 | ||
80 | int __init bpa_nvram_init(void) | 80 | int __init mmio_nvram_init(void) |
81 | { | 81 | { |
82 | struct device_node *nvram_node; | 82 | struct device_node *nvram_node; |
83 | unsigned long *buffer; | 83 | unsigned long *buffer; |
@@ -97,20 +97,20 @@ int __init bpa_nvram_init(void) | |||
97 | 97 | ||
98 | ret = -ENODEV; | 98 | ret = -ENODEV; |
99 | nvram_addr = buffer[0]; | 99 | nvram_addr = buffer[0]; |
100 | bpa_nvram_len = buffer[1]; | 100 | mmio_nvram_len = buffer[1]; |
101 | if ( (!bpa_nvram_len) || (!nvram_addr) ) | 101 | if ( (!mmio_nvram_len) || (!nvram_addr) ) |
102 | goto out; | 102 | goto out; |
103 | 103 | ||
104 | bpa_nvram_start = ioremap(nvram_addr, bpa_nvram_len); | 104 | mmio_nvram_start = ioremap(nvram_addr, mmio_nvram_len); |
105 | if (!bpa_nvram_start) | 105 | if (!mmio_nvram_start) |
106 | goto out; | 106 | goto out; |
107 | 107 | ||
108 | printk(KERN_INFO "BPA NVRAM, %luk mapped to %p\n", | 108 | printk(KERN_INFO "mmio NVRAM, %luk mapped to %p\n", |
109 | bpa_nvram_len >> 10, bpa_nvram_start); | 109 | mmio_nvram_len >> 10, mmio_nvram_start); |
110 | 110 | ||
111 | ppc_md.nvram_read = bpa_nvram_read; | 111 | ppc_md.nvram_read = mmio_nvram_read; |
112 | ppc_md.nvram_write = bpa_nvram_write; | 112 | ppc_md.nvram_write = mmio_nvram_write; |
113 | ppc_md.nvram_size = bpa_nvram_get_size; | 113 | ppc_md.nvram_size = mmio_nvram_get_size; |
114 | 114 | ||
115 | out: | 115 | out: |
116 | of_node_put(nvram_node); | 116 | of_node_put(nvram_node); |
diff --git a/arch/ppc/Makefile b/arch/ppc/Makefile index 94d5716fa7c3..e719a4933af1 100644 --- a/arch/ppc/Makefile +++ b/arch/ppc/Makefile | |||
@@ -66,7 +66,8 @@ head-$(CONFIG_PPC_FPU) += arch/powerpc/kernel/fpu.o | |||
66 | core-y += arch/ppc/kernel/ arch/powerpc/kernel/ \ | 66 | core-y += arch/ppc/kernel/ arch/powerpc/kernel/ \ |
67 | arch/ppc/platforms/ \ | 67 | arch/ppc/platforms/ \ |
68 | arch/ppc/mm/ arch/ppc/lib/ \ | 68 | arch/ppc/mm/ arch/ppc/lib/ \ |
69 | arch/ppc/syslib/ arch/powerpc/sysdev/ | 69 | arch/ppc/syslib/ arch/powerpc/sysdev/ \ |
70 | arch/powerpc/lib/ | ||
70 | core-$(CONFIG_4xx) += arch/ppc/platforms/4xx/ | 71 | core-$(CONFIG_4xx) += arch/ppc/platforms/4xx/ |
71 | core-$(CONFIG_83xx) += arch/ppc/platforms/83xx/ | 72 | core-$(CONFIG_83xx) += arch/ppc/platforms/83xx/ |
72 | core-$(CONFIG_85xx) += arch/ppc/platforms/85xx/ | 73 | core-$(CONFIG_85xx) += arch/ppc/platforms/85xx/ |
diff --git a/arch/ppc/kernel/bitops.c b/arch/ppc/kernel/bitops.c deleted file mode 100644 index 7f53d193968b..000000000000 --- a/arch/ppc/kernel/bitops.c +++ /dev/null | |||
@@ -1,126 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 1996 Paul Mackerras. | ||
3 | */ | ||
4 | |||
5 | #include <linux/kernel.h> | ||
6 | #include <linux/bitops.h> | ||
7 | |||
8 | /* | ||
9 | * If the bitops are not inlined in bitops.h, they are defined here. | ||
10 | * -- paulus | ||
11 | */ | ||
12 | #if !__INLINE_BITOPS | ||
13 | void set_bit(int nr, volatile void * addr) | ||
14 | { | ||
15 | unsigned long old; | ||
16 | unsigned long mask = 1 << (nr & 0x1f); | ||
17 | unsigned long *p = ((unsigned long *)addr) + (nr >> 5); | ||
18 | |||
19 | __asm__ __volatile__(SMP_WMB "\n\ | ||
20 | 1: lwarx %0,0,%3 \n\ | ||
21 | or %0,%0,%2 \n" | ||
22 | PPC405_ERR77(0,%3) | ||
23 | " stwcx. %0,0,%3 \n\ | ||
24 | bne 1b" | ||
25 | SMP_MB | ||
26 | : "=&r" (old), "=m" (*p) | ||
27 | : "r" (mask), "r" (p), "m" (*p) | ||
28 | : "cc" ); | ||
29 | } | ||
30 | |||
31 | void clear_bit(int nr, volatile void *addr) | ||
32 | { | ||
33 | unsigned long old; | ||
34 | unsigned long mask = 1 << (nr & 0x1f); | ||
35 | unsigned long *p = ((unsigned long *)addr) + (nr >> 5); | ||
36 | |||
37 | __asm__ __volatile__(SMP_WMB "\n\ | ||
38 | 1: lwarx %0,0,%3 \n\ | ||
39 | andc %0,%0,%2 \n" | ||
40 | PPC405_ERR77(0,%3) | ||
41 | " stwcx. %0,0,%3 \n\ | ||
42 | bne 1b" | ||
43 | SMP_MB | ||
44 | : "=&r" (old), "=m" (*p) | ||
45 | : "r" (mask), "r" (p), "m" (*p) | ||
46 | : "cc"); | ||
47 | } | ||
48 | |||
49 | void change_bit(int nr, volatile void *addr) | ||
50 | { | ||
51 | unsigned long old; | ||
52 | unsigned long mask = 1 << (nr & 0x1f); | ||
53 | unsigned long *p = ((unsigned long *)addr) + (nr >> 5); | ||
54 | |||
55 | __asm__ __volatile__(SMP_WMB "\n\ | ||
56 | 1: lwarx %0,0,%3 \n\ | ||
57 | xor %0,%0,%2 \n" | ||
58 | PPC405_ERR77(0,%3) | ||
59 | " stwcx. %0,0,%3 \n\ | ||
60 | bne 1b" | ||
61 | SMP_MB | ||
62 | : "=&r" (old), "=m" (*p) | ||
63 | : "r" (mask), "r" (p), "m" (*p) | ||
64 | : "cc"); | ||
65 | } | ||
66 | |||
67 | int test_and_set_bit(int nr, volatile void *addr) | ||
68 | { | ||
69 | unsigned int old, t; | ||
70 | unsigned int mask = 1 << (nr & 0x1f); | ||
71 | volatile unsigned int *p = ((volatile unsigned int *)addr) + (nr >> 5); | ||
72 | |||
73 | __asm__ __volatile__(SMP_WMB "\n\ | ||
74 | 1: lwarx %0,0,%4 \n\ | ||
75 | or %1,%0,%3 \n" | ||
76 | PPC405_ERR77(0,%4) | ||
77 | " stwcx. %1,0,%4 \n\ | ||
78 | bne 1b" | ||
79 | SMP_MB | ||
80 | : "=&r" (old), "=&r" (t), "=m" (*p) | ||
81 | : "r" (mask), "r" (p), "m" (*p) | ||
82 | : "cc"); | ||
83 | |||
84 | return (old & mask) != 0; | ||
85 | } | ||
86 | |||
87 | int test_and_clear_bit(int nr, volatile void *addr) | ||
88 | { | ||
89 | unsigned int old, t; | ||
90 | unsigned int mask = 1 << (nr & 0x1f); | ||
91 | volatile unsigned int *p = ((volatile unsigned int *)addr) + (nr >> 5); | ||
92 | |||
93 | __asm__ __volatile__(SMP_WMB "\n\ | ||
94 | 1: lwarx %0,0,%4 \n\ | ||
95 | andc %1,%0,%3 \n" | ||
96 | PPC405_ERR77(0,%4) | ||
97 | " stwcx. %1,0,%4 \n\ | ||
98 | bne 1b" | ||
99 | SMP_MB | ||
100 | : "=&r" (old), "=&r" (t), "=m" (*p) | ||
101 | : "r" (mask), "r" (p), "m" (*p) | ||
102 | : "cc"); | ||
103 | |||
104 | return (old & mask) != 0; | ||
105 | } | ||
106 | |||
107 | int test_and_change_bit(int nr, volatile void *addr) | ||
108 | { | ||
109 | unsigned int old, t; | ||
110 | unsigned int mask = 1 << (nr & 0x1f); | ||
111 | volatile unsigned int *p = ((volatile unsigned int *)addr) + (nr >> 5); | ||
112 | |||
113 | __asm__ __volatile__(SMP_WMB "\n\ | ||
114 | 1: lwarx %0,0,%4 \n\ | ||
115 | xor %1,%0,%3 \n" | ||
116 | PPC405_ERR77(0,%4) | ||
117 | " stwcx. %1,0,%4 \n\ | ||
118 | bne 1b" | ||
119 | SMP_MB | ||
120 | : "=&r" (old), "=&r" (t), "=m" (*p) | ||
121 | : "r" (mask), "r" (p), "m" (*p) | ||
122 | : "cc"); | ||
123 | |||
124 | return (old & mask) != 0; | ||
125 | } | ||
126 | #endif /* !__INLINE_BITOPS */ | ||
diff --git a/arch/ppc64/Makefile b/arch/ppc64/Makefile index fdbd6f44adc0..a55a82d145d4 100644 --- a/arch/ppc64/Makefile +++ b/arch/ppc64/Makefile | |||
@@ -86,7 +86,6 @@ head-y := arch/ppc64/kernel/head.o | |||
86 | head-y += arch/powerpc/kernel/fpu.o | 86 | head-y += arch/powerpc/kernel/fpu.o |
87 | head-y += arch/powerpc/kernel/entry_64.o | 87 | head-y += arch/powerpc/kernel/entry_64.o |
88 | 88 | ||
89 | libs-y += arch/ppc64/lib/ | ||
90 | core-y += arch/ppc64/kernel/ arch/powerpc/kernel/ | 89 | core-y += arch/ppc64/kernel/ arch/powerpc/kernel/ |
91 | core-y += arch/powerpc/mm/ | 90 | core-y += arch/powerpc/mm/ |
92 | core-y += arch/powerpc/sysdev/ | 91 | core-y += arch/powerpc/sysdev/ |
diff --git a/arch/ppc64/kernel/Makefile b/arch/ppc64/kernel/Makefile index 327c08ce4291..990df0905c87 100644 --- a/arch/ppc64/kernel/Makefile +++ b/arch/ppc64/kernel/Makefile | |||
@@ -13,7 +13,7 @@ endif | |||
13 | 13 | ||
14 | obj-y += irq.o idle.o dma.o \ | 14 | obj-y += irq.o idle.o dma.o \ |
15 | signal.o \ | 15 | signal.o \ |
16 | align.o bitops.o pacaData.o \ | 16 | align.o pacaData.o \ |
17 | udbg.o ioctl32.o \ | 17 | udbg.o ioctl32.o \ |
18 | rtc.o \ | 18 | rtc.o \ |
19 | cpu_setup_power4.o \ | 19 | cpu_setup_power4.o \ |
@@ -31,9 +31,6 @@ endif | |||
31 | 31 | ||
32 | obj-$(CONFIG_PPC_PSERIES) += rtasd.o udbg_16550.o | 32 | obj-$(CONFIG_PPC_PSERIES) += rtasd.o udbg_16550.o |
33 | 33 | ||
34 | obj-$(CONFIG_PPC_BPA) += bpa_setup.o bpa_iommu.o bpa_nvram.o \ | ||
35 | bpa_iic.o spider-pic.o | ||
36 | |||
37 | obj-$(CONFIG_KEXEC) += machine_kexec.o | 34 | obj-$(CONFIG_KEXEC) += machine_kexec.o |
38 | obj-$(CONFIG_EEH) += eeh.o | 35 | obj-$(CONFIG_EEH) += eeh.o |
39 | obj-$(CONFIG_PROC_FS) += proc_ppc64.o | 36 | obj-$(CONFIG_PROC_FS) += proc_ppc64.o |
diff --git a/arch/ppc64/kernel/irq.c b/arch/ppc64/kernel/irq.c index 310931dbd4ae..87474584033f 100644 --- a/arch/ppc64/kernel/irq.c +++ b/arch/ppc64/kernel/irq.c | |||
@@ -392,7 +392,7 @@ int virt_irq_create_mapping(unsigned int real_irq) | |||
392 | if (ppc64_interrupt_controller == IC_OPEN_PIC) | 392 | if (ppc64_interrupt_controller == IC_OPEN_PIC) |
393 | return real_irq; /* no mapping for openpic (for now) */ | 393 | return real_irq; /* no mapping for openpic (for now) */ |
394 | 394 | ||
395 | if (ppc64_interrupt_controller == IC_BPA_IIC) | 395 | if (ppc64_interrupt_controller == IC_CELL_PIC) |
396 | return real_irq; /* no mapping for iic either */ | 396 | return real_irq; /* no mapping for iic either */ |
397 | 397 | ||
398 | /* don't map interrupts < MIN_VIRT_IRQ */ | 398 | /* don't map interrupts < MIN_VIRT_IRQ */ |
diff --git a/arch/ppc64/kernel/proc_ppc64.c b/arch/ppc64/kernel/proc_ppc64.c index a87c66a9652a..24e955ee9487 100644 --- a/arch/ppc64/kernel/proc_ppc64.c +++ b/arch/ppc64/kernel/proc_ppc64.c | |||
@@ -53,7 +53,7 @@ static int __init proc_ppc64_create(void) | |||
53 | if (!root) | 53 | if (!root) |
54 | return 1; | 54 | return 1; |
55 | 55 | ||
56 | if (!(systemcfg->platform & (PLATFORM_PSERIES | PLATFORM_BPA))) | 56 | if (!(systemcfg->platform & (PLATFORM_PSERIES | PLATFORM_CELL))) |
57 | return 0; | 57 | return 0; |
58 | 58 | ||
59 | if (!proc_mkdir("rtas", root)) | 59 | if (!proc_mkdir("rtas", root)) |
diff --git a/arch/ppc64/kernel/prom_init.c b/arch/ppc64/kernel/prom_init.c index 69924ba4d7d9..a4bbca6dbb8b 100644 --- a/arch/ppc64/kernel/prom_init.c +++ b/arch/ppc64/kernel/prom_init.c | |||
@@ -1939,9 +1939,9 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4, unsigned long | |||
1939 | prom_send_capabilities(); | 1939 | prom_send_capabilities(); |
1940 | 1940 | ||
1941 | /* | 1941 | /* |
1942 | * On pSeries and BPA, copy the CPU hold code | 1942 | * On pSeries and Cell, copy the CPU hold code |
1943 | */ | 1943 | */ |
1944 | if (RELOC(of_platform) & (PLATFORM_PSERIES | PLATFORM_BPA)) | 1944 | if (RELOC(of_platform) & (PLATFORM_PSERIES | PLATFORM_CELL)) |
1945 | copy_and_flush(0, KERNELBASE - offset, 0x100, 0); | 1945 | copy_and_flush(0, KERNELBASE - offset, 0x100, 0); |
1946 | 1946 | ||
1947 | /* | 1947 | /* |
diff --git a/arch/ppc64/lib/Makefile b/arch/ppc64/lib/Makefile deleted file mode 100644 index 42d5295bf345..000000000000 --- a/arch/ppc64/lib/Makefile +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | # | ||
2 | # Makefile for ppc64-specific library files.. | ||
3 | # | ||
4 | |||
5 | lib-y := string.o | ||
diff --git a/arch/ppc64/lib/string.S b/arch/ppc64/lib/string.S deleted file mode 100644 index e21a0038a4d6..000000000000 --- a/arch/ppc64/lib/string.S +++ /dev/null | |||
@@ -1,179 +0,0 @@ | |||
1 | /* | ||
2 | * String handling functions for PowerPC. | ||
3 | * | ||
4 | * Copyright (C) 1996 Paul Mackerras. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | #include <asm/processor.h> | ||
12 | #include <asm/errno.h> | ||
13 | #include <asm/ppc_asm.h> | ||
14 | |||
15 | _GLOBAL(strcpy) | ||
16 | addi r5,r3,-1 | ||
17 | addi r4,r4,-1 | ||
18 | 1: lbzu r0,1(r4) | ||
19 | cmpwi 0,r0,0 | ||
20 | stbu r0,1(r5) | ||
21 | bne 1b | ||
22 | blr | ||
23 | |||
24 | _GLOBAL(strncpy) | ||
25 | cmpwi 0,r5,0 | ||
26 | beqlr | ||
27 | mtctr r5 | ||
28 | addi r6,r3,-1 | ||
29 | addi r4,r4,-1 | ||
30 | 1: lbzu r0,1(r4) | ||
31 | cmpwi 0,r0,0 | ||
32 | stbu r0,1(r6) | ||
33 | bdnzf 2,1b /* dec ctr, branch if ctr != 0 && !cr0.eq */ | ||
34 | blr | ||
35 | |||
36 | _GLOBAL(strcat) | ||
37 | addi r5,r3,-1 | ||
38 | addi r4,r4,-1 | ||
39 | 1: lbzu r0,1(r5) | ||
40 | cmpwi 0,r0,0 | ||
41 | bne 1b | ||
42 | addi r5,r5,-1 | ||
43 | 1: lbzu r0,1(r4) | ||
44 | cmpwi 0,r0,0 | ||
45 | stbu r0,1(r5) | ||
46 | bne 1b | ||
47 | blr | ||
48 | |||
49 | _GLOBAL(strcmp) | ||
50 | addi r5,r3,-1 | ||
51 | addi r4,r4,-1 | ||
52 | 1: lbzu r3,1(r5) | ||
53 | cmpwi 1,r3,0 | ||
54 | lbzu r0,1(r4) | ||
55 | subf. r3,r0,r3 | ||
56 | beqlr 1 | ||
57 | beq 1b | ||
58 | blr | ||
59 | |||
60 | _GLOBAL(strlen) | ||
61 | addi r4,r3,-1 | ||
62 | 1: lbzu r0,1(r4) | ||
63 | cmpwi 0,r0,0 | ||
64 | bne 1b | ||
65 | subf r3,r3,r4 | ||
66 | blr | ||
67 | |||
68 | _GLOBAL(memcmp) | ||
69 | cmpwi 0,r5,0 | ||
70 | ble- 2f | ||
71 | mtctr r5 | ||
72 | addi r6,r3,-1 | ||
73 | addi r4,r4,-1 | ||
74 | 1: lbzu r3,1(r6) | ||
75 | lbzu r0,1(r4) | ||
76 | subf. r3,r0,r3 | ||
77 | bdnzt 2,1b | ||
78 | blr | ||
79 | 2: li r3,0 | ||
80 | blr | ||
81 | |||
82 | _GLOBAL(memchr) | ||
83 | cmpwi 0,r5,0 | ||
84 | ble- 2f | ||
85 | mtctr r5 | ||
86 | addi r3,r3,-1 | ||
87 | 1: lbzu r0,1(r3) | ||
88 | cmpw 0,r0,r4 | ||
89 | bdnzf 2,1b | ||
90 | beqlr | ||
91 | 2: li r3,0 | ||
92 | blr | ||
93 | |||
94 | _GLOBAL(__clear_user) | ||
95 | addi r6,r3,-4 | ||
96 | li r3,0 | ||
97 | li r5,0 | ||
98 | cmplwi 0,r4,4 | ||
99 | blt 7f | ||
100 | /* clear a single word */ | ||
101 | 11: stwu r5,4(r6) | ||
102 | beqlr | ||
103 | /* clear word sized chunks */ | ||
104 | andi. r0,r6,3 | ||
105 | add r4,r0,r4 | ||
106 | subf r6,r0,r6 | ||
107 | srwi r0,r4,2 | ||
108 | andi. r4,r4,3 | ||
109 | mtctr r0 | ||
110 | bdz 7f | ||
111 | 1: stwu r5,4(r6) | ||
112 | bdnz 1b | ||
113 | /* clear byte sized chunks */ | ||
114 | 7: cmpwi 0,r4,0 | ||
115 | beqlr | ||
116 | mtctr r4 | ||
117 | addi r6,r6,3 | ||
118 | 8: stbu r5,1(r6) | ||
119 | bdnz 8b | ||
120 | blr | ||
121 | 90: mr r3,r4 | ||
122 | blr | ||
123 | 91: mfctr r3 | ||
124 | slwi r3,r3,2 | ||
125 | add r3,r3,r4 | ||
126 | blr | ||
127 | 92: mfctr r3 | ||
128 | blr | ||
129 | |||
130 | .section __ex_table,"a" | ||
131 | .align 3 | ||
132 | .llong 11b,90b | ||
133 | .llong 1b,91b | ||
134 | .llong 8b,92b | ||
135 | .text | ||
136 | |||
137 | /* r3 = dst, r4 = src, r5 = count */ | ||
138 | _GLOBAL(__strncpy_from_user) | ||
139 | addi r6,r3,-1 | ||
140 | addi r4,r4,-1 | ||
141 | cmpwi 0,r5,0 | ||
142 | beq 2f | ||
143 | mtctr r5 | ||
144 | 1: lbzu r0,1(r4) | ||
145 | cmpwi 0,r0,0 | ||
146 | stbu r0,1(r6) | ||
147 | bdnzf 2,1b /* dec ctr, branch if ctr != 0 && !cr0.eq */ | ||
148 | beq 3f | ||
149 | 2: addi r6,r6,1 | ||
150 | 3: subf r3,r3,r6 | ||
151 | blr | ||
152 | 99: li r3,-EFAULT | ||
153 | blr | ||
154 | |||
155 | .section __ex_table,"a" | ||
156 | .align 3 | ||
157 | .llong 1b,99b | ||
158 | .text | ||
159 | |||
160 | /* r3 = str, r4 = len (> 0) */ | ||
161 | _GLOBAL(__strnlen_user) | ||
162 | addi r7,r3,-1 | ||
163 | mtctr r4 /* ctr = len */ | ||
164 | 1: lbzu r0,1(r7) /* get next byte */ | ||
165 | cmpwi 0,r0,0 | ||
166 | bdnzf 2,1b /* loop if --ctr != 0 && byte != 0 */ | ||
167 | addi r7,r7,1 | ||
168 | subf r3,r3,r7 /* number of bytes we have looked at */ | ||
169 | beqlr /* return if we found a 0 byte */ | ||
170 | cmpw 0,r3,r4 /* did we look at all len bytes? */ | ||
171 | blt 99f /* if not, must have hit top */ | ||
172 | addi r3,r4,1 /* return len + 1 to indicate no null found */ | ||
173 | blr | ||
174 | 99: li r3,0 /* bad address, return 0 */ | ||
175 | blr | ||
176 | |||
177 | .section __ex_table,"a" | ||
178 | .align 3 | ||
179 | .llong 1b,99b | ||