+ add-force-of-use-mmconfig.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     Add force of use MMCONFIG

has been added to the -mm tree.  Its filename is

     add-force-of-use-mmconfig.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: Add force of use MMCONFIG
From: Edgar Hucek <hostmaster@xxxxxxxxxx>

This Patch adds forcing of mmconfig.

On Intel Macs the efi firmware gives a different memory map then ACPI_MCFG
provides.  This makes the chack whether to use mmconfig or not fail.

Signed-off-by: Edgar Hucek <hostmaster@xxxxxxxxxx>
Cc: Andi Kleen <ak@xxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 arch/i386/Kconfig        |    1 
 arch/i386/pci/mmconfig.c |   66 +++++++++++++++++++++++++++++++++----
 2 files changed, 60 insertions(+), 7 deletions(-)

diff -puN arch/i386/Kconfig~add-force-of-use-mmconfig arch/i386/Kconfig
--- a/arch/i386/Kconfig~add-force-of-use-mmconfig
+++ a/arch/i386/Kconfig
@@ -1053,6 +1053,7 @@ config PCI_DIRECT
 	default y
 
 config PCI_MMCONFIG
+	depends on DMI
 	bool
 	depends on PCI && ACPI && (PCI_GOMMCONFIG || PCI_GOANY)
 	default y
diff -puN arch/i386/pci/mmconfig.c~add-force-of-use-mmconfig arch/i386/pci/mmconfig.c
--- a/arch/i386/pci/mmconfig.c~add-force-of-use-mmconfig
+++ a/arch/i386/pci/mmconfig.c
@@ -12,6 +12,8 @@
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <linux/acpi.h>
+#include <linux/dmi.h>
+#include <linux/efi.h>
 #include <asm/e820.h>
 #include "pci.h"
 
@@ -187,6 +189,54 @@ static __init void unreachable_devices(v
 	}
 }
 
+/*
+ * Print system on which MMCONFIG is forced.
+ */
+
+static int pci_mmcfg_force_system(struct dmi_system_id *id)
+{
+	printk(KERN_INFO "PCI: System %s detected. Force MMCONFIG\n",
+		id->ident);
+	
+	return 0;
+}
+
+/*
+ * DMI table of forced MMCONFIG systems.
+ */
+
+static struct dmi_system_id __initdata pci_mmcfg_dmi_system_apple[] = {
+	{ pci_mmcfg_force_system, "iMac4,1", {
+	  DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
+	  DMI_MATCH(DMI_BIOS_VERSION,"iMac4,1") }},
+	{ pci_mmcfg_force_system, "MacBookPro1,1", {
+	  DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
+	  DMI_MATCH(DMI_BIOS_VERSION,"MacBookPro1,1") }},
+	{ pci_mmcfg_force_system, "MacBook1,1", {
+	  DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
+	  DMI_MATCH(DMI_PRODUCT_NAME,"MacBook1,1")}},
+	{ pci_mmcfg_force_system, "Macmini1,1", {
+	  DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
+	  DMI_MATCH(DMI_PRODUCT_NAME,"Macmini1,1")}},
+	{},
+};
+
+/*
+ * Check force MMCONFIG.
+ */
+
+int __init pci_mmcfg_force(void)
+{
+	if (efi_enabled) {
+		if (dmi_check_system(pci_mmcfg_dmi_system_apple)) {
+			add_memory_region(pci_mmcfg_config[0].base_address, 
+				pci_mmcfg_config[0].base_address + MMCONFIG_APER_MIN, E820_RESERVED);
+			return 1;
+		}
+	}
+	return 0;
+}
+
 void __init pci_mmcfg_init(void)
 {
 	if ((pci_probe & PCI_PROBE_MMCONF) == 0)
@@ -198,13 +248,15 @@ void __init pci_mmcfg_init(void)
 	    (pci_mmcfg_config[0].base_address == 0))
 		return;
 
-	if (!e820_all_mapped(pci_mmcfg_config[0].base_address,
-			pci_mmcfg_config[0].base_address + MMCONFIG_APER_MIN,
-			E820_RESERVED)) {
-		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;
+ 	if (!pci_mmcfg_force()) {
+		if (!e820_all_mapped(pci_mmcfg_config[0].base_address,
+				pci_mmcfg_config[0].base_address + MMCONFIG_APER_MIN,
+				E820_RESERVED)) {
+			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;
+		}
 	}
 
 	printk(KERN_INFO "PCI: Using MMCONFIG\n");
_

Patches currently in -mm which might be from hostmaster@xxxxxxxxxx are

add-force-of-use-mmconfig.patch
fix-boot-on-efi-32-bit-machines.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux