diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-07 12:34:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-07 12:34:40 -0400 |
commit | c818c778b0384e5d9e8184ec43b73e05a7ced86f (patch) | |
tree | 2d50257ac6f94448f1dfe2bb65b4ff5aa383fe4a | |
parent | c8de2fa4dc2778ae3605925c127b3deac54b2b3a (diff) | |
parent | 5737789c8340620d7b542d1d4e9b197de8eb2801 (diff) |
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Pull powerpc updates from Benjamin Herrenschmidt:
"Here are a few more powerpc bits that I would like in 3.10.
Mostly remaining bolts & screw tightening of power8 support such as
actually exposing the new features via the previously added AT_HWCAP2,
and a few fixes, some of them for problems exposed recently like
irqdomain warnings or sysfs access permission issues, some exposed by
power8 hardware.
The only change outside of arch/powerpc is a small one to irqdomain.c
to allow silent failure to fix a problem on Cell where we get a dozen
WARN_ON's tripping at boot for what is basically a normal case."
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
powerpc: Make hard_irq_disable() do the right thing vs. irq tracing
powerpc/topology: Fix spurr attribute permission
powerpc/pci: Support per-aperture memory offset
powerpc/cell/iommu: Improve error message for missing node
powerpc/cell/spufs: Fix status attribute permission
irqdomain: Allow quiet failure mode
powerpc/pnv: Fix "compatible" property for P8 PHB
powerpc/pci: Don't add bogus empty resources to PHBs
powerpc/powerpnv: Properly handle failure starting CPUs
powerpc/cputable: Advertise support for ISEL/HTM/DSCR/TAR on POWER8
powerpc/cputable: Advertise ISEL support on appropriate embedded processors
powerpc/cputable: Advertise DSCR support on P7/P7+
powerpc/cputable: Reserve bits in HWCAP2 for new features
powerpc/pseries: Perform proper max_bus_speed detection
powerpc/pseries: Force 32 bit MSIs for devices that require it
powerpc/tm: Fix null pointer deference in flush_hash_page
powerpc/powernv: Defer OPAL exception handler registration
powerpc: Emulate non privileged DSCR read and write
29 files changed, 236 insertions, 128 deletions
diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h index fcc54ad159ba..26807e5aff51 100644 --- a/arch/powerpc/include/asm/cputable.h +++ b/arch/powerpc/include/asm/cputable.h | |||
@@ -224,8 +224,10 @@ extern const char *powerpc_base_platform; | |||
224 | /* We only set the TM feature if the kernel was compiled with TM supprt */ | 224 | /* We only set the TM feature if the kernel was compiled with TM supprt */ |
225 | #ifdef CONFIG_PPC_TRANSACTIONAL_MEM | 225 | #ifdef CONFIG_PPC_TRANSACTIONAL_MEM |
226 | #define CPU_FTR_TM_COMP CPU_FTR_TM | 226 | #define CPU_FTR_TM_COMP CPU_FTR_TM |
227 | #define PPC_FEATURE2_HTM_COMP PPC_FEATURE2_HTM | ||
227 | #else | 228 | #else |
228 | #define CPU_FTR_TM_COMP 0 | 229 | #define CPU_FTR_TM_COMP 0 |
230 | #define PPC_FEATURE2_HTM_COMP 0 | ||
229 | #endif | 231 | #endif |
230 | 232 | ||
231 | /* We need to mark all pages as being coherent if we're SMP or we have a | 233 | /* We need to mark all pages as being coherent if we're SMP or we have a |
diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h index e45c4947a772..d615b28dda82 100644 --- a/arch/powerpc/include/asm/hw_irq.h +++ b/arch/powerpc/include/asm/hw_irq.h | |||
@@ -95,15 +95,13 @@ static inline bool arch_irqs_disabled(void) | |||
95 | #define __hard_irq_disable() __mtmsrd(local_paca->kernel_msr, 1) | 95 | #define __hard_irq_disable() __mtmsrd(local_paca->kernel_msr, 1) |
96 | #endif | 96 | #endif |
97 | 97 | ||
98 | static inline void hard_irq_disable(void) | 98 | #define hard_irq_disable() do { \ |
99 | { | 99 | __hard_irq_disable(); \ |
100 | __hard_irq_disable(); | 100 | if (local_paca->soft_enabled) \ |
101 | get_paca()->soft_enabled = 0; | 101 | trace_hardirqs_off(); \ |
102 | get_paca()->irq_happened |= PACA_IRQ_HARD_DIS; | 102 | get_paca()->soft_enabled = 0; \ |
103 | } | 103 | get_paca()->irq_happened |= PACA_IRQ_HARD_DIS; \ |
104 | 104 | } while(0) | |
105 | /* include/linux/interrupt.h needs hard_irq_disable to be a macro */ | ||
106 | #define hard_irq_disable hard_irq_disable | ||
107 | 105 | ||
108 | static inline bool lazy_irq_pending(void) | 106 | static inline bool lazy_irq_pending(void) |
109 | { | 107 | { |
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h index 3f3f691be2e7..92386fc4e82a 100644 --- a/arch/powerpc/include/asm/machdep.h +++ b/arch/powerpc/include/asm/machdep.h | |||
@@ -29,6 +29,7 @@ struct rtc_time; | |||
29 | struct file; | 29 | struct file; |
30 | struct pci_controller; | 30 | struct pci_controller; |
31 | struct kimage; | 31 | struct kimage; |
32 | struct pci_host_bridge; | ||
32 | 33 | ||
33 | struct machdep_calls { | 34 | struct machdep_calls { |
34 | char *name; | 35 | char *name; |
@@ -108,6 +109,8 @@ struct machdep_calls { | |||
108 | void (*pcibios_fixup)(void); | 109 | void (*pcibios_fixup)(void); |
109 | int (*pci_probe_mode)(struct pci_bus *); | 110 | int (*pci_probe_mode)(struct pci_bus *); |
110 | void (*pci_irq_fixup)(struct pci_dev *dev); | 111 | void (*pci_irq_fixup)(struct pci_dev *dev); |
112 | int (*pcibios_root_bridge_prepare)(struct pci_host_bridge | ||
113 | *bridge); | ||
111 | 114 | ||
112 | /* To setup PHBs when using automatic OF platform driver for PCI */ | 115 | /* To setup PHBs when using automatic OF platform driver for PCI */ |
113 | int (*pci_setup_phb)(struct pci_controller *host); | 116 | int (*pci_setup_phb)(struct pci_controller *host); |
diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h index ffbc5fd549ac..8b11b5bd9938 100644 --- a/arch/powerpc/include/asm/pci-bridge.h +++ b/arch/powerpc/include/asm/pci-bridge.h | |||
@@ -39,11 +39,6 @@ struct pci_controller { | |||
39 | resource_size_t io_base_phys; | 39 | resource_size_t io_base_phys; |
40 | resource_size_t pci_io_size; | 40 | resource_size_t pci_io_size; |
41 | 41 | ||
42 | /* Some machines (PReP) have a non 1:1 mapping of | ||
43 | * the PCI memory space in the CPU bus space | ||
44 | */ | ||
45 | resource_size_t pci_mem_offset; | ||
46 | |||
47 | /* Some machines have a special region to forward the ISA | 42 | /* Some machines have a special region to forward the ISA |
48 | * "memory" cycles such as VGA memory regions. Left to 0 | 43 | * "memory" cycles such as VGA memory regions. Left to 0 |
49 | * if unsupported | 44 | * if unsupported |
@@ -86,6 +81,7 @@ struct pci_controller { | |||
86 | */ | 81 | */ |
87 | struct resource io_resource; | 82 | struct resource io_resource; |
88 | struct resource mem_resources[3]; | 83 | struct resource mem_resources[3]; |
84 | resource_size_t mem_offset[3]; | ||
89 | int global_number; /* PCI domain number */ | 85 | int global_number; /* PCI domain number */ |
90 | 86 | ||
91 | resource_size_t dma_window_base_cur; | 87 | resource_size_t dma_window_base_cur; |
@@ -163,6 +159,8 @@ struct pci_dn { | |||
163 | 159 | ||
164 | int pci_ext_config_space; /* for pci devices */ | 160 | int pci_ext_config_space; /* for pci devices */ |
165 | 161 | ||
162 | int force_32bit_msi:1; | ||
163 | |||
166 | struct pci_dev *pcidev; /* back-pointer to the pci device */ | 164 | struct pci_dev *pcidev; /* back-pointer to the pci device */ |
167 | #ifdef CONFIG_EEH | 165 | #ifdef CONFIG_EEH |
168 | struct eeh_dev *edev; /* eeh device */ | 166 | struct eeh_dev *edev; /* eeh device */ |
diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h index 0c34e4803499..eccfc161e58e 100644 --- a/arch/powerpc/include/asm/ppc-opcode.h +++ b/arch/powerpc/include/asm/ppc-opcode.h | |||
@@ -115,6 +115,10 @@ | |||
115 | #define PPC_INST_MFSPR_DSCR_MASK 0xfc1fffff | 115 | #define PPC_INST_MFSPR_DSCR_MASK 0xfc1fffff |
116 | #define PPC_INST_MTSPR_DSCR 0x7c1103a6 | 116 | #define PPC_INST_MTSPR_DSCR 0x7c1103a6 |
117 | #define PPC_INST_MTSPR_DSCR_MASK 0xfc1fffff | 117 | #define PPC_INST_MTSPR_DSCR_MASK 0xfc1fffff |
118 | #define PPC_INST_MFSPR_DSCR_USER 0x7c0302a6 | ||
119 | #define PPC_INST_MFSPR_DSCR_USER_MASK 0xfc1fffff | ||
120 | #define PPC_INST_MTSPR_DSCR_USER 0x7c0303a6 | ||
121 | #define PPC_INST_MTSPR_DSCR_USER_MASK 0xfc1fffff | ||
118 | #define PPC_INST_SLBFEE 0x7c0007a7 | 122 | #define PPC_INST_SLBFEE 0x7c0007a7 |
119 | 123 | ||
120 | #define PPC_INST_STRING 0x7c00042a | 124 | #define PPC_INST_STRING 0x7c00042a |
diff --git a/arch/powerpc/include/uapi/asm/cputable.h b/arch/powerpc/include/uapi/asm/cputable.h index ed9dd8156962..5b7657959faa 100644 --- a/arch/powerpc/include/uapi/asm/cputable.h +++ b/arch/powerpc/include/uapi/asm/cputable.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _UAPI__ASM_POWERPC_CPUTABLE_H | 1 | #ifndef _UAPI__ASM_POWERPC_CPUTABLE_H |
2 | #define _UAPI__ASM_POWERPC_CPUTABLE_H | 2 | #define _UAPI__ASM_POWERPC_CPUTABLE_H |
3 | 3 | ||
4 | /* in AT_HWCAP */ | ||
4 | #define PPC_FEATURE_32 0x80000000 | 5 | #define PPC_FEATURE_32 0x80000000 |
5 | #define PPC_FEATURE_64 0x40000000 | 6 | #define PPC_FEATURE_64 0x40000000 |
6 | #define PPC_FEATURE_601_INSTR 0x20000000 | 7 | #define PPC_FEATURE_601_INSTR 0x20000000 |
@@ -33,4 +34,12 @@ | |||
33 | #define PPC_FEATURE_TRUE_LE 0x00000002 | 34 | #define PPC_FEATURE_TRUE_LE 0x00000002 |
34 | #define PPC_FEATURE_PPC_LE 0x00000001 | 35 | #define PPC_FEATURE_PPC_LE 0x00000001 |
35 | 36 | ||
37 | /* in AT_HWCAP2 */ | ||
38 | #define PPC_FEATURE2_ARCH_2_07 0x80000000 | ||
39 | #define PPC_FEATURE2_HTM 0x40000000 | ||
40 | #define PPC_FEATURE2_DSCR 0x20000000 | ||
41 | #define PPC_FEATURE2_EBB 0x10000000 | ||
42 | #define PPC_FEATURE2_ISEL 0x08000000 | ||
43 | #define PPC_FEATURE2_TAR 0x04000000 | ||
44 | |||
36 | #endif /* _UAPI__ASM_POWERPC_CPUTABLE_H */ | 45 | #endif /* _UAPI__ASM_POWERPC_CPUTABLE_H */ |
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c index ae9f433daabf..c60bbec25c1f 100644 --- a/arch/powerpc/kernel/cputable.c +++ b/arch/powerpc/kernel/cputable.c | |||
@@ -98,10 +98,14 @@ extern void __restore_cpu_e6500(void); | |||
98 | PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \ | 98 | PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \ |
99 | PPC_FEATURE_TRUE_LE | \ | 99 | PPC_FEATURE_TRUE_LE | \ |
100 | PPC_FEATURE_PSERIES_PERFMON_COMPAT) | 100 | PPC_FEATURE_PSERIES_PERFMON_COMPAT) |
101 | #define COMMON_USER2_POWER7 (PPC_FEATURE2_DSCR) | ||
101 | #define COMMON_USER_POWER8 (COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_06 |\ | 102 | #define COMMON_USER_POWER8 (COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_06 |\ |
102 | PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \ | 103 | PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \ |
103 | PPC_FEATURE_TRUE_LE | \ | 104 | PPC_FEATURE_TRUE_LE | \ |
104 | PPC_FEATURE_PSERIES_PERFMON_COMPAT) | 105 | PPC_FEATURE_PSERIES_PERFMON_COMPAT) |
106 | #define COMMON_USER2_POWER8 (PPC_FEATURE2_ARCH_2_07 | \ | ||
107 | PPC_FEATURE2_HTM_COMP | PPC_FEATURE2_DSCR | \ | ||
108 | PPC_FEATURE2_ISEL | PPC_FEATURE2_TAR) | ||
105 | #define COMMON_USER_PA6T (COMMON_USER_PPC64 | PPC_FEATURE_PA6T |\ | 109 | #define COMMON_USER_PA6T (COMMON_USER_PPC64 | PPC_FEATURE_PA6T |\ |
106 | PPC_FEATURE_TRUE_LE | \ | 110 | PPC_FEATURE_TRUE_LE | \ |
107 | PPC_FEATURE_HAS_ALTIVEC_COMP) | 111 | PPC_FEATURE_HAS_ALTIVEC_COMP) |
@@ -428,6 +432,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
428 | .cpu_name = "POWER7 (architected)", | 432 | .cpu_name = "POWER7 (architected)", |
429 | .cpu_features = CPU_FTRS_POWER7, | 433 | .cpu_features = CPU_FTRS_POWER7, |
430 | .cpu_user_features = COMMON_USER_POWER7, | 434 | .cpu_user_features = COMMON_USER_POWER7, |
435 | .cpu_user_features2 = COMMON_USER2_POWER7, | ||
431 | .mmu_features = MMU_FTRS_POWER7, | 436 | .mmu_features = MMU_FTRS_POWER7, |
432 | .icache_bsize = 128, | 437 | .icache_bsize = 128, |
433 | .dcache_bsize = 128, | 438 | .dcache_bsize = 128, |
@@ -443,6 +448,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
443 | .cpu_name = "POWER8 (architected)", | 448 | .cpu_name = "POWER8 (architected)", |
444 | .cpu_features = CPU_FTRS_POWER8, | 449 | .cpu_features = CPU_FTRS_POWER8, |
445 | .cpu_user_features = COMMON_USER_POWER8, | 450 | .cpu_user_features = COMMON_USER_POWER8, |
451 | .cpu_user_features2 = COMMON_USER2_POWER8, | ||
446 | .mmu_features = MMU_FTRS_POWER8, | 452 | .mmu_features = MMU_FTRS_POWER8, |
447 | .icache_bsize = 128, | 453 | .icache_bsize = 128, |
448 | .dcache_bsize = 128, | 454 | .dcache_bsize = 128, |
@@ -458,6 +464,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
458 | .cpu_name = "POWER7 (raw)", | 464 | .cpu_name = "POWER7 (raw)", |
459 | .cpu_features = CPU_FTRS_POWER7, | 465 | .cpu_features = CPU_FTRS_POWER7, |
460 | .cpu_user_features = COMMON_USER_POWER7, | 466 | .cpu_user_features = COMMON_USER_POWER7, |
467 | .cpu_user_features2 = COMMON_USER2_POWER7, | ||
461 | .mmu_features = MMU_FTRS_POWER7, | 468 | .mmu_features = MMU_FTRS_POWER7, |
462 | .icache_bsize = 128, | 469 | .icache_bsize = 128, |
463 | .dcache_bsize = 128, | 470 | .dcache_bsize = 128, |
@@ -475,6 +482,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
475 | .cpu_name = "POWER7+ (raw)", | 482 | .cpu_name = "POWER7+ (raw)", |
476 | .cpu_features = CPU_FTRS_POWER7, | 483 | .cpu_features = CPU_FTRS_POWER7, |
477 | .cpu_user_features = COMMON_USER_POWER7, | 484 | .cpu_user_features = COMMON_USER_POWER7, |
485 | .cpu_user_features = COMMON_USER2_POWER7, | ||
478 | .mmu_features = MMU_FTRS_POWER7, | 486 | .mmu_features = MMU_FTRS_POWER7, |
479 | .icache_bsize = 128, | 487 | .icache_bsize = 128, |
480 | .dcache_bsize = 128, | 488 | .dcache_bsize = 128, |
@@ -492,6 +500,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
492 | .cpu_name = "POWER8 (raw)", | 500 | .cpu_name = "POWER8 (raw)", |
493 | .cpu_features = CPU_FTRS_POWER8, | 501 | .cpu_features = CPU_FTRS_POWER8, |
494 | .cpu_user_features = COMMON_USER_POWER8, | 502 | .cpu_user_features = COMMON_USER_POWER8, |
503 | .cpu_user_features2 = COMMON_USER2_POWER8, | ||
495 | .mmu_features = MMU_FTRS_POWER8, | 504 | .mmu_features = MMU_FTRS_POWER8, |
496 | .icache_bsize = 128, | 505 | .icache_bsize = 128, |
497 | .dcache_bsize = 128, | 506 | .dcache_bsize = 128, |
@@ -1995,6 +2004,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
1995 | .cpu_user_features = COMMON_USER_BOOKE | | 2004 | .cpu_user_features = COMMON_USER_BOOKE | |
1996 | PPC_FEATURE_HAS_SPE_COMP | | 2005 | PPC_FEATURE_HAS_SPE_COMP | |
1997 | PPC_FEATURE_HAS_EFP_SINGLE_COMP, | 2006 | PPC_FEATURE_HAS_EFP_SINGLE_COMP, |
2007 | .cpu_user_features2 = PPC_FEATURE2_ISEL, | ||
1998 | .mmu_features = MMU_FTR_TYPE_FSL_E, | 2008 | .mmu_features = MMU_FTR_TYPE_FSL_E, |
1999 | .icache_bsize = 32, | 2009 | .icache_bsize = 32, |
2000 | .dcache_bsize = 32, | 2010 | .dcache_bsize = 32, |
@@ -2014,6 +2024,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
2014 | PPC_FEATURE_HAS_SPE_COMP | | 2024 | PPC_FEATURE_HAS_SPE_COMP | |
2015 | PPC_FEATURE_HAS_EFP_SINGLE_COMP | | 2025 | PPC_FEATURE_HAS_EFP_SINGLE_COMP | |
2016 | PPC_FEATURE_HAS_EFP_DOUBLE_COMP, | 2026 | PPC_FEATURE_HAS_EFP_DOUBLE_COMP, |
2027 | .cpu_user_features2 = PPC_FEATURE2_ISEL, | ||
2017 | .mmu_features = MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS, | 2028 | .mmu_features = MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS, |
2018 | .icache_bsize = 32, | 2029 | .icache_bsize = 32, |
2019 | .dcache_bsize = 32, | 2030 | .dcache_bsize = 32, |
@@ -2030,6 +2041,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
2030 | .cpu_name = "e500mc", | 2041 | .cpu_name = "e500mc", |
2031 | .cpu_features = CPU_FTRS_E500MC, | 2042 | .cpu_features = CPU_FTRS_E500MC, |
2032 | .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU, | 2043 | .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU, |
2044 | .cpu_user_features2 = PPC_FEATURE2_ISEL, | ||
2033 | .mmu_features = MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS | | 2045 | .mmu_features = MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS | |
2034 | MMU_FTR_USE_TLBILX, | 2046 | MMU_FTR_USE_TLBILX, |
2035 | .icache_bsize = 64, | 2047 | .icache_bsize = 64, |
@@ -2048,6 +2060,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
2048 | .cpu_name = "e5500", | 2060 | .cpu_name = "e5500", |
2049 | .cpu_features = CPU_FTRS_E5500, | 2061 | .cpu_features = CPU_FTRS_E5500, |
2050 | .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU, | 2062 | .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU, |
2063 | .cpu_user_features2 = PPC_FEATURE2_ISEL, | ||
2051 | .mmu_features = MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS | | 2064 | .mmu_features = MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS | |
2052 | MMU_FTR_USE_TLBILX, | 2065 | MMU_FTR_USE_TLBILX, |
2053 | .icache_bsize = 64, | 2066 | .icache_bsize = 64, |
@@ -2069,6 +2082,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
2069 | .cpu_features = CPU_FTRS_E6500, | 2082 | .cpu_features = CPU_FTRS_E6500, |
2070 | .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU | | 2083 | .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU | |
2071 | PPC_FEATURE_HAS_ALTIVEC_COMP, | 2084 | PPC_FEATURE_HAS_ALTIVEC_COMP, |
2085 | .cpu_user_features2 = PPC_FEATURE2_ISEL, | ||
2072 | .mmu_features = MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS | | 2086 | .mmu_features = MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS | |
2073 | MMU_FTR_USE_TLBILX, | 2087 | MMU_FTR_USE_TLBILX, |
2074 | .icache_bsize = 64, | 2088 | .icache_bsize = 64, |
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index f325dc923409..f5c5c90799a7 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
@@ -786,22 +786,8 @@ void pci_process_bridge_OF_ranges(struct pci_controller *hose, | |||
786 | hose->isa_mem_size = size; | 786 | hose->isa_mem_size = size; |
787 | } | 787 | } |
788 | 788 | ||
789 | /* We get the PCI/Mem offset from the first range or | ||
790 | * the, current one if the offset came from an ISA | ||
791 | * hole. If they don't match, bugger. | ||
792 | */ | ||
793 | if (memno == 0 || | ||
794 | (isa_hole >= 0 && pci_addr != 0 && | ||
795 | hose->pci_mem_offset == isa_mb)) | ||
796 | hose->pci_mem_offset = cpu_addr - pci_addr; | ||
797 | else if (pci_addr != 0 && | ||
798 | hose->pci_mem_offset != cpu_addr - pci_addr) { | ||
799 | printk(KERN_INFO | ||
800 | " \\--> Skipped (offset mismatch) !\n"); | ||
801 | continue; | ||
802 | } | ||
803 | |||
804 | /* Build resource */ | 789 | /* Build resource */ |
790 | hose->mem_offset[memno] = cpu_addr - pci_addr; | ||
805 | res = &hose->mem_resources[memno++]; | 791 | res = &hose->mem_resources[memno++]; |
806 | res->flags = IORESOURCE_MEM; | 792 | res->flags = IORESOURCE_MEM; |
807 | if (pci_space & 0x40000000) | 793 | if (pci_space & 0x40000000) |
@@ -817,20 +803,6 @@ void pci_process_bridge_OF_ranges(struct pci_controller *hose, | |||
817 | res->child = NULL; | 803 | res->child = NULL; |
818 | } | 804 | } |
819 | } | 805 | } |
820 | |||
821 | /* If there's an ISA hole and the pci_mem_offset is -not- matching | ||
822 | * the ISA hole offset, then we need to remove the ISA hole from | ||
823 | * the resource list for that brige | ||
824 | */ | ||
825 | if (isa_hole >= 0 && hose->pci_mem_offset != isa_mb) { | ||
826 | unsigned int next = isa_hole + 1; | ||
827 | printk(KERN_INFO " Removing ISA hole at 0x%016llx\n", isa_mb); | ||
828 | if (next < memno) | ||
829 | memmove(&hose->mem_resources[isa_hole], | ||
830 | &hose->mem_resources[next], | ||
831 | sizeof(struct resource) * (memno - next)); | ||
832 | hose->mem_resources[--memno].flags = 0; | ||
833 | } | ||
834 | } | 806 | } |
835 | 807 | ||
836 | /* Decide whether to display the domain number in /proc */ | 808 | /* Decide whether to display the domain number in /proc */ |
@@ -845,6 +817,14 @@ int pci_proc_domain(struct pci_bus *bus) | |||
845 | return 1; | 817 | return 1; |
846 | } | 818 | } |
847 | 819 | ||
820 | int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge) | ||
821 | { | ||
822 | if (ppc_md.pcibios_root_bridge_prepare) | ||
823 | return ppc_md.pcibios_root_bridge_prepare(bridge); | ||
824 | |||
825 | return 0; | ||
826 | } | ||
827 | |||
848 | /* This header fixup will do the resource fixup for all devices as they are | 828 | /* This header fixup will do the resource fixup for all devices as they are |
849 | * probed, but not for bridge ranges | 829 | * probed, but not for bridge ranges |
850 | */ | 830 | */ |
@@ -908,6 +888,7 @@ static int pcibios_uninitialized_bridge_resource(struct pci_bus *bus, | |||
908 | struct pci_controller *hose = pci_bus_to_host(bus); | 888 | struct pci_controller *hose = pci_bus_to_host(bus); |
909 | struct pci_dev *dev = bus->self; | 889 | struct pci_dev *dev = bus->self; |
910 | resource_size_t offset; | 890 | resource_size_t offset; |
891 | struct pci_bus_region region; | ||
911 | u16 command; | 892 | u16 command; |
912 | int i; | 893 | int i; |
913 | 894 | ||
@@ -917,10 +898,10 @@ static int pcibios_uninitialized_bridge_resource(struct pci_bus *bus, | |||
917 | 898 | ||
918 | /* Job is a bit different between memory and IO */ | 899 | /* Job is a bit different between memory and IO */ |
919 | if (res->flags & IORESOURCE_MEM) { | 900 | if (res->flags & IORESOURCE_MEM) { |
920 | /* If the BAR is non-0 (res != pci_mem_offset) then it's probably been | 901 | pcibios_resource_to_bus(dev, ®ion, res); |
921 | * initialized by somebody | 902 | |
922 | */ | 903 | /* If the BAR is non-0 then it's probably been initialized */ |
923 | if (res->start != hose->pci_mem_offset) | 904 | if (region.start != 0) |
924 | return 0; | 905 | return 0; |
925 | 906 | ||
926 | /* The BAR is 0, let's check if memory decoding is enabled on | 907 | /* The BAR is 0, let's check if memory decoding is enabled on |
@@ -932,11 +913,11 @@ static int pcibios_uninitialized_bridge_resource(struct pci_bus *bus, | |||
932 | 913 | ||
933 | /* Memory decoding is enabled and the BAR is 0. If any of the bridge | 914 | /* Memory decoding is enabled and the BAR is 0. If any of the bridge |
934 | * resources covers that starting address (0 then it's good enough for | 915 | * resources covers that starting address (0 then it's good enough for |
935 | * us for memory | 916 | * us for memory space) |
936 | */ | 917 | */ |
937 | for (i = 0; i < 3; i++) { | 918 | for (i = 0; i < 3; i++) { |
938 | if ((hose->mem_resources[i].flags & IORESOURCE_MEM) && | 919 | if ((hose->mem_resources[i].flags & IORESOURCE_MEM) && |
939 | hose->mem_resources[i].start == hose->pci_mem_offset) | 920 | hose->mem_resources[i].start == hose->mem_offset[i]) |
940 | return 0; | 921 | return 0; |
941 | } | 922 | } |
942 | 923 | ||
@@ -1373,10 +1354,9 @@ static void __init pcibios_reserve_legacy_regions(struct pci_bus *bus) | |||
1373 | 1354 | ||
1374 | no_io: | 1355 | no_io: |
1375 | /* Check for memory */ | 1356 | /* Check for memory */ |
1376 | offset = hose->pci_mem_offset; | ||
1377 | pr_debug("hose mem offset: %016llx\n", (unsigned long long)offset); | ||
1378 | for (i = 0; i < 3; i++) { | 1357 | for (i = 0; i < 3; i++) { |
1379 | pres = &hose->mem_resources[i]; | 1358 | pres = &hose->mem_resources[i]; |
1359 | offset = hose->mem_offset[i]; | ||
1380 | if (!(pres->flags & IORESOURCE_MEM)) | 1360 | if (!(pres->flags & IORESOURCE_MEM)) |
1381 | continue; | 1361 | continue; |
1382 | pr_debug("hose mem res: %pR\n", pres); | 1362 | pr_debug("hose mem res: %pR\n", pres); |
@@ -1516,6 +1496,7 @@ static void pcibios_setup_phb_resources(struct pci_controller *hose, | |||
1516 | struct list_head *resources) | 1496 | struct list_head *resources) |
1517 | { | 1497 | { |
1518 | struct resource *res; | 1498 | struct resource *res; |
1499 | resource_size_t offset; | ||
1519 | int i; | 1500 | int i; |
1520 | 1501 | ||
1521 | /* Hookup PHB IO resource */ | 1502 | /* Hookup PHB IO resource */ |
@@ -1525,49 +1506,37 @@ static void pcibios_setup_phb_resources(struct pci_controller *hose, | |||
1525 | printk(KERN_WARNING "PCI: I/O resource not set for host" | 1506 | printk(KERN_WARNING "PCI: I/O resource not set for host" |
1526 | " bridge %s (domain %d)\n", | 1507 | " bridge %s (domain %d)\n", |
1527 | hose->dn->full_name, hose->global_number); | 1508 | hose->dn->full_name, hose->global_number); |
1528 | #ifdef CONFIG_PPC32 | 1509 | } else { |
1529 | /* Workaround for lack of IO resource only on 32-bit */ | 1510 | offset = pcibios_io_space_offset(hose); |
1530 | res->start = (unsigned long)hose->io_base_virt - isa_io_base; | ||
1531 | res->end = res->start + IO_SPACE_LIMIT; | ||
1532 | res->flags = IORESOURCE_IO; | ||
1533 | #endif /* CONFIG_PPC32 */ | ||
1534 | } | ||
1535 | 1511 | ||
1536 | pr_debug("PCI: PHB IO resource = %016llx-%016llx [%lx]\n", | 1512 | pr_debug("PCI: PHB IO resource = %08llx-%08llx [%lx] off 0x%08llx\n", |
1537 | (unsigned long long)res->start, | 1513 | (unsigned long long)res->start, |
1538 | (unsigned long long)res->end, | 1514 | (unsigned long long)res->end, |
1539 | (unsigned long)res->flags); | 1515 | (unsigned long)res->flags, |
1540 | pci_add_resource_offset(resources, res, pcibios_io_space_offset(hose)); | 1516 | (unsigned long long)offset); |
1517 | pci_add_resource_offset(resources, res, offset); | ||
1518 | } | ||
1541 | 1519 | ||
1542 | /* Hookup PHB Memory resources */ | 1520 | /* Hookup PHB Memory resources */ |
1543 | for (i = 0; i < 3; ++i) { | 1521 | for (i = 0; i < 3; ++i) { |
1544 | res = &hose->mem_resources[i]; | 1522 | res = &hose->mem_resources[i]; |
1545 | if (!res->flags) { | 1523 | if (!res->flags) { |
1546 | if (i > 0) | ||
1547 | continue; | ||
1548 | printk(KERN_ERR "PCI: Memory resource 0 not set for " | 1524 | printk(KERN_ERR "PCI: Memory resource 0 not set for " |
1549 | "host bridge %s (domain %d)\n", | 1525 | "host bridge %s (domain %d)\n", |
1550 | hose->dn->full_name, hose->global_number); | 1526 | hose->dn->full_name, hose->global_number); |
1551 | #ifdef CONFIG_PPC32 | 1527 | continue; |
1552 | /* Workaround for lack of MEM resource only on 32-bit */ | ||
1553 | res->start = hose->pci_mem_offset; | ||
1554 | res->end = (resource_size_t)-1LL; | ||
1555 | res->flags = IORESOURCE_MEM; | ||
1556 | #endif /* CONFIG_PPC32 */ | ||
1557 | } | 1528 | } |
1529 | offset = hose->mem_offset[i]; | ||
1558 | 1530 | ||
1559 | pr_debug("PCI: PHB MEM resource %d = %016llx-%016llx [%lx]\n", i, | 1531 | |
1532 | pr_debug("PCI: PHB MEM resource %d = %08llx-%08llx [%lx] off 0x%08llx\n", i, | ||
1560 | (unsigned long long)res->start, | 1533 | (unsigned long long)res->start, |
1561 | (unsigned long long)res->end, | 1534 | (unsigned long long)res->end, |
1562 | (unsigned long)res->flags); | 1535 | (unsigned long)res->flags, |
1563 | pci_add_resource_offset(resources, res, hose->pci_mem_offset); | 1536 | (unsigned long long)offset); |
1564 | } | ||
1565 | |||
1566 | pr_debug("PCI: PHB MEM offset = %016llx\n", | ||
1567 | (unsigned long long)hose->pci_mem_offset); | ||
1568 | pr_debug("PCI: PHB IO offset = %08lx\n", | ||
1569 | (unsigned long)hose->io_base_virt - _IO_BASE); | ||
1570 | 1537 | ||
1538 | pci_add_resource_offset(resources, res, offset); | ||
1539 | } | ||
1571 | } | 1540 | } |
1572 | 1541 | ||
1573 | /* | 1542 | /* |
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c index e37c2152acf4..432459c817fa 100644 --- a/arch/powerpc/kernel/pci_32.c +++ b/arch/powerpc/kernel/pci_32.c | |||
@@ -295,7 +295,7 @@ long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn) | |||
295 | case IOBASE_BRIDGE_NUMBER: | 295 | case IOBASE_BRIDGE_NUMBER: |
296 | return (long)hose->first_busno; | 296 | return (long)hose->first_busno; |
297 | case IOBASE_MEMORY: | 297 | case IOBASE_MEMORY: |
298 | return (long)hose->pci_mem_offset; | 298 | return (long)hose->mem_offset[0]; |
299 | case IOBASE_IO: | 299 | case IOBASE_IO: |
300 | return (long)hose->io_base_phys; | 300 | return (long)hose->io_base_phys; |
301 | case IOBASE_ISA_IO: | 301 | case IOBASE_ISA_IO: |
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index 51a133a78a09..873050d26840 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
@@ -246,7 +246,7 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus, | |||
246 | case IOBASE_BRIDGE_NUMBER: | 246 | case IOBASE_BRIDGE_NUMBER: |
247 | return (long)hose->first_busno; | 247 | return (long)hose->first_busno; |
248 | case IOBASE_MEMORY: | 248 | case IOBASE_MEMORY: |
249 | return (long)hose->pci_mem_offset; | 249 | return (long)hose->mem_offset[0]; |
250 | case IOBASE_IO: | 250 | case IOBASE_IO: |
251 | return (long)hose->io_base_phys; | 251 | return (long)hose->io_base_phys; |
252 | case IOBASE_ISA_IO: | 252 | case IOBASE_ISA_IO: |
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c index 3ce1f864c2d3..e68a84568b8b 100644 --- a/arch/powerpc/kernel/sysfs.c +++ b/arch/powerpc/kernel/sysfs.c | |||
@@ -180,7 +180,7 @@ SYSFS_PMCSETUP(dscr, SPRN_DSCR); | |||
180 | SYSFS_PMCSETUP(pir, SPRN_PIR); | 180 | SYSFS_PMCSETUP(pir, SPRN_PIR); |
181 | 181 | ||
182 | static DEVICE_ATTR(mmcra, 0600, show_mmcra, store_mmcra); | 182 | static DEVICE_ATTR(mmcra, 0600, show_mmcra, store_mmcra); |
183 | static DEVICE_ATTR(spurr, 0600, show_spurr, NULL); | 183 | static DEVICE_ATTR(spurr, 0400, show_spurr, NULL); |
184 | static DEVICE_ATTR(dscr, 0600, show_dscr, store_dscr); | 184 | static DEVICE_ATTR(dscr, 0600, show_dscr, store_dscr); |
185 | static DEVICE_ATTR(purr, 0600, show_purr, store_purr); | 185 | static DEVICE_ATTR(purr, 0600, show_purr, store_purr); |
186 | static DEVICE_ATTR(pir, 0400, show_pir, NULL); | 186 | static DEVICE_ATTR(pir, 0400, show_pir, NULL); |
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 37cc40ef5043..83efa2f7d926 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c | |||
@@ -970,7 +970,10 @@ static int emulate_instruction(struct pt_regs *regs) | |||
970 | 970 | ||
971 | #ifdef CONFIG_PPC64 | 971 | #ifdef CONFIG_PPC64 |
972 | /* Emulate the mfspr rD, DSCR. */ | 972 | /* Emulate the mfspr rD, DSCR. */ |
973 | if (((instword & PPC_INST_MFSPR_DSCR_MASK) == PPC_INST_MFSPR_DSCR) && | 973 | if ((((instword & PPC_INST_MFSPR_DSCR_USER_MASK) == |
974 | PPC_INST_MFSPR_DSCR_USER) || | ||
975 | ((instword & PPC_INST_MFSPR_DSCR_MASK) == | ||
976 | PPC_INST_MFSPR_DSCR)) && | ||
974 | cpu_has_feature(CPU_FTR_DSCR)) { | 977 | cpu_has_feature(CPU_FTR_DSCR)) { |
975 | PPC_WARN_EMULATED(mfdscr, regs); | 978 | PPC_WARN_EMULATED(mfdscr, regs); |
976 | rd = (instword >> 21) & 0x1f; | 979 | rd = (instword >> 21) & 0x1f; |
@@ -978,7 +981,10 @@ static int emulate_instruction(struct pt_regs *regs) | |||
978 | return 0; | 981 | return 0; |
979 | } | 982 | } |
980 | /* Emulate the mtspr DSCR, rD. */ | 983 | /* Emulate the mtspr DSCR, rD. */ |
981 | if (((instword & PPC_INST_MTSPR_DSCR_MASK) == PPC_INST_MTSPR_DSCR) && | 984 | if ((((instword & PPC_INST_MTSPR_DSCR_USER_MASK) == |
985 | PPC_INST_MTSPR_DSCR_USER) || | ||
986 | ((instword & PPC_INST_MTSPR_DSCR_MASK) == | ||
987 | PPC_INST_MTSPR_DSCR)) && | ||
982 | cpu_has_feature(CPU_FTR_DSCR)) { | 988 | cpu_has_feature(CPU_FTR_DSCR)) { |
983 | PPC_WARN_EMULATED(mtdscr, regs); | 989 | PPC_WARN_EMULATED(mtdscr, regs); |
984 | rd = (instword >> 21) & 0x1f; | 990 | rd = (instword >> 21) & 0x1f; |
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index 3e4c4ed19335..88ac0eeaadde 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
@@ -1230,6 +1230,7 @@ void flush_hash_page(unsigned long vpn, real_pte_t pte, int psize, int ssize, | |||
1230 | * unmapping it first, it may see the speculated version. | 1230 | * unmapping it first, it may see the speculated version. |
1231 | */ | 1231 | */ |
1232 | if (local && cpu_has_feature(CPU_FTR_TM) && | 1232 | if (local && cpu_has_feature(CPU_FTR_TM) && |
1233 | current->thread.regs && | ||
1233 | MSR_TM_ACTIVE(current->thread.regs->msr)) { | 1234 | MSR_TM_ACTIVE(current->thread.regs->msr)) { |
1234 | tm_enable(); | 1235 | tm_enable(); |
1235 | tm_abort(TM_CAUSE_TLBI); | 1236 | tm_abort(TM_CAUSE_TLBI); |
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c index e56bb651da1a..946306b1bb4e 100644 --- a/arch/powerpc/platforms/cell/iommu.c +++ b/arch/powerpc/platforms/cell/iommu.c | |||
@@ -550,7 +550,7 @@ static struct iommu_table *cell_get_iommu_table(struct device *dev) | |||
550 | */ | 550 | */ |
551 | iommu = cell_iommu_for_node(dev_to_node(dev)); | 551 | iommu = cell_iommu_for_node(dev_to_node(dev)); |
552 | if (iommu == NULL || list_empty(&iommu->windows)) { | 552 | if (iommu == NULL || list_empty(&iommu->windows)) { |
553 | printk(KERN_ERR "iommu: missing iommu for %s (node %d)\n", | 553 | dev_err(dev, "iommu: missing iommu for %s (node %d)\n", |
554 | of_node_full_name(dev->of_node), dev_to_node(dev)); | 554 | of_node_full_name(dev->of_node), dev_to_node(dev)); |
555 | return NULL; | 555 | return NULL; |
556 | } | 556 | } |
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c index 8b1213993b10..f85db3a69b4a 100644 --- a/arch/powerpc/platforms/cell/spu_base.c +++ b/arch/powerpc/platforms/cell/spu_base.c | |||
@@ -715,7 +715,7 @@ static ssize_t spu_stat_show(struct device *dev, | |||
715 | spu->stats.libassist); | 715 | spu->stats.libassist); |
716 | } | 716 | } |
717 | 717 | ||
718 | static DEVICE_ATTR(stat, 0644, spu_stat_show, NULL); | 718 | static DEVICE_ATTR(stat, 0444, spu_stat_show, NULL); |
719 | 719 | ||
720 | #ifdef CONFIG_KEXEC | 720 | #ifdef CONFIG_KEXEC |
721 | 721 | ||
diff --git a/arch/powerpc/platforms/embedded6xx/mpc10x.h b/arch/powerpc/platforms/embedded6xx/mpc10x.h index b30a6a3b5bd2..b290b63661f1 100644 --- a/arch/powerpc/platforms/embedded6xx/mpc10x.h +++ b/arch/powerpc/platforms/embedded6xx/mpc10x.h | |||
@@ -81,17 +81,6 @@ | |||
81 | #define MPC10X_MAPB_PCI_MEM_OFFSET (MPC10X_MAPB_ISA_MEM_BASE - \ | 81 | #define MPC10X_MAPB_PCI_MEM_OFFSET (MPC10X_MAPB_ISA_MEM_BASE - \ |
82 | MPC10X_MAPB_PCI_MEM_START) | 82 | MPC10X_MAPB_PCI_MEM_START) |
83 | 83 | ||
84 | /* Set hose members to values appropriate for the mem map used */ | ||
85 | #define MPC10X_SETUP_HOSE(hose, map) { \ | ||
86 | (hose)->pci_mem_offset = MPC10X_MAP##map##_PCI_MEM_OFFSET; \ | ||
87 | (hose)->io_space.start = MPC10X_MAP##map##_PCI_IO_START; \ | ||
88 | (hose)->io_space.end = MPC10X_MAP##map##_PCI_IO_END; \ | ||
89 | (hose)->mem_space.start = MPC10X_MAP##map##_PCI_MEM_START; \ | ||
90 | (hose)->mem_space.end = MPC10X_MAP##map##_PCI_MEM_END; \ | ||
91 | (hose)->io_base_virt = (void *)MPC10X_MAP##map##_ISA_IO_BASE; \ | ||
92 | } | ||
93 | |||
94 | |||
95 | /* Miscellaneous Configuration register offsets */ | 84 | /* Miscellaneous Configuration register offsets */ |
96 | #define MPC10X_CFG_PIR_REG 0x09 | 85 | #define MPC10X_CFG_PIR_REG 0x09 |
97 | #define MPC10X_CFG_PIR_HOST_BRIDGE 0x00 | 86 | #define MPC10X_CFG_PIR_HOST_BRIDGE 0x00 |
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c index 2b8af75abc23..cf7009b8c7b6 100644 --- a/arch/powerpc/platforms/powermac/pci.c +++ b/arch/powerpc/platforms/powermac/pci.c | |||
@@ -824,6 +824,7 @@ static void __init parse_region_decode(struct pci_controller *hose, | |||
824 | hose->mem_resources[cur].name = hose->dn->full_name; | 824 | hose->mem_resources[cur].name = hose->dn->full_name; |
825 | hose->mem_resources[cur].start = base; | 825 | hose->mem_resources[cur].start = base; |
826 | hose->mem_resources[cur].end = end; | 826 | hose->mem_resources[cur].end = end; |
827 | hose->mem_offset[cur] = 0; | ||
827 | DBG(" %d: 0x%08lx-0x%08lx\n", cur, base, end); | 828 | DBG(" %d: 0x%08lx-0x%08lx\n", cur, base, end); |
828 | } else { | 829 | } else { |
829 | DBG(" : -0x%08lx\n", end); | 830 | DBG(" : -0x%08lx\n", end); |
@@ -866,7 +867,6 @@ static void __init setup_u3_ht(struct pci_controller* hose) | |||
866 | hose->io_resource.start = 0; | 867 | hose->io_resource.start = 0; |
867 | hose->io_resource.end = 0x003fffff; | 868 | hose->io_resource.end = 0x003fffff; |
868 | hose->io_resource.flags = IORESOURCE_IO; | 869 | hose->io_resource.flags = IORESOURCE_IO; |
869 | hose->pci_mem_offset = 0; | ||
870 | hose->first_busno = 0; | 870 | hose->first_busno = 0; |
871 | hose->last_busno = 0xef; | 871 | hose->last_busno = 0xef; |
872 | 872 | ||
diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c index aaa0dba49471..ade4463226c6 100644 --- a/arch/powerpc/platforms/powernv/opal.c +++ b/arch/powerpc/platforms/powernv/opal.c | |||
@@ -34,7 +34,6 @@ int __init early_init_dt_scan_opal(unsigned long node, | |||
34 | { | 34 | { |
35 | const void *basep, *entryp; | 35 | const void *basep, *entryp; |
36 | unsigned long basesz, entrysz; | 36 | unsigned long basesz, entrysz; |
37 | u64 glue; | ||
38 | 37 | ||
39 | if (depth != 1 || strcmp(uname, "ibm,opal") != 0) | 38 | if (depth != 1 || strcmp(uname, "ibm,opal") != 0) |
40 | return 0; | 39 | return 0; |
@@ -61,6 +60,16 @@ int __init early_init_dt_scan_opal(unsigned long node, | |||
61 | printk("OPAL V1 detected !\n"); | 60 | printk("OPAL V1 detected !\n"); |
62 | } | 61 | } |
63 | 62 | ||
63 | return 1; | ||
64 | } | ||
65 | |||
66 | static int __init opal_register_exception_handlers(void) | ||
67 | { | ||
68 | u64 glue; | ||
69 | |||
70 | if (!(powerpc_firmware_features & FW_FEATURE_OPAL)) | ||
71 | return -ENODEV; | ||
72 | |||
64 | /* Hookup some exception handlers. We use the fwnmi area at 0x7000 | 73 | /* Hookup some exception handlers. We use the fwnmi area at 0x7000 |
65 | * to provide the glue space to OPAL | 74 | * to provide the glue space to OPAL |
66 | */ | 75 | */ |
@@ -74,9 +83,11 @@ int __init early_init_dt_scan_opal(unsigned long node, | |||
74 | glue += 128; | 83 | glue += 128; |
75 | opal_register_exception_handler(OPAL_SOFTPATCH_HANDLER, 0, glue); | 84 | opal_register_exception_handler(OPAL_SOFTPATCH_HANDLER, 0, glue); |
76 | 85 | ||
77 | return 1; | 86 | return 0; |
78 | } | 87 | } |
79 | 88 | ||
89 | early_initcall(opal_register_exception_handlers); | ||
90 | |||
80 | int opal_get_chars(uint32_t vtermno, char *buf, int count) | 91 | int opal_get_chars(uint32_t vtermno, char *buf, int count) |
81 | { | 92 | { |
82 | s64 len, rc; | 93 | s64 len, rc; |
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 8c6c9cf91c13..1da578b7c1bf 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c | |||
@@ -915,11 +915,14 @@ static void pnv_ioda_setup_pe_seg(struct pci_controller *hose, | |||
915 | index++; | 915 | index++; |
916 | } | 916 | } |
917 | } else if (res->flags & IORESOURCE_MEM) { | 917 | } else if (res->flags & IORESOURCE_MEM) { |
918 | /* WARNING: Assumes M32 is mem region 0 in PHB. We need to | ||
919 | * harden that algorithm when we start supporting M64 | ||
920 | */ | ||
918 | region.start = res->start - | 921 | region.start = res->start - |
919 | hose->pci_mem_offset - | 922 | hose->mem_offset[0] - |
920 | phb->ioda.m32_pci_base; | 923 | phb->ioda.m32_pci_base; |
921 | region.end = res->end - | 924 | region.end = res->end - |
922 | hose->pci_mem_offset - | 925 | hose->mem_offset[0] - |
923 | phb->ioda.m32_pci_base; | 926 | phb->ioda.m32_pci_base; |
924 | index = region.start / phb->ioda.m32_segsize; | 927 | index = region.start / phb->ioda.m32_segsize; |
925 | 928 | ||
@@ -1089,7 +1092,7 @@ void __init pnv_pci_init_ioda_phb(struct device_node *np, int ioda_type) | |||
1089 | /* Detect specific models for error handling */ | 1092 | /* Detect specific models for error handling */ |
1090 | if (of_device_is_compatible(np, "ibm,p7ioc-pciex")) | 1093 | if (of_device_is_compatible(np, "ibm,p7ioc-pciex")) |
1091 | phb->model = PNV_PHB_MODEL_P7IOC; | 1094 | phb->model = PNV_PHB_MODEL_P7IOC; |
1092 | else if (of_device_is_compatible(np, "ibm,p8-pciex")) | 1095 | else if (of_device_is_compatible(np, "ibm,power8-pciex")) |
1093 | phb->model = PNV_PHB_MODEL_PHB3; | 1096 | phb->model = PNV_PHB_MODEL_PHB3; |
1094 | else | 1097 | else |
1095 | phb->model = PNV_PHB_MODEL_UNKNOWN; | 1098 | phb->model = PNV_PHB_MODEL_UNKNOWN; |
@@ -1115,8 +1118,7 @@ void __init pnv_pci_init_ioda_phb(struct device_node *np, int ioda_type) | |||
1115 | phb->ioda.m32_size += 0x10000; | 1118 | phb->ioda.m32_size += 0x10000; |
1116 | 1119 | ||
1117 | phb->ioda.m32_segsize = phb->ioda.m32_size / phb->ioda.total_pe; | 1120 | phb->ioda.m32_segsize = phb->ioda.m32_size / phb->ioda.total_pe; |
1118 | phb->ioda.m32_pci_base = hose->mem_resources[0].start - | 1121 | phb->ioda.m32_pci_base = hose->mem_resources[0].start - hose->mem_offset[0]; |
1119 | hose->pci_mem_offset; | ||
1120 | phb->ioda.io_size = hose->pci_io_size; | 1122 | phb->ioda.io_size = hose->pci_io_size; |
1121 | phb->ioda.io_segsize = phb->ioda.io_size / phb->ioda.total_pe; | 1123 | phb->ioda.io_segsize = phb->ioda.io_size / phb->ioda.total_pe; |
1122 | phb->ioda.io_pci_base = 0; /* XXX calculate this ? */ | 1124 | phb->ioda.io_pci_base = 0; /* XXX calculate this ? */ |
diff --git a/arch/powerpc/platforms/powernv/smp.c b/arch/powerpc/platforms/powernv/smp.c index 0bdc735db16f..6a3ecca5b725 100644 --- a/arch/powerpc/platforms/powernv/smp.c +++ b/arch/powerpc/platforms/powernv/smp.c | |||
@@ -77,9 +77,11 @@ int pnv_smp_kick_cpu(int nr) | |||
77 | if (!paca[nr].cpu_start && firmware_has_feature(FW_FEATURE_OPALv2)) { | 77 | if (!paca[nr].cpu_start && firmware_has_feature(FW_FEATURE_OPALv2)) { |
78 | pr_devel("OPAL: Starting CPU %d (HW 0x%x)...\n", nr, pcpu); | 78 | pr_devel("OPAL: Starting CPU %d (HW 0x%x)...\n", nr, pcpu); |
79 | rc = opal_start_cpu(pcpu, start_here); | 79 | rc = opal_start_cpu(pcpu, start_here); |
80 | if (rc != OPAL_SUCCESS) | 80 | if (rc != OPAL_SUCCESS) { |
81 | pr_warn("OPAL Error %ld starting CPU %d\n", | 81 | pr_warn("OPAL Error %ld starting CPU %d\n", |
82 | rc, nr); | 82 | rc, nr); |
83 | return -ENODEV; | ||
84 | } | ||
83 | } | 85 | } |
84 | return smp_generic_kick_cpu(nr); | 86 | return smp_generic_kick_cpu(nr); |
85 | } | 87 | } |
diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c index e5b084723131..420524e6f8c9 100644 --- a/arch/powerpc/platforms/pseries/msi.c +++ b/arch/powerpc/platforms/pseries/msi.c | |||
@@ -24,6 +24,7 @@ static int query_token, change_token; | |||
24 | #define RTAS_RESET_FN 2 | 24 | #define RTAS_RESET_FN 2 |
25 | #define RTAS_CHANGE_MSI_FN 3 | 25 | #define RTAS_CHANGE_MSI_FN 3 |
26 | #define RTAS_CHANGE_MSIX_FN 4 | 26 | #define RTAS_CHANGE_MSIX_FN 4 |
27 | #define RTAS_CHANGE_32MSI_FN 5 | ||
27 | 28 | ||
28 | static struct pci_dn *get_pdn(struct pci_dev *pdev) | 29 | static struct pci_dn *get_pdn(struct pci_dev *pdev) |
29 | { | 30 | { |
@@ -58,7 +59,8 @@ static int rtas_change_msi(struct pci_dn *pdn, u32 func, u32 num_irqs) | |||
58 | 59 | ||
59 | seq_num = 1; | 60 | seq_num = 1; |
60 | do { | 61 | do { |
61 | if (func == RTAS_CHANGE_MSI_FN || func == RTAS_CHANGE_MSIX_FN) | 62 | if (func == RTAS_CHANGE_MSI_FN || func == RTAS_CHANGE_MSIX_FN || |
63 | func == RTAS_CHANGE_32MSI_FN) | ||
62 | rc = rtas_call(change_token, 6, 4, rtas_ret, addr, | 64 | rc = rtas_call(change_token, 6, 4, rtas_ret, addr, |
63 | BUID_HI(buid), BUID_LO(buid), | 65 | BUID_HI(buid), BUID_LO(buid), |
64 | func, num_irqs, seq_num); | 66 | func, num_irqs, seq_num); |
@@ -426,9 +428,12 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec_in, int type) | |||
426 | */ | 428 | */ |
427 | again: | 429 | again: |
428 | if (type == PCI_CAP_ID_MSI) { | 430 | if (type == PCI_CAP_ID_MSI) { |
429 | rc = rtas_change_msi(pdn, RTAS_CHANGE_MSI_FN, nvec); | 431 | if (pdn->force_32bit_msi) |
432 | rc = rtas_change_msi(pdn, RTAS_CHANGE_32MSI_FN, nvec); | ||
433 | else | ||
434 | rc = rtas_change_msi(pdn, RTAS_CHANGE_MSI_FN, nvec); | ||
430 | 435 | ||
431 | if (rc < 0) { | 436 | if (rc < 0 && !pdn->force_32bit_msi) { |
432 | pr_debug("rtas_msi: trying the old firmware call.\n"); | 437 | pr_debug("rtas_msi: trying the old firmware call.\n"); |
433 | rc = rtas_change_msi(pdn, RTAS_CHANGE_FN, nvec); | 438 | rc = rtas_change_msi(pdn, RTAS_CHANGE_FN, nvec); |
434 | } | 439 | } |
@@ -512,3 +517,13 @@ static int rtas_msi_init(void) | |||
512 | return 0; | 517 | return 0; |
513 | } | 518 | } |
514 | arch_initcall(rtas_msi_init); | 519 | arch_initcall(rtas_msi_init); |
520 | |||
521 | static void quirk_radeon(struct pci_dev *dev) | ||
522 | { | ||
523 | struct pci_dn *pdn = get_pdn(dev); | ||
524 | |||
525 | if (pdn) | ||
526 | pdn->force_32bit_msi = 1; | ||
527 | } | ||
528 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x68f2, quirk_radeon); | ||
529 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0xaa68, quirk_radeon); | ||
diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c index 0b580f413a9a..5f93856cdf47 100644 --- a/arch/powerpc/platforms/pseries/pci.c +++ b/arch/powerpc/platforms/pseries/pci.c | |||
@@ -108,3 +108,56 @@ static void fixup_winbond_82c105(struct pci_dev* dev) | |||
108 | } | 108 | } |
109 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105, | 109 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105, |
110 | fixup_winbond_82c105); | 110 | fixup_winbond_82c105); |
111 | |||
112 | int pseries_root_bridge_prepare(struct pci_host_bridge *bridge) | ||
113 | { | ||
114 | struct device_node *dn, *pdn; | ||
115 | struct pci_bus *bus; | ||
116 | const uint32_t *pcie_link_speed_stats; | ||
117 | |||
118 | bus = bridge->bus; | ||
119 | |||
120 | dn = pcibios_get_phb_of_node(bus); | ||
121 | if (!dn) | ||
122 | return 0; | ||
123 | |||
124 | for (pdn = dn; pdn != NULL; pdn = of_get_next_parent(pdn)) { | ||
125 | pcie_link_speed_stats = (const uint32_t *) of_get_property(pdn, | ||
126 | "ibm,pcie-link-speed-stats", NULL); | ||
127 | if (pcie_link_speed_stats) | ||
128 | break; | ||
129 | } | ||
130 | |||
131 | of_node_put(pdn); | ||
132 | |||
133 | if (!pcie_link_speed_stats) { | ||
134 | pr_err("no ibm,pcie-link-speed-stats property\n"); | ||
135 | return 0; | ||
136 | } | ||
137 | |||
138 | switch (pcie_link_speed_stats[0]) { | ||
139 | case 0x01: | ||
140 | bus->max_bus_speed = PCIE_SPEED_2_5GT; | ||
141 | break; | ||
142 | case 0x02: | ||
143 | bus->max_bus_speed = PCIE_SPEED_5_0GT; | ||
144 | break; | ||
145 | default: | ||
146 | bus->max_bus_speed = PCI_SPEED_UNKNOWN; | ||
147 | break; | ||
148 | } | ||
149 | |||
150 | switch (pcie_link_speed_stats[1]) { | ||
151 | case 0x01: | ||
152 | bus->cur_bus_speed = PCIE_SPEED_2_5GT; | ||
153 | break; | ||
154 | case 0x02: | ||
155 | bus->cur_bus_speed = PCIE_SPEED_5_0GT; | ||
156 | break; | ||
157 | default: | ||
158 | bus->cur_bus_speed = PCI_SPEED_UNKNOWN; | ||
159 | break; | ||
160 | } | ||
161 | |||
162 | return 0; | ||
163 | } | ||
diff --git a/arch/powerpc/platforms/pseries/pseries.h b/arch/powerpc/platforms/pseries/pseries.h index 8af71e4cc17f..c2a3a258001c 100644 --- a/arch/powerpc/platforms/pseries/pseries.h +++ b/arch/powerpc/platforms/pseries/pseries.h | |||
@@ -63,4 +63,8 @@ extern int dlpar_detach_node(struct device_node *); | |||
63 | /* Snooze Delay, pseries_idle */ | 63 | /* Snooze Delay, pseries_idle */ |
64 | DECLARE_PER_CPU(long, smt_snooze_delay); | 64 | DECLARE_PER_CPU(long, smt_snooze_delay); |
65 | 65 | ||
66 | /* PCI root bridge prepare function override for pseries */ | ||
67 | struct pci_host_bridge; | ||
68 | int pseries_root_bridge_prepare(struct pci_host_bridge *bridge); | ||
69 | |||
66 | #endif /* _PSERIES_PSERIES_H */ | 70 | #endif /* _PSERIES_PSERIES_H */ |
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index ac932a9eb440..c11c8238797c 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -466,6 +466,8 @@ static void __init pSeries_setup_arch(void) | |||
466 | else | 466 | else |
467 | ppc_md.enable_pmcs = power4_enable_pmcs; | 467 | ppc_md.enable_pmcs = power4_enable_pmcs; |
468 | 468 | ||
469 | ppc_md.pcibios_root_bridge_prepare = pseries_root_bridge_prepare; | ||
470 | |||
469 | if (firmware_has_feature(FW_FEATURE_SET_MODE)) { | 471 | if (firmware_has_feature(FW_FEATURE_SET_MODE)) { |
470 | long rc; | 472 | long rc; |
471 | if ((rc = pSeries_enable_reloc_on_exc()) != H_SUCCESS) { | 473 | if ((rc = pSeries_enable_reloc_on_exc()) != H_SUCCESS) { |
diff --git a/arch/powerpc/platforms/wsp/wsp_pci.c b/arch/powerpc/platforms/wsp/wsp_pci.c index 8e22f561d171..62cb527493e7 100644 --- a/arch/powerpc/platforms/wsp/wsp_pci.c +++ b/arch/powerpc/platforms/wsp/wsp_pci.c | |||
@@ -502,7 +502,7 @@ static void __init wsp_pcie_configure_hw(struct pci_controller *hose) | |||
502 | (~(hose->mem_resources[0].end - | 502 | (~(hose->mem_resources[0].end - |
503 | hose->mem_resources[0].start)) & 0x3ffffff0000ul); | 503 | hose->mem_resources[0].start)) & 0x3ffffff0000ul); |
504 | out_be64(hose->cfg_data + PCIE_REG_M32A_START_ADDR, | 504 | out_be64(hose->cfg_data + PCIE_REG_M32A_START_ADDR, |
505 | (hose->mem_resources[0].start - hose->pci_mem_offset) | 1); | 505 | (hose->mem_resources[0].start - hose->mem_offset[0]) | 1); |
506 | 506 | ||
507 | /* Clear all TVT entries | 507 | /* Clear all TVT entries |
508 | * | 508 | * |
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index cffe7edac858..028ac1f71b51 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c | |||
@@ -178,7 +178,7 @@ static void setup_pci_atmu(struct pci_controller *hose) | |||
178 | struct ccsr_pci __iomem *pci = hose->private_data; | 178 | struct ccsr_pci __iomem *pci = hose->private_data; |
179 | int i, j, n, mem_log, win_idx = 3, start_idx = 1, end_idx = 4; | 179 | int i, j, n, mem_log, win_idx = 3, start_idx = 1, end_idx = 4; |
180 | u64 mem, sz, paddr_hi = 0; | 180 | u64 mem, sz, paddr_hi = 0; |
181 | u64 paddr_lo = ULLONG_MAX; | 181 | u64 offset = 0, paddr_lo = ULLONG_MAX; |
182 | u32 pcicsrbar = 0, pcicsrbar_sz; | 182 | u32 pcicsrbar = 0, pcicsrbar_sz; |
183 | u32 piwar = PIWAR_EN | PIWAR_PF | PIWAR_TGI_LOCAL | | 183 | u32 piwar = PIWAR_EN | PIWAR_PF | PIWAR_TGI_LOCAL | |
184 | PIWAR_READ_SNOOP | PIWAR_WRITE_SNOOP; | 184 | PIWAR_READ_SNOOP | PIWAR_WRITE_SNOOP; |
@@ -208,8 +208,9 @@ static void setup_pci_atmu(struct pci_controller *hose) | |||
208 | paddr_lo = min(paddr_lo, (u64)hose->mem_resources[i].start); | 208 | paddr_lo = min(paddr_lo, (u64)hose->mem_resources[i].start); |
209 | paddr_hi = max(paddr_hi, (u64)hose->mem_resources[i].end); | 209 | paddr_hi = max(paddr_hi, (u64)hose->mem_resources[i].end); |
210 | 210 | ||
211 | n = setup_one_atmu(pci, j, &hose->mem_resources[i], | 211 | /* We assume all memory resources have the same offset */ |
212 | hose->pci_mem_offset); | 212 | offset = hose->mem_offset[i]; |
213 | n = setup_one_atmu(pci, j, &hose->mem_resources[i], offset); | ||
213 | 214 | ||
214 | if (n < 0 || j >= 5) { | 215 | if (n < 0 || j >= 5) { |
215 | pr_err("Ran out of outbound PCI ATMUs for resource %d!\n", i); | 216 | pr_err("Ran out of outbound PCI ATMUs for resource %d!\n", i); |
@@ -239,8 +240,8 @@ static void setup_pci_atmu(struct pci_controller *hose) | |||
239 | } | 240 | } |
240 | 241 | ||
241 | /* convert to pci address space */ | 242 | /* convert to pci address space */ |
242 | paddr_hi -= hose->pci_mem_offset; | 243 | paddr_hi -= offset; |
243 | paddr_lo -= hose->pci_mem_offset; | 244 | paddr_lo -= offset; |
244 | 245 | ||
245 | if (paddr_hi == paddr_lo) { | 246 | if (paddr_hi == paddr_lo) { |
246 | pr_err("%s: No outbound window space\n", name); | 247 | pr_err("%s: No outbound window space\n", name); |
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index d30e6a676c89..ee21b5e71aec 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
@@ -1001,8 +1001,12 @@ static int mpic_host_map(struct irq_domain *h, unsigned int virq, | |||
1001 | 1001 | ||
1002 | if (hw == mpic->spurious_vec) | 1002 | if (hw == mpic->spurious_vec) |
1003 | return -EINVAL; | 1003 | return -EINVAL; |
1004 | if (mpic->protected && test_bit(hw, mpic->protected)) | 1004 | if (mpic->protected && test_bit(hw, mpic->protected)) { |
1005 | return -EINVAL; | 1005 | pr_warning("mpic: Mapping of source 0x%x failed, " |
1006 | "source protected by firmware !\n",\ | ||
1007 | (unsigned int)hw); | ||
1008 | return -EPERM; | ||
1009 | } | ||
1006 | 1010 | ||
1007 | #ifdef CONFIG_SMP | 1011 | #ifdef CONFIG_SMP |
1008 | else if (hw >= mpic->ipi_vecs[0]) { | 1012 | else if (hw >= mpic->ipi_vecs[0]) { |
@@ -1029,8 +1033,12 @@ static int mpic_host_map(struct irq_domain *h, unsigned int virq, | |||
1029 | if (mpic_map_error_int(mpic, virq, hw)) | 1033 | if (mpic_map_error_int(mpic, virq, hw)) |
1030 | return 0; | 1034 | return 0; |
1031 | 1035 | ||
1032 | if (hw >= mpic->num_sources) | 1036 | if (hw >= mpic->num_sources) { |
1037 | pr_warning("mpic: Mapping of source 0x%x failed, " | ||
1038 | "source out of range !\n",\ | ||
1039 | (unsigned int)hw); | ||
1033 | return -EINVAL; | 1040 | return -EINVAL; |
1041 | } | ||
1034 | 1042 | ||
1035 | mpic_msi_reserve_hwirq(mpic, hw); | 1043 | mpic_msi_reserve_hwirq(mpic, hw); |
1036 | 1044 | ||
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c index 56e8b3c3c890..64603a10b863 100644 --- a/arch/powerpc/sysdev/ppc4xx_pci.c +++ b/arch/powerpc/sysdev/ppc4xx_pci.c | |||
@@ -257,6 +257,7 @@ static void __init ppc4xx_configure_pci_PMMs(struct pci_controller *hose, | |||
257 | /* Setup outbound memory windows */ | 257 | /* Setup outbound memory windows */ |
258 | for (i = j = 0; i < 3; i++) { | 258 | for (i = j = 0; i < 3; i++) { |
259 | struct resource *res = &hose->mem_resources[i]; | 259 | struct resource *res = &hose->mem_resources[i]; |
260 | resource_size_t offset = hose->mem_offset[i]; | ||
260 | 261 | ||
261 | /* we only care about memory windows */ | 262 | /* we only care about memory windows */ |
262 | if (!(res->flags & IORESOURCE_MEM)) | 263 | if (!(res->flags & IORESOURCE_MEM)) |
@@ -270,7 +271,7 @@ static void __init ppc4xx_configure_pci_PMMs(struct pci_controller *hose, | |||
270 | /* Configure the resource */ | 271 | /* Configure the resource */ |
271 | if (ppc4xx_setup_one_pci_PMM(hose, reg, | 272 | if (ppc4xx_setup_one_pci_PMM(hose, reg, |
272 | res->start, | 273 | res->start, |
273 | res->start - hose->pci_mem_offset, | 274 | res->start - offset, |
274 | resource_size(res), | 275 | resource_size(res), |
275 | res->flags, | 276 | res->flags, |
276 | j) == 0) { | 277 | j) == 0) { |
@@ -279,7 +280,7 @@ static void __init ppc4xx_configure_pci_PMMs(struct pci_controller *hose, | |||
279 | /* If the resource PCI address is 0 then we have our | 280 | /* If the resource PCI address is 0 then we have our |
280 | * ISA memory hole | 281 | * ISA memory hole |
281 | */ | 282 | */ |
282 | if (res->start == hose->pci_mem_offset) | 283 | if (res->start == offset) |
283 | found_isa_hole = 1; | 284 | found_isa_hole = 1; |
284 | } | 285 | } |
285 | } | 286 | } |
@@ -457,6 +458,7 @@ static void __init ppc4xx_configure_pcix_POMs(struct pci_controller *hose, | |||
457 | /* Setup outbound memory windows */ | 458 | /* Setup outbound memory windows */ |
458 | for (i = j = 0; i < 3; i++) { | 459 | for (i = j = 0; i < 3; i++) { |
459 | struct resource *res = &hose->mem_resources[i]; | 460 | struct resource *res = &hose->mem_resources[i]; |
461 | resource_size_t offset = hose->mem_offset[i]; | ||
460 | 462 | ||
461 | /* we only care about memory windows */ | 463 | /* we only care about memory windows */ |
462 | if (!(res->flags & IORESOURCE_MEM)) | 464 | if (!(res->flags & IORESOURCE_MEM)) |
@@ -470,7 +472,7 @@ static void __init ppc4xx_configure_pcix_POMs(struct pci_controller *hose, | |||
470 | /* Configure the resource */ | 472 | /* Configure the resource */ |
471 | if (ppc4xx_setup_one_pcix_POM(hose, reg, | 473 | if (ppc4xx_setup_one_pcix_POM(hose, reg, |
472 | res->start, | 474 | res->start, |
473 | res->start - hose->pci_mem_offset, | 475 | res->start - offset, |
474 | resource_size(res), | 476 | resource_size(res), |
475 | res->flags, | 477 | res->flags, |
476 | j) == 0) { | 478 | j) == 0) { |
@@ -479,7 +481,7 @@ static void __init ppc4xx_configure_pcix_POMs(struct pci_controller *hose, | |||
479 | /* If the resource PCI address is 0 then we have our | 481 | /* If the resource PCI address is 0 then we have our |
480 | * ISA memory hole | 482 | * ISA memory hole |
481 | */ | 483 | */ |
482 | if (res->start == hose->pci_mem_offset) | 484 | if (res->start == offset) |
483 | found_isa_hole = 1; | 485 | found_isa_hole = 1; |
484 | } | 486 | } |
485 | } | 487 | } |
@@ -1792,6 +1794,7 @@ static void __init ppc4xx_configure_pciex_POMs(struct ppc4xx_pciex_port *port, | |||
1792 | /* Setup outbound memory windows */ | 1794 | /* Setup outbound memory windows */ |
1793 | for (i = j = 0; i < 3; i++) { | 1795 | for (i = j = 0; i < 3; i++) { |
1794 | struct resource *res = &hose->mem_resources[i]; | 1796 | struct resource *res = &hose->mem_resources[i]; |
1797 | resource_size_t offset = hose->mem_offset[i]; | ||
1795 | 1798 | ||
1796 | /* we only care about memory windows */ | 1799 | /* we only care about memory windows */ |
1797 | if (!(res->flags & IORESOURCE_MEM)) | 1800 | if (!(res->flags & IORESOURCE_MEM)) |
@@ -1805,7 +1808,7 @@ static void __init ppc4xx_configure_pciex_POMs(struct ppc4xx_pciex_port *port, | |||
1805 | /* Configure the resource */ | 1808 | /* Configure the resource */ |
1806 | if (ppc4xx_setup_one_pciex_POM(port, hose, mbase, | 1809 | if (ppc4xx_setup_one_pciex_POM(port, hose, mbase, |
1807 | res->start, | 1810 | res->start, |
1808 | res->start - hose->pci_mem_offset, | 1811 | res->start - offset, |
1809 | resource_size(res), | 1812 | resource_size(res), |
1810 | res->flags, | 1813 | res->flags, |
1811 | j) == 0) { | 1814 | j) == 0) { |
@@ -1814,7 +1817,7 @@ static void __init ppc4xx_configure_pciex_POMs(struct ppc4xx_pciex_port *port, | |||
1814 | /* If the resource PCI address is 0 then we have our | 1817 | /* If the resource PCI address is 0 then we have our |
1815 | * ISA memory hole | 1818 | * ISA memory hole |
1816 | */ | 1819 | */ |
1817 | if (res->start == hose->pci_mem_offset) | 1820 | if (res->start == offset) |
1818 | found_isa_hole = 1; | 1821 | found_isa_hole = 1; |
1819 | } | 1822 | } |
1820 | } | 1823 | } |
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 96f3a1d9c379..5a83dde8ca0c 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c | |||
@@ -462,9 +462,23 @@ int irq_domain_associate_many(struct irq_domain *domain, unsigned int irq_base, | |||
462 | if (domain->ops->map) { | 462 | if (domain->ops->map) { |
463 | ret = domain->ops->map(domain, virq, hwirq); | 463 | ret = domain->ops->map(domain, virq, hwirq); |
464 | if (ret != 0) { | 464 | if (ret != 0) { |
465 | pr_err("irq-%i==>hwirq-0x%lx mapping failed: %d\n", | 465 | /* |
466 | virq, hwirq, ret); | 466 | * If map() returns -EPERM, this interrupt is protected |
467 | WARN_ON(1); | 467 | * by the firmware or some other service and shall not |
468 | * be mapped. | ||
469 | * | ||
470 | * Since on some platforms we blindly try to map everything | ||
471 | * we end up with a log full of backtraces. | ||
472 | * | ||
473 | * So instead, we silently fail on -EPERM, it is the | ||
474 | * responsibility of the PIC driver to display a relevant | ||
475 | * message if needed. | ||
476 | */ | ||
477 | if (ret != -EPERM) { | ||
478 | pr_err("irq-%i==>hwirq-0x%lx mapping failed: %d\n", | ||
479 | virq, hwirq, ret); | ||
480 | WARN_ON(1); | ||
481 | } | ||
468 | irq_data->domain = NULL; | 482 | irq_data->domain = NULL; |
469 | irq_data->hwirq = 0; | 483 | irq_data->hwirq = 0; |
470 | goto err_unmap; | 484 | goto err_unmap; |