Commit 56f1d5d52a21b93bc2984c920b17e0d80df5d1b2

Authored by Natalie.Protasevich@unisys.com
Committed by Linus Torvalds
1 parent a1740913ca

[PATCH] ES7000 platform update (i386)

This is subarch update for ES7000.  I've modified platform check code and
removed unnecessary OEM table parsing for newer systems that don't use OEM
information during boot.  Parsing the table in fact is causing problems,
and the platform doesn't get recognized.  The patch only affects the ES7000
subach.

Signed-off-by: <Natalie.Protasevich@unisys.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 3 changed files with 49 additions and 31 deletions Side-by-side Diff

arch/i386/mach-es7000/es7000.h
... ... @@ -104,8 +104,9 @@
104 104 #define MIP_SW_APIC 0x1020b
105 105 #define MIP_FUNC(VALUE) (VALUE & 0xff)
106 106  
107   -extern int parse_unisys_oem (char *oemptr, int oem_entries);
108   -extern int find_unisys_acpi_oem_table(unsigned long *oem_addr, int *length);
  107 +extern int parse_unisys_oem (char *oemptr);
  108 +extern int find_unisys_acpi_oem_table(unsigned long *oem_addr);
  109 +extern void setup_unisys ();
109 110 extern int es7000_start_cpu(int cpu, unsigned long eip);
110 111 extern void es7000_sw_apic(void);
arch/i386/mach-es7000/es7000plat.c
... ... @@ -75,12 +75,29 @@
75 75  
76 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 96 * Parse the OEM Table
80 97 */
81 98  
82 99 int __init
83   -parse_unisys_oem (char *oemptr, int oem_entries)
  100 +parse_unisys_oem (char *oemptr)
84 101 {
85 102 int i;
86 103 int success = 0;
... ... @@ -95,7 +112,7 @@
95 112  
96 113 tp += 8;
97 114  
98   - for (i=0; i <= oem_entries; i++) {
  115 + for (i=0; i <= 6; i++) {
99 116 type = *tp++;
100 117 size = *tp++;
101 118 tp -= 2;
102 119  
103 120  
... ... @@ -130,34 +147,18 @@
130 147 default:
131 148 break;
132 149 }
133   - if (i == 6) break;
134 150 tp += size;
135 151 }
136 152  
137 153 if (success < 2) {
138 154 es7000_plat = 0;
139   - } else {
140   - printk("\nEnabling ES7000 specific features...\n");
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   - }
  155 + } else
  156 + setup_unisys();
156 157 return es7000_plat;
157 158 }
158 159  
159 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 163 struct acpi_table_rsdp *rsdp = NULL;
163 164 unsigned long rsdp_phys = 0;
164 165  
... ... @@ -201,13 +202,11 @@
201 202 acpi_table_print(header, sdt.entry[i].pa);
202 203 t = (struct oem_table *) __acpi_map_table(sdt.entry[i].pa, header->length);
203 204 addr = (void *) __acpi_map_table(t->OEMTableAddr, t->OEMTableSize);
204   - *length = header->length;
205 205 *oem_addr = (unsigned long) addr;
206 206 return 0;
207 207 }
208 208 }
209 209 }
210   - Dprintk("ES7000: did not find Unisys ACPI OEM table!\n");
211 210 return -1;
212 211 }
213 212  
include/asm-i386/mach-es7000/mach_mpparse.h
1 1 #ifndef __ASM_MACH_MPPARSE_H
2 2 #define __ASM_MACH_MPPARSE_H
3 3  
  4 +#include <linux/acpi.h>
  5 +
4 6 static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name,
5 7 struct mpc_config_translation *translation)
6 8 {
... ... @@ -12,8 +14,9 @@
12 14 {
13 15 }
14 16  
15   -extern int parse_unisys_oem (char *oemptr, int oem_entries);
16   -extern int find_unisys_acpi_oem_table(unsigned long *oem_addr, int *length);
  17 +extern int parse_unisys_oem (char *oemptr);
  18 +extern int find_unisys_acpi_oem_table(unsigned long *oem_addr);
  19 +extern void setup_unisys();
17 20  
18 21 static inline int mps_oem_check(struct mp_config_table *mpc, char *oem,
19 22 char *productid)
20 23  
21 24  
... ... @@ -22,18 +25,33 @@
22 25 struct mp_config_oemtable *oem_table =
23 26 (struct mp_config_oemtable *)mpc->mpc_oemptr;
24 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 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 43 /* Hook from generic ACPI tables.c */
31 44 static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id)
32 45 {
33 46 unsigned long oem_addr;
34   - int oem_entries;
35   - if (!find_unisys_acpi_oem_table(&oem_addr, &oem_entries))
36   - return parse_unisys_oem((char *)oem_addr, oem_entries);
  47 + if (!find_unisys_acpi_oem_table(&oem_addr)) {
  48 + if (es7000_check_dsdt())
  49 + return parse_unisys_oem((char *)oem_addr);
  50 + else {
  51 + setup_unisys();
  52 + return 1;
  53 + }
  54 + }
37 55 return 0;
38 56 }
39 57