diff options
author | Paul Mackerras <paulus@samba.org> | 2006-10-04 01:02:27 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-10-04 01:02:27 -0400 |
commit | c730f5b621afa33e9f4939da9078669162ebff4e (patch) | |
tree | ac78a2cea0fbf365ef659c26ab192e263debb544 /arch | |
parent | 0a730ae59960165ae50de3284fb50316d1755d98 (diff) | |
parent | 80a544cebca5f28397020332e21e04d639a18943 (diff) |
Merge branch 'master' of git://oak/home/sfr/kernels/iseries/work
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/Kconfig | 8 | ||||
-rw-r--r-- | arch/powerpc/kernel/entry_64.S | 18 | ||||
-rw-r--r-- | arch/powerpc/kernel/head_64.S | 28 | ||||
-rw-r--r-- | arch/powerpc/kernel/misc_64.S | 46 | ||||
-rw-r--r-- | arch/powerpc/kernel/pci_64.c | 58 | ||||
-rw-r--r-- | arch/powerpc/kernel/vmlinux.lds.S | 8 | ||||
-rw-r--r-- | arch/powerpc/mm/pgtable_64.c | 29 | ||||
-rw-r--r-- | arch/powerpc/mm/slb_low.S | 3 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/pci.c | 8 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/setup.c | 16 |
10 files changed, 148 insertions, 74 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 032e6ab5d3c4..5342f3fdb083 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -338,10 +338,6 @@ config PPC_MULTIPLATFORM | |||
338 | RS/6000 machine, an Apple machine, or a PReP, CHRP, | 338 | RS/6000 machine, an Apple machine, or a PReP, CHRP, |
339 | Maple or Cell-based machine. | 339 | Maple or Cell-based machine. |
340 | 340 | ||
341 | config PPC_ISERIES | ||
342 | bool "IBM Legacy iSeries" | ||
343 | depends on PPC64 | ||
344 | |||
345 | config EMBEDDED6xx | 341 | config EMBEDDED6xx |
346 | bool "Embedded 6xx/7xx/7xxx-based board" | 342 | bool "Embedded 6xx/7xx/7xxx-based board" |
347 | depends on PPC32 && (BROKEN||BROKEN_ON_SMP) | 343 | depends on PPC32 && (BROKEN||BROKEN_ON_SMP) |
@@ -365,6 +361,10 @@ config PPC_PSERIES | |||
365 | select PPC_UDBG_16550 | 361 | select PPC_UDBG_16550 |
366 | default y | 362 | default y |
367 | 363 | ||
364 | config PPC_ISERIES | ||
365 | bool "IBM Legacy iSeries" | ||
366 | depends on PPC_MULTIPLATFORM && PPC64 | ||
367 | |||
368 | config PPC_CHRP | 368 | config PPC_CHRP |
369 | bool "Common Hardware Reference Platform (CHRP) based machines" | 369 | bool "Common Hardware Reference Platform (CHRP) based machines" |
370 | depends on PPC_MULTIPLATFORM && PPC32 | 370 | depends on PPC_MULTIPLATFORM && PPC32 |
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index 2cd872b5283b..748e74fcf541 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S | |||
@@ -27,10 +27,7 @@ | |||
27 | #include <asm/ppc_asm.h> | 27 | #include <asm/ppc_asm.h> |
28 | #include <asm/asm-offsets.h> | 28 | #include <asm/asm-offsets.h> |
29 | #include <asm/cputable.h> | 29 | #include <asm/cputable.h> |
30 | 30 | #include <asm/firmware.h> | |
31 | #ifdef CONFIG_PPC_ISERIES | ||
32 | #define DO_SOFT_DISABLE | ||
33 | #endif | ||
34 | 31 | ||
35 | /* | 32 | /* |
36 | * System calls. | 33 | * System calls. |
@@ -91,6 +88,7 @@ system_call_common: | |||
91 | ld r11,exception_marker@toc(r2) | 88 | ld r11,exception_marker@toc(r2) |
92 | std r11,-16(r9) /* "regshere" marker */ | 89 | std r11,-16(r9) /* "regshere" marker */ |
93 | #ifdef CONFIG_PPC_ISERIES | 90 | #ifdef CONFIG_PPC_ISERIES |
91 | BEGIN_FW_FTR_SECTION | ||
94 | /* Hack for handling interrupts when soft-enabling on iSeries */ | 92 | /* Hack for handling interrupts when soft-enabling on iSeries */ |
95 | cmpdi cr1,r0,0x5555 /* syscall 0x5555 */ | 93 | cmpdi cr1,r0,0x5555 /* syscall 0x5555 */ |
96 | andi. r10,r12,MSR_PR /* from kernel */ | 94 | andi. r10,r12,MSR_PR /* from kernel */ |
@@ -98,6 +96,7 @@ system_call_common: | |||
98 | beq hardware_interrupt_entry | 96 | beq hardware_interrupt_entry |
99 | lbz r10,PACAPROCENABLED(r13) | 97 | lbz r10,PACAPROCENABLED(r13) |
100 | std r10,SOFTE(r1) | 98 | std r10,SOFTE(r1) |
99 | END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) | ||
101 | #endif | 100 | #endif |
102 | mfmsr r11 | 101 | mfmsr r11 |
103 | ori r11,r11,MSR_EE | 102 | ori r11,r11,MSR_EE |
@@ -462,6 +461,7 @@ _GLOBAL(ret_from_except_lite) | |||
462 | 461 | ||
463 | restore: | 462 | restore: |
464 | #ifdef CONFIG_PPC_ISERIES | 463 | #ifdef CONFIG_PPC_ISERIES |
464 | BEGIN_FW_FTR_SECTION | ||
465 | ld r5,SOFTE(r1) | 465 | ld r5,SOFTE(r1) |
466 | cmpdi 0,r5,0 | 466 | cmpdi 0,r5,0 |
467 | beq 4f | 467 | beq 4f |
@@ -480,6 +480,7 @@ restore: | |||
480 | b .ret_from_except_lite /* loop back and handle more */ | 480 | b .ret_from_except_lite /* loop back and handle more */ |
481 | 481 | ||
482 | 4: stb r5,PACAPROCENABLED(r13) | 482 | 4: stb r5,PACAPROCENABLED(r13) |
483 | END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) | ||
483 | #endif | 484 | #endif |
484 | 485 | ||
485 | ld r3,_MSR(r1) | 486 | ld r3,_MSR(r1) |
@@ -538,18 +539,23 @@ do_work: | |||
538 | lwz r8,TI_PREEMPT(r9) | 539 | lwz r8,TI_PREEMPT(r9) |
539 | cmpwi cr1,r8,0 | 540 | cmpwi cr1,r8,0 |
540 | #ifdef CONFIG_PPC_ISERIES | 541 | #ifdef CONFIG_PPC_ISERIES |
542 | BEGIN_FW_FTR_SECTION | ||
541 | ld r0,SOFTE(r1) | 543 | ld r0,SOFTE(r1) |
542 | cmpdi r0,0 | 544 | cmpdi r0,0 |
543 | #else | 545 | END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) |
544 | andi. r0,r3,MSR_EE | ||
545 | #endif | 546 | #endif |
547 | BEGIN_FW_FTR_SECTION | ||
548 | andi. r0,r3,MSR_EE | ||
549 | END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES) | ||
546 | crandc eq,cr1*4+eq,eq | 550 | crandc eq,cr1*4+eq,eq |
547 | bne restore | 551 | bne restore |
548 | /* here we are preempting the current task */ | 552 | /* here we are preempting the current task */ |
549 | 1: | 553 | 1: |
550 | #ifdef CONFIG_PPC_ISERIES | 554 | #ifdef CONFIG_PPC_ISERIES |
555 | BEGIN_FW_FTR_SECTION | ||
551 | li r0,1 | 556 | li r0,1 |
552 | stb r0,PACAPROCENABLED(r13) | 557 | stb r0,PACAPROCENABLED(r13) |
558 | END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) | ||
553 | #endif | 559 | #endif |
554 | ori r10,r10,MSR_EE | 560 | ori r10,r10,MSR_EE |
555 | mtmsrd r10,1 /* reenable interrupts */ | 561 | mtmsrd r10,1 /* reenable interrupts */ |
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index 3065b472b95d..645c7f10fb28 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <asm/hvcall.h> | 33 | #include <asm/hvcall.h> |
34 | #include <asm/iseries/lpar_map.h> | 34 | #include <asm/iseries/lpar_map.h> |
35 | #include <asm/thread_info.h> | 35 | #include <asm/thread_info.h> |
36 | #include <asm/firmware.h> | ||
36 | 37 | ||
37 | #ifdef CONFIG_PPC_ISERIES | 38 | #ifdef CONFIG_PPC_ISERIES |
38 | #define DO_SOFT_DISABLE | 39 | #define DO_SOFT_DISABLE |
@@ -365,19 +366,28 @@ label##_iSeries: \ | |||
365 | 366 | ||
366 | #ifdef DO_SOFT_DISABLE | 367 | #ifdef DO_SOFT_DISABLE |
367 | #define DISABLE_INTS \ | 368 | #define DISABLE_INTS \ |
369 | BEGIN_FW_FTR_SECTION; \ | ||
368 | lbz r10,PACAPROCENABLED(r13); \ | 370 | lbz r10,PACAPROCENABLED(r13); \ |
369 | li r11,0; \ | 371 | li r11,0; \ |
370 | std r10,SOFTE(r1); \ | 372 | std r10,SOFTE(r1); \ |
371 | mfmsr r10; \ | 373 | mfmsr r10; \ |
372 | stb r11,PACAPROCENABLED(r13); \ | 374 | stb r11,PACAPROCENABLED(r13); \ |
373 | ori r10,r10,MSR_EE; \ | 375 | ori r10,r10,MSR_EE; \ |
374 | mtmsrd r10,1 | 376 | mtmsrd r10,1; \ |
377 | END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) | ||
375 | 378 | ||
376 | #define ENABLE_INTS \ | 379 | #define ENABLE_INTS \ |
380 | BEGIN_FW_FTR_SECTION; \ | ||
377 | lbz r10,PACAPROCENABLED(r13); \ | 381 | lbz r10,PACAPROCENABLED(r13); \ |
378 | mfmsr r11; \ | 382 | mfmsr r11; \ |
379 | std r10,SOFTE(r1); \ | 383 | std r10,SOFTE(r1); \ |
380 | ori r11,r11,MSR_EE; \ | 384 | ori r11,r11,MSR_EE; \ |
385 | END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES); \ | ||
386 | BEGIN_FW_FTR_SECTION; \ | ||
387 | ld r12,_MSR(r1); \ | ||
388 | mfmsr r11; \ | ||
389 | rlwimi r11,r12,0,MSR_EE; \ | ||
390 | END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES); \ | ||
381 | mtmsrd r11,1 | 391 | mtmsrd r11,1 |
382 | 392 | ||
383 | #else /* hard enable/disable interrupts */ | 393 | #else /* hard enable/disable interrupts */ |
@@ -1071,8 +1081,10 @@ _GLOBAL(slb_miss_realmode) | |||
1071 | ld r3,PACA_EXSLB+EX_R3(r13) | 1081 | ld r3,PACA_EXSLB+EX_R3(r13) |
1072 | lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */ | 1082 | lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */ |
1073 | #ifdef CONFIG_PPC_ISERIES | 1083 | #ifdef CONFIG_PPC_ISERIES |
1084 | BEGIN_FW_FTR_SECTION | ||
1074 | ld r11,PACALPPACAPTR(r13) | 1085 | ld r11,PACALPPACAPTR(r13) |
1075 | ld r11,LPPACASRR0(r11) /* get SRR0 value */ | 1086 | ld r11,LPPACASRR0(r11) /* get SRR0 value */ |
1087 | END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) | ||
1076 | #endif /* CONFIG_PPC_ISERIES */ | 1088 | #endif /* CONFIG_PPC_ISERIES */ |
1077 | 1089 | ||
1078 | mtlr r10 | 1090 | mtlr r10 |
@@ -1087,8 +1099,10 @@ _GLOBAL(slb_miss_realmode) | |||
1087 | .machine pop | 1099 | .machine pop |
1088 | 1100 | ||
1089 | #ifdef CONFIG_PPC_ISERIES | 1101 | #ifdef CONFIG_PPC_ISERIES |
1102 | BEGIN_FW_FTR_SECTION | ||
1090 | mtspr SPRN_SRR0,r11 | 1103 | mtspr SPRN_SRR0,r11 |
1091 | mtspr SPRN_SRR1,r12 | 1104 | mtspr SPRN_SRR1,r12 |
1105 | END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) | ||
1092 | #endif /* CONFIG_PPC_ISERIES */ | 1106 | #endif /* CONFIG_PPC_ISERIES */ |
1093 | ld r9,PACA_EXSLB+EX_R9(r13) | 1107 | ld r9,PACA_EXSLB+EX_R9(r13) |
1094 | ld r10,PACA_EXSLB+EX_R10(r13) | 1108 | ld r10,PACA_EXSLB+EX_R10(r13) |
@@ -1301,6 +1315,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_SLB) | |||
1301 | cmpdi r3,0 /* see if hash_page succeeded */ | 1315 | cmpdi r3,0 /* see if hash_page succeeded */ |
1302 | 1316 | ||
1303 | #ifdef DO_SOFT_DISABLE | 1317 | #ifdef DO_SOFT_DISABLE |
1318 | BEGIN_FW_FTR_SECTION | ||
1304 | /* | 1319 | /* |
1305 | * If we had interrupts soft-enabled at the point where the | 1320 | * If we had interrupts soft-enabled at the point where the |
1306 | * DSI/ISI occurred, and an interrupt came in during hash_page, | 1321 | * DSI/ISI occurred, and an interrupt came in during hash_page, |
@@ -1321,12 +1336,14 @@ END_FTR_SECTION_IFCLR(CPU_FTR_SLB) | |||
1321 | ld r3,SOFTE(r1) | 1336 | ld r3,SOFTE(r1) |
1322 | bl .local_irq_restore | 1337 | bl .local_irq_restore |
1323 | b 11f | 1338 | b 11f |
1324 | #else | 1339 | END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) |
1340 | #endif | ||
1341 | BEGIN_FW_FTR_SECTION | ||
1325 | beq fast_exception_return /* Return from exception on success */ | 1342 | beq fast_exception_return /* Return from exception on success */ |
1326 | ble- 12f /* Failure return from hash_page */ | 1343 | ble- 12f /* Failure return from hash_page */ |
1327 | 1344 | ||
1328 | /* fall through */ | 1345 | /* fall through */ |
1329 | #endif | 1346 | END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES) |
1330 | 1347 | ||
1331 | /* Here we have a page fault that hash_page can't handle. */ | 1348 | /* Here we have a page fault that hash_page can't handle. */ |
1332 | _GLOBAL(handle_page_fault) | 1349 | _GLOBAL(handle_page_fault) |
@@ -1861,7 +1878,9 @@ _GLOBAL(__secondary_start) | |||
1861 | LOAD_REG_ADDR(r3, .start_secondary_prolog) | 1878 | LOAD_REG_ADDR(r3, .start_secondary_prolog) |
1862 | LOAD_REG_IMMEDIATE(r4, MSR_KERNEL) | 1879 | LOAD_REG_IMMEDIATE(r4, MSR_KERNEL) |
1863 | #ifdef DO_SOFT_DISABLE | 1880 | #ifdef DO_SOFT_DISABLE |
1881 | BEGIN_FW_FTR_SECTION | ||
1864 | ori r4,r4,MSR_EE | 1882 | ori r4,r4,MSR_EE |
1883 | END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) | ||
1865 | #endif | 1884 | #endif |
1866 | mtspr SPRN_SRR0,r3 | 1885 | mtspr SPRN_SRR0,r3 |
1867 | mtspr SPRN_SRR1,r4 | 1886 | mtspr SPRN_SRR1,r4 |
@@ -1986,6 +2005,7 @@ _STATIC(start_here_common) | |||
1986 | */ | 2005 | */ |
1987 | li r3,0 | 2006 | li r3,0 |
1988 | bl .do_cpu_ftr_fixups | 2007 | bl .do_cpu_ftr_fixups |
2008 | bl .do_fw_ftr_fixups | ||
1989 | 2009 | ||
1990 | /* ptr to current */ | 2010 | /* ptr to current */ |
1991 | LOAD_REG_IMMEDIATE(r4, init_task) | 2011 | LOAD_REG_IMMEDIATE(r4, init_task) |
@@ -2000,11 +2020,13 @@ _STATIC(start_here_common) | |||
2000 | /* Load up the kernel context */ | 2020 | /* Load up the kernel context */ |
2001 | 5: | 2021 | 5: |
2002 | #ifdef DO_SOFT_DISABLE | 2022 | #ifdef DO_SOFT_DISABLE |
2023 | BEGIN_FW_FTR_SECTION | ||
2003 | li r5,0 | 2024 | li r5,0 |
2004 | stb r5,PACAPROCENABLED(r13) /* Soft Disabled */ | 2025 | stb r5,PACAPROCENABLED(r13) /* Soft Disabled */ |
2005 | mfmsr r5 | 2026 | mfmsr r5 |
2006 | ori r5,r5,MSR_EE /* Hard Enabled */ | 2027 | ori r5,r5,MSR_EE /* Hard Enabled */ |
2007 | mtmsrd r5 | 2028 | mtmsrd r5 |
2029 | END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) | ||
2008 | #endif | 2030 | #endif |
2009 | 2031 | ||
2010 | bl .start_kernel | 2032 | bl .start_kernel |
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S index 9c54eccad993..41521b30c3cd 100644 --- a/arch/powerpc/kernel/misc_64.S +++ b/arch/powerpc/kernel/misc_64.S | |||
@@ -325,6 +325,52 @@ _GLOBAL(do_cpu_ftr_fixups) | |||
325 | isync | 325 | isync |
326 | b 1b | 326 | b 1b |
327 | 327 | ||
328 | /* | ||
329 | * do_fw_ftr_fixups - goes through the list of firmware feature fixups | ||
330 | * and writes nop's over sections of code that don't apply for this firmware. | ||
331 | * r3 = data offset (not changed) | ||
332 | */ | ||
333 | _GLOBAL(do_fw_ftr_fixups) | ||
334 | /* Get firmware features */ | ||
335 | LOAD_REG_IMMEDIATE(r6,powerpc_firmware_features) | ||
336 | sub r6,r6,r3 | ||
337 | ld r4,0(r6) | ||
338 | /* Get the fixup table */ | ||
339 | LOAD_REG_IMMEDIATE(r6,__start___fw_ftr_fixup) | ||
340 | sub r6,r6,r3 | ||
341 | LOAD_REG_IMMEDIATE(r7,__stop___fw_ftr_fixup) | ||
342 | sub r7,r7,r3 | ||
343 | /* Do the fixup */ | ||
344 | 1: cmpld r6,r7 | ||
345 | bgelr | ||
346 | addi r6,r6,32 | ||
347 | ld r8,-32(r6) /* mask */ | ||
348 | and r8,r8,r4 | ||
349 | ld r9,-24(r6) /* value */ | ||
350 | cmpld r8,r9 | ||
351 | beq 1b | ||
352 | ld r8,-16(r6) /* section begin */ | ||
353 | ld r9,-8(r6) /* section end */ | ||
354 | subf. r9,r8,r9 | ||
355 | beq 1b | ||
356 | /* write nops over the section of code */ | ||
357 | /* todo: if large section, add a branch at the start of it */ | ||
358 | srwi r9,r9,2 | ||
359 | mtctr r9 | ||
360 | sub r8,r8,r3 | ||
361 | lis r0,0x60000000@h /* nop */ | ||
362 | 3: stw r0,0(r8) | ||
363 | BEGIN_FTR_SECTION | ||
364 | dcbst 0,r8 /* suboptimal, but simpler */ | ||
365 | sync | ||
366 | icbi 0,r8 | ||
367 | END_FTR_SECTION_IFSET(CPU_FTR_SPLIT_ID_CACHE) | ||
368 | addi r8,r8,4 | ||
369 | bdnz 3b | ||
370 | sync /* additional sync needed on g4 */ | ||
371 | isync | ||
372 | b 1b | ||
373 | |||
328 | #if defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) | 374 | #if defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) |
329 | /* | 375 | /* |
330 | * Do an IO access in real mode | 376 | * Do an IO access in real mode |
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index c1b1e14775e4..78d3c0fc8dfb 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <asm/byteorder.h> | 30 | #include <asm/byteorder.h> |
31 | #include <asm/machdep.h> | 31 | #include <asm/machdep.h> |
32 | #include <asm/ppc-pci.h> | 32 | #include <asm/ppc-pci.h> |
33 | #include <asm/firmware.h> | ||
33 | 34 | ||
34 | #ifdef DEBUG | 35 | #ifdef DEBUG |
35 | #include <asm/udbg.h> | 36 | #include <asm/udbg.h> |
@@ -209,7 +210,6 @@ void pcibios_free_controller(struct pci_controller *phb) | |||
209 | kfree(phb); | 210 | kfree(phb); |
210 | } | 211 | } |
211 | 212 | ||
212 | #ifndef CONFIG_PPC_ISERIES | ||
213 | void __devinit pcibios_claim_one_bus(struct pci_bus *b) | 213 | void __devinit pcibios_claim_one_bus(struct pci_bus *b) |
214 | { | 214 | { |
215 | struct pci_dev *dev; | 215 | struct pci_dev *dev; |
@@ -238,10 +238,12 @@ static void __init pcibios_claim_of_setup(void) | |||
238 | { | 238 | { |
239 | struct pci_bus *b; | 239 | struct pci_bus *b; |
240 | 240 | ||
241 | if (firmware_has_feature(FW_FEATURE_ISERIES)) | ||
242 | return; | ||
243 | |||
241 | list_for_each_entry(b, &pci_root_buses, node) | 244 | list_for_each_entry(b, &pci_root_buses, node) |
242 | pcibios_claim_one_bus(b); | 245 | pcibios_claim_one_bus(b); |
243 | } | 246 | } |
244 | #endif | ||
245 | 247 | ||
246 | #ifdef CONFIG_PPC_MULTIPLATFORM | 248 | #ifdef CONFIG_PPC_MULTIPLATFORM |
247 | static u32 get_int_prop(struct device_node *np, const char *name, u32 def) | 249 | static u32 get_int_prop(struct device_node *np, const char *name, u32 def) |
@@ -554,9 +556,8 @@ static int __init pcibios_init(void) | |||
554 | */ | 556 | */ |
555 | ppc_md.phys_mem_access_prot = pci_phys_mem_access_prot; | 557 | ppc_md.phys_mem_access_prot = pci_phys_mem_access_prot; |
556 | 558 | ||
557 | #ifdef CONFIG_PPC_ISERIES | 559 | if (firmware_has_feature(FW_FEATURE_ISERIES)) |
558 | iSeries_pcibios_init(); | 560 | iSeries_pcibios_init(); |
559 | #endif | ||
560 | 561 | ||
561 | printk(KERN_DEBUG "PCI: Probing PCI hardware\n"); | 562 | printk(KERN_DEBUG "PCI: Probing PCI hardware\n"); |
562 | 563 | ||
@@ -566,15 +567,15 @@ static int __init pcibios_init(void) | |||
566 | pci_bus_add_devices(hose->bus); | 567 | pci_bus_add_devices(hose->bus); |
567 | } | 568 | } |
568 | 569 | ||
569 | #ifndef CONFIG_PPC_ISERIES | 570 | if (!firmware_has_feature(FW_FEATURE_ISERIES)) { |
570 | if (pci_probe_only) | 571 | if (pci_probe_only) |
571 | pcibios_claim_of_setup(); | 572 | pcibios_claim_of_setup(); |
572 | else | 573 | else |
573 | /* FIXME: `else' will be removed when | 574 | /* FIXME: `else' will be removed when |
574 | pci_assign_unassigned_resources() is able to work | 575 | pci_assign_unassigned_resources() is able to work |
575 | correctly with [partially] allocated PCI tree. */ | 576 | correctly with [partially] allocated PCI tree. */ |
576 | pci_assign_unassigned_resources(); | 577 | pci_assign_unassigned_resources(); |
577 | #endif /* !CONFIG_PPC_ISERIES */ | 578 | } |
578 | 579 | ||
579 | /* Call machine dependent final fixup */ | 580 | /* Call machine dependent final fixup */ |
580 | if (ppc_md.pcibios_fixup) | 581 | if (ppc_md.pcibios_fixup) |
@@ -586,8 +587,9 @@ static int __init pcibios_init(void) | |||
586 | printk(KERN_DEBUG "ISA bridge at %s\n", pci_name(ppc64_isabridge_dev)); | 587 | printk(KERN_DEBUG "ISA bridge at %s\n", pci_name(ppc64_isabridge_dev)); |
587 | 588 | ||
588 | #ifdef CONFIG_PPC_MULTIPLATFORM | 589 | #ifdef CONFIG_PPC_MULTIPLATFORM |
589 | /* map in PCI I/O space */ | 590 | if (!firmware_has_feature(FW_FEATURE_ISERIES)) |
590 | phbs_remap_io(); | 591 | /* map in PCI I/O space */ |
592 | phbs_remap_io(); | ||
591 | #endif | 593 | #endif |
592 | 594 | ||
593 | printk(KERN_DEBUG "PCI: Probing PCI hardware done\n"); | 595 | printk(KERN_DEBUG "PCI: Probing PCI hardware done\n"); |
@@ -637,13 +639,13 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) | |||
637 | */ | 639 | */ |
638 | int pci_domain_nr(struct pci_bus *bus) | 640 | int pci_domain_nr(struct pci_bus *bus) |
639 | { | 641 | { |
640 | #ifdef CONFIG_PPC_ISERIES | 642 | if (firmware_has_feature(FW_FEATURE_ISERIES)) |
641 | return 0; | 643 | return 0; |
642 | #else | 644 | else { |
643 | struct pci_controller *hose = pci_bus_to_host(bus); | 645 | struct pci_controller *hose = pci_bus_to_host(bus); |
644 | 646 | ||
645 | return hose->global_number; | 647 | return hose->global_number; |
646 | #endif | 648 | } |
647 | } | 649 | } |
648 | 650 | ||
649 | EXPORT_SYMBOL(pci_domain_nr); | 651 | EXPORT_SYMBOL(pci_domain_nr); |
@@ -651,12 +653,12 @@ EXPORT_SYMBOL(pci_domain_nr); | |||
651 | /* Decide whether to display the domain number in /proc */ | 653 | /* Decide whether to display the domain number in /proc */ |
652 | int pci_proc_domain(struct pci_bus *bus) | 654 | int pci_proc_domain(struct pci_bus *bus) |
653 | { | 655 | { |
654 | #ifdef CONFIG_PPC_ISERIES | 656 | if (firmware_has_feature(FW_FEATURE_ISERIES)) |
655 | return 0; | 657 | return 0; |
656 | #else | 658 | else { |
657 | struct pci_controller *hose = pci_bus_to_host(bus); | 659 | struct pci_controller *hose = pci_bus_to_host(bus); |
658 | return hose->buid; | 660 | return hose->buid; |
659 | #endif | 661 | } |
660 | } | 662 | } |
661 | 663 | ||
662 | /* | 664 | /* |
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index 02665a02130d..cb0e8d46c3e8 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S | |||
@@ -132,6 +132,14 @@ SECTIONS | |||
132 | *(__ftr_fixup) | 132 | *(__ftr_fixup) |
133 | __stop___ftr_fixup = .; | 133 | __stop___ftr_fixup = .; |
134 | } | 134 | } |
135 | #ifdef CONFIG_PPC64 | ||
136 | . = ALIGN(8); | ||
137 | __fw_ftr_fixup : { | ||
138 | __start___fw_ftr_fixup = .; | ||
139 | *(__fw_ftr_fixup) | ||
140 | __stop___fw_ftr_fixup = .; | ||
141 | } | ||
142 | #endif | ||
135 | 143 | ||
136 | . = ALIGN(PAGE_SIZE); | 144 | . = ALIGN(PAGE_SIZE); |
137 | .init.ramfs : { | 145 | .init.ramfs : { |
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c index b1da03165496..ac64f4aaa509 100644 --- a/arch/powerpc/mm/pgtable_64.c +++ b/arch/powerpc/mm/pgtable_64.c | |||
@@ -63,32 +63,13 @@ | |||
63 | #include <asm/iommu.h> | 63 | #include <asm/iommu.h> |
64 | #include <asm/abs_addr.h> | 64 | #include <asm/abs_addr.h> |
65 | #include <asm/vdso.h> | 65 | #include <asm/vdso.h> |
66 | #include <asm/firmware.h> | ||
66 | 67 | ||
67 | #include "mmu_decl.h" | 68 | #include "mmu_decl.h" |
68 | 69 | ||
69 | unsigned long ioremap_bot = IMALLOC_BASE; | 70 | unsigned long ioremap_bot = IMALLOC_BASE; |
70 | static unsigned long phbs_io_bot = PHBS_IO_BASE; | 71 | static unsigned long phbs_io_bot = PHBS_IO_BASE; |
71 | 72 | ||
72 | #ifdef CONFIG_PPC_ISERIES | ||
73 | |||
74 | void __iomem *ioremap(unsigned long addr, unsigned long size) | ||
75 | { | ||
76 | return (void __iomem *)addr; | ||
77 | } | ||
78 | |||
79 | extern void __iomem *__ioremap(unsigned long addr, unsigned long size, | ||
80 | unsigned long flags) | ||
81 | { | ||
82 | return (void __iomem *)addr; | ||
83 | } | ||
84 | |||
85 | void iounmap(volatile void __iomem *addr) | ||
86 | { | ||
87 | return; | ||
88 | } | ||
89 | |||
90 | #else | ||
91 | |||
92 | /* | 73 | /* |
93 | * map_io_page currently only called by __ioremap | 74 | * map_io_page currently only called by __ioremap |
94 | * map_io_page adds an entry to the ioremap page table | 75 | * map_io_page adds an entry to the ioremap page table |
@@ -161,6 +142,9 @@ void __iomem * __ioremap(unsigned long addr, unsigned long size, | |||
161 | unsigned long pa, ea; | 142 | unsigned long pa, ea; |
162 | void __iomem *ret; | 143 | void __iomem *ret; |
163 | 144 | ||
145 | if (firmware_has_feature(FW_FEATURE_ISERIES)) | ||
146 | return (void __iomem *)addr; | ||
147 | |||
164 | /* | 148 | /* |
165 | * Choose an address to map it to. | 149 | * Choose an address to map it to. |
166 | * Once the imalloc system is running, we use it. | 150 | * Once the imalloc system is running, we use it. |
@@ -255,6 +239,9 @@ void iounmap(volatile void __iomem *token) | |||
255 | { | 239 | { |
256 | void *addr; | 240 | void *addr; |
257 | 241 | ||
242 | if (firmware_has_feature(FW_FEATURE_ISERIES)) | ||
243 | return; | ||
244 | |||
258 | if (!mem_init_done) | 245 | if (!mem_init_done) |
259 | return; | 246 | return; |
260 | 247 | ||
@@ -315,8 +302,6 @@ int iounmap_explicit(volatile void __iomem *start, unsigned long size) | |||
315 | return 0; | 302 | return 0; |
316 | } | 303 | } |
317 | 304 | ||
318 | #endif | ||
319 | |||
320 | EXPORT_SYMBOL(ioremap); | 305 | EXPORT_SYMBOL(ioremap); |
321 | EXPORT_SYMBOL(__ioremap); | 306 | EXPORT_SYMBOL(__ioremap); |
322 | EXPORT_SYMBOL(iounmap); | 307 | EXPORT_SYMBOL(iounmap); |
diff --git a/arch/powerpc/mm/slb_low.S b/arch/powerpc/mm/slb_low.S index dbc1abbde038..b10e4707d7c1 100644 --- a/arch/powerpc/mm/slb_low.S +++ b/arch/powerpc/mm/slb_low.S | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <asm/page.h> | 21 | #include <asm/page.h> |
22 | #include <asm/mmu.h> | 22 | #include <asm/mmu.h> |
23 | #include <asm/pgtable.h> | 23 | #include <asm/pgtable.h> |
24 | #include <asm/firmware.h> | ||
24 | 25 | ||
25 | /* void slb_allocate_realmode(unsigned long ea); | 26 | /* void slb_allocate_realmode(unsigned long ea); |
26 | * | 27 | * |
@@ -183,6 +184,7 @@ slb_finish_load: | |||
183 | * dont have any LRU information to help us choose a slot. | 184 | * dont have any LRU information to help us choose a slot. |
184 | */ | 185 | */ |
185 | #ifdef CONFIG_PPC_ISERIES | 186 | #ifdef CONFIG_PPC_ISERIES |
187 | BEGIN_FW_FTR_SECTION | ||
186 | /* | 188 | /* |
187 | * On iSeries, the "bolted" stack segment can be cast out on | 189 | * On iSeries, the "bolted" stack segment can be cast out on |
188 | * shared processor switch so we need to check for a miss on | 190 | * shared processor switch so we need to check for a miss on |
@@ -194,6 +196,7 @@ slb_finish_load: | |||
194 | li r10,SLB_NUM_BOLTED-1 /* Stack goes in last bolted slot */ | 196 | li r10,SLB_NUM_BOLTED-1 /* Stack goes in last bolted slot */ |
195 | cmpld r9,r3 | 197 | cmpld r9,r3 |
196 | beq 3f | 198 | beq 3f |
199 | END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) | ||
197 | #endif /* CONFIG_PPC_ISERIES */ | 200 | #endif /* CONFIG_PPC_ISERIES */ |
198 | 201 | ||
199 | ld r10,PACASTABRR(r13) | 202 | ld r10,PACASTABRR(r13) |
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c index 3eb12065df23..4aa165e010d9 100644 --- a/arch/powerpc/platforms/iseries/pci.c +++ b/arch/powerpc/platforms/iseries/pci.c | |||
@@ -262,14 +262,6 @@ void __init iSeries_pci_final_fixup(void) | |||
262 | mf_display_src(0xC9000200); | 262 | mf_display_src(0xC9000200); |
263 | } | 263 | } |
264 | 264 | ||
265 | void pcibios_fixup_bus(struct pci_bus *PciBus) | ||
266 | { | ||
267 | } | ||
268 | |||
269 | void pcibios_fixup_resources(struct pci_dev *pdev) | ||
270 | { | ||
271 | } | ||
272 | |||
273 | /* | 265 | /* |
274 | * Look down the chain to find the matching Device Device | 266 | * Look down the chain to find the matching Device Device |
275 | */ | 267 | */ |
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c index 7f1953066ff8..a0ff7ba7d666 100644 --- a/arch/powerpc/platforms/iseries/setup.c +++ b/arch/powerpc/platforms/iseries/setup.c | |||
@@ -649,15 +649,21 @@ static void iseries_dedicated_idle(void) | |||
649 | void __init iSeries_init_IRQ(void) { } | 649 | void __init iSeries_init_IRQ(void) { } |
650 | #endif | 650 | #endif |
651 | 651 | ||
652 | /* | ||
653 | * iSeries has no legacy IO, anything calling this function has to | ||
654 | * fail or bad things will happen | ||
655 | */ | ||
656 | static int iseries_check_legacy_ioport(unsigned int baseport) | ||
657 | { | ||
658 | return -ENODEV; | ||
659 | } | ||
660 | |||
652 | static int __init iseries_probe(void) | 661 | static int __init iseries_probe(void) |
653 | { | 662 | { |
654 | unsigned long root = of_get_flat_dt_root(); | 663 | unsigned long root = of_get_flat_dt_root(); |
655 | if (!of_flat_dt_is_compatible(root, "IBM,iSeries")) | 664 | if (!of_flat_dt_is_compatible(root, "IBM,iSeries")) |
656 | return 0; | 665 | return 0; |
657 | 666 | ||
658 | powerpc_firmware_features |= FW_FEATURE_ISERIES; | ||
659 | powerpc_firmware_features |= FW_FEATURE_LPAR; | ||
660 | |||
661 | hpte_init_iSeries(); | 667 | hpte_init_iSeries(); |
662 | 668 | ||
663 | return 1; | 669 | return 1; |
@@ -680,6 +686,7 @@ define_machine(iseries) { | |||
680 | .calibrate_decr = generic_calibrate_decr, | 686 | .calibrate_decr = generic_calibrate_decr, |
681 | .progress = iSeries_progress, | 687 | .progress = iSeries_progress, |
682 | .probe = iseries_probe, | 688 | .probe = iseries_probe, |
689 | .check_legacy_ioport = iseries_check_legacy_ioport, | ||
683 | /* XXX Implement enable_pmcs for iSeries */ | 690 | /* XXX Implement enable_pmcs for iSeries */ |
684 | }; | 691 | }; |
685 | 692 | ||
@@ -687,6 +694,9 @@ void * __init iSeries_early_setup(void) | |||
687 | { | 694 | { |
688 | unsigned long phys_mem_size; | 695 | unsigned long phys_mem_size; |
689 | 696 | ||
697 | powerpc_firmware_features |= FW_FEATURE_ISERIES; | ||
698 | powerpc_firmware_features |= FW_FEATURE_LPAR; | ||
699 | |||
690 | iSeries_fixup_klimit(); | 700 | iSeries_fixup_klimit(); |
691 | 701 | ||
692 | /* | 702 | /* |