[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Simplify Unisys ES7000 code in light of the fact we do not support



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1184058420 -3600
# Node ID fa9fa5f98c91b2acbabfe1771ab621a170cbaf03
# Parent  c64a59ff988068f9cbdbfabb2b7a13932fd33245
Simplify Unisys ES7000 code in light of the fact we do not support
legacy boxes with very non-standard APIC setup.
From: Raj Subrahmanian <raj.subrahmanian@xxxxxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/genapic/es7000.h                  |  120 --------------
 xen/arch/x86/dmi_scan.c                        |    2 
 xen/arch/x86/genapic/es7000plat.c              |  214 ++-----------------------
 xen/arch/x86/mpparse.c                         |    6 
 xen/include/asm-x86/mach-es7000/mach_mpparse.h |    7 
 xen/include/asm-x86/mach-generic/mach_apic.h   |    5 
 xen/include/asm-x86/system.h                   |    4 
 7 files changed, 25 insertions(+), 333 deletions(-)

diff -r c64a59ff9880 -r fa9fa5f98c91 xen/arch/x86/dmi_scan.c
--- a/xen/arch/x86/dmi_scan.c   Mon Jul 09 19:28:54 2007 +0100
+++ b/xen/arch/x86/dmi_scan.c   Tue Jul 10 10:07:00 2007 +0100
@@ -14,8 +14,6 @@
 #define bt_iounmap(b,l)  ((void)0)
 #define memcpy_fromio    memcpy
 #define alloc_bootmem(l) xmalloc_bytes(l)
-
-int es7000_plat = 0;
 
 struct dmi_header
 {
diff -r c64a59ff9880 -r fa9fa5f98c91 xen/arch/x86/genapic/es7000.h
--- a/xen/arch/x86/genapic/es7000.h     Mon Jul 09 19:28:54 2007 +0100
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-/*
- * Written by: Garry Forsgren, Unisys Corporation
- *             Natalie Protasevich, Unisys Corporation
- * This file contains the code to configure and interface 
- * with Unisys ES7000 series hardware system manager.
- *
- * Copyright (c) 2003 Unisys Corporation.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * Contact information: Unisys Corporation, Township Line & Union Meeting 
- * Roads-A, Unisys Way, Blue Bell, Pennsylvania, 19424, or:
- *
- * http://www.unisys.com
- */
-
-/*
- * ES7000 chipsets
- */
-
-#define NON_UNISYS             0
-#define ES7000_CLASSIC         1
-#define ES7000_ZORRO           2
-
-
-#define        MIP_REG                 1
-#define        MIP_PSAI_REG            4
-
-#define        MIP_BUSY                1
-#define        MIP_SPIN                0xf0000
-#define        MIP_VALID               0x0100000000000000ULL
-#define        MIP_PORT(VALUE) ((VALUE >> 32) & 0xffff)
-
-#define        MIP_RD_LO(VALUE)        (VALUE & 0xffffffff)   
-
-struct mip_reg_info {
-       unsigned long long mip_info;
-       unsigned long long delivery_info;
-       unsigned long long host_reg;
-       unsigned long long mip_reg;
-};
-
-struct part_info {
-       unsigned char type;   
-       unsigned char length;
-       unsigned char part_id;
-       unsigned char apic_mode;
-       unsigned long snum;    
-       char ptype[16];
-       char sname[64];
-       char pname[64];
-};
-
-struct psai {
-       unsigned long long entry_type;
-       unsigned long long addr;
-       unsigned long long bep_addr;
-};
-
-struct es7000_mem_info {
-       unsigned char type;   
-       unsigned char length;
-       unsigned char resv[6];
-       unsigned long long  start;
-       unsigned long long  size;
-};
-
-struct es7000_oem_table {
-       unsigned long long hdr;
-       struct mip_reg_info mip;
-       struct part_info pif;
-       struct es7000_mem_info shm;
-       struct psai psai;
-};
-
-struct acpi_table_sdt {
-       unsigned long pa;
-       unsigned long count;
-       struct {
-               unsigned long pa;
-               enum acpi_table_id id;
-               unsigned long size;
-       }       entry[50];
-};
-
-struct oem_table {
-       struct acpi_table_header Header;
-       u32 OEMTableAddr;
-       u32 OEMTableSize;
-};
-
-struct mip_reg {
-       unsigned long long off_0;
-       unsigned long long off_8;
-       unsigned long long off_10;
-       unsigned long long off_18;
-       unsigned long long off_20;
-       unsigned long long off_28;
-       unsigned long long off_30;
-       unsigned long long off_38;
-};
-
-#define        MIP_SW_APIC             0x1020b
-#define        MIP_FUNC(VALUE)         (VALUE & 0xff)
-
-extern int parse_unisys_oem (char *oemptr);
-extern int find_unisys_acpi_oem_table(unsigned long *oem_addr);
-extern void setup_unisys(void);
-extern int es7000_start_cpu(int cpu, unsigned long eip);
-extern void es7000_sw_apic(void);
diff -r c64a59ff9880 -r fa9fa5f98c91 xen/arch/x86/genapic/es7000plat.c
--- a/xen/arch/x86/genapic/es7000plat.c Mon Jul 09 19:28:54 2007 +0100
+++ b/xen/arch/x86/genapic/es7000plat.c Tue Jul 10 10:07:00 2007 +0100
@@ -1,6 +1,7 @@
 /*
  * Written by: Garry Forsgren, Unisys Corporation
  *             Natalie Protasevich, Unisys Corporation
+ * Modified by: Raj Subrahmanian <raj.subrahmanian@xxxxxxxxxx> Unisys Corp.
  * This file contains the code to configure and interface
  * with Unisys ES7000 series hardware system manager.
  *
@@ -36,77 +37,33 @@
 #include <asm/io.h>
 #include <asm/smp.h>
 #include <asm/apicdef.h>
-#include "es7000.h"
 
-/*
- * ES7000 Globals
- */
+#define        MIP_REG                 1
+#define        MIP_PSAI_REG            4
 
-volatile unsigned long *psai = NULL;
-struct mip_reg         *mip_reg;
-struct mip_reg         *host_reg;
-int                    mip_port;
-unsigned long          mip_addr, host_addr;
+struct acpi_table_sdt {
+       unsigned long pa;
+       unsigned long count;
+       struct {
+               unsigned long pa;
+               enum acpi_table_id id;
+               unsigned long size;
+       }       entry[50];
+};
 
-#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI)
-
-/*
- * GSI override for ES7000 platforms.
- */
-
-static unsigned int base;
-
-static int
-es7000_rename_gsi(int ioapic, int gsi)
-{
-       if (es7000_plat == ES7000_ZORRO)
-               return gsi;
-
-       if (!base) {
-               int i;
-               for (i = 0; i < nr_ioapics; i++)
-                       base += nr_ioapic_registers[i];
-       }
-
-       if (!ioapic && (gsi < 16)) 
-               gsi += base;
-       return gsi;
-}
-
-#endif /* (CONFIG_X86_IO_APIC) && (CONFIG_ACPI) */
-
-void __init
-setup_unisys(void)
-{
-       /*
-        * 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 = ES7000_ZORRO;
-       else
-               es7000_plat = ES7000_CLASSIC;
-       ioapic_renumber_irq = es7000_rename_gsi;
-}
-
-/*
- * Parse the OEM Table
- */
+struct oem_table {
+       struct acpi_table_header Header;
+       u32 OEMTableAddr;
+       u32 OEMTableSize;
+};
 
 int __init
-parse_unisys_oem (char *oemptr)
+parse_unisys_oem(char *oemptr)
 {
        int                     i;
        int                     success = 0;
        unsigned char           type, size;
-       unsigned long           val;
        char                    *tp = NULL;
-       struct psai             *psaip = NULL;
-       struct mip_reg_info     *mi;
-       struct mip_reg          *host, *mip;
 
        tp = oemptr;
 
@@ -118,31 +75,8 @@ parse_unisys_oem (char *oemptr)
                tp -= 2;
                switch (type) {
                case MIP_REG:
-                       mi = (struct mip_reg_info *)tp;
-                       val = MIP_RD_LO(mi->host_reg);
-                       host_addr = val;
-                       host = (struct mip_reg *)val;
-                       host_reg = __va(host);
-                       val = MIP_RD_LO(mi->mip_reg);
-                       mip_port = MIP_PORT(mi->mip_info);
-                       mip_addr = val;
-                       mip = (struct mip_reg *)val;
-                       mip_reg = __va(mip);
-                       Dprintk("es7000_mipcfg: host_reg = 0x%lx \n",
-                               (unsigned long)host_reg);
-                       Dprintk("es7000_mipcfg: mip_reg = 0x%lx \n",
-                               (unsigned long)mip_reg);
+               case MIP_PSAI_REG:
                        success++;
-                       break;
-               case MIP_PSAI_REG:
-                       psaip = (struct psai *)tp;
-                       if (tp != NULL) {
-                               if (psaip->addr)
-                                       psai = __va(psaip->addr);
-                               else
-                                       psai = NULL;
-                               success++;
-                       }
                        break;
                default:
                        break;
@@ -150,11 +84,7 @@ parse_unisys_oem (char *oemptr)
                tp += size;
        }
 
-       if (success < 2) {
-               es7000_plat = NON_UNISYS;
-       } else
-               setup_unisys();
-       return es7000_plat;
+       return (success >= 2);
 }
 
 int __init
@@ -209,107 +139,3 @@ find_unisys_acpi_oem_table(unsigned long
        }
        return -1;
 }
-
-static void
-es7000_spin(int n)
-{
-       int i = 0;
-
-       while (i++ < n)
-               rep_nop();
-}
-
-static int __init
-es7000_mip_write(struct mip_reg *mip_reg)
-{
-       int                     status = 0;
-       int                     spin;
-
-       spin = MIP_SPIN;
-       while (((unsigned long long)host_reg->off_38 &
-               (unsigned long long)MIP_VALID) != 0) {
-                       if (--spin <= 0) {
-                               printk("es7000_mip_write: Timeout waiting for 
Host Valid Flag");
-                               return -1;
-                       }
-               es7000_spin(MIP_SPIN);
-       }
-
-       memcpy(host_reg, mip_reg, sizeof(struct mip_reg));
-       outb(1, mip_port);
-
-       spin = MIP_SPIN;
-
-       while (((unsigned long long)mip_reg->off_38 &
-               (unsigned long long)MIP_VALID) == 0) {
-               if (--spin <= 0) {
-                       printk("es7000_mip_write: Timeout waiting for MIP Valid 
Flag");
-                       return -1;
-               }
-               es7000_spin(MIP_SPIN);
-       }
-
-       status = ((unsigned long long)mip_reg->off_0 &
-               (unsigned long long)0xffff0000000000ULL) >> 48;
-       mip_reg->off_38 = ((unsigned long long)mip_reg->off_38 &
-               (unsigned long long)~MIP_VALID);
-       return status;
-}
-
-int
-es7000_start_cpu(int cpu, unsigned long eip)
-{
-       unsigned long vect = 0, psaival = 0;
-
-       if (psai == NULL)
-               return -1;
-
-       vect = ((unsigned long)__pa(eip)/0x1000) << 16;
-       psaival = (0x1000000 | vect | cpu);
-
-       while (*psai & 0x1000000)
-                ;
-
-       *psai = psaival;
-
-       return 0;
-
-}
-
-int
-es7000_stop_cpu(int cpu)
-{
-       int startup;
-
-       if (psai == NULL)
-               return -1;
-
-       startup= (0x1000000 | cpu);
-
-       while ((*psai & 0xff00ffff) != startup)
-               ;
-
-       startup = (*psai & 0xff0000) >> 16;
-       *psai &= 0xffffff;
-
-       return 0;
-
-}
-
-void __init
-es7000_sw_apic()
-{
-       if (es7000_plat && (es7000_plat != ES7000_ZORRO)) {
-               int mip_status;
-               struct mip_reg es7000_mip_reg;
-
-               printk("ES7000: Enabling APIC mode.\n");
-               memset(&es7000_mip_reg, 0, sizeof(struct mip_reg));
-               es7000_mip_reg.off_0 = MIP_SW_APIC;
-               es7000_mip_reg.off_38 = (MIP_VALID);
-               while ((mip_status = es7000_mip_write(&es7000_mip_reg)) != 0)
-                       printk("es7000_sw_apic: command failed, status = %x\n",
-                               mip_status);
-               return;
-       }
-}
diff -r c64a59ff9880 -r fa9fa5f98c91 xen/arch/x86/mpparse.c
--- a/xen/arch/x86/mpparse.c    Mon Jul 09 19:28:54 2007 +0100
+++ b/xen/arch/x86/mpparse.c    Tue Jul 10 10:07:00 2007 +0100
@@ -1001,12 +1001,6 @@ void __init mp_config_acpi_legacy_irqs (
        mp_bus_id_to_type[MP_ISA_BUS] = MP_BUS_ISA;
        Dprintk("Bus #%d is ISA\n", MP_ISA_BUS);
 
-       /*
-        * Older generations of ES7000 have no legacy identity mappings
-        */
-       if (es7000_plat == 1)
-               return;
-
        /* 
         * Locate the IOAPIC that manages the ISA IRQs (0-15). 
         */
diff -r c64a59ff9880 -r fa9fa5f98c91 
xen/include/asm-x86/mach-es7000/mach_mpparse.h
--- a/xen/include/asm-x86/mach-es7000/mach_mpparse.h    Mon Jul 09 19:28:54 
2007 +0100
+++ b/xen/include/asm-x86/mach-es7000/mach_mpparse.h    Tue Jul 10 10:07:00 
2007 +0100
@@ -3,9 +3,8 @@
 
 #include <xen/acpi.h>
 
-extern int parse_unisys_oem (char *oemptr);
+extern int parse_unisys_oem(char *oemptr);
 extern int find_unisys_acpi_oem_table(unsigned long *oem_addr);
-extern void setup_unisys(void);
 
 static inline int mps_oem_check(struct mp_config_table *mpc, char *oem,
                char *productid)
@@ -36,10 +35,8 @@ static inline int acpi_madt_oem_check(ch
        if (!find_unisys_acpi_oem_table(&oem_addr)) {
                if (es7000_check_dsdt())
                        return parse_unisys_oem((char *)oem_addr);
-               else {
-                       setup_unisys();
+               else
                        return 1;
-               }
        }
        return 0;
 }
diff -r c64a59ff9880 -r fa9fa5f98c91 
xen/include/asm-x86/mach-generic/mach_apic.h
--- a/xen/include/asm-x86/mach-generic/mach_apic.h      Mon Jul 09 19:28:54 
2007 +0100
+++ b/xen/include/asm-x86/mach-generic/mach_apic.h      Tue Jul 10 10:07:00 
2007 +0100
@@ -15,11 +15,10 @@
 #define clustered_apic_check (genapic->clustered_apic_check) 
 #define cpu_mask_to_apicid (genapic->cpu_mask_to_apicid)
 
-extern void es7000_sw_apic(void);
 static inline void enable_apic_mode(void)
 {
-       es7000_sw_apic();
-       return;
+       /* Not needed for modern ES7000 which boot in Virtual Wire mode. */
+       /*es7000_sw_apic();*/
 }
 
 #define apicid_to_node(apicid) ((int)apicid_to_node[(u8)apicid])
diff -r c64a59ff9880 -r fa9fa5f98c91 xen/include/asm-x86/system.h
--- a/xen/include/asm-x86/system.h      Mon Jul 09 19:28:54 2007 +0100
+++ b/xen/include/asm-x86/system.h      Tue Jul 10 10:07:00 2007 +0100
@@ -335,6 +335,4 @@ static inline int local_irq_is_enabled(v
 #define BROKEN_ACPI_Sx         0x0001
 #define BROKEN_INIT_AFTER_S1   0x0002
 
-extern int es7000_plat;
-
-#endif
+#endif

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.