aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/pci/common.c7
-rw-r--r--arch/x86/pci/pcbios.c72
-rw-r--r--arch/x86/pci/pci.h3
3 files changed, 0 insertions, 82 deletions
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index 7b6e3bb9b28..c9ff4ff6673 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -427,10 +427,6 @@ static int __init pcibios_init(void)
427 427
428 if (pci_bf_sort >= pci_force_bf) 428 if (pci_bf_sort >= pci_force_bf)
429 pci_sort_breadthfirst(); 429 pci_sort_breadthfirst();
430#ifdef CONFIG_PCI_BIOS
431 if ((pci_probe & PCI_BIOS_SORT) && !(pci_probe & PCI_NO_SORT))
432 pcibios_sort();
433#endif
434 return 0; 430 return 0;
435} 431}
436 432
@@ -455,9 +451,6 @@ char * __devinit pcibios_setup(char *str)
455 } else if (!strcmp(str, "nobios")) { 451 } else if (!strcmp(str, "nobios")) {
456 pci_probe &= ~PCI_PROBE_BIOS; 452 pci_probe &= ~PCI_PROBE_BIOS;
457 return NULL; 453 return NULL;
458 } else if (!strcmp(str, "nosort")) {
459 pci_probe |= PCI_NO_SORT;
460 return NULL;
461 } else if (!strcmp(str, "biosirq")) { 454 } else if (!strcmp(str, "biosirq")) {
462 pci_probe |= PCI_BIOS_IRQ_SCAN; 455 pci_probe |= PCI_BIOS_IRQ_SCAN;
463 return NULL; 456 return NULL;
diff --git a/arch/x86/pci/pcbios.c b/arch/x86/pci/pcbios.c
index 2f7109ac4c1..37472fc6f72 100644
--- a/arch/x86/pci/pcbios.c
+++ b/arch/x86/pci/pcbios.c
@@ -152,28 +152,6 @@ static int __devinit check_pcibios(void)
152 return 0; 152 return 0;
153} 153}
154 154
155static int __devinit pci_bios_find_device (unsigned short vendor, unsigned short device_id,
156 unsigned short index, unsigned char *bus, unsigned char *device_fn)
157{
158 unsigned short bx;
159 unsigned short ret;
160
161 __asm__("lcall *(%%edi); cld\n\t"
162 "jc 1f\n\t"
163 "xor %%ah, %%ah\n"
164 "1:"
165 : "=b" (bx),
166 "=a" (ret)
167 : "1" (PCIBIOS_FIND_PCI_DEVICE),
168 "c" (device_id),
169 "d" (vendor),
170 "S" ((int) index),
171 "D" (&pci_indirect));
172 *bus = (bx >> 8) & 0xff;
173 *device_fn = bx & 0xff;
174 return (int) (ret & 0xff00) >> 8;
175}
176
177static int pci_bios_read(unsigned int seg, unsigned int bus, 155static int pci_bios_read(unsigned int seg, unsigned int bus,
178 unsigned int devfn, int reg, int len, u32 *value) 156 unsigned int devfn, int reg, int len, u32 *value)
179{ 157{
@@ -364,55 +342,6 @@ static struct pci_raw_ops * __devinit pci_find_bios(void)
364} 342}
365 343
366/* 344/*
367 * Sort the device list according to PCI BIOS. Nasty hack, but since some
368 * fool forgot to define the `correct' device order in the PCI BIOS specs
369 * and we want to be (possibly bug-to-bug ;-]) compatible with older kernels
370 * which used BIOS ordering, we are bound to do this...
371 */
372
373void __devinit pcibios_sort(void)
374{
375 LIST_HEAD(sorted_devices);
376 struct list_head *ln;
377 struct pci_dev *dev, *d;
378 int idx, found;
379 unsigned char bus, devfn;
380
381 DBG("PCI: Sorting device list...\n");
382 while (!list_empty(&pci_devices)) {
383 ln = pci_devices.next;
384 dev = pci_dev_g(ln);
385 idx = found = 0;
386 while (pci_bios_find_device(dev->vendor, dev->device, idx, &bus, &devfn) == PCIBIOS_SUCCESSFUL) {
387 idx++;
388 list_for_each(ln, &pci_devices) {
389 d = pci_dev_g(ln);
390 if (d->bus->number == bus && d->devfn == devfn) {
391 list_move_tail(&d->global_list, &sorted_devices);
392 if (d == dev)
393 found = 1;
394 break;
395 }
396 }
397 if (ln == &pci_devices) {
398 printk(KERN_WARNING "PCI: BIOS reporting unknown device %02x:%02x\n", bus, devfn);
399 /*
400 * We must not continue scanning as several buggy BIOSes
401 * return garbage after the last device. Grr.
402 */
403 break;
404 }
405 }
406 if (!found) {
407 printk(KERN_WARNING "PCI: Device %s not found by BIOS\n",
408 pci_name(dev));
409 list_move_tail(&dev->global_list, &sorted_devices);
410 }
411 }
412 list_splice(&sorted_devices, &pci_devices);
413}
414
415/*
416 * BIOS Functions for IRQ Routing 345 * BIOS Functions for IRQ Routing
417 */ 346 */
418 347
@@ -495,7 +424,6 @@ void __init pci_pcbios_init(void)
495{ 424{
496 if ((pci_probe & PCI_PROBE_BIOS) 425 if ((pci_probe & PCI_PROBE_BIOS)
497 && ((raw_pci_ops = pci_find_bios()))) { 426 && ((raw_pci_ops = pci_find_bios()))) {
498 pci_probe |= PCI_BIOS_SORT;
499 pci_bios_present = 1; 427 pci_bios_present = 1;
500 } 428 }
501} 429}
diff --git a/arch/x86/pci/pci.h b/arch/x86/pci/pci.h
index 3431518d921..02b016a9842 100644
--- a/arch/x86/pci/pci.h
+++ b/arch/x86/pci/pci.h
@@ -19,8 +19,6 @@
19#define PCI_PROBE_MASK 0x000f 19#define PCI_PROBE_MASK 0x000f
20#define PCI_PROBE_NOEARLY 0x0010 20#define PCI_PROBE_NOEARLY 0x0010
21 21
22#define PCI_NO_SORT 0x0100
23#define PCI_BIOS_SORT 0x0200
24#define PCI_NO_CHECKS 0x0400 22#define PCI_NO_CHECKS 0x0400
25#define PCI_USE_PIRQ_MASK 0x0800 23#define PCI_USE_PIRQ_MASK 0x0800
26#define PCI_ASSIGN_ROMS 0x1000 24#define PCI_ASSIGN_ROMS 0x1000
@@ -101,7 +99,6 @@ extern int pci_direct_probe(void);
101extern void pci_direct_init(int type); 99extern void pci_direct_init(int type);
102extern void pci_pcbios_init(void); 100extern void pci_pcbios_init(void);
103extern void pci_mmcfg_init(int type); 101extern void pci_mmcfg_init(int type);
104extern void pcibios_sort(void);
105 102
106/* pci-mmconfig.c */ 103/* pci-mmconfig.c */
107 104