diff options
Diffstat (limited to 'arch/mips/pci')
-rw-r--r-- | arch/mips/pci/fixup-cobalt.c | 61 | ||||
-rw-r--r-- | arch/mips/pci/fixup-lemote2f.c | 2 | ||||
-rw-r--r-- | arch/mips/pci/ops-loongson2.c | 4 | ||||
-rw-r--r-- | arch/mips/pci/ops-pmcmsp.c | 2 | ||||
-rw-r--r-- | arch/mips/pci/pci-bcm47xx.c | 1 | ||||
-rw-r--r-- | arch/mips/pci/pci-octeon.c | 6 | ||||
-rw-r--r-- | arch/mips/pci/pci.c | 8 |
7 files changed, 69 insertions, 15 deletions
diff --git a/arch/mips/pci/fixup-cobalt.c b/arch/mips/pci/fixup-cobalt.c index 9553b14002dd..acacd1407c63 100644 --- a/arch/mips/pci/fixup-cobalt.c +++ b/arch/mips/pci/fixup-cobalt.c | |||
@@ -51,6 +51,67 @@ static void qube_raq_galileo_early_fixup(struct pci_dev *dev) | |||
51 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_MARVELL, PCI_DEVICE_ID_MARVELL_GT64111, | 51 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_MARVELL, PCI_DEVICE_ID_MARVELL_GT64111, |
52 | qube_raq_galileo_early_fixup); | 52 | qube_raq_galileo_early_fixup); |
53 | 53 | ||
54 | static void __devinit cobalt_legacy_ide_resource_fixup(struct pci_dev *dev, | ||
55 | struct resource *res) | ||
56 | { | ||
57 | struct pci_controller *hose = (struct pci_controller *)dev->sysdata; | ||
58 | unsigned long offset = hose->io_offset; | ||
59 | struct resource orig = *res; | ||
60 | |||
61 | if (!(res->flags & IORESOURCE_IO) || | ||
62 | !(res->flags & IORESOURCE_PCI_FIXED)) | ||
63 | return; | ||
64 | |||
65 | res->start -= offset; | ||
66 | res->end -= offset; | ||
67 | dev_printk(KERN_DEBUG, &dev->dev, "converted legacy %pR to bus %pR\n", | ||
68 | &orig, res); | ||
69 | } | ||
70 | |||
71 | static void __devinit cobalt_legacy_ide_fixup(struct pci_dev *dev) | ||
72 | { | ||
73 | u32 class; | ||
74 | u8 progif; | ||
75 | |||
76 | /* | ||
77 | * If the IDE controller is in legacy mode, pci_setup_device() fills in | ||
78 | * the resources with the legacy addresses that normally appear on the | ||
79 | * PCI bus, just as if we had read them from a BAR. | ||
80 | * | ||
81 | * However, with the GT-64111, those legacy addresses, e.g., 0x1f0, | ||
82 | * will never appear on the PCI bus because it converts memory accesses | ||
83 | * in the PCI I/O region (which is never at address zero) into I/O port | ||
84 | * accesses with no address translation. | ||
85 | * | ||
86 | * For example, if GT_DEF_PCI0_IO_BASE is 0x10000000, a load or store | ||
87 | * to physical address 0x100001f0 will become a PCI access to I/O port | ||
88 | * 0x100001f0. There's no way to generate an access to I/O port 0x1f0, | ||
89 | * but the VT82C586 IDE controller does respond at 0x100001f0 because | ||
90 | * it only decodes the low 24 bits of the address. | ||
91 | * | ||
92 | * When this quirk runs, the pci_dev resources should contain bus | ||
93 | * addresses, not Linux I/O port numbers, so convert legacy addresses | ||
94 | * like 0x1f0 to bus addresses like 0x100001f0. Later, we'll convert | ||
95 | * them back with pcibios_fixup_bus() or pcibios_bus_to_resource(). | ||
96 | */ | ||
97 | class = dev->class >> 8; | ||
98 | if (class != PCI_CLASS_STORAGE_IDE) | ||
99 | return; | ||
100 | |||
101 | pci_read_config_byte(dev, PCI_CLASS_PROG, &progif); | ||
102 | if ((progif & 1) == 0) { | ||
103 | cobalt_legacy_ide_resource_fixup(dev, &dev->resource[0]); | ||
104 | cobalt_legacy_ide_resource_fixup(dev, &dev->resource[1]); | ||
105 | } | ||
106 | if ((progif & 4) == 0) { | ||
107 | cobalt_legacy_ide_resource_fixup(dev, &dev->resource[2]); | ||
108 | cobalt_legacy_ide_resource_fixup(dev, &dev->resource[3]); | ||
109 | } | ||
110 | } | ||
111 | |||
112 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, | ||
113 | cobalt_legacy_ide_fixup); | ||
114 | |||
54 | static void qube_raq_via_bmIDE_fixup(struct pci_dev *dev) | 115 | static void qube_raq_via_bmIDE_fixup(struct pci_dev *dev) |
55 | { | 116 | { |
56 | unsigned short cfgword; | 117 | unsigned short cfgword; |
diff --git a/arch/mips/pci/fixup-lemote2f.c b/arch/mips/pci/fixup-lemote2f.c index caf2edeb02f0..4b9768d5d729 100644 --- a/arch/mips/pci/fixup-lemote2f.c +++ b/arch/mips/pci/fixup-lemote2f.c | |||
@@ -131,7 +131,7 @@ static void __init loongson_cs5536_ehci_fixup(struct pci_dev *pdev) | |||
131 | 131 | ||
132 | /* Serial short detect enable */ | 132 | /* Serial short detect enable */ |
133 | _rdmsr(USB_MSR_REG(USB_CONFIG), &hi, &lo); | 133 | _rdmsr(USB_MSR_REG(USB_CONFIG), &hi, &lo); |
134 | _wrmsr(USB_MSR_REG(USB_CONFIG), (1 << 1) | (1 << 2) | (1 << 3), lo); | 134 | _wrmsr(USB_MSR_REG(USB_CONFIG), (1 << 1) | (1 << 3), lo); |
135 | 135 | ||
136 | /* setting the USB2.0 micro frame length */ | 136 | /* setting the USB2.0 micro frame length */ |
137 | pci_write_config_dword(pdev, PCI_EHCI_FLADJ_REG, 0x2000); | 137 | pci_write_config_dword(pdev, PCI_EHCI_FLADJ_REG, 0x2000); |
diff --git a/arch/mips/pci/ops-loongson2.c b/arch/mips/pci/ops-loongson2.c index aa5d3da27212..2bb4057bf6c7 100644 --- a/arch/mips/pci/ops-loongson2.c +++ b/arch/mips/pci/ops-loongson2.c | |||
@@ -1,13 +1,11 @@ | |||
1 | /* | 1 | /* |
2 | * fuloong2e specific PCI support. | ||
3 | * | ||
4 | * Copyright (C) 1999, 2000, 2004 MIPS Technologies, Inc. | 2 | * Copyright (C) 1999, 2000, 2004 MIPS Technologies, Inc. |
5 | * All rights reserved. | 3 | * All rights reserved. |
6 | * Authors: Carsten Langgaard <carstenl@mips.com> | 4 | * Authors: Carsten Langgaard <carstenl@mips.com> |
7 | * Maciej W. Rozycki <macro@mips.com> | 5 | * Maciej W. Rozycki <macro@mips.com> |
8 | * | 6 | * |
9 | * Copyright (C) 2009 Lemote Inc. | 7 | * Copyright (C) 2009 Lemote Inc. |
10 | * Author: Wu Zhangjin <wuzj@lemote.com> | 8 | * Author: Wu Zhangjin <wuzhangjin@gmail.com> |
11 | * | 9 | * |
12 | * This program is free software; you can distribute it and/or modify it | 10 | * This program is free software; you can distribute it and/or modify it |
13 | * under the terms of the GNU General Public License (Version 2) as | 11 | * under the terms of the GNU General Public License (Version 2) as |
diff --git a/arch/mips/pci/ops-pmcmsp.c b/arch/mips/pci/ops-pmcmsp.c index 32548b5d68d6..04b31478a6d7 100644 --- a/arch/mips/pci/ops-pmcmsp.c +++ b/arch/mips/pci/ops-pmcmsp.c | |||
@@ -206,7 +206,7 @@ static void pci_proc_init(void) | |||
206 | } | 206 | } |
207 | #endif /* CONFIG_PROC_FS && PCI_COUNTERS */ | 207 | #endif /* CONFIG_PROC_FS && PCI_COUNTERS */ |
208 | 208 | ||
209 | DEFINE_SPINLOCK(bpci_lock); | 209 | static DEFINE_SPINLOCK(bpci_lock); |
210 | 210 | ||
211 | /***************************************************************************** | 211 | /***************************************************************************** |
212 | * | 212 | * |
diff --git a/arch/mips/pci/pci-bcm47xx.c b/arch/mips/pci/pci-bcm47xx.c index bea9b6cdfdbf..455f8e50a007 100644 --- a/arch/mips/pci/pci-bcm47xx.c +++ b/arch/mips/pci/pci-bcm47xx.c | |||
@@ -57,4 +57,3 @@ int pcibios_plat_dev_init(struct pci_dev *dev) | |||
57 | dev->irq = res; | 57 | dev->irq = res; |
58 | return 0; | 58 | return 0; |
59 | } | 59 | } |
60 | |||
diff --git a/arch/mips/pci/pci-octeon.c b/arch/mips/pci/pci-octeon.c index 9cb0c807f564..d248b707eff3 100644 --- a/arch/mips/pci/pci-octeon.c +++ b/arch/mips/pci/pci-octeon.c | |||
@@ -209,16 +209,14 @@ const char *octeon_get_pci_interrupts(void) | |||
209 | case CVMX_BOARD_TYPE_NAO38: | 209 | case CVMX_BOARD_TYPE_NAO38: |
210 | /* This is really the NAC38 */ | 210 | /* This is really the NAC38 */ |
211 | return "AAAAADABAAAAAAAAAAAAAAAAAAAAAAAA"; | 211 | return "AAAAADABAAAAAAAAAAAAAAAAAAAAAAAA"; |
212 | case CVMX_BOARD_TYPE_THUNDER: | ||
213 | return ""; | ||
214 | case CVMX_BOARD_TYPE_EBH3000: | ||
215 | return ""; | ||
216 | case CVMX_BOARD_TYPE_EBH3100: | 212 | case CVMX_BOARD_TYPE_EBH3100: |
217 | case CVMX_BOARD_TYPE_CN3010_EVB_HS5: | 213 | case CVMX_BOARD_TYPE_CN3010_EVB_HS5: |
218 | case CVMX_BOARD_TYPE_CN3005_EVB_HS5: | 214 | case CVMX_BOARD_TYPE_CN3005_EVB_HS5: |
219 | return "AAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; | 215 | return "AAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; |
220 | case CVMX_BOARD_TYPE_BBGW_REF: | 216 | case CVMX_BOARD_TYPE_BBGW_REF: |
221 | return "AABCD"; | 217 | return "AABCD"; |
218 | case CVMX_BOARD_TYPE_THUNDER: | ||
219 | case CVMX_BOARD_TYPE_EBH3000: | ||
222 | default: | 220 | default: |
223 | return ""; | 221 | return ""; |
224 | } | 222 | } |
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c index 9a11c2226891..38bc28005b4a 100644 --- a/arch/mips/pci/pci.c +++ b/arch/mips/pci/pci.c | |||
@@ -49,8 +49,8 @@ static int pci_initialized; | |||
49 | * but we want to try to avoid allocating at 0x2900-0x2bff | 49 | * but we want to try to avoid allocating at 0x2900-0x2bff |
50 | * which might have be mirrored at 0x0100-0x03ff.. | 50 | * which might have be mirrored at 0x0100-0x03ff.. |
51 | */ | 51 | */ |
52 | void | 52 | resource_size_t |
53 | pcibios_align_resource(void *data, struct resource *res, | 53 | pcibios_align_resource(void *data, const struct resource *res, |
54 | resource_size_t size, resource_size_t align) | 54 | resource_size_t size, resource_size_t align) |
55 | { | 55 | { |
56 | struct pci_dev *dev = data; | 56 | struct pci_dev *dev = data; |
@@ -73,7 +73,7 @@ pcibios_align_resource(void *data, struct resource *res, | |||
73 | start = PCIBIOS_MIN_MEM + hose->mem_resource->start; | 73 | start = PCIBIOS_MIN_MEM + hose->mem_resource->start; |
74 | } | 74 | } |
75 | 75 | ||
76 | res->start = start; | 76 | return start; |
77 | } | 77 | } |
78 | 78 | ||
79 | static void __devinit pcibios_scanbus(struct pci_controller *hose) | 79 | static void __devinit pcibios_scanbus(struct pci_controller *hose) |
@@ -251,8 +251,6 @@ static void pcibios_fixup_device_resources(struct pci_dev *dev, | |||
251 | for (i = 0; i < PCI_NUM_RESOURCES; i++) { | 251 | for (i = 0; i < PCI_NUM_RESOURCES; i++) { |
252 | if (!dev->resource[i].start) | 252 | if (!dev->resource[i].start) |
253 | continue; | 253 | continue; |
254 | if (dev->resource[i].flags & IORESOURCE_PCI_FIXED) | ||
255 | continue; | ||
256 | if (dev->resource[i].flags & IORESOURCE_IO) | 254 | if (dev->resource[i].flags & IORESOURCE_IO) |
257 | offset = hose->io_offset; | 255 | offset = hose->io_offset; |
258 | else if (dev->resource[i].flags & IORESOURCE_MEM) | 256 | else if (dev->resource[i].flags & IORESOURCE_MEM) |