diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2012-12-06 16:37:32 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2012-12-06 16:37:32 -0500 |
commit | 72e1e868ca8f14ef34c95e0e8b73f64b6acf5934 (patch) | |
tree | d3bc99f121693ab8f09c03ea555254c9314ff98d /arch/x86/pci | |
parent | edb1daab8e91338b7e2a6c41faec695891ccda35 (diff) | |
parent | f9a37be0f02a943d63e3346b19f9c9d8d91826cb (diff) |
Merge branch 'pci/mjg-pci-roms-from-efi' into next
* pci/mjg-pci-roms-from-efi:
x86: Use PCI setup data
PCI: Add support for non-BAR ROMs
PCI: Add pcibios_add_device
EFI: Stash ROMs if they're not in the PCI BAR
Diffstat (limited to 'arch/x86/pci')
-rw-r--r-- | arch/x86/pci/common.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c index 52dbf1aeeb63..6a6b01778dab 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <asm/io.h> | 17 | #include <asm/io.h> |
18 | #include <asm/smp.h> | 18 | #include <asm/smp.h> |
19 | #include <asm/pci_x86.h> | 19 | #include <asm/pci_x86.h> |
20 | #include <asm/setup.h> | ||
20 | 21 | ||
21 | unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2 | | 22 | unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2 | |
22 | PCI_PROBE_MMCONF; | 23 | PCI_PROBE_MMCONF; |
@@ -608,6 +609,35 @@ unsigned int pcibios_assign_all_busses(void) | |||
608 | return (pci_probe & PCI_ASSIGN_ALL_BUSSES) ? 1 : 0; | 609 | return (pci_probe & PCI_ASSIGN_ALL_BUSSES) ? 1 : 0; |
609 | } | 610 | } |
610 | 611 | ||
612 | int pcibios_add_device(struct pci_dev *dev) | ||
613 | { | ||
614 | struct setup_data *data; | ||
615 | struct pci_setup_rom *rom; | ||
616 | u64 pa_data; | ||
617 | |||
618 | pa_data = boot_params.hdr.setup_data; | ||
619 | while (pa_data) { | ||
620 | data = phys_to_virt(pa_data); | ||
621 | |||
622 | if (data->type == SETUP_PCI) { | ||
623 | rom = (struct pci_setup_rom *)data; | ||
624 | |||
625 | if ((pci_domain_nr(dev->bus) == rom->segment) && | ||
626 | (dev->bus->number == rom->bus) && | ||
627 | (PCI_SLOT(dev->devfn) == rom->device) && | ||
628 | (PCI_FUNC(dev->devfn) == rom->function) && | ||
629 | (dev->vendor == rom->vendor) && | ||
630 | (dev->device == rom->devid)) { | ||
631 | dev->rom = (void *)(unsigned long)(pa_data + | ||
632 | offsetof(struct pci_setup_rom, romdata)); | ||
633 | dev->romlen = rom->pcilen; | ||
634 | } | ||
635 | } | ||
636 | pa_data = data->next; | ||
637 | } | ||
638 | return 0; | ||
639 | } | ||
640 | |||
611 | int pcibios_enable_device(struct pci_dev *dev, int mask) | 641 | int pcibios_enable_device(struct pci_dev *dev, int mask) |
612 | { | 642 | { |
613 | int err; | 643 | int err; |