diff options
-rw-r--r-- | arch/i386/mach-es7000/es7000.h | 5 | ||||
-rw-r--r-- | arch/i386/mach-es7000/es7000plat.c | 45 | ||||
-rw-r--r-- | include/asm-i386/mach-es7000/mach_mpparse.h | 30 |
3 files changed, 49 insertions, 31 deletions
diff --git a/arch/i386/mach-es7000/es7000.h b/arch/i386/mach-es7000/es7000.h index 70691f0c4ce2..898ed905e119 100644 --- a/arch/i386/mach-es7000/es7000.h +++ b/arch/i386/mach-es7000/es7000.h | |||
@@ -104,7 +104,8 @@ struct mip_reg { | |||
104 | #define MIP_SW_APIC 0x1020b | 104 | #define MIP_SW_APIC 0x1020b |
105 | #define MIP_FUNC(VALUE) (VALUE & 0xff) | 105 | #define MIP_FUNC(VALUE) (VALUE & 0xff) |
106 | 106 | ||
107 | extern int parse_unisys_oem (char *oemptr, int oem_entries); | 107 | extern int parse_unisys_oem (char *oemptr); |
108 | extern int find_unisys_acpi_oem_table(unsigned long *oem_addr, int *length); | 108 | extern int find_unisys_acpi_oem_table(unsigned long *oem_addr); |
109 | extern void setup_unisys (); | ||
109 | extern int es7000_start_cpu(int cpu, unsigned long eip); | 110 | extern int es7000_start_cpu(int cpu, unsigned long eip); |
110 | extern void es7000_sw_apic(void); | 111 | extern void es7000_sw_apic(void); |
diff --git a/arch/i386/mach-es7000/es7000plat.c b/arch/i386/mach-es7000/es7000plat.c index d5936d500479..2000bdca2fc2 100644 --- a/arch/i386/mach-es7000/es7000plat.c +++ b/arch/i386/mach-es7000/es7000plat.c | |||
@@ -75,12 +75,29 @@ es7000_rename_gsi(int ioapic, int gsi) | |||
75 | 75 | ||
76 | #endif // (CONFIG_X86_IO_APIC) && (CONFIG_ACPI_INTERPRETER || CONFIG_ACPI_BOOT) | 76 | #endif // (CONFIG_X86_IO_APIC) && (CONFIG_ACPI_INTERPRETER || CONFIG_ACPI_BOOT) |
77 | 77 | ||
78 | void __init | ||
79 | setup_unisys () | ||
80 | { | ||
81 | /* | ||
82 | * Determine the generation of the ES7000 currently running. | ||
83 | * | ||
84 | * es7000_plat = 1 if the machine is a 5xx ES7000 box | ||
85 | * es7000_plat = 2 if the machine is a x86_64 ES7000 box | ||
86 | * | ||
87 | */ | ||
88 | if (!(boot_cpu_data.x86 <= 15 && boot_cpu_data.x86_model <= 2)) | ||
89 | es7000_plat = 2; | ||
90 | else | ||
91 | es7000_plat = 1; | ||
92 | ioapic_renumber_irq = es7000_rename_gsi; | ||
93 | } | ||
94 | |||
78 | /* | 95 | /* |
79 | * Parse the OEM Table | 96 | * Parse the OEM Table |
80 | */ | 97 | */ |
81 | 98 | ||
82 | int __init | 99 | int __init |
83 | parse_unisys_oem (char *oemptr, int oem_entries) | 100 | parse_unisys_oem (char *oemptr) |
84 | { | 101 | { |
85 | int i; | 102 | int i; |
86 | int success = 0; | 103 | int success = 0; |
@@ -95,7 +112,7 @@ parse_unisys_oem (char *oemptr, int oem_entries) | |||
95 | 112 | ||
96 | tp += 8; | 113 | tp += 8; |
97 | 114 | ||
98 | for (i=0; i <= oem_entries; i++) { | 115 | for (i=0; i <= 6; i++) { |
99 | type = *tp++; | 116 | type = *tp++; |
100 | size = *tp++; | 117 | size = *tp++; |
101 | tp -= 2; | 118 | tp -= 2; |
@@ -130,34 +147,18 @@ parse_unisys_oem (char *oemptr, int oem_entries) | |||
130 | default: | 147 | default: |
131 | break; | 148 | break; |
132 | } | 149 | } |
133 | if (i == 6) break; | ||
134 | tp += size; | 150 | tp += size; |
135 | } | 151 | } |
136 | 152 | ||
137 | if (success < 2) { | 153 | if (success < 2) { |
138 | es7000_plat = 0; | 154 | es7000_plat = 0; |
139 | } else { | 155 | } else |
140 | printk("\nEnabling ES7000 specific features...\n"); | 156 | setup_unisys(); |
141 | /* | ||
142 | * Determine the generation of the ES7000 currently running. | ||
143 | * | ||
144 | * es7000_plat = 0 if the machine is NOT a Unisys ES7000 box | ||
145 | * es7000_plat = 1 if the machine is a 5xx ES7000 box | ||
146 | * es7000_plat = 2 if the machine is a x86_64 ES7000 box | ||
147 | * | ||
148 | */ | ||
149 | if (!(boot_cpu_data.x86 <= 15 && boot_cpu_data.x86_model <= 2)) | ||
150 | es7000_plat = 2; | ||
151 | else | ||
152 | es7000_plat = 1; | ||
153 | |||
154 | ioapic_renumber_irq = es7000_rename_gsi; | ||
155 | } | ||
156 | return es7000_plat; | 157 | return es7000_plat; |
157 | } | 158 | } |
158 | 159 | ||
159 | int __init | 160 | int __init |
160 | find_unisys_acpi_oem_table(unsigned long *oem_addr, int *length) | 161 | find_unisys_acpi_oem_table(unsigned long *oem_addr) |
161 | { | 162 | { |
162 | struct acpi_table_rsdp *rsdp = NULL; | 163 | struct acpi_table_rsdp *rsdp = NULL; |
163 | unsigned long rsdp_phys = 0; | 164 | unsigned long rsdp_phys = 0; |
@@ -201,13 +202,11 @@ find_unisys_acpi_oem_table(unsigned long *oem_addr, int *length) | |||
201 | acpi_table_print(header, sdt.entry[i].pa); | 202 | acpi_table_print(header, sdt.entry[i].pa); |
202 | t = (struct oem_table *) __acpi_map_table(sdt.entry[i].pa, header->length); | 203 | t = (struct oem_table *) __acpi_map_table(sdt.entry[i].pa, header->length); |
203 | addr = (void *) __acpi_map_table(t->OEMTableAddr, t->OEMTableSize); | 204 | addr = (void *) __acpi_map_table(t->OEMTableAddr, t->OEMTableSize); |
204 | *length = header->length; | ||
205 | *oem_addr = (unsigned long) addr; | 205 | *oem_addr = (unsigned long) addr; |
206 | return 0; | 206 | return 0; |
207 | } | 207 | } |
208 | } | 208 | } |
209 | } | 209 | } |
210 | Dprintk("ES7000: did not find Unisys ACPI OEM table!\n"); | ||
211 | return -1; | 210 | return -1; |
212 | } | 211 | } |
213 | 212 | ||
diff --git a/include/asm-i386/mach-es7000/mach_mpparse.h b/include/asm-i386/mach-es7000/mach_mpparse.h index 85809e0898d7..28a84f6185a7 100644 --- a/include/asm-i386/mach-es7000/mach_mpparse.h +++ b/include/asm-i386/mach-es7000/mach_mpparse.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __ASM_MACH_MPPARSE_H | 1 | #ifndef __ASM_MACH_MPPARSE_H |
2 | #define __ASM_MACH_MPPARSE_H | 2 | #define __ASM_MACH_MPPARSE_H |
3 | 3 | ||
4 | #include <linux/acpi.h> | ||
5 | |||
4 | static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name, | 6 | static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name, |
5 | struct mpc_config_translation *translation) | 7 | struct mpc_config_translation *translation) |
6 | { | 8 | { |
@@ -12,8 +14,9 @@ static inline void mpc_oem_pci_bus(struct mpc_config_bus *m, | |||
12 | { | 14 | { |
13 | } | 15 | } |
14 | 16 | ||
15 | extern int parse_unisys_oem (char *oemptr, int oem_entries); | 17 | extern int parse_unisys_oem (char *oemptr); |
16 | extern int find_unisys_acpi_oem_table(unsigned long *oem_addr, int *length); | 18 | extern int find_unisys_acpi_oem_table(unsigned long *oem_addr); |
19 | extern void setup_unisys(); | ||
17 | 20 | ||
18 | static inline int mps_oem_check(struct mp_config_table *mpc, char *oem, | 21 | static inline int mps_oem_check(struct mp_config_table *mpc, char *oem, |
19 | char *productid) | 22 | char *productid) |
@@ -22,18 +25,33 @@ static inline int mps_oem_check(struct mp_config_table *mpc, char *oem, | |||
22 | struct mp_config_oemtable *oem_table = | 25 | struct mp_config_oemtable *oem_table = |
23 | (struct mp_config_oemtable *)mpc->mpc_oemptr; | 26 | (struct mp_config_oemtable *)mpc->mpc_oemptr; |
24 | if (!strncmp(oem, "UNISYS", 6)) | 27 | if (!strncmp(oem, "UNISYS", 6)) |
25 | return parse_unisys_oem((char *)oem_table, oem_table->oem_length); | 28 | return parse_unisys_oem((char *)oem_table); |
26 | } | 29 | } |
27 | return 0; | 30 | return 0; |
28 | } | 31 | } |
29 | 32 | ||
33 | static inline int es7000_check_dsdt() | ||
34 | { | ||
35 | struct acpi_table_header *header = NULL; | ||
36 | if(!acpi_get_table_header_early(ACPI_DSDT, &header)) | ||
37 | acpi_table_print(header, 0); | ||
38 | if (!strncmp(header->oem_id, "UNISYS", 6)) | ||
39 | return 1; | ||
40 | return 0; | ||
41 | } | ||
42 | |||
30 | /* Hook from generic ACPI tables.c */ | 43 | /* Hook from generic ACPI tables.c */ |
31 | static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) | 44 | static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
32 | { | 45 | { |
33 | unsigned long oem_addr; | 46 | unsigned long oem_addr; |
34 | int oem_entries; | 47 | if (!find_unisys_acpi_oem_table(&oem_addr)) { |
35 | if (!find_unisys_acpi_oem_table(&oem_addr, &oem_entries)) | 48 | if (es7000_check_dsdt()) |
36 | return parse_unisys_oem((char *)oem_addr, oem_entries); | 49 | return parse_unisys_oem((char *)oem_addr); |
50 | else { | ||
51 | setup_unisys(); | ||
52 | return 1; | ||
53 | } | ||
54 | } | ||
37 | return 0; | 55 | return 0; |
38 | } | 56 | } |
39 | 57 | ||