From: Edgar Hucek <hostmaster@ed-soft.at>
To: Linus Torvalds <torvalds@osdl.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
"H. Peter Anvin" <hpa@zytor.com>,
LKML <linux-kernel@vger.kernel.org>,
akpm@osdl.org
Subject: [PATCH 1/1] Add force of use MMCONFIG [try #1]
Date: Sun, 16 Jul 2006 11:00:21 +0200 [thread overview]
Message-ID: <44BA0025.6020105@ed-soft.at> (raw)
In-Reply-To: <Pine.LNX.4.64.0607140901200.5623@g5.osdl.org>
This Patch add force for mmconfig.
On Intel Macs the efi firmaware gives
a different memory map then ACPI_MCFG
provides. This makes the chack wether
to use mmconfig or not fail.
Signed-off-by: Edgar Hucek <hostmaster@ed-soft.at>
diff -uNr linux-2.6.18-rc2/arch/i386/Kconfig linux-2.6.18-rc2.mactel/arch/i386/Kconfig
--- linux-2.6.18-rc2/arch/i386/Kconfig 2006-07-16 10:38:09.000000000 +0200
+++ linux-2.6.18-rc2.mactel/arch/i386/Kconfig 2006-07-16 10:16:12.000000000 +0200
@@ -1027,6 +1027,7 @@
default y
config PCI_MMCONFIG
+ depends on DMI
bool
depends on PCI && ACPI && (PCI_GOMMCONFIG || PCI_GOANY)
default y
diff -uNr linux-2.6.18-rc2/arch/i386/pci/mmconfig.c linux-2.6.18-rc2.mactel/arch/i386/pci/mmconfig.c
--- linux-2.6.18-rc2/arch/i386/pci/mmconfig.c 2006-07-16 10:38:10.000000000 +0200
+++ linux-2.6.18-rc2.mactel/arch/i386/pci/mmconfig.c 2006-07-16 10:18:04.000000000 +0200
@@ -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 @@
}
}
+/*
+ * 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 @@
(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");
next prev parent reply other threads:[~2006-07-16 9:00 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-26 21:19 [PATCH 1/1] Fix boot on efi 32 bit Machines [try #4] Edgar Hucek
2006-06-26 21:33 ` Linus Torvalds
2006-06-27 6:15 ` Edgar Hucek
2006-06-27 6:20 ` Linus Torvalds
2006-06-28 22:37 ` H. Peter Anvin
2006-07-02 17:39 ` Eric W. Biederman
2006-07-02 17:42 ` H. Peter Anvin
2006-07-02 18:26 ` Eric W. Biederman
2006-07-02 18:46 ` Arjan van de Ven
2006-07-05 9:38 ` Edgar Hucek
2006-07-05 15:52 ` Eric W. Biederman
2006-07-13 21:46 ` Edgar Hucek
2006-07-13 22:15 ` Linus Torvalds
2006-07-14 4:23 ` Eric W. Biederman
2006-07-14 6:22 ` H. Peter Anvin
2006-07-14 6:20 ` Edgar Hucek
2006-07-14 16:09 ` Linus Torvalds
2006-07-16 8:55 ` [PATCH 1/1] Add efi e820 memory mapping on x86 [try #1] Edgar Hucek
2006-07-25 4:29 ` Andrew Morton
2006-07-25 5:17 ` Eric W. Biederman
2006-07-25 5:32 ` Linus Torvalds
2006-07-25 5:34 ` H. Peter Anvin
2006-07-25 5:44 ` Linus Torvalds
2006-07-25 6:26 ` H. Peter Anvin
2006-07-25 6:00 ` Linus Torvalds
2006-07-16 9:00 ` Edgar Hucek [this message]
2006-07-25 4:33 ` [PATCH 1/1] Add force of use MMCONFIG " Andrew Morton
2006-07-25 5:27 ` Linus Torvalds
2006-07-26 15:05 ` Andi Kleen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44BA0025.6020105@ed-soft.at \
--to=hostmaster@ed-soft.at \
--cc=akpm@osdl.org \
--cc=ebiederm@xmission.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.