diff options
Diffstat (limited to 'arch/x86_64/pci')
-rw-r--r-- | arch/x86_64/pci/mmconfig.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/arch/x86_64/pci/mmconfig.c b/arch/x86_64/pci/mmconfig.c index b693c232fd07..09cfcc1234b9 100644 --- a/arch/x86_64/pci/mmconfig.c +++ b/arch/x86_64/pci/mmconfig.c | |||
@@ -7,15 +7,13 @@ | |||
7 | 7 | ||
8 | #include <linux/pci.h> | 8 | #include <linux/pci.h> |
9 | #include <linux/init.h> | 9 | #include <linux/init.h> |
10 | #include <linux/acpi.h> | ||
10 | #include "pci.h" | 11 | #include "pci.h" |
11 | 12 | ||
12 | #define MMCONFIG_APER_SIZE (256*1024*1024) | 13 | #define MMCONFIG_APER_SIZE (256*1024*1024) |
13 | 14 | ||
14 | /* The physical address of the MMCONFIG aperture. Set from ACPI tables. */ | ||
15 | u32 pci_mmcfg_base_addr; | ||
16 | |||
17 | /* Static virtual mapping of the MMCONFIG aperture */ | 15 | /* Static virtual mapping of the MMCONFIG aperture */ |
18 | char *pci_mmcfg_virt; | 16 | static char *pci_mmcfg_virt; |
19 | 17 | ||
20 | static inline char *pci_dev_base(unsigned int bus, unsigned int devfn) | 18 | static inline char *pci_dev_base(unsigned int bus, unsigned int devfn) |
21 | { | 19 | { |
@@ -77,7 +75,11 @@ static int __init pci_mmcfg_init(void) | |||
77 | { | 75 | { |
78 | if ((pci_probe & PCI_PROBE_MMCONF) == 0) | 76 | if ((pci_probe & PCI_PROBE_MMCONF) == 0) |
79 | return 0; | 77 | return 0; |
80 | if (!pci_mmcfg_base_addr) | 78 | |
79 | acpi_table_parse(ACPI_MCFG, acpi_parse_mcfg); | ||
80 | if ((pci_mmcfg_config_num == 0) || | ||
81 | (pci_mmcfg_config == NULL) || | ||
82 | (pci_mmcfg_config[0].base_address == 0)) | ||
81 | return 0; | 83 | return 0; |
82 | 84 | ||
83 | /* Kludge for now. Don't use mmconfig on AMD systems because | 85 | /* Kludge for now. Don't use mmconfig on AMD systems because |
@@ -88,13 +90,13 @@ static int __init pci_mmcfg_init(void) | |||
88 | return 0; | 90 | return 0; |
89 | 91 | ||
90 | /* RED-PEN i386 doesn't do _nocache right now */ | 92 | /* RED-PEN i386 doesn't do _nocache right now */ |
91 | pci_mmcfg_virt = ioremap_nocache(pci_mmcfg_base_addr, MMCONFIG_APER_SIZE); | 93 | pci_mmcfg_virt = ioremap_nocache(pci_mmcfg_config[0].base_address, MMCONFIG_APER_SIZE); |
92 | if (!pci_mmcfg_virt) { | 94 | if (!pci_mmcfg_virt) { |
93 | printk("PCI: Cannot map mmconfig aperture\n"); | 95 | printk("PCI: Cannot map mmconfig aperture\n"); |
94 | return 0; | 96 | return 0; |
95 | } | 97 | } |
96 | 98 | ||
97 | printk(KERN_INFO "PCI: Using MMCONFIG at %x\n", pci_mmcfg_base_addr); | 99 | printk(KERN_INFO "PCI: Using MMCONFIG at %x\n", pci_mmcfg_config[0].base_address); |
98 | raw_pci_ops = &pci_mmcfg; | 100 | raw_pci_ops = &pci_mmcfg; |
99 | pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF; | 101 | pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF; |
100 | 102 | ||