ia64/xen-unstable

changeset 15707:a451b0ab40d9

es7000: Remove the bulk of the ES7000 specific code from Xen.

On the Unisys ES7000-One, Xen now uses the bigsmp APIC driver. This patch
has been tested on the ES7000 and a commodity box.

Signed-off-by: Raj Subrahmanian <raj.subrahmanian@unisys.com>
author kfraser@localhost.localdomain
date Fri Aug 03 09:04:29 2007 +0100 (2007-08-03)
parents 9f939ff527ee
children 52e5c110aadb
files xen/arch/x86/genapic/Makefile xen/arch/x86/genapic/bigsmp.c xen/arch/x86/genapic/es7000.c xen/arch/x86/genapic/es7000plat.c xen/arch/x86/genapic/probe.c xen/include/asm-x86/mach-es7000/mach_mpparse.h
line diff
     1.1 --- a/xen/arch/x86/genapic/Makefile	Thu Aug 02 16:03:35 2007 +0100
     1.2 +++ b/xen/arch/x86/genapic/Makefile	Fri Aug 03 09:04:29 2007 +0100
     1.3 @@ -1,7 +1,5 @@
     1.4  obj-y += bigsmp.o
     1.5  obj-y += default.o
     1.6  obj-y += delivery.o
     1.7 -obj-y += es7000.o
     1.8 -obj-y += es7000plat.o
     1.9  obj-y += probe.o
    1.10  obj-y += summit.o
     2.1 --- a/xen/arch/x86/genapic/bigsmp.c	Thu Aug 02 16:03:35 2007 +0100
     2.2 +++ b/xen/arch/x86/genapic/bigsmp.c	Fri Aug 03 09:04:29 2007 +0100
     2.3 @@ -13,7 +13,7 @@
     2.4  
     2.5  static int dmi_bigsmp; /* can be set by dmi scanners */
     2.6  
     2.7 -static __init int hp_ht_bigsmp(struct dmi_system_id *d)
     2.8 +static __init int force_bigsmp(struct dmi_system_id *d)
     2.9  {
    2.10  	printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident);
    2.11  	dmi_bigsmp = 1;
    2.12 @@ -22,15 +22,19 @@ static __init int hp_ht_bigsmp(struct dm
    2.13  
    2.14  
    2.15  static struct dmi_system_id __initdata bigsmp_dmi_table[] = {
    2.16 -	{ hp_ht_bigsmp, "HP ProLiant DL760 G2", {
    2.17 +	{ force_bigsmp, "HP ProLiant DL760 G2", {
    2.18  		DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
    2.19  		DMI_MATCH(DMI_BIOS_VERSION, "P44-"),
    2.20  	}},
    2.21  
    2.22 -	{ hp_ht_bigsmp, "HP ProLiant DL740", {
    2.23 +	{ force_bigsmp, "HP ProLiant DL740", {
    2.24  		DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
    2.25  		DMI_MATCH(DMI_BIOS_VERSION, "P47-"),
    2.26  	 }},
    2.27 +	{ force_bigsmp, "UNISYS ES7000-ONE", {
    2.28 +		DMI_MATCH(DMI_PRODUCT_NAME, "ES7000-ONE")
    2.29 +	 }},
    2.30 +	
    2.31  	 { }
    2.32  };
    2.33  
     3.1 --- a/xen/arch/x86/genapic/es7000.c	Thu Aug 02 16:03:35 2007 +0100
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,27 +0,0 @@
     3.4 -/*
     3.5 - * APIC driver for the Unisys ES7000 chipset.
     3.6 - */
     3.7 -#include <xen/config.h>
     3.8 -#include <xen/cpumask.h>
     3.9 -#include <asm/current.h>
    3.10 -#include <asm/mpspec.h>
    3.11 -#include <asm/genapic.h>
    3.12 -#include <asm/fixmap.h>
    3.13 -#include <asm/apicdef.h>
    3.14 -#include <asm/atomic.h>
    3.15 -#include <xen/kernel.h>
    3.16 -#include <xen/string.h>
    3.17 -#include <xen/smp.h>
    3.18 -#include <xen/init.h>
    3.19 -#include <asm/mach-es7000/mach_mpparse.h>
    3.20 -
    3.21 -static __init int probe_es7000(void)
    3.22 -{
    3.23 -	/* probed later in mptable/ACPI hooks */
    3.24 -	return 0;
    3.25 -}
    3.26 -
    3.27 -struct genapic apic_es7000 = {
    3.28 -	APIC_INIT("es7000", probe_es7000),
    3.29 -	GENAPIC_PHYS
    3.30 -};
     4.1 --- a/xen/arch/x86/genapic/es7000plat.c	Thu Aug 02 16:03:35 2007 +0100
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,141 +0,0 @@
     4.4 -/*
     4.5 - * Written by: Garry Forsgren, Unisys Corporation
     4.6 - *             Natalie Protasevich, Unisys Corporation
     4.7 - * Modified by: Raj Subrahmanian <raj.subrahmanian@unisys.com> Unisys Corp.
     4.8 - * This file contains the code to configure and interface
     4.9 - * with Unisys ES7000 series hardware system manager.
    4.10 - *
    4.11 - * Copyright (c) 2003 Unisys Corporation.  All Rights Reserved.
    4.12 - *
    4.13 - * This program is free software; you can redistribute it and/or modify it
    4.14 - * under the terms of version 2 of the GNU General Public License as
    4.15 - * published by the Free Software Foundation.
    4.16 - *
    4.17 - * This program is distributed in the hope that it would be useful, but
    4.18 - * WITHOUT ANY WARRANTY; without even the implied warranty of
    4.19 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    4.20 - *
    4.21 - * You should have received a copy of the GNU General Public License along
    4.22 - * with this program; if not, write the Free Software Foundation, Inc., 59
    4.23 - * Temple Place - Suite 330, Boston MA 02111-1307, USA.
    4.24 - *
    4.25 - * Contact information: Unisys Corporation, Township Line & Union Meeting
    4.26 - * Roads-A, Unisys Way, Blue Bell, Pennsylvania, 19424, or:
    4.27 - *
    4.28 - * http://www.unisys.com
    4.29 - */
    4.30 -
    4.31 -#include <xen/config.h>
    4.32 -#include <xen/types.h>
    4.33 -#include <xen/kernel.h>
    4.34 -#include <xen/smp.h>
    4.35 -#include <xen/string.h>
    4.36 -#include <xen/spinlock.h>
    4.37 -#include <xen/errno.h>
    4.38 -#include <xen/init.h>
    4.39 -#include <xen/acpi.h>
    4.40 -#include <asm/io.h>
    4.41 -#include <asm/smp.h>
    4.42 -#include <asm/apicdef.h>
    4.43 -
    4.44 -#define	MIP_REG			1
    4.45 -#define	MIP_PSAI_REG		4
    4.46 -
    4.47 -struct acpi_table_sdt {
    4.48 -	unsigned long pa;
    4.49 -	unsigned long count;
    4.50 -	struct {
    4.51 -		unsigned long pa;
    4.52 -		enum acpi_table_id id;
    4.53 -		unsigned long size;
    4.54 -	}	entry[50];
    4.55 -};
    4.56 -
    4.57 -struct oem_table {
    4.58 -	struct acpi_table_header Header;
    4.59 -	u32 OEMTableAddr;
    4.60 -	u32 OEMTableSize;
    4.61 -};
    4.62 -
    4.63 -int __init
    4.64 -parse_unisys_oem(char *oemptr)
    4.65 -{
    4.66 -	int                     i;
    4.67 -	int 			success = 0;
    4.68 -	unsigned char           type, size;
    4.69 -	char                    *tp = NULL;
    4.70 -
    4.71 -	tp = oemptr;
    4.72 -
    4.73 -	tp += 8;
    4.74 -
    4.75 -	for (i=0; i <= 6; i++) {
    4.76 -		type = *tp++;
    4.77 -		size = *tp++;
    4.78 -		tp -= 2;
    4.79 -		switch (type) {
    4.80 -		case MIP_REG:
    4.81 -		case MIP_PSAI_REG:
    4.82 -			success++;
    4.83 -			break;
    4.84 -		default:
    4.85 -			break;
    4.86 -		}
    4.87 -		tp += size;
    4.88 -	}
    4.89 -
    4.90 -	return (success >= 2);
    4.91 -}
    4.92 -
    4.93 -int __init
    4.94 -find_unisys_acpi_oem_table(unsigned long *oem_addr)
    4.95 -{
    4.96 -	struct acpi_table_rsdp		*rsdp = NULL;
    4.97 -	unsigned long			rsdp_phys = 0;
    4.98 -	struct acpi_table_header 	*header = NULL;
    4.99 -	int				i;
   4.100 -	struct acpi_table_sdt		sdt = { 0 }; /* initialise sdt.count */
   4.101 -
   4.102 -	rsdp_phys = acpi_find_rsdp();
   4.103 -	rsdp = __va(rsdp_phys);
   4.104 -	if (rsdp->rsdt_address) {
   4.105 -		struct acpi_table_rsdt	*mapped_rsdt = NULL;
   4.106 -		sdt.pa = rsdp->rsdt_address;
   4.107 -
   4.108 -		header = (struct acpi_table_header *)
   4.109 -			__acpi_map_table(sdt.pa, sizeof(struct acpi_table_header));
   4.110 -		if (!header)
   4.111 -			return -ENODEV;
   4.112 -
   4.113 -		sdt.count = (header->length - sizeof(struct acpi_table_header)) >> 3;
   4.114 -		mapped_rsdt = (struct acpi_table_rsdt *)
   4.115 -			__acpi_map_table(sdt.pa, header->length);
   4.116 -		if (!mapped_rsdt)
   4.117 -			return -ENODEV;
   4.118 -
   4.119 -		header = &mapped_rsdt->header;
   4.120 -
   4.121 -		for (i = 0; i < sdt.count; i++)
   4.122 -			sdt.entry[i].pa = (unsigned long) mapped_rsdt->entry[i];
   4.123 -	};
   4.124 -	for (i = 0; i < sdt.count; i++) {
   4.125 -
   4.126 -		header = (struct acpi_table_header *)
   4.127 -			__acpi_map_table(sdt.entry[i].pa,
   4.128 -				sizeof(struct acpi_table_header));
   4.129 -		if (!header)
   4.130 -			continue;
   4.131 -		if (!strncmp((char *) &header->signature, "OEM1", 4)) {
   4.132 -			if (!strncmp((char *) &header->oem_id, "UNISYS", 6)) {
   4.133 -				void *addr;
   4.134 -				struct oem_table *t;
   4.135 -				acpi_table_print(header, sdt.entry[i].pa);
   4.136 -				t = (struct oem_table *) __acpi_map_table(sdt.entry[i].pa, header->length);
   4.137 -				addr = (void *) __acpi_map_table(t->OEMTableAddr, t->OEMTableSize);
   4.138 -				*oem_addr = (unsigned long) addr;
   4.139 -				return 0;
   4.140 -			}
   4.141 -		}
   4.142 -	}
   4.143 -	return -1;
   4.144 -}
     5.1 --- a/xen/arch/x86/genapic/probe.c	Thu Aug 02 16:03:35 2007 +0100
     5.2 +++ b/xen/arch/x86/genapic/probe.c	Fri Aug 03 09:04:29 2007 +0100
     5.3 @@ -16,7 +16,6 @@
     5.4  
     5.5  extern struct genapic apic_summit;
     5.6  extern struct genapic apic_bigsmp;
     5.7 -extern struct genapic apic_es7000;
     5.8  extern struct genapic apic_default;
     5.9  
    5.10  struct genapic *genapic;
    5.11 @@ -24,7 +23,6 @@ struct genapic *genapic;
    5.12  struct genapic *apic_probe[] __initdata = { 
    5.13  	&apic_summit,
    5.14  	&apic_bigsmp, 
    5.15 -	&apic_es7000,
    5.16  	&apic_default,	/* must be last */
    5.17  	NULL,
    5.18  };
     6.1 --- a/xen/include/asm-x86/mach-es7000/mach_mpparse.h	Thu Aug 02 16:03:35 2007 +0100
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,45 +0,0 @@
     6.4 -#ifndef __ASM_MACH_MPPARSE_H
     6.5 -#define __ASM_MACH_MPPARSE_H
     6.6 -
     6.7 -#include <xen/acpi.h>
     6.8 -
     6.9 -extern int parse_unisys_oem(char *oemptr);
    6.10 -extern int find_unisys_acpi_oem_table(unsigned long *oem_addr);
    6.11 -
    6.12 -static inline int mps_oem_check(struct mp_config_table *mpc, char *oem,
    6.13 -		char *productid)
    6.14 -{
    6.15 -	if (mpc->mpc_oemptr) {
    6.16 -		struct mp_config_oemtable *oem_table = 
    6.17 -			(struct mp_config_oemtable *)(long)mpc->mpc_oemptr;
    6.18 -		if (!strncmp(oem, "UNISYS", 6))
    6.19 -			return parse_unisys_oem((char *)oem_table);
    6.20 -	}
    6.21 -	return 0;
    6.22 -}
    6.23 -
    6.24 -static inline int es7000_check_dsdt(void)
    6.25 -{
    6.26 -	struct acpi_table_header *header = NULL;
    6.27 -	if(!acpi_get_table_header_early(ACPI_DSDT, &header))
    6.28 -		acpi_table_print(header, 0);
    6.29 -	if (!strncmp(header->oem_id, "UNISYS", 6))
    6.30 -		return 1;
    6.31 -	return 0;
    6.32 -}
    6.33 -
    6.34 -/* Hook from generic ACPI tables.c */
    6.35 -static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id)
    6.36 -{
    6.37 -	unsigned long oem_addr;
    6.38 -	if (!find_unisys_acpi_oem_table(&oem_addr)) {
    6.39 -		if (es7000_check_dsdt())
    6.40 -			return parse_unisys_oem((char *)oem_addr);
    6.41 -		else
    6.42 -			return 1;
    6.43 -	}
    6.44 -	return 0;
    6.45 -}
    6.46 -
    6.47 -
    6.48 -#endif /* __ASM_MACH_MPPARSE_H */