Merge ../linus
[pandora-kernel.git] / arch / i386 / pci / mmconfig.c
index f77d7f8..e545b09 100644 (file)
@@ -15,7 +15,9 @@
 #include <asm/e820.h>
 #include "pci.h"
 
-#define MMCONFIG_APER_SIZE (256*1024*1024)
+/* aperture is up to 256MB but BIOS may reserve less */
+#define MMCONFIG_APER_MIN      (2 * 1024*1024)
+#define MMCONFIG_APER_MAX      (256 * 1024*1024)
 
 /* Assume systems with more busses have correct MCFG */
 #define MAX_CHECK_BUS 16
@@ -80,7 +82,7 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus,
        unsigned long flags;
        u32 base;
 
-       if (!value || (bus > 255) || (devfn > 255) || (reg > 4095)) {
+       if ((bus > 255) || (devfn > 255) || (reg > 4095)) {
                *value = -1;
                return -EINVAL;
        }
@@ -197,9 +199,10 @@ void __init pci_mmcfg_init(void)
                return;
 
        if (!e820_all_mapped(pci_mmcfg_config[0].base_address,
-                       pci_mmcfg_config[0].base_address + MMCONFIG_APER_SIZE,
+                       pci_mmcfg_config[0].base_address + MMCONFIG_APER_MIN,
                        E820_RESERVED)) {
-               printk(KERN_ERR "PCI: BIOS Bug: MCFG area is not E820-reserved\n");
+               printk(KERN_ERR "PCI: BIOS Bug: MCFG area at %x is not E820-reserved\n",
+                               pci_mmcfg_config[0].base_address);
                printk(KERN_ERR "PCI: Not using MMCONFIG.\n");
                return;
        }