diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-23 20:35:56 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-28 00:52:47 -0400 |
commit | 545493917dc90298e1c38f018ad893f5518928e7 (patch) | |
tree | 1c809616d3113785c0f7dd3039ea3b05c99c6440 /arch/i386/pci/mmconfig.c | |
parent | d18c3db58bc544fce6662ca7edba616ca9788a70 (diff) |
[PATCH] PCI: add proper MCFG table parsing to ACPI core.
This patch is the first step in properly handling the MCFG PCI table.
It defines the structures properly, and saves off the table so that the
pci mmconfig code can access it. It moves the parsing of the table a
little later in the boot process, but still before the information is
needed.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/i386/pci/mmconfig.c')
-rw-r--r-- | arch/i386/pci/mmconfig.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/i386/pci/mmconfig.c b/arch/i386/pci/mmconfig.c index 021a50aa51f4..5fbaa9132258 100644 --- a/arch/i386/pci/mmconfig.c +++ b/arch/i386/pci/mmconfig.c | |||
@@ -11,11 +11,9 @@ | |||
11 | 11 | ||
12 | #include <linux/pci.h> | 12 | #include <linux/pci.h> |
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/acpi.h> | ||
14 | #include "pci.h" | 15 | #include "pci.h" |
15 | 16 | ||
16 | /* The physical address of the MMCONFIG aperture. Set from ACPI tables. */ | ||
17 | u32 pci_mmcfg_base_addr; | ||
18 | |||
19 | #define mmcfg_virt_addr ((void __iomem *) fix_to_virt(FIX_PCIE_MCFG)) | 17 | #define mmcfg_virt_addr ((void __iomem *) fix_to_virt(FIX_PCIE_MCFG)) |
20 | 18 | ||
21 | /* The base address of the last MMCONFIG device accessed */ | 19 | /* The base address of the last MMCONFIG device accessed */ |
@@ -27,7 +25,7 @@ static u32 mmcfg_last_accessed_device; | |||
27 | 25 | ||
28 | static inline void pci_exp_set_dev_base(int bus, int devfn) | 26 | static inline void pci_exp_set_dev_base(int bus, int devfn) |
29 | { | 27 | { |
30 | u32 dev_base = pci_mmcfg_base_addr | (bus << 20) | (devfn << 12); | 28 | u32 dev_base = pci_mmcfg_config[0].base_address | (bus << 20) | (devfn << 12); |
31 | if (dev_base != mmcfg_last_accessed_device) { | 29 | if (dev_base != mmcfg_last_accessed_device) { |
32 | mmcfg_last_accessed_device = dev_base; | 30 | mmcfg_last_accessed_device = dev_base; |
33 | set_fixmap_nocache(FIX_PCIE_MCFG, dev_base); | 31 | set_fixmap_nocache(FIX_PCIE_MCFG, dev_base); |
@@ -101,7 +99,11 @@ static int __init pci_mmcfg_init(void) | |||
101 | { | 99 | { |
102 | if ((pci_probe & PCI_PROBE_MMCONF) == 0) | 100 | if ((pci_probe & PCI_PROBE_MMCONF) == 0) |
103 | goto out; | 101 | goto out; |
104 | if (!pci_mmcfg_base_addr) | 102 | |
103 | acpi_table_parse(ACPI_MCFG, acpi_parse_mcfg); | ||
104 | if ((pci_mmcfg_config_num == 0) || | ||
105 | (pci_mmcfg_config == NULL) || | ||
106 | (pci_mmcfg_config[0].base_address == 0)) | ||
105 | goto out; | 107 | goto out; |
106 | 108 | ||
107 | /* Kludge for now. Don't use mmconfig on AMD systems because | 109 | /* Kludge for now. Don't use mmconfig on AMD systems because |