aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/mach-generic
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/i386/mach-generic
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'arch/i386/mach-generic')
-rw-r--r--arch/i386/mach-generic/Makefile7
-rw-r--r--arch/i386/mach-generic/bigsmp.c54
-rw-r--r--arch/i386/mach-generic/default.c27
-rw-r--r--arch/i386/mach-generic/es7000.c28
-rw-r--r--arch/i386/mach-generic/probe.c102
-rw-r--r--arch/i386/mach-generic/summit.c27
6 files changed, 245 insertions, 0 deletions
diff --git a/arch/i386/mach-generic/Makefile b/arch/i386/mach-generic/Makefile
new file mode 100644
index 000000000000..77fbc9f64fbc
--- /dev/null
+++ b/arch/i386/mach-generic/Makefile
@@ -0,0 +1,7 @@
1#
2# Makefile for the generic architecture
3#
4
5EXTRA_CFLAGS += -I../kernel
6
7obj-y := probe.o summit.o bigsmp.o es7000.o default.o ../mach-es7000/
diff --git a/arch/i386/mach-generic/bigsmp.c b/arch/i386/mach-generic/bigsmp.c
new file mode 100644
index 000000000000..25883b44f625
--- /dev/null
+++ b/arch/i386/mach-generic/bigsmp.c
@@ -0,0 +1,54 @@
1/*
2 * APIC driver for "bigsmp" XAPIC machines with more than 8 virtual CPUs.
3 * Drives the local APIC in "clustered mode".
4 */
5#define APIC_DEFINITION 1
6#include <linux/config.h>
7#include <linux/threads.h>
8#include <linux/cpumask.h>
9#include <asm/mpspec.h>
10#include <asm/genapic.h>
11#include <asm/fixmap.h>
12#include <asm/apicdef.h>
13#include <linux/kernel.h>
14#include <linux/smp.h>
15#include <linux/init.h>
16#include <linux/dmi.h>
17#include <asm/mach-bigsmp/mach_apic.h>
18#include <asm/mach-bigsmp/mach_apicdef.h>
19#include <asm/mach-bigsmp/mach_ipi.h>
20#include <asm/mach-default/mach_mpparse.h>
21
22static int dmi_bigsmp; /* can be set by dmi scanners */
23
24static __init int hp_ht_bigsmp(struct dmi_system_id *d)
25{
26#ifdef CONFIG_X86_GENERICARCH
27 printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident);
28 dmi_bigsmp = 1;
29#endif
30 return 0;
31}
32
33
34static struct dmi_system_id __initdata bigsmp_dmi_table[] = {
35 { hp_ht_bigsmp, "HP ProLiant DL760 G2", {
36 DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
37 DMI_MATCH(DMI_BIOS_VERSION, "P44-"),
38 }},
39
40 { hp_ht_bigsmp, "HP ProLiant DL740", {
41 DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
42 DMI_MATCH(DMI_BIOS_VERSION, "P47-"),
43 }},
44 { }
45};
46
47
48static __init int probe_bigsmp(void)
49{
50 dmi_check_system(bigsmp_dmi_table);
51 return dmi_bigsmp;
52}
53
54struct genapic apic_bigsmp = APIC_INIT("bigsmp", probe_bigsmp);
diff --git a/arch/i386/mach-generic/default.c b/arch/i386/mach-generic/default.c
new file mode 100644
index 000000000000..7da14e9a79c3
--- /dev/null
+++ b/arch/i386/mach-generic/default.c
@@ -0,0 +1,27 @@
1/*
2 * Default generic APIC driver. This handles upto 8 CPUs.
3 */
4#define APIC_DEFINITION 1
5#include <linux/config.h>
6#include <linux/threads.h>
7#include <linux/cpumask.h>
8#include <asm/mpspec.h>
9#include <asm/mach-default/mach_apicdef.h>
10#include <asm/genapic.h>
11#include <asm/fixmap.h>
12#include <asm/apicdef.h>
13#include <linux/kernel.h>
14#include <linux/string.h>
15#include <linux/smp.h>
16#include <linux/init.h>
17#include <asm/mach-default/mach_apic.h>
18#include <asm/mach-default/mach_ipi.h>
19#include <asm/mach-default/mach_mpparse.h>
20
21/* should be called last. */
22static __init int probe_default(void)
23{
24 return 1;
25}
26
27struct genapic apic_default = APIC_INIT("default", probe_default);
diff --git a/arch/i386/mach-generic/es7000.c b/arch/i386/mach-generic/es7000.c
new file mode 100644
index 000000000000..48d3ec37241b
--- /dev/null
+++ b/arch/i386/mach-generic/es7000.c
@@ -0,0 +1,28 @@
1/*
2 * APIC driver for the Unisys ES7000 chipset.
3 */
4#define APIC_DEFINITION 1
5#include <linux/config.h>
6#include <linux/threads.h>
7#include <linux/cpumask.h>
8#include <asm/mpspec.h>
9#include <asm/genapic.h>
10#include <asm/fixmap.h>
11#include <asm/apicdef.h>
12#include <linux/kernel.h>
13#include <linux/string.h>
14#include <linux/smp.h>
15#include <linux/init.h>
16#include <asm/mach-es7000/mach_apicdef.h>
17#include <asm/mach-es7000/mach_apic.h>
18#include <asm/mach-es7000/mach_ipi.h>
19#include <asm/mach-es7000/mach_mpparse.h>
20#include <asm/mach-es7000/mach_wakecpu.h>
21
22static __init int probe_es7000(void)
23{
24 /* probed later in mptable/ACPI hooks */
25 return 0;
26}
27
28struct genapic apic_es7000 = APIC_INIT("es7000", probe_es7000);
diff --git a/arch/i386/mach-generic/probe.c b/arch/i386/mach-generic/probe.c
new file mode 100644
index 000000000000..5497c65a8790
--- /dev/null
+++ b/arch/i386/mach-generic/probe.c
@@ -0,0 +1,102 @@
1/* Copyright 2003 Andi Kleen, SuSE Labs.
2 * Subject to the GNU Public License, v.2
3 *
4 * Generic x86 APIC driver probe layer.
5 */
6#include <linux/config.h>
7#include <linux/threads.h>
8#include <linux/cpumask.h>
9#include <linux/string.h>
10#include <linux/kernel.h>
11#include <linux/ctype.h>
12#include <linux/init.h>
13#include <asm/fixmap.h>
14#include <asm/mpspec.h>
15#include <asm/apicdef.h>
16#include <asm/genapic.h>
17
18extern struct genapic apic_summit;
19extern struct genapic apic_bigsmp;
20extern struct genapic apic_es7000;
21extern struct genapic apic_default;
22
23struct genapic *genapic = &apic_default;
24
25struct genapic *apic_probe[] __initdata = {
26 &apic_summit,
27 &apic_bigsmp,
28 &apic_es7000,
29 &apic_default, /* must be last */
30 NULL,
31};
32
33void __init generic_apic_probe(char *command_line)
34{
35 char *s;
36 int i;
37 int changed = 0;
38
39 s = strstr(command_line, "apic=");
40 if (s && (s == command_line || isspace(s[-1]))) {
41 char *p = strchr(s, ' '), old;
42 if (!p)
43 p = strchr(s, '\0');
44 old = *p;
45 *p = 0;
46 for (i = 0; !changed && apic_probe[i]; i++) {
47 if (!strcmp(apic_probe[i]->name, s+5)) {
48 changed = 1;
49 genapic = apic_probe[i];
50 }
51 }
52 if (!changed)
53 printk(KERN_ERR "Unknown genapic `%s' specified.\n", s);
54 *p = old;
55 }
56 for (i = 0; !changed && apic_probe[i]; i++) {
57 if (apic_probe[i]->probe()) {
58 changed = 1;
59 genapic = apic_probe[i];
60 }
61 }
62 /* Not visible without early console */
63 if (!changed)
64 panic("Didn't find an APIC driver");
65
66 printk(KERN_INFO "Using APIC driver %s\n", genapic->name);
67}
68
69/* These functions can switch the APIC even after the initial ->probe() */
70
71int __init mps_oem_check(struct mp_config_table *mpc, char *oem, char *productid)
72{
73 int i;
74 for (i = 0; apic_probe[i]; ++i) {
75 if (apic_probe[i]->mps_oem_check(mpc,oem,productid)) {
76 genapic = apic_probe[i];
77 printk(KERN_INFO "Switched to APIC driver `%s'.\n",
78 genapic->name);
79 return 1;
80 }
81 }
82 return 0;
83}
84
85int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
86{
87 int i;
88 for (i = 0; apic_probe[i]; ++i) {
89 if (apic_probe[i]->acpi_madt_oem_check(oem_id, oem_table_id)) {
90 genapic = apic_probe[i];
91 printk(KERN_INFO "Switched to APIC driver `%s'.\n",
92 genapic->name);
93 return 1;
94 }
95 }
96 return 0;
97}
98
99int hard_smp_processor_id(void)
100{
101 return genapic->get_apic_id(*(unsigned long *)(APIC_BASE+APIC_ID));
102}
diff --git a/arch/i386/mach-generic/summit.c b/arch/i386/mach-generic/summit.c
new file mode 100644
index 000000000000..65ddf74d7f25
--- /dev/null
+++ b/arch/i386/mach-generic/summit.c
@@ -0,0 +1,27 @@
1/*
2 * APIC driver for the IBM "Summit" chipset.
3 */
4#define APIC_DEFINITION 1
5#include <linux/config.h>
6#include <linux/threads.h>
7#include <linux/cpumask.h>
8#include <asm/mpspec.h>
9#include <asm/genapic.h>
10#include <asm/fixmap.h>
11#include <asm/apicdef.h>
12#include <linux/kernel.h>
13#include <linux/string.h>
14#include <linux/smp.h>
15#include <linux/init.h>
16#include <asm/mach-summit/mach_apic.h>
17#include <asm/mach-summit/mach_apicdef.h>
18#include <asm/mach-summit/mach_ipi.h>
19#include <asm/mach-summit/mach_mpparse.h>
20
21static __init int probe_summit(void)
22{
23 /* probed later in mptable/ACPI hooks */
24 return 0;
25}
26
27struct genapic apic_summit = APIC_INIT("summit", probe_summit);