diff options
Diffstat (limited to 'arch/i386/pci/fixup.c')
-rw-r--r-- | arch/i386/pci/fixup.c | 62 |
1 files changed, 13 insertions, 49 deletions
diff --git a/arch/i386/pci/fixup.c b/arch/i386/pci/fixup.c index b60d7e8689ed..cde1170b01a1 100644 --- a/arch/i386/pci/fixup.c +++ b/arch/i386/pci/fixup.c | |||
@@ -74,52 +74,6 @@ static void __devinit pci_fixup_ncr53c810(struct pci_dev *d) | |||
74 | } | 74 | } |
75 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, pci_fixup_ncr53c810); | 75 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, pci_fixup_ncr53c810); |
76 | 76 | ||
77 | static void __devinit pci_fixup_ide_bases(struct pci_dev *d) | ||
78 | { | ||
79 | int i; | ||
80 | |||
81 | /* | ||
82 | * PCI IDE controllers use non-standard I/O port decoding, respect it. | ||
83 | */ | ||
84 | if ((d->class >> 8) != PCI_CLASS_STORAGE_IDE) | ||
85 | return; | ||
86 | DBG("PCI: IDE base address fixup for %s\n", pci_name(d)); | ||
87 | for(i=0; i<4; i++) { | ||
88 | struct resource *r = &d->resource[i]; | ||
89 | if ((r->start & ~0x80) == 0x374) { | ||
90 | r->start |= 2; | ||
91 | r->end = r->start; | ||
92 | } | ||
93 | } | ||
94 | } | ||
95 | DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_ide_bases); | ||
96 | |||
97 | static void __devinit pci_fixup_ide_trash(struct pci_dev *d) | ||
98 | { | ||
99 | int i; | ||
100 | |||
101 | /* | ||
102 | * Runs the fixup only for the first IDE controller | ||
103 | * (Shai Fultheim - shai@ftcon.com) | ||
104 | */ | ||
105 | static int called = 0; | ||
106 | if (called) | ||
107 | return; | ||
108 | called = 1; | ||
109 | |||
110 | /* | ||
111 | * There exist PCI IDE controllers which have utter garbage | ||
112 | * in first four base registers. Ignore that. | ||
113 | */ | ||
114 | DBG("PCI: IDE base address trash cleared for %s\n", pci_name(d)); | ||
115 | for(i=0; i<4; i++) | ||
116 | d->resource[i].start = d->resource[i].end = d->resource[i].flags = 0; | ||
117 | } | ||
118 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5513, pci_fixup_ide_trash); | ||
119 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_10, pci_fixup_ide_trash); | ||
120 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_11, pci_fixup_ide_trash); | ||
121 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_9, pci_fixup_ide_trash); | ||
122 | |||
123 | static void __devinit pci_fixup_latency(struct pci_dev *d) | 77 | static void __devinit pci_fixup_latency(struct pci_dev *d) |
124 | { | 78 | { |
125 | /* | 79 | /* |
@@ -348,8 +302,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MCH_PC1, pcie_r | |||
348 | * From information provided by "Jon Smirl" <jonsmirl@gmail.com> | 302 | * From information provided by "Jon Smirl" <jonsmirl@gmail.com> |
349 | * | 303 | * |
350 | * The standard boot ROM sequence for an x86 machine uses the BIOS | 304 | * The standard boot ROM sequence for an x86 machine uses the BIOS |
351 | * to select an initial video card for boot display. This boot video | 305 | * to select an initial video card for boot display. This boot video |
352 | * card will have it's BIOS copied to C0000 in system RAM. | 306 | * card will have it's BIOS copied to C0000 in system RAM. |
353 | * IORESOURCE_ROM_SHADOW is used to associate the boot video | 307 | * IORESOURCE_ROM_SHADOW is used to associate the boot video |
354 | * card with this copy. On laptops this copy has to be used since | 308 | * card with this copy. On laptops this copy has to be used since |
355 | * the main ROM may be compressed or combined with another image. | 309 | * the main ROM may be compressed or combined with another image. |
@@ -371,7 +325,17 @@ static void __devinit pci_fixup_video(struct pci_dev *pdev) | |||
371 | bus = pdev->bus; | 325 | bus = pdev->bus; |
372 | while (bus) { | 326 | while (bus) { |
373 | bridge = bus->self; | 327 | bridge = bus->self; |
374 | if (bridge) { | 328 | |
329 | /* | ||
330 | * From information provided by | ||
331 | * "David Miller" <davem@davemloft.net> | ||
332 | * The bridge control register is valid for PCI header | ||
333 | * type BRIDGE, or CARDBUS. Host to PCI controllers use | ||
334 | * PCI header type NORMAL. | ||
335 | */ | ||
336 | if (bridge | ||
337 | &&((bridge->hdr_type == PCI_HEADER_TYPE_BRIDGE) | ||
338 | ||(bridge->hdr_type == PCI_HEADER_TYPE_CARDBUS))) { | ||
375 | pci_read_config_word(bridge, PCI_BRIDGE_CONTROL, | 339 | pci_read_config_word(bridge, PCI_BRIDGE_CONTROL, |
376 | &config); | 340 | &config); |
377 | if (!(config & PCI_BRIDGE_CTL_VGA)) | 341 | if (!(config & PCI_BRIDGE_CTL_VGA)) |