diff options
author | David Woodhouse <dwmw2@infradead.org> | 2006-12-01 04:56:43 -0500 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2006-12-01 04:56:43 -0500 |
commit | bd3c97a7c718bfb9f1e4f31c16c383a5c6f815eb (patch) | |
tree | 3f56594e813c6f35cbacbdb3e137ba5bfd0b3069 /arch/i386/pci | |
parent | 6c33cafc794d07c9254c160789120a0e98c088c9 (diff) | |
parent | 0215ffb08ce99e2bb59eca114a99499a4d06e704 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'arch/i386/pci')
-rw-r--r-- | arch/i386/pci/common.c | 1 | ||||
-rw-r--r-- | arch/i386/pci/fixup.c | 55 | ||||
-rw-r--r-- | arch/i386/pci/i386.c | 9 | ||||
-rw-r--r-- | arch/i386/pci/irq.c | 4 | ||||
-rw-r--r-- | arch/i386/pci/mmconfig.c | 35 | ||||
-rw-r--r-- | arch/i386/pci/pci.h | 1 |
6 files changed, 57 insertions, 48 deletions
diff --git a/arch/i386/pci/common.c b/arch/i386/pci/common.c index 6d5ace845e44..cdfcf971098b 100644 --- a/arch/i386/pci/common.c +++ b/arch/i386/pci/common.c | |||
@@ -343,7 +343,6 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) | |||
343 | 343 | ||
344 | void pcibios_disable_device (struct pci_dev *dev) | 344 | void pcibios_disable_device (struct pci_dev *dev) |
345 | { | 345 | { |
346 | pcibios_disable_resources(dev); | ||
347 | if (pcibios_disable_irq) | 346 | if (pcibios_disable_irq) |
348 | pcibios_disable_irq(dev); | 347 | pcibios_disable_irq(dev); |
349 | } | 348 | } |
diff --git a/arch/i386/pci/fixup.c b/arch/i386/pci/fixup.c index 908b410f4c93..c1949ff38d61 100644 --- a/arch/i386/pci/fixup.c +++ b/arch/i386/pci/fixup.c | |||
@@ -343,6 +343,61 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MCH_PC, pcie_ro | |||
343 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MCH_PC1, pcie_rootport_aspm_quirk ); | 343 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MCH_PC1, pcie_rootport_aspm_quirk ); |
344 | 344 | ||
345 | /* | 345 | /* |
346 | * Fixup to mark boot BIOS video selected by BIOS before it changes | ||
347 | * | ||
348 | * From information provided by "Jon Smirl" <jonsmirl@gmail.com> | ||
349 | * | ||
350 | * 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 | ||
352 | * card will have it's BIOS copied to C0000 in system RAM. | ||
353 | * IORESOURCE_ROM_SHADOW is used to associate the boot video | ||
354 | * 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. | ||
356 | * See pci_map_rom() for use of this flag. IORESOURCE_ROM_SHADOW | ||
357 | * is marked here since the boot video device will be the only enabled | ||
358 | * video device at this point. | ||
359 | */ | ||
360 | |||
361 | static void __devinit pci_fixup_video(struct pci_dev *pdev) | ||
362 | { | ||
363 | struct pci_dev *bridge; | ||
364 | struct pci_bus *bus; | ||
365 | u16 config; | ||
366 | |||
367 | if ((pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA) | ||
368 | return; | ||
369 | |||
370 | /* Is VGA routed to us? */ | ||
371 | bus = pdev->bus; | ||
372 | while (bus) { | ||
373 | bridge = bus->self; | ||
374 | |||
375 | /* | ||
376 | * From information provided by | ||
377 | * "David Miller" <davem@davemloft.net> | ||
378 | * The bridge control register is valid for PCI header | ||
379 | * type BRIDGE, or CARDBUS. Host to PCI controllers use | ||
380 | * PCI header type NORMAL. | ||
381 | */ | ||
382 | if (bridge | ||
383 | &&((bridge->hdr_type == PCI_HEADER_TYPE_BRIDGE) | ||
384 | ||(bridge->hdr_type == PCI_HEADER_TYPE_CARDBUS))) { | ||
385 | pci_read_config_word(bridge, PCI_BRIDGE_CONTROL, | ||
386 | &config); | ||
387 | if (!(config & PCI_BRIDGE_CTL_VGA)) | ||
388 | return; | ||
389 | } | ||
390 | bus = bus->parent; | ||
391 | } | ||
392 | pci_read_config_word(pdev, PCI_COMMAND, &config); | ||
393 | if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { | ||
394 | pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW; | ||
395 | printk(KERN_DEBUG "Boot video device is %s\n", pci_name(pdev)); | ||
396 | } | ||
397 | } | ||
398 | DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_video); | ||
399 | |||
400 | /* | ||
346 | * Some Toshiba laptops need extra code to enable their TI TSB43AB22/A. | 401 | * Some Toshiba laptops need extra code to enable their TI TSB43AB22/A. |
347 | * | 402 | * |
348 | * We pretend to bring them out of full D3 state, and restore the proper | 403 | * We pretend to bring them out of full D3 state, and restore the proper |
diff --git a/arch/i386/pci/i386.c b/arch/i386/pci/i386.c index 10154a2cac68..98580292f0d4 100644 --- a/arch/i386/pci/i386.c +++ b/arch/i386/pci/i386.c | |||
@@ -242,15 +242,6 @@ 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 | |||
254 | /* | 245 | /* |
255 | * If we set up a device for bus mastering, we need to check the latency | 246 | * If we set up a device for bus mastering, we need to check the latency |
256 | * timer as certain crappy BIOSes forget to set it properly. | 247 | * 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 dbc4aae91959..69163998adeb 100644 --- a/arch/i386/pci/irq.c +++ b/arch/i386/pci/irq.c | |||
@@ -255,13 +255,13 @@ static int pirq_via_set(struct pci_dev *router, struct pci_dev *dev, int pirq, i | |||
255 | */ | 255 | */ |
256 | static int pirq_via586_get(struct pci_dev *router, struct pci_dev *dev, int pirq) | 256 | static int pirq_via586_get(struct pci_dev *router, struct pci_dev *dev, int pirq) |
257 | { | 257 | { |
258 | static const unsigned int pirqmap[4] = { 3, 2, 5, 1 }; | 258 | static const unsigned int pirqmap[5] = { 3, 2, 5, 1, 1 }; |
259 | return read_config_nybble(router, 0x55, pirqmap[pirq-1]); | 259 | return read_config_nybble(router, 0x55, pirqmap[pirq-1]); |
260 | } | 260 | } |
261 | 261 | ||
262 | static int pirq_via586_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) | 262 | static int pirq_via586_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) |
263 | { | 263 | { |
264 | static const unsigned int pirqmap[4] = { 3, 2, 5, 1 }; | 264 | static const unsigned int pirqmap[5] = { 3, 2, 5, 1, 1 }; |
265 | write_config_nybble(router, 0x55, pirqmap[pirq-1], irq); | 265 | write_config_nybble(router, 0x55, pirqmap[pirq-1], irq); |
266 | return 1; | 266 | return 1; |
267 | } | 267 | } |
diff --git a/arch/i386/pci/mmconfig.c b/arch/i386/pci/mmconfig.c index d0c3da3aa2aa..c6b6d9bbc453 100644 --- a/arch/i386/pci/mmconfig.c +++ b/arch/i386/pci/mmconfig.c | |||
@@ -154,38 +154,6 @@ static struct pci_raw_ops pci_mmcfg = { | |||
154 | .write = pci_mmcfg_write, | 154 | .write = pci_mmcfg_write, |
155 | }; | 155 | }; |
156 | 156 | ||
157 | |||
158 | static __init void pci_mmcfg_insert_resources(void) | ||
159 | { | ||
160 | #define PCI_MMCFG_RESOURCE_NAME_LEN 19 | ||
161 | int i; | ||
162 | struct resource *res; | ||
163 | char *names; | ||
164 | unsigned num_buses; | ||
165 | |||
166 | res = kcalloc(PCI_MMCFG_RESOURCE_NAME_LEN + sizeof(*res), | ||
167 | pci_mmcfg_config_num, GFP_KERNEL); | ||
168 | |||
169 | if (!res) { | ||
170 | printk(KERN_ERR "PCI: Unable to allocate MMCONFIG resources\n"); | ||
171 | return; | ||
172 | } | ||
173 | |||
174 | names = (void *)&res[pci_mmcfg_config_num]; | ||
175 | for (i = 0; i < pci_mmcfg_config_num; i++, res++) { | ||
176 | num_buses = pci_mmcfg_config[i].end_bus_number - | ||
177 | pci_mmcfg_config[i].start_bus_number + 1; | ||
178 | res->name = names; | ||
179 | snprintf(names, PCI_MMCFG_RESOURCE_NAME_LEN, "PCI MMCONFIG %u", | ||
180 | pci_mmcfg_config[i].pci_segment_group_number); | ||
181 | res->start = pci_mmcfg_config[i].base_address; | ||
182 | res->end = res->start + (num_buses << 20) - 1; | ||
183 | res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; | ||
184 | insert_resource(&iomem_resource, res); | ||
185 | names += PCI_MMCFG_RESOURCE_NAME_LEN; | ||
186 | } | ||
187 | } | ||
188 | |||
189 | /* K8 systems have some devices (typically in the builtin northbridge) | 157 | /* K8 systems have some devices (typically in the builtin northbridge) |
190 | that are only accessible using type1 | 158 | that are only accessible using type1 |
191 | Normally this can be expressed in the MCFG by not listing them | 159 | Normally this can be expressed in the MCFG by not listing them |
@@ -222,8 +190,6 @@ static __init void unreachable_devices(void) | |||
222 | } | 190 | } |
223 | } | 191 | } |
224 | 192 | ||
225 | |||
226 | |||
227 | void __init pci_mmcfg_init(int type) | 193 | void __init pci_mmcfg_init(int type) |
228 | { | 194 | { |
229 | if ((pci_probe & PCI_PROBE_MMCONF) == 0) | 195 | if ((pci_probe & PCI_PROBE_MMCONF) == 0) |
@@ -251,5 +217,4 @@ void __init pci_mmcfg_init(int type) | |||
251 | pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF; | 217 | pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF; |
252 | 218 | ||
253 | unreachable_devices(); | 219 | unreachable_devices(); |
254 | pci_mmcfg_insert_resources(); | ||
255 | } | 220 | } |
diff --git a/arch/i386/pci/pci.h b/arch/i386/pci/pci.h index ad065cebd7b9..a0a25180b61a 100644 --- a/arch/i386/pci/pci.h +++ b/arch/i386/pci/pci.h | |||
@@ -43,7 +43,6 @@ extern unsigned int pcibios_max_latency; | |||
43 | 43 | ||
44 | void pcibios_resource_survey(void); | 44 | void pcibios_resource_survey(void); |
45 | int pcibios_enable_resources(struct pci_dev *, int); | 45 | int pcibios_enable_resources(struct pci_dev *, int); |
46 | void pcibios_disable_resources(struct pci_dev *); | ||
47 | 46 | ||
48 | /* pci-pc.c */ | 47 | /* pci-pc.c */ |
49 | 48 | ||