Commit 56f1d5d5 authored by Natalie.Protasevich@unisys.com's avatar Natalie.Protasevich@unisys.com Committed by Linus Torvalds

[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: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a1740913
...@@ -104,7 +104,8 @@ struct mip_reg { ...@@ -104,7 +104,8 @@ struct mip_reg {
#define MIP_SW_APIC 0x1020b #define MIP_SW_APIC 0x1020b
#define MIP_FUNC(VALUE) (VALUE & 0xff) #define MIP_FUNC(VALUE) (VALUE & 0xff)
extern int parse_unisys_oem (char *oemptr, int oem_entries); extern int parse_unisys_oem (char *oemptr);
extern int find_unisys_acpi_oem_table(unsigned long *oem_addr, int *length); extern int find_unisys_acpi_oem_table(unsigned long *oem_addr);
extern void setup_unisys ();
extern int es7000_start_cpu(int cpu, unsigned long eip); extern int es7000_start_cpu(int cpu, unsigned long eip);
extern void es7000_sw_apic(void); extern void es7000_sw_apic(void);
...@@ -75,12 +75,29 @@ es7000_rename_gsi(int ioapic, int gsi) ...@@ -75,12 +75,29 @@ es7000_rename_gsi(int ioapic, int gsi)
#endif // (CONFIG_X86_IO_APIC) && (CONFIG_ACPI_INTERPRETER || CONFIG_ACPI_BOOT) #endif // (CONFIG_X86_IO_APIC) && (CONFIG_ACPI_INTERPRETER || CONFIG_ACPI_BOOT)
void __init
setup_unisys ()
{
/*
* Determine the generation of the ES7000 currently running.
*
* es7000_plat = 1 if the machine is a 5xx ES7000 box
* es7000_plat = 2 if the machine is a x86_64 ES7000 box
*
*/
if (!(boot_cpu_data.x86 <= 15 && boot_cpu_data.x86_model <= 2))
es7000_plat = 2;
else
es7000_plat = 1;
ioapic_renumber_irq = es7000_rename_gsi;
}
/* /*
* Parse the OEM Table * Parse the OEM Table
*/ */
int __init int __init
parse_unisys_oem (char *oemptr, int oem_entries) parse_unisys_oem (char *oemptr)
{ {
int i; int i;
int success = 0; int success = 0;
...@@ -95,7 +112,7 @@ parse_unisys_oem (char *oemptr, int oem_entries) ...@@ -95,7 +112,7 @@ parse_unisys_oem (char *oemptr, int oem_entries)
tp += 8; tp += 8;
for (i=0; i <= oem_entries; i++) { for (i=0; i <= 6; i++) {
type = *tp++; type = *tp++;
size = *tp++; size = *tp++;
tp -= 2; tp -= 2;
...@@ -130,34 +147,18 @@ parse_unisys_oem (char *oemptr, int oem_entries) ...@@ -130,34 +147,18 @@ parse_unisys_oem (char *oemptr, int oem_entries)
default: default:
break; break;
} }
if (i == 6) break;
tp += size; tp += size;
} }
if (success < 2) { if (success < 2) {
es7000_plat = 0; es7000_plat = 0;
} else { } else
printk("\nEnabling ES7000 specific features...\n"); setup_unisys();
/*
* Determine the generation of the ES7000 currently running.
*
* es7000_plat = 0 if the machine is NOT a Unisys ES7000 box
* es7000_plat = 1 if the machine is a 5xx ES7000 box
* es7000_plat = 2 if the machine is a x86_64 ES7000 box
*
*/
if (!(boot_cpu_data.x86 <= 15 && boot_cpu_data.x86_model <= 2))
es7000_plat = 2;
else
es7000_plat = 1;
ioapic_renumber_irq = es7000_rename_gsi;
}
return es7000_plat; return es7000_plat;
} }
int __init int __init
find_unisys_acpi_oem_table(unsigned long *oem_addr, int *length) find_unisys_acpi_oem_table(unsigned long *oem_addr)
{ {
struct acpi_table_rsdp *rsdp = NULL; struct acpi_table_rsdp *rsdp = NULL;
unsigned long rsdp_phys = 0; unsigned long rsdp_phys = 0;
...@@ -201,13 +202,11 @@ find_unisys_acpi_oem_table(unsigned long *oem_addr, int *length) ...@@ -201,13 +202,11 @@ find_unisys_acpi_oem_table(unsigned long *oem_addr, int *length)
acpi_table_print(header, sdt.entry[i].pa); acpi_table_print(header, sdt.entry[i].pa);
t = (struct oem_table *) __acpi_map_table(sdt.entry[i].pa, header->length); t = (struct oem_table *) __acpi_map_table(sdt.entry[i].pa, header->length);
addr = (void *) __acpi_map_table(t->OEMTableAddr, t->OEMTableSize); addr = (void *) __acpi_map_table(t->OEMTableAddr, t->OEMTableSize);
*length = header->length;
*oem_addr = (unsigned long) addr; *oem_addr = (unsigned long) addr;
return 0; return 0;
} }
} }
} }
Dprintk("ES7000: did not find Unisys ACPI OEM table!\n");
return -1; return -1;
} }
......
#ifndef __ASM_MACH_MPPARSE_H #ifndef __ASM_MACH_MPPARSE_H
#define __ASM_MACH_MPPARSE_H #define __ASM_MACH_MPPARSE_H
#include <linux/acpi.h>
static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name, static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name,
struct mpc_config_translation *translation) struct mpc_config_translation *translation)
{ {
...@@ -12,8 +14,9 @@ static inline void mpc_oem_pci_bus(struct mpc_config_bus *m, ...@@ -12,8 +14,9 @@ static inline void mpc_oem_pci_bus(struct mpc_config_bus *m,
{ {
} }
extern int parse_unisys_oem (char *oemptr, int oem_entries); extern int parse_unisys_oem (char *oemptr);
extern int find_unisys_acpi_oem_table(unsigned long *oem_addr, int *length); extern int find_unisys_acpi_oem_table(unsigned long *oem_addr);
extern void setup_unisys();
static inline int mps_oem_check(struct mp_config_table *mpc, char *oem, static inline int mps_oem_check(struct mp_config_table *mpc, char *oem,
char *productid) char *productid)
...@@ -22,18 +25,33 @@ static inline int mps_oem_check(struct mp_config_table *mpc, char *oem, ...@@ -22,18 +25,33 @@ static inline int mps_oem_check(struct mp_config_table *mpc, char *oem,
struct mp_config_oemtable *oem_table = struct mp_config_oemtable *oem_table =
(struct mp_config_oemtable *)mpc->mpc_oemptr; (struct mp_config_oemtable *)mpc->mpc_oemptr;
if (!strncmp(oem, "UNISYS", 6)) if (!strncmp(oem, "UNISYS", 6))
return parse_unisys_oem((char *)oem_table, oem_table->oem_length); return parse_unisys_oem((char *)oem_table);
} }
return 0; return 0;
} }
static inline int es7000_check_dsdt()
{
struct acpi_table_header *header = NULL;
if(!acpi_get_table_header_early(ACPI_DSDT, &header))
acpi_table_print(header, 0);
if (!strncmp(header->oem_id, "UNISYS", 6))
return 1;
return 0;
}
/* Hook from generic ACPI tables.c */ /* Hook from generic ACPI tables.c */
static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id)
{ {
unsigned long oem_addr; unsigned long oem_addr;
int oem_entries; if (!find_unisys_acpi_oem_table(&oem_addr)) {
if (!find_unisys_acpi_oem_table(&oem_addr, &oem_entries)) if (es7000_check_dsdt())
return parse_unisys_oem((char *)oem_addr, oem_entries); return parse_unisys_oem((char *)oem_addr);
else {
setup_unisys();
return 1;
}
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment