diff options
| -rw-r--r-- | arch/i386/pci/mmconfig.c | 9 | ||||
| -rw-r--r-- | arch/x86_64/pci/mmconfig.c | 13 |
2 files changed, 15 insertions, 7 deletions
diff --git a/arch/i386/pci/mmconfig.c b/arch/i386/pci/mmconfig.c index 6b1ea0c9a570..e545b0992c48 100644 --- a/arch/i386/pci/mmconfig.c +++ b/arch/i386/pci/mmconfig.c | |||
| @@ -15,7 +15,9 @@ | |||
| 15 | #include <asm/e820.h> | 15 | #include <asm/e820.h> |
| 16 | #include "pci.h" | 16 | #include "pci.h" |
| 17 | 17 | ||
| 18 | #define MMCONFIG_APER_SIZE (256*1024*1024) | 18 | /* aperture is up to 256MB but BIOS may reserve less */ |
| 19 | #define MMCONFIG_APER_MIN (2 * 1024*1024) | ||
| 20 | #define MMCONFIG_APER_MAX (256 * 1024*1024) | ||
| 19 | 21 | ||
| 20 | /* Assume systems with more busses have correct MCFG */ | 22 | /* Assume systems with more busses have correct MCFG */ |
| 21 | #define MAX_CHECK_BUS 16 | 23 | #define MAX_CHECK_BUS 16 |
| @@ -197,9 +199,10 @@ void __init pci_mmcfg_init(void) | |||
| 197 | return; | 199 | return; |
| 198 | 200 | ||
| 199 | if (!e820_all_mapped(pci_mmcfg_config[0].base_address, | 201 | if (!e820_all_mapped(pci_mmcfg_config[0].base_address, |
| 200 | pci_mmcfg_config[0].base_address + MMCONFIG_APER_SIZE, | 202 | pci_mmcfg_config[0].base_address + MMCONFIG_APER_MIN, |
| 201 | E820_RESERVED)) { | 203 | E820_RESERVED)) { |
| 202 | printk(KERN_ERR "PCI: BIOS Bug: MCFG area is not E820-reserved\n"); | 204 | printk(KERN_ERR "PCI: BIOS Bug: MCFG area at %x is not E820-reserved\n", |
| 205 | pci_mmcfg_config[0].base_address); | ||
| 203 | printk(KERN_ERR "PCI: Not using MMCONFIG.\n"); | 206 | printk(KERN_ERR "PCI: Not using MMCONFIG.\n"); |
| 204 | return; | 207 | return; |
| 205 | } | 208 | } |
diff --git a/arch/x86_64/pci/mmconfig.c b/arch/x86_64/pci/mmconfig.c index a2060e4d5de6..3c55c76c6fd5 100644 --- a/arch/x86_64/pci/mmconfig.c +++ b/arch/x86_64/pci/mmconfig.c | |||
| @@ -13,7 +13,10 @@ | |||
| 13 | 13 | ||
| 14 | #include "pci.h" | 14 | #include "pci.h" |
| 15 | 15 | ||
| 16 | #define MMCONFIG_APER_SIZE (256*1024*1024) | 16 | /* aperture is up to 256MB but BIOS may reserve less */ |
| 17 | #define MMCONFIG_APER_MIN (2 * 1024*1024) | ||
| 18 | #define MMCONFIG_APER_MAX (256 * 1024*1024) | ||
| 19 | |||
| 17 | /* Verify the first 16 busses. We assume that systems with more busses | 20 | /* Verify the first 16 busses. We assume that systems with more busses |
| 18 | get MCFG right. */ | 21 | get MCFG right. */ |
| 19 | #define MAX_CHECK_BUS 16 | 22 | #define MAX_CHECK_BUS 16 |
| @@ -175,9 +178,10 @@ void __init pci_mmcfg_init(void) | |||
| 175 | return; | 178 | return; |
| 176 | 179 | ||
| 177 | if (!e820_all_mapped(pci_mmcfg_config[0].base_address, | 180 | if (!e820_all_mapped(pci_mmcfg_config[0].base_address, |
| 178 | pci_mmcfg_config[0].base_address + MMCONFIG_APER_SIZE, | 181 | pci_mmcfg_config[0].base_address + MMCONFIG_APER_MIN, |
| 179 | E820_RESERVED)) { | 182 | E820_RESERVED)) { |
| 180 | printk(KERN_ERR "PCI: BIOS Bug: MCFG area is not E820-reserved\n"); | 183 | printk(KERN_ERR "PCI: BIOS Bug: MCFG area at %x is not E820-reserved\n", |
| 184 | pci_mmcfg_config[0].base_address); | ||
| 181 | printk(KERN_ERR "PCI: Not using MMCONFIG.\n"); | 185 | printk(KERN_ERR "PCI: Not using MMCONFIG.\n"); |
| 182 | return; | 186 | return; |
| 183 | } | 187 | } |
| @@ -190,7 +194,8 @@ void __init pci_mmcfg_init(void) | |||
| 190 | } | 194 | } |
| 191 | for (i = 0; i < pci_mmcfg_config_num; ++i) { | 195 | for (i = 0; i < pci_mmcfg_config_num; ++i) { |
| 192 | pci_mmcfg_virt[i].cfg = &pci_mmcfg_config[i]; | 196 | pci_mmcfg_virt[i].cfg = &pci_mmcfg_config[i]; |
| 193 | pci_mmcfg_virt[i].virt = ioremap_nocache(pci_mmcfg_config[i].base_address, MMCONFIG_APER_SIZE); | 197 | pci_mmcfg_virt[i].virt = ioremap_nocache(pci_mmcfg_config[i].base_address, |
| 198 | MMCONFIG_APER_MAX); | ||
| 194 | if (!pci_mmcfg_virt[i].virt) { | 199 | if (!pci_mmcfg_virt[i].virt) { |
| 195 | printk("PCI: Cannot map mmconfig aperture for segment %d\n", | 200 | printk("PCI: Cannot map mmconfig aperture for segment %d\n", |
| 196 | pci_mmcfg_config[i].pci_segment_group_number); | 201 | pci_mmcfg_config[i].pci_segment_group_number); |
