aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/pci
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-13 17:52:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-13 17:52:21 -0400
commitd1447464789918db1e1a3d0aaf50d3d0f6487a4f (patch)
tree490bd5c493cdba742dc90d3731962226838e5f33 /arch/mips/pci
parent833e68340d108d88f4cb79b7d7223f6859d362ca (diff)
parent6ac5310e649df5fcd240d764503bf16a1317ea39 (diff)
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS updates from Ralf Baechle: "MIPS updates: - All the things that didn't make 3.10. - Removes the Windriver PPMC platform. Nobody will miss it. - Remove a workaround from kernel/irq/irqdomain.c which was there exclusivly for MIPS. Patch by Grant Likely. - More small improvments for the SEAD 3 platform - Improvments on the BMIPS / SMP support for the BCM63xx series. - Various cleanups of dead leftovers. - Platform support for the Cavium Octeon-based EdgeRouter Lite. Two large KVM patchsets didn't make it for this pull request because their respective authors are vacationing" * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (124 commits) MIPS: Kconfig: Add missing MODULES dependency to VPE_LOADER MIPS: BCM63xx: CLK: Add dummy clk_{set,round}_rate() functions MIPS: SEAD3: Disable L2 cache on SEAD-3. MIPS: BCM63xx: Enable second core SMP on BCM6328 if available MIPS: BCM63xx: Add SMP support to prom.c MIPS: define write{b,w,l,q}_relaxed MIPS: Expose missing pci_io{map,unmap} declarations MIPS: Malta: Update GCMP detection. Revert "MIPS: make CAC_ADDR and UNCAC_ADDR account for PHYS_OFFSET" MIPS: APSP: Remove <asm/kspd.h> SSB: Kconfig: Amend SSB_EMBEDDED dependencies MIPS: microMIPS: Fix improper definition of ISA exception bit. MIPS: Don't try to decode microMIPS branch instructions where they cannot exist. MIPS: Declare emulate_load_store_microMIPS as a static function. MIPS: Fix typos and cleanup comment MIPS: Cleanup indentation and whitespace MIPS: BMIPS: support booting from physical CPU other than 0 MIPS: Only set cpu_has_mmips if SYS_SUPPORTS_MICROMIPS MIPS: GIC: Fix gic_set_affinity infinite loop MIPS: Don't save/restore OCTEON wide multiplier state on syscalls. ...
Diffstat (limited to 'arch/mips/pci')
-rw-r--r--arch/mips/pci/Makefile7
-rw-r--r--arch/mips/pci/fixup-wrppmc.c37
-rw-r--r--arch/mips/pci/pci-bcm63xx.c3
-rw-r--r--arch/mips/pci/pci-ip27.c2
-rw-r--r--arch/mips/pci/pci-malta.c254
5 files changed, 261 insertions, 42 deletions
diff --git a/arch/mips/pci/Makefile b/arch/mips/pci/Makefile
index 2cb1d315d225..c382042911dd 100644
--- a/arch/mips/pci/Makefile
+++ b/arch/mips/pci/Makefile
@@ -29,7 +29,7 @@ obj-$(CONFIG_LASAT) += pci-lasat.o
29obj-$(CONFIG_MIPS_COBALT) += fixup-cobalt.o 29obj-$(CONFIG_MIPS_COBALT) += fixup-cobalt.o
30obj-$(CONFIG_LEMOTE_FULOONG2E) += fixup-fuloong2e.o ops-loongson2.o 30obj-$(CONFIG_LEMOTE_FULOONG2E) += fixup-fuloong2e.o ops-loongson2.o
31obj-$(CONFIG_LEMOTE_MACH2F) += fixup-lemote2f.o ops-loongson2.o 31obj-$(CONFIG_LEMOTE_MACH2F) += fixup-lemote2f.o ops-loongson2.o
32obj-$(CONFIG_MIPS_MALTA) += fixup-malta.o 32obj-$(CONFIG_MIPS_MALTA) += fixup-malta.o pci-malta.o
33obj-$(CONFIG_PMC_MSP7120_GW) += fixup-pmcmsp.o ops-pmcmsp.o 33obj-$(CONFIG_PMC_MSP7120_GW) += fixup-pmcmsp.o ops-pmcmsp.o
34obj-$(CONFIG_PMC_MSP7120_EVAL) += fixup-pmcmsp.o ops-pmcmsp.o 34obj-$(CONFIG_PMC_MSP7120_EVAL) += fixup-pmcmsp.o ops-pmcmsp.o
35obj-$(CONFIG_PMC_MSP7120_FPGA) += fixup-pmcmsp.o ops-pmcmsp.o 35obj-$(CONFIG_PMC_MSP7120_FPGA) += fixup-pmcmsp.o ops-pmcmsp.o
@@ -52,12 +52,11 @@ obj-$(CONFIG_TOSHIBA_RBTX4927) += fixup-rbtx4927.o
52obj-$(CONFIG_TOSHIBA_RBTX4938) += fixup-rbtx4938.o 52obj-$(CONFIG_TOSHIBA_RBTX4938) += fixup-rbtx4938.o
53obj-$(CONFIG_VICTOR_MPC30X) += fixup-mpc30x.o 53obj-$(CONFIG_VICTOR_MPC30X) += fixup-mpc30x.o
54obj-$(CONFIG_ZAO_CAPCELLA) += fixup-capcella.o 54obj-$(CONFIG_ZAO_CAPCELLA) += fixup-capcella.o
55obj-$(CONFIG_WR_PPMC) += fixup-wrppmc.o
56obj-$(CONFIG_MIKROTIK_RB532) += pci-rc32434.o ops-rc32434.o fixup-rc32434.o 55obj-$(CONFIG_MIKROTIK_RB532) += pci-rc32434.o ops-rc32434.o fixup-rc32434.o
57obj-$(CONFIG_CPU_CAVIUM_OCTEON) += pci-octeon.o pcie-octeon.o 56obj-$(CONFIG_CAVIUM_OCTEON_SOC) += pci-octeon.o pcie-octeon.o
58obj-$(CONFIG_CPU_XLR) += pci-xlr.o 57obj-$(CONFIG_CPU_XLR) += pci-xlr.o
59obj-$(CONFIG_CPU_XLP) += pci-xlp.o 58obj-$(CONFIG_CPU_XLP) += pci-xlp.o
60 59
61ifdef CONFIG_PCI_MSI 60ifdef CONFIG_PCI_MSI
62obj-$(CONFIG_CPU_CAVIUM_OCTEON) += msi-octeon.o 61obj-$(CONFIG_CAVIUM_OCTEON_SOC) += msi-octeon.o
63endif 62endif
diff --git a/arch/mips/pci/fixup-wrppmc.c b/arch/mips/pci/fixup-wrppmc.c
deleted file mode 100644
index 29737edd121f..000000000000
--- a/arch/mips/pci/fixup-wrppmc.c
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * fixup-wrppmc.c: PPMC board specific PCI fixup
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2006, Wind River Inc. Rongkai.zhan (rongkai.zhan@windriver.com)
9 */
10#include <linux/init.h>
11#include <linux/pci.h>
12#include <asm/gt64120.h>
13
14/* PCI interrupt pins */
15#define PCI_INTA 1
16#define PCI_INTB 2
17#define PCI_INTC 3
18#define PCI_INTD 4
19
20#define PCI_SLOT_MAXNR 32 /* Each PCI bus has 32 physical slots */
21
22static char pci_irq_tab[PCI_SLOT_MAXNR][5] __initdata = {
23 /* 0 INTA INTB INTC INTD */
24 [0] = {0, 0, 0, 0, 0}, /* Slot 0: GT64120 PCI bridge */
25 [6] = {0, WRPPMC_PCI_INTA_IRQ, 0, 0, 0},
26};
27
28int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
29{
30 return pci_irq_tab[slot][pin];
31}
32
33/* Do platform specific device initialization at pci_enable_device() time */
34int pcibios_plat_dev_init(struct pci_dev *dev)
35{
36 return 0;
37}
diff --git a/arch/mips/pci/pci-bcm63xx.c b/arch/mips/pci/pci-bcm63xx.c
index 2eb954239bc5..151d9b5870bb 100644
--- a/arch/mips/pci/pci-bcm63xx.c
+++ b/arch/mips/pci/pci-bcm63xx.c
@@ -266,7 +266,7 @@ static int __init bcm63xx_register_pci(void)
266 /* setup PCI to local bus access, used by PCI device to target 266 /* setup PCI to local bus access, used by PCI device to target
267 * local RAM while bus mastering */ 267 * local RAM while bus mastering */
268 bcm63xx_int_cfg_writel(0, PCI_BASE_ADDRESS_3); 268 bcm63xx_int_cfg_writel(0, PCI_BASE_ADDRESS_3);
269 if (BCMCPU_IS_6358() || BCMCPU_IS_6368()) 269 if (BCMCPU_IS_3368() || BCMCPU_IS_6358() || BCMCPU_IS_6368())
270 val = MPI_SP0_REMAP_ENABLE_MASK; 270 val = MPI_SP0_REMAP_ENABLE_MASK;
271 else 271 else
272 val = 0; 272 val = 0;
@@ -338,6 +338,7 @@ static int __init bcm63xx_pci_init(void)
338 case BCM6328_CPU_ID: 338 case BCM6328_CPU_ID:
339 case BCM6362_CPU_ID: 339 case BCM6362_CPU_ID:
340 return bcm63xx_register_pcie(); 340 return bcm63xx_register_pcie();
341 case BCM3368_CPU_ID:
341 case BCM6348_CPU_ID: 342 case BCM6348_CPU_ID:
342 case BCM6358_CPU_ID: 343 case BCM6358_CPU_ID:
343 case BCM6368_CPU_ID: 344 case BCM6368_CPU_ID:
diff --git a/arch/mips/pci/pci-ip27.c b/arch/mips/pci/pci-ip27.c
index 6eb65e44d9e4..7b2ac81e1f59 100644
--- a/arch/mips/pci/pci-ip27.c
+++ b/arch/mips/pci/pci-ip27.c
@@ -217,6 +217,7 @@ static void pci_fixup_ioc3(struct pci_dev *d)
217 pci_disable_swapping(d); 217 pci_disable_swapping(d);
218} 218}
219 219
220#ifdef CONFIG_NUMA
220int pcibus_to_node(struct pci_bus *bus) 221int pcibus_to_node(struct pci_bus *bus)
221{ 222{
222 struct bridge_controller *bc = BRIDGE_CONTROLLER(bus); 223 struct bridge_controller *bc = BRIDGE_CONTROLLER(bus);
@@ -224,6 +225,7 @@ int pcibus_to_node(struct pci_bus *bus)
224 return bc->nasid; 225 return bc->nasid;
225} 226}
226EXPORT_SYMBOL(pcibus_to_node); 227EXPORT_SYMBOL(pcibus_to_node);
228#endif /* CONFIG_NUMA */
227 229
228DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC3, 230DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC3,
229 pci_fixup_ioc3); 231 pci_fixup_ioc3);
diff --git a/arch/mips/pci/pci-malta.c b/arch/mips/pci/pci-malta.c
new file mode 100644
index 000000000000..37134ddfeaa5
--- /dev/null
+++ b/arch/mips/pci/pci-malta.c
@@ -0,0 +1,254 @@
1/*
2 * Copyright (C) 1999, 2000, 2004, 2005 MIPS Technologies, Inc.
3 * All rights reserved.
4 * Authors: Carsten Langgaard <carstenl@mips.com>
5 * Maciej W. Rozycki <macro@mips.com>
6 *
7 * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org)
8 *
9 * This program is free software; you can distribute it and/or modify it
10 * under the terms of the GNU General Public License (Version 2) as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
21 *
22 * MIPS boards specific PCI support.
23 */
24#include <linux/types.h>
25#include <linux/pci.h>
26#include <linux/kernel.h>
27#include <linux/init.h>
28
29#include <asm/gt64120.h>
30#include <asm/gcmpregs.h>
31#include <asm/mips-boards/generic.h>
32#include <asm/mips-boards/bonito64.h>
33#include <asm/mips-boards/msc01_pci.h>
34
35static struct resource bonito64_mem_resource = {
36 .name = "Bonito PCI MEM",
37 .flags = IORESOURCE_MEM,
38};
39
40static struct resource bonito64_io_resource = {
41 .name = "Bonito PCI I/O",
42 .start = 0x00000000UL,
43 .end = 0x000fffffUL,
44 .flags = IORESOURCE_IO,
45};
46
47static struct resource gt64120_mem_resource = {
48 .name = "GT-64120 PCI MEM",
49 .flags = IORESOURCE_MEM,
50};
51
52static struct resource gt64120_io_resource = {
53 .name = "GT-64120 PCI I/O",
54 .flags = IORESOURCE_IO,
55};
56
57static struct resource msc_mem_resource = {
58 .name = "MSC PCI MEM",
59 .flags = IORESOURCE_MEM,
60};
61
62static struct resource msc_io_resource = {
63 .name = "MSC PCI I/O",
64 .flags = IORESOURCE_IO,
65};
66
67extern struct pci_ops bonito64_pci_ops;
68extern struct pci_ops gt64xxx_pci0_ops;
69extern struct pci_ops msc_pci_ops;
70
71static struct pci_controller bonito64_controller = {
72 .pci_ops = &bonito64_pci_ops,
73 .io_resource = &bonito64_io_resource,
74 .mem_resource = &bonito64_mem_resource,
75 .io_offset = 0x00000000UL,
76};
77
78static struct pci_controller gt64120_controller = {
79 .pci_ops = &gt64xxx_pci0_ops,
80 .io_resource = &gt64120_io_resource,
81 .mem_resource = &gt64120_mem_resource,
82};
83
84static struct pci_controller msc_controller = {
85 .pci_ops = &msc_pci_ops,
86 .io_resource = &msc_io_resource,
87 .mem_resource = &msc_mem_resource,
88};
89
90void __init mips_pcibios_init(void)
91{
92 struct pci_controller *controller;
93 resource_size_t start, end, map, start1, end1, map1, map2, map3, mask;
94
95 switch (mips_revision_sconid) {
96 case MIPS_REVISION_SCON_GT64120:
97 /*
98 * Due to a bug in the Galileo system controller, we need
99 * to setup the PCI BAR for the Galileo internal registers.
100 * This should be done in the bios/bootprom and will be
101 * fixed in a later revision of YAMON (the MIPS boards
102 * boot prom).
103 */
104 GT_WRITE(GT_PCI0_CFGADDR_OFS,
105 (0 << GT_PCI0_CFGADDR_BUSNUM_SHF) | /* Local bus */
106 (0 << GT_PCI0_CFGADDR_DEVNUM_SHF) | /* GT64120 dev */
107 (0 << GT_PCI0_CFGADDR_FUNCTNUM_SHF) | /* Function 0*/
108 ((0x20/4) << GT_PCI0_CFGADDR_REGNUM_SHF) | /* BAR 4*/
109 GT_PCI0_CFGADDR_CONFIGEN_BIT);
110
111 /* Perform the write */
112 GT_WRITE(GT_PCI0_CFGDATA_OFS, CPHYSADDR(MIPS_GT_BASE));
113
114 /* Set up resource ranges from the controller's registers. */
115 start = GT_READ(GT_PCI0M0LD_OFS);
116 end = GT_READ(GT_PCI0M0HD_OFS);
117 map = GT_READ(GT_PCI0M0REMAP_OFS);
118 end = (end & GT_PCI_HD_MSK) | (start & ~GT_PCI_HD_MSK);
119 start1 = GT_READ(GT_PCI0M1LD_OFS);
120 end1 = GT_READ(GT_PCI0M1HD_OFS);
121 map1 = GT_READ(GT_PCI0M1REMAP_OFS);
122 end1 = (end1 & GT_PCI_HD_MSK) | (start1 & ~GT_PCI_HD_MSK);
123 /* Cannot support multiple windows, use the wider. */
124 if (end1 - start1 > end - start) {
125 start = start1;
126 end = end1;
127 map = map1;
128 }
129 mask = ~(start ^ end);
130 /* We don't support remapping with a discontiguous mask. */
131 BUG_ON((start & GT_PCI_HD_MSK) != (map & GT_PCI_HD_MSK) &&
132 mask != ~((mask & -mask) - 1));
133 gt64120_mem_resource.start = start;
134 gt64120_mem_resource.end = end;
135 gt64120_controller.mem_offset = (start & mask) - (map & mask);
136 /* Addresses are 36-bit, so do shifts in the destinations. */
137 gt64120_mem_resource.start <<= GT_PCI_DCRM_SHF;
138 gt64120_mem_resource.end <<= GT_PCI_DCRM_SHF;
139 gt64120_mem_resource.end |= (1 << GT_PCI_DCRM_SHF) - 1;
140 gt64120_controller.mem_offset <<= GT_PCI_DCRM_SHF;
141
142 start = GT_READ(GT_PCI0IOLD_OFS);
143 end = GT_READ(GT_PCI0IOHD_OFS);
144 map = GT_READ(GT_PCI0IOREMAP_OFS);
145 end = (end & GT_PCI_HD_MSK) | (start & ~GT_PCI_HD_MSK);
146 mask = ~(start ^ end);
147 /* We don't support remapping with a discontiguous mask. */
148 BUG_ON((start & GT_PCI_HD_MSK) != (map & GT_PCI_HD_MSK) &&
149 mask != ~((mask & -mask) - 1));
150 gt64120_io_resource.start = map & mask;
151 gt64120_io_resource.end = (map & mask) | ~mask;
152 gt64120_controller.io_offset = 0;
153 /* Addresses are 36-bit, so do shifts in the destinations. */
154 gt64120_io_resource.start <<= GT_PCI_DCRM_SHF;
155 gt64120_io_resource.end <<= GT_PCI_DCRM_SHF;
156 gt64120_io_resource.end |= (1 << GT_PCI_DCRM_SHF) - 1;
157
158 controller = &gt64120_controller;
159 break;
160
161 case MIPS_REVISION_SCON_BONITO:
162 /* Set up resource ranges from the controller's registers. */
163 map = BONITO_PCIMAP;
164 map1 = (BONITO_PCIMAP & BONITO_PCIMAP_PCIMAP_LO0) >>
165 BONITO_PCIMAP_PCIMAP_LO0_SHIFT;
166 map2 = (BONITO_PCIMAP & BONITO_PCIMAP_PCIMAP_LO1) >>
167 BONITO_PCIMAP_PCIMAP_LO1_SHIFT;
168 map3 = (BONITO_PCIMAP & BONITO_PCIMAP_PCIMAP_LO2) >>
169 BONITO_PCIMAP_PCIMAP_LO2_SHIFT;
170 /* Combine as many adjacent windows as possible. */
171 map = map1;
172 start = BONITO_PCILO0_BASE;
173 end = 1;
174 if (map3 == map2 + 1) {
175 map = map2;
176 start = BONITO_PCILO1_BASE;
177 end++;
178 }
179 if (map2 == map1 + 1) {
180 map = map1;
181 start = BONITO_PCILO0_BASE;
182 end++;
183 }
184 bonito64_mem_resource.start = start;
185 bonito64_mem_resource.end = start +
186 BONITO_PCIMAP_WINBASE(end) - 1;
187 bonito64_controller.mem_offset = start -
188 BONITO_PCIMAP_WINBASE(map);
189
190 controller = &bonito64_controller;
191 break;
192
193 case MIPS_REVISION_SCON_SOCIT:
194 case MIPS_REVISION_SCON_ROCIT:
195 case MIPS_REVISION_SCON_SOCITSC:
196 case MIPS_REVISION_SCON_SOCITSCP:
197 /* Set up resource ranges from the controller's registers. */
198 MSC_READ(MSC01_PCI_SC2PMBASL, start);
199 MSC_READ(MSC01_PCI_SC2PMMSKL, mask);
200 MSC_READ(MSC01_PCI_SC2PMMAPL, map);
201 msc_mem_resource.start = start & mask;
202 msc_mem_resource.end = (start & mask) | ~mask;
203 msc_controller.mem_offset = (start & mask) - (map & mask);
204#ifdef CONFIG_MIPS_CMP
205 if (gcmp_niocu())
206 gcmp_setregion(0, start, mask,
207 GCMP_GCB_GCMPB_CMDEFTGT_IOCU1);
208#endif
209 MSC_READ(MSC01_PCI_SC2PIOBASL, start);
210 MSC_READ(MSC01_PCI_SC2PIOMSKL, mask);
211 MSC_READ(MSC01_PCI_SC2PIOMAPL, map);
212 msc_io_resource.start = map & mask;
213 msc_io_resource.end = (map & mask) | ~mask;
214 msc_controller.io_offset = 0;
215 ioport_resource.end = ~mask;
216#ifdef CONFIG_MIPS_CMP
217 if (gcmp_niocu())
218 gcmp_setregion(1, start, mask,
219 GCMP_GCB_GCMPB_CMDEFTGT_IOCU1);
220#endif
221 /* If ranges overlap I/O takes precedence. */
222 start = start & mask;
223 end = start | ~mask;
224 if ((start >= msc_mem_resource.start &&
225 start <= msc_mem_resource.end) ||
226 (end >= msc_mem_resource.start &&
227 end <= msc_mem_resource.end)) {
228 /* Use the larger space. */
229 start = max(start, msc_mem_resource.start);
230 end = min(end, msc_mem_resource.end);
231 if (start - msc_mem_resource.start >=
232 msc_mem_resource.end - end)
233 msc_mem_resource.end = start - 1;
234 else
235 msc_mem_resource.start = end + 1;
236 }
237
238 controller = &msc_controller;
239 break;
240 default:
241 return;
242 }
243
244 /* Change start address to avoid conflicts with ACPI and SMB devices */
245 if (controller->io_resource->start < 0x00002000UL)
246 controller->io_resource->start = 0x00002000UL;
247
248 iomem_resource.end &= 0xfffffffffULL; /* 64 GB */
249 ioport_resource.end = controller->io_resource->end;
250
251 controller->io_map_base = mips_io_port_base;
252
253 register_pci_controller(controller);
254}