From db634450d504b1cc1790a9670c62ea146771f1a6 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Wed, 5 Dec 2012 14:33:27 -0700 Subject: [PATCH] --- yaml --- r: 343279 b: refs/heads/master c: f9a37be0f02a943d63e3346b19f9c9d8d91826cb h: refs/heads/master i: 343277: ef0d4bee28dc3346b39dc9bddfb71a42d743c641 343275: 7538b11fe0136d12065c76757e03f4f5b902274f 343271: 27352bab233d5a580291cbbd42a8f7c0474fae96 343263: 116e950971eebb6e5eb9c46ce97e0e5971c1fcba v: v3 --- [refs] | 2 +- trunk/arch/x86/kernel/setup.c | 4 ---- trunk/arch/x86/pci/common.c | 30 ++++++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 46ecbce6e5a8..9139e2197414 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 84c1b80e32638f881c17390dfe88143e5cd3f583 +refs/heads/master: f9a37be0f02a943d63e3346b19f9c9d8d91826cb diff --git a/trunk/arch/x86/kernel/setup.c b/trunk/arch/x86/kernel/setup.c index ca45696f30fb..c228322ca180 100644 --- a/trunk/arch/x86/kernel/setup.c +++ b/trunk/arch/x86/kernel/setup.c @@ -143,11 +143,7 @@ int default_check_phys_apicid_present(int phys_apicid) } #endif -#ifndef CONFIG_DEBUG_BOOT_PARAMS -struct boot_params __initdata boot_params; -#else struct boot_params boot_params; -#endif /* * Machine setup.. diff --git a/trunk/arch/x86/pci/common.c b/trunk/arch/x86/pci/common.c index 720e973fc34a..fddb9f66cc47 100644 --- a/trunk/arch/x86/pci/common.c +++ b/trunk/arch/x86/pci/common.c @@ -17,6 +17,7 @@ #include #include #include +#include unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2 | PCI_PROBE_MMCONF; @@ -608,6 +609,35 @@ unsigned int pcibios_assign_all_busses(void) return (pci_probe & PCI_ASSIGN_ALL_BUSSES) ? 1 : 0; } +int pcibios_add_device(struct pci_dev *dev) +{ + struct setup_data *data; + struct pci_setup_rom *rom; + u64 pa_data; + + pa_data = boot_params.hdr.setup_data; + while (pa_data) { + data = phys_to_virt(pa_data); + + if (data->type == SETUP_PCI) { + rom = (struct pci_setup_rom *)data; + + if ((pci_domain_nr(dev->bus) == rom->segment) && + (dev->bus->number == rom->bus) && + (PCI_SLOT(dev->devfn) == rom->device) && + (PCI_FUNC(dev->devfn) == rom->function) && + (dev->vendor == rom->vendor) && + (dev->device == rom->devid)) { + dev->rom = (void *)(unsigned long)(pa_data + + offsetof(struct pci_setup_rom, romdata)); + dev->romlen = rom->pcilen; + } + } + pa_data = data->next; + } + return 0; +} + int pcibios_enable_device(struct pci_dev *dev, int mask) { int err;