diff options
author | Tony Luck <tony.luck@intel.com> | 2006-06-23 16:46:23 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2006-06-23 16:46:23 -0400 |
commit | 8cf60e04a131310199d5776e2f9e915f0c468899 (patch) | |
tree | 373a68e88e6737713a0a5723d552cdeefffff929 /arch/i386/pci | |
parent | 1323523f505606cfd24af6122369afddefc3b09d (diff) | |
parent | 95eaa5fa8eb2c345244acd5f65b200b115ae8c65 (diff) |
Auto-update from upstream
Diffstat (limited to 'arch/i386/pci')
-rw-r--r-- | arch/i386/pci/common.c | 1 | ||||
-rw-r--r-- | arch/i386/pci/i386.c | 9 | ||||
-rw-r--r-- | arch/i386/pci/irq.c | 15 | ||||
-rw-r--r-- | arch/i386/pci/mmconfig.c | 9 | ||||
-rw-r--r-- | arch/i386/pci/pci.h | 1 |
5 files changed, 25 insertions, 10 deletions
diff --git a/arch/i386/pci/common.c b/arch/i386/pci/common.c index dbece776c5b2..c624b61e1104 100644 --- a/arch/i386/pci/common.c +++ b/arch/i386/pci/common.c | |||
@@ -288,6 +288,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) | |||
288 | 288 | ||
289 | void pcibios_disable_device (struct pci_dev *dev) | 289 | void pcibios_disable_device (struct pci_dev *dev) |
290 | { | 290 | { |
291 | pcibios_disable_resources(dev); | ||
291 | if (pcibios_disable_irq) | 292 | if (pcibios_disable_irq) |
292 | pcibios_disable_irq(dev); | 293 | pcibios_disable_irq(dev); |
293 | } | 294 | } |
diff --git a/arch/i386/pci/i386.c b/arch/i386/pci/i386.c index ed2c8c899bd3..7852827a599b 100644 --- a/arch/i386/pci/i386.c +++ b/arch/i386/pci/i386.c | |||
@@ -242,6 +242,15 @@ int pcibios_enable_resources(struct pci_dev *dev, int mask) | |||
242 | return 0; | 242 | return 0; |
243 | } | 243 | } |
244 | 244 | ||
245 | void pcibios_disable_resources(struct pci_dev *dev) | ||
246 | { | ||
247 | u16 cmd; | ||
248 | |||
249 | pci_read_config_word(dev, PCI_COMMAND, &cmd); | ||
250 | cmd &= ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY); | ||
251 | pci_write_config_word(dev, PCI_COMMAND, cmd); | ||
252 | } | ||
253 | |||
245 | /* | 254 | /* |
246 | * If we set up a device for bus mastering, we need to check the latency | 255 | * If we set up a device for bus mastering, we need to check the latency |
247 | * timer as certain crappy BIOSes forget to set it properly. | 256 | * timer as certain crappy BIOSes forget to set it properly. |
diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c index 06dab00aaadc..8ce69508f3c7 100644 --- a/arch/i386/pci/irq.c +++ b/arch/i386/pci/irq.c | |||
@@ -198,14 +198,14 @@ static void write_config_nybble(struct pci_dev *router, unsigned offset, unsigne | |||
198 | */ | 198 | */ |
199 | static int pirq_ali_get(struct pci_dev *router, struct pci_dev *dev, int pirq) | 199 | static int pirq_ali_get(struct pci_dev *router, struct pci_dev *dev, int pirq) |
200 | { | 200 | { |
201 | static unsigned char irqmap[16] = { 0, 9, 3, 10, 4, 5, 7, 6, 1, 11, 0, 12, 0, 14, 0, 15 }; | 201 | static const unsigned char irqmap[16] = { 0, 9, 3, 10, 4, 5, 7, 6, 1, 11, 0, 12, 0, 14, 0, 15 }; |
202 | 202 | ||
203 | return irqmap[read_config_nybble(router, 0x48, pirq-1)]; | 203 | return irqmap[read_config_nybble(router, 0x48, pirq-1)]; |
204 | } | 204 | } |
205 | 205 | ||
206 | static int pirq_ali_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) | 206 | static int pirq_ali_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) |
207 | { | 207 | { |
208 | static unsigned char irqmap[16] = { 0, 8, 0, 2, 4, 5, 7, 6, 0, 1, 3, 9, 11, 0, 13, 15 }; | 208 | static const unsigned char irqmap[16] = { 0, 8, 0, 2, 4, 5, 7, 6, 0, 1, 3, 9, 11, 0, 13, 15 }; |
209 | unsigned int val = irqmap[irq]; | 209 | unsigned int val = irqmap[irq]; |
210 | 210 | ||
211 | if (val) { | 211 | if (val) { |
@@ -256,13 +256,13 @@ static int pirq_via_set(struct pci_dev *router, struct pci_dev *dev, int pirq, i | |||
256 | */ | 256 | */ |
257 | static int pirq_via586_get(struct pci_dev *router, struct pci_dev *dev, int pirq) | 257 | static int pirq_via586_get(struct pci_dev *router, struct pci_dev *dev, int pirq) |
258 | { | 258 | { |
259 | static unsigned int pirqmap[4] = { 3, 2, 5, 1 }; | 259 | static const unsigned int pirqmap[4] = { 3, 2, 5, 1 }; |
260 | return read_config_nybble(router, 0x55, pirqmap[pirq-1]); | 260 | return read_config_nybble(router, 0x55, pirqmap[pirq-1]); |
261 | } | 261 | } |
262 | 262 | ||
263 | static int pirq_via586_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) | 263 | static int pirq_via586_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) |
264 | { | 264 | { |
265 | static unsigned int pirqmap[4] = { 3, 2, 5, 1 }; | 265 | static const unsigned int pirqmap[4] = { 3, 2, 5, 1 }; |
266 | write_config_nybble(router, 0x55, pirqmap[pirq-1], irq); | 266 | write_config_nybble(router, 0x55, pirqmap[pirq-1], irq); |
267 | return 1; | 267 | return 1; |
268 | } | 268 | } |
@@ -274,13 +274,13 @@ static int pirq_via586_set(struct pci_dev *router, struct pci_dev *dev, int pirq | |||
274 | */ | 274 | */ |
275 | static int pirq_ite_get(struct pci_dev *router, struct pci_dev *dev, int pirq) | 275 | static int pirq_ite_get(struct pci_dev *router, struct pci_dev *dev, int pirq) |
276 | { | 276 | { |
277 | static unsigned char pirqmap[4] = { 1, 0, 2, 3 }; | 277 | static const unsigned char pirqmap[4] = { 1, 0, 2, 3 }; |
278 | return read_config_nybble(router,0x43, pirqmap[pirq-1]); | 278 | return read_config_nybble(router,0x43, pirqmap[pirq-1]); |
279 | } | 279 | } |
280 | 280 | ||
281 | static int pirq_ite_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) | 281 | static int pirq_ite_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) |
282 | { | 282 | { |
283 | static unsigned char pirqmap[4] = { 1, 0, 2, 3 }; | 283 | static const unsigned char pirqmap[4] = { 1, 0, 2, 3 }; |
284 | write_config_nybble(router, 0x43, pirqmap[pirq-1], irq); | 284 | write_config_nybble(router, 0x43, pirqmap[pirq-1], irq); |
285 | return 1; | 285 | return 1; |
286 | } | 286 | } |
@@ -505,7 +505,7 @@ static int pirq_bios_set(struct pci_dev *router, struct pci_dev *dev, int pirq, | |||
505 | 505 | ||
506 | static __init int intel_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) | 506 | static __init int intel_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) |
507 | { | 507 | { |
508 | static struct pci_device_id pirq_440gx[] = { | 508 | static struct pci_device_id __initdata pirq_440gx[] = { |
509 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443GX_0) }, | 509 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443GX_0) }, |
510 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443GX_2) }, | 510 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443GX_2) }, |
511 | { }, | 511 | { }, |
@@ -880,6 +880,7 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
880 | ((!(pci_probe & PCI_USE_PIRQ_MASK)) || ((1 << irq) & mask)) ) { | 880 | ((!(pci_probe & PCI_USE_PIRQ_MASK)) || ((1 << irq) & mask)) ) { |
881 | DBG(" -> got IRQ %d\n", irq); | 881 | DBG(" -> got IRQ %d\n", irq); |
882 | msg = "Found"; | 882 | msg = "Found"; |
883 | eisa_set_level_irq(irq); | ||
883 | } else if (newirq && r->set && (dev->class >> 8) != PCI_CLASS_DISPLAY_VGA) { | 884 | } else if (newirq && r->set && (dev->class >> 8) != PCI_CLASS_DISPLAY_VGA) { |
884 | DBG(" -> assigning IRQ %d", newirq); | 885 | DBG(" -> assigning IRQ %d", newirq); |
885 | if (r->set(pirq_router_dev, dev, pirq, newirq)) { | 886 | if (r->set(pirq_router_dev, dev, pirq, newirq)) { |
diff --git a/arch/i386/pci/mmconfig.c b/arch/i386/pci/mmconfig.c index 6b1ea0c9a570..e545b0992c48 100644 --- a/arch/i386/pci/mmconfig.c +++ b/arch/i386/pci/mmconfig.c | |||
@@ -15,7 +15,9 @@ | |||
15 | #include <asm/e820.h> | 15 | #include <asm/e820.h> |
16 | #include "pci.h" | 16 | #include "pci.h" |
17 | 17 | ||
18 | #define MMCONFIG_APER_SIZE (256*1024*1024) | 18 | /* aperture is up to 256MB but BIOS may reserve less */ |
19 | #define MMCONFIG_APER_MIN (2 * 1024*1024) | ||
20 | #define MMCONFIG_APER_MAX (256 * 1024*1024) | ||
19 | 21 | ||
20 | /* Assume systems with more busses have correct MCFG */ | 22 | /* Assume systems with more busses have correct MCFG */ |
21 | #define MAX_CHECK_BUS 16 | 23 | #define MAX_CHECK_BUS 16 |
@@ -197,9 +199,10 @@ void __init pci_mmcfg_init(void) | |||
197 | return; | 199 | return; |
198 | 200 | ||
199 | if (!e820_all_mapped(pci_mmcfg_config[0].base_address, | 201 | if (!e820_all_mapped(pci_mmcfg_config[0].base_address, |
200 | pci_mmcfg_config[0].base_address + MMCONFIG_APER_SIZE, | 202 | pci_mmcfg_config[0].base_address + MMCONFIG_APER_MIN, |
201 | E820_RESERVED)) { | 203 | E820_RESERVED)) { |
202 | printk(KERN_ERR "PCI: BIOS Bug: MCFG area is not E820-reserved\n"); | 204 | printk(KERN_ERR "PCI: BIOS Bug: MCFG area at %x is not E820-reserved\n", |
205 | pci_mmcfg_config[0].base_address); | ||
203 | printk(KERN_ERR "PCI: Not using MMCONFIG.\n"); | 206 | printk(KERN_ERR "PCI: Not using MMCONFIG.\n"); |
204 | return; | 207 | return; |
205 | } | 208 | } |
diff --git a/arch/i386/pci/pci.h b/arch/i386/pci/pci.h index 12035e29108b..12bf3d8dda29 100644 --- a/arch/i386/pci/pci.h +++ b/arch/i386/pci/pci.h | |||
@@ -35,6 +35,7 @@ extern unsigned int pcibios_max_latency; | |||
35 | 35 | ||
36 | void pcibios_resource_survey(void); | 36 | void pcibios_resource_survey(void); |
37 | int pcibios_enable_resources(struct pci_dev *, int); | 37 | int pcibios_enable_resources(struct pci_dev *, int); |
38 | void pcibios_disable_resources(struct pci_dev *); | ||
38 | 39 | ||
39 | /* pci-pc.c */ | 40 | /* pci-pc.c */ |
40 | 41 | ||