aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pasemi/pci.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-12-27 13:43:24 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-12-27 13:43:24 -0500
commit8d6973327ee84c2f40dd9efd8928d4a1186c96e2 (patch)
tree1c6accd71b6e9c4e05d5aaae766b958ad440d320 /arch/powerpc/platforms/pasemi/pci.c
parent6d101ba6be2a26a3e1f513b5e293f0fd2b79ec5c (diff)
parent12526b0d6c580df860b31e59d68e5696e16c6e5b (diff)
Merge tag 'powerpc-4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc updates from Michael Ellerman: "Notable changes: - Mitigations for Spectre v2 on some Freescale (NXP) CPUs. - A large series adding support for pass-through of Nvidia V100 GPUs to guests on Power9. - Another large series to enable hardware assistance for TLB table walk on MPC8xx CPUs. - Some preparatory changes to our DMA code, to make way for further cleanups from Christoph. - Several fixes for our Transactional Memory handling discovered by fuzzing the signal return path. - Support for generating our system call table(s) from a text file like other architectures. - A fix to our page fault handler so that instead of generating a WARN_ON_ONCE, user accesses of kernel addresses instead print a ratelimited and appropriately scary warning. - A cosmetic change to make our unhandled page fault messages more similar to other arches and also more compact and informative. - Freescale updates from Scott: "Highlights include elimination of legacy clock bindings use from dts files, an 83xx watchdog handler, fixes to old dts interrupt errors, and some minor cleanup." And many clean-ups, reworks and minor fixes etc. Thanks to: Alexandre Belloni, Alexey Kardashevskiy, Andrew Donnellan, Aneesh Kumar K.V, Arnd Bergmann, Benjamin Herrenschmidt, Breno Leitao, Christian Lamparter, Christophe Leroy, Christoph Hellwig, Daniel Axtens, Darren Stevens, David Gibson, Diana Craciun, Dmitry V. Levin, Firoz Khan, Geert Uytterhoeven, Greg Kurz, Gustavo Romero, Hari Bathini, Joel Stanley, Kees Cook, Madhavan Srinivasan, Mahesh Salgaonkar, Markus Elfring, Mathieu Malaterre, Michal Suchánek, Naveen N. Rao, Nick Desaulniers, Oliver O'Halloran, Paul Mackerras, Ram Pai, Ravi Bangoria, Rob Herring, Russell Currey, Sabyasachi Gupta, Sam Bobroff, Satheesh Rajendran, Scott Wood, Segher Boessenkool, Stephen Rothwell, Tang Yuantian, Thiago Jung Bauermann, Yangtao Li, Yuantian Tang, Yue Haibing" * tag 'powerpc-4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (201 commits) Revert "powerpc/fsl_pci: simplify fsl_pci_dma_set_mask" powerpc/zImage: Also check for stdout-path powerpc: Fix HMIs on big-endian with CONFIG_RELOCATABLE=y macintosh: Use of_node_name_{eq, prefix} for node name comparisons ide: Use of_node_name_eq for node name comparisons powerpc: Use of_node_name_eq for node name comparisons powerpc/pseries/pmem: Convert to %pOFn instead of device_node.name powerpc/mm: Remove very old comment in hash-4k.h powerpc/pseries: Fix node leak in update_lmb_associativity_index() powerpc/configs/85xx: Enable CONFIG_DEBUG_KERNEL powerpc/dts/fsl: Fix dtc-flagged interrupt errors clk: qoriq: add more compatibles strings powerpc/fsl: Use new clockgen binding powerpc/83xx: handle machine check caused by watchdog timer powerpc/fsl-rio: fix spelling mistake "reserverd" -> "reserved" powerpc/fsl_pci: simplify fsl_pci_dma_set_mask arch/powerpc/fsl_rmu: Use dma_zalloc_coherent vfio_pci: Add NVIDIA GV100GL [Tesla V100 SXM2] subdriver vfio_pci: Allow regions to add own capabilities vfio_pci: Allow mapping extra regions ...
Diffstat (limited to 'arch/powerpc/platforms/pasemi/pci.c')
-rw-r--r--arch/powerpc/platforms/pasemi/pci.c66
1 files changed, 66 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c
index c3c64172482d..fdc839d93837 100644
--- a/arch/powerpc/platforms/pasemi/pci.c
+++ b/arch/powerpc/platforms/pasemi/pci.c
@@ -27,6 +27,7 @@
27#include <linux/pci.h> 27#include <linux/pci.h>
28 28
29#include <asm/pci-bridge.h> 29#include <asm/pci-bridge.h>
30#include <asm/isa-bridge.h>
30#include <asm/machdep.h> 31#include <asm/machdep.h>
31 32
32#include <asm/ppc-pci.h> 33#include <asm/ppc-pci.h>
@@ -108,6 +109,61 @@ static int workaround_5945(struct pci_bus *bus, unsigned int devfn,
108 return 1; 109 return 1;
109} 110}
110 111
112#ifdef CONFIG_PPC_PASEMI_NEMO
113#define PXP_ERR_CFG_REG 0x4
114#define PXP_IGNORE_PCIE_ERRORS 0x800
115#define SB600_BUS 5
116
117static void sb600_set_flag(int bus)
118{
119 static void __iomem *iob_mapbase = NULL;
120 struct resource res;
121 struct device_node *dn;
122 int err;
123
124 if (iob_mapbase == NULL) {
125 dn = of_find_compatible_node(NULL, "isa", "pasemi,1682m-iob");
126 if (!dn) {
127 pr_crit("NEMO SB600 missing iob node\n");
128 return;
129 }
130
131 err = of_address_to_resource(dn, 0, &res);
132 of_node_put(dn);
133
134 if (err) {
135 pr_crit("NEMO SB600 missing resource\n");
136 return;
137 }
138
139 pr_info("NEMO SB600 IOB base %08llx\n",res.start);
140
141 iob_mapbase = ioremap(res.start + 0x100, 0x94);
142 }
143
144 if (iob_mapbase != NULL) {
145 if (bus == SB600_BUS) {
146 /*
147 * This is the SB600's bus, tell the PCI-e root port
148 * to allow non-zero devices to enumerate.
149 */
150 out_le32(iob_mapbase + PXP_ERR_CFG_REG, in_le32(iob_mapbase + PXP_ERR_CFG_REG) | PXP_IGNORE_PCIE_ERRORS);
151 } else {
152 /*
153 * Only scan device 0 on other busses
154 */
155 out_le32(iob_mapbase + PXP_ERR_CFG_REG, in_le32(iob_mapbase + PXP_ERR_CFG_REG) & ~PXP_IGNORE_PCIE_ERRORS);
156 }
157 }
158}
159
160#else
161
162static void sb600_set_flag(int bus)
163{
164}
165#endif
166
111static int pa_pxp_read_config(struct pci_bus *bus, unsigned int devfn, 167static int pa_pxp_read_config(struct pci_bus *bus, unsigned int devfn,
112 int offset, int len, u32 *val) 168 int offset, int len, u32 *val)
113{ 169{
@@ -126,6 +182,8 @@ static int pa_pxp_read_config(struct pci_bus *bus, unsigned int devfn,
126 182
127 addr = pa_pxp_cfg_addr(hose, bus->number, devfn, offset); 183 addr = pa_pxp_cfg_addr(hose, bus->number, devfn, offset);
128 184
185 sb600_set_flag(bus->number);
186
129 /* 187 /*
130 * Note: the caller has already checked that offset is 188 * Note: the caller has already checked that offset is
131 * suitably aligned and that len is 1, 2 or 4. 189 * suitably aligned and that len is 1, 2 or 4.
@@ -160,6 +218,8 @@ static int pa_pxp_write_config(struct pci_bus *bus, unsigned int devfn,
160 218
161 addr = pa_pxp_cfg_addr(hose, bus->number, devfn, offset); 219 addr = pa_pxp_cfg_addr(hose, bus->number, devfn, offset);
162 220
221 sb600_set_flag(bus->number);
222
163 /* 223 /*
164 * Note: the caller has already checked that offset is 224 * Note: the caller has already checked that offset is
165 * suitably aligned and that len is 1, 2 or 4. 225 * suitably aligned and that len is 1, 2 or 4.
@@ -210,6 +270,12 @@ static int __init pas_add_bridge(struct device_node *dev)
210 /* Interpret the "ranges" property */ 270 /* Interpret the "ranges" property */
211 pci_process_bridge_OF_ranges(hose, dev, 1); 271 pci_process_bridge_OF_ranges(hose, dev, 1);
212 272
273 /*
274 * Scan for an isa bridge. This is needed to find the SB600 on the nemo
275 * and does nothing on machines without one.
276 */
277 isa_bridge_find_early(hose);
278
213 return 0; 279 return 0;
214} 280}
215 281