aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-04-14 19:08:25 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-26 17:41:04 -0400
commit5f0b2976cb2b62668a076f54419c24b8ab677167 (patch)
treeda8439a413adf51359728208beab5ce9f6863ce5 /arch/x86
parente8ee6f0ae5cd860e8e6c02807edfa3c1fa01bcb5 (diff)
x86: add pci=check_enable_amd_mmconf and dmi check
so will disable that feature by default, and only enable that via pci=check_enable_amd_mmconf or for system match with dmi table. Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/mmconf-fam10h_64.c28
-rw-r--r--arch/x86/kernel/setup_64.c23
-rw-r--r--arch/x86/pci/common.c4
-rw-r--r--arch/x86/pci/mmconfig-shared.c3
-rw-r--r--arch/x86/pci/pci.h1
5 files changed, 51 insertions, 8 deletions
diff --git a/arch/x86/kernel/mmconf-fam10h_64.c b/arch/x86/kernel/mmconf-fam10h_64.c
index 37897920ec65..edc5fbfe85c0 100644
--- a/arch/x86/kernel/mmconf-fam10h_64.c
+++ b/arch/x86/kernel/mmconf-fam10h_64.c
@@ -6,12 +6,15 @@
6#include <linux/mm.h> 6#include <linux/mm.h>
7#include <linux/string.h> 7#include <linux/string.h>
8#include <linux/pci.h> 8#include <linux/pci.h>
9#include <linux/dmi.h>
9#include <asm/pci-direct.h> 10#include <asm/pci-direct.h>
10#include <linux/sort.h> 11#include <linux/sort.h>
11#include <asm/io.h> 12#include <asm/io.h>
12#include <asm/msr.h> 13#include <asm/msr.h>
13#include <asm/acpi.h> 14#include <asm/acpi.h>
14 15
16#include "../pci/pci.h"
17
15struct pci_hostbridge_probe { 18struct pci_hostbridge_probe {
16 u32 bus; 19 u32 bus;
17 u32 slot; 20 u32 slot;
@@ -176,6 +179,9 @@ void __cpuinit fam10h_check_enable_mmcfg(void)
176 u64 val; 179 u64 val;
177 u32 address; 180 u32 address;
178 181
182 if (!(pci_probe & PCI_CHECK_ENABLE_AMD_MMCONF))
183 return;
184
179 address = MSR_FAM10H_MMIO_CONF_BASE; 185 address = MSR_FAM10H_MMIO_CONF_BASE;
180 rdmsrl(address, val); 186 rdmsrl(address, val);
181 187
@@ -213,3 +219,25 @@ void __cpuinit fam10h_check_enable_mmcfg(void)
213 FAM10H_MMIO_CONF_ENABLE; 219 FAM10H_MMIO_CONF_ENABLE;
214 wrmsrl(address, val); 220 wrmsrl(address, val);
215} 221}
222
223static int __devinit set_check_enable_amd_mmconf(const struct dmi_system_id *d)
224{
225 pci_probe |= PCI_CHECK_ENABLE_AMD_MMCONF;
226 return 0;
227}
228
229static struct dmi_system_id __devinitdata mmconf_dmi_table[] = {
230 {
231 .callback = set_check_enable_amd_mmconf,
232 .ident = "Sun Microsystems Machine",
233 .matches = {
234 DMI_MATCH(DMI_SYS_VENDOR, "Sun Microsystems"),
235 },
236 },
237 {}
238};
239
240void __init check_enable_amd_mmconf_dmi(void)
241{
242 dmi_check_system(mmconf_dmi_table);
243}
diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c
index d8a9ee752fb3..2f5c488aad0b 100644
--- a/arch/x86/kernel/setup_64.c
+++ b/arch/x86/kernel/setup_64.c
@@ -289,6 +289,18 @@ static void __init parse_setup_data(void)
289 } 289 }
290} 290}
291 291
292#ifdef CONFIG_PCI_MMCONFIG
293extern void __cpuinit fam10h_check_enable_mmcfg(void);
294extern void __init check_enable_amd_mmconf_dmi(void);
295#else
296void __cpuinit fam10h_check_enable_mmcfg(void)
297{
298}
299void __init check_enable_amd_mmconf_dmi(void)
300{
301}
302#endif
303
292/* 304/*
293 * setup_arch - architecture-specific boot-time initializations 305 * setup_arch - architecture-specific boot-time initializations
294 * 306 *
@@ -510,6 +522,9 @@ void __init setup_arch(char **cmdline_p)
510 conswitchp = &dummy_con; 522 conswitchp = &dummy_con;
511#endif 523#endif
512#endif 524#endif
525
526 /* do this before identify_cpu for boot cpu */
527 check_enable_amd_mmconf_dmi();
513} 528}
514 529
515static int __cpuinit get_model_name(struct cpuinfo_x86 *c) 530static int __cpuinit get_model_name(struct cpuinfo_x86 *c)
@@ -697,14 +712,6 @@ static void __cpuinit early_init_amd(struct cpuinfo_x86 *c)
697 set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); 712 set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
698} 713}
699 714
700#ifdef CONFIG_PCI_MMCONFIG
701extern void __cpuinit fam10h_check_enable_mmcfg(void);
702#else
703void __cpuinit fam10h_check_enable_mmcfg(void)
704{
705}
706#endif
707
708static void __cpuinit init_amd(struct cpuinfo_x86 *c) 715static void __cpuinit init_amd(struct cpuinfo_x86 *c)
709{ 716{
710 unsigned level; 717 unsigned level;
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index 07d53184f7a4..2a4d751818b7 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -425,6 +425,10 @@ char * __devinit pcibios_setup(char *str)
425 pci_probe &= ~PCI_PROBE_MMCONF; 425 pci_probe &= ~PCI_PROBE_MMCONF;
426 return NULL; 426 return NULL;
427 } 427 }
428 else if (!strcmp(str, "check_enable_amd_mmconf")) {
429 pci_probe |= PCI_CHECK_ENABLE_AMD_MMCONF;
430 return NULL;
431 }
428#endif 432#endif
429 else if (!strcmp(str, "noacpi")) { 433 else if (!strcmp(str, "noacpi")) {
430 acpi_noirq_set(); 434 acpi_noirq_set();
diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c
index bdf62243186a..0cfebecf2a8f 100644
--- a/arch/x86/pci/mmconfig-shared.c
+++ b/arch/x86/pci/mmconfig-shared.c
@@ -107,6 +107,9 @@ static const char __init *pci_mmcfg_amd_fam10h(void)
107 int i; 107 int i;
108 unsigned segnbits = 0, busnbits; 108 unsigned segnbits = 0, busnbits;
109 109
110 if (!(pci_probe & PCI_CHECK_ENABLE_AMD_MMCONF))
111 return NULL;
112
110 address = MSR_FAM10H_MMIO_CONF_BASE; 113 address = MSR_FAM10H_MMIO_CONF_BASE;
111 if (rdmsr_safe(address, &low, &high)) 114 if (rdmsr_safe(address, &low, &high))
112 return NULL; 115 return NULL;
diff --git a/arch/x86/pci/pci.h b/arch/x86/pci/pci.h
index c8b89a832c66..8ef86b5c37c8 100644
--- a/arch/x86/pci/pci.h
+++ b/arch/x86/pci/pci.h
@@ -26,6 +26,7 @@
26#define PCI_ASSIGN_ALL_BUSSES 0x4000 26#define PCI_ASSIGN_ALL_BUSSES 0x4000
27#define PCI_CAN_SKIP_ISA_ALIGN 0x8000 27#define PCI_CAN_SKIP_ISA_ALIGN 0x8000
28#define PCI_USE__CRS 0x10000 28#define PCI_USE__CRS 0x10000
29#define PCI_CHECK_ENABLE_AMD_MMCONF 0x20000
29 30
30extern unsigned int pci_probe; 31extern unsigned int pci_probe;
31extern unsigned long pirq_table_addr; 32extern unsigned long pirq_table_addr;