WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

[Xen-ia64-devel] [patch] console setup

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [patch] console setup
From: Greg Edwards <edwardsg@xxxxxxx>
Date: Thu, 2 Jun 2005 09:08:16 -0500
Delivery-date: Thu, 02 Jun 2005 14:07:26 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: DIscussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
Below is a patch to hook into the new serial console infrastructure in the
xeno-unstable.bk tree.  It currently just defines the putc function for
sn2 and hpsim consoles.  It goes on top of Kevin Tian's other console
patches from earlier this week.

Part of this is switching to CONFIG_IA64_GENERIC so we can make use of the
ia64_platform_is() macro.  For the machvec's, there are all currently
defined to the hpsim definitions, but the infrastructure is there if
any would later need to be changed.

I wanted to post a early version to get some feedback if this looks like
the right way to go.

Greg


 xen/arch/ia64/Makefile                                   |    4 
 xen/arch/ia64/irq.c                                      |    1 
 xen/arch/ia64/lib/Makefile                               |    2 
 xen/arch/ia64/patch/linux-2.6.11/hpsim_console.c         |   30 +++
 xen/arch/ia64/patch/linux-2.6.11/machvec.h               |  138 +++++++++++++++
 xen/arch/ia64/patch/linux-2.6.11/machvec_dig.h           |   29 +++
 xen/arch/ia64/patch/linux-2.6.11/machvec_hpzx1.h         |   39 ++++
 xen/arch/ia64/patch/linux-2.6.11/machvec_hpzx1_swiotlb.h |   39 ++++
 xen/arch/ia64/patch/linux-2.6.11/machvec_sn2.h           |   39 ++++
 xen/arch/ia64/patch/linux-2.6.11/setup.c                 |   45 +++-
 xen/arch/ia64/patch/linux-2.6.11/sn_console.c            |   69 +++++++
 xen/arch/ia64/patch/linux-2.6.11/sn_sal.h                |   33 +++
 xen/arch/ia64/patch/linux-2.6.11/sn_setup.c              |   38 ++++
 xen/arch/ia64/tools/mkbuildtree                          |   50 +++++
 xen/include/asm-ia64/config.h                            |   15 -
 15 files changed, 547 insertions(+), 24 deletions(-)

Index: xeno-unstable.bk/xen/include/asm-ia64/config.h
===================================================================
--- xeno-unstable.bk.orig/xen/include/asm-ia64/config.h 2005-06-02 
09:05:07.911638932 -0500
+++ xeno-unstable.bk/xen/include/asm-ia64/config.h      2005-06-02 
09:05:09.254397734 -0500
@@ -11,13 +11,16 @@
 // manufactured from component pieces
 
 // defined in linux/arch/ia64/defconfig
-//#define      CONFIG_IA64_GENERIC
-#define        CONFIG_IA64_HP_SIM
+#define        CONFIG_IA64_GENERIC
 #define        CONFIG_IA64_L1_CACHE_SHIFT 7
 // needed by include/asm-ia64/page.h
 #define        CONFIG_IA64_PAGE_SIZE_16KB      // 4KB doesn't work?!?
 #define        CONFIG_IA64_GRANULE_16MB
 
+/* consoles */
+#define CONFIG_HP_SIMSERIAL_CONSOLE
+#define CONFIG_SERIAL_SGI_L1_CONSOLE
+
 #ifndef __ASSEMBLY__
 
 // can't find where this typedef was before?!?
@@ -115,14 +118,6 @@ struct page;
 // avoid redefining task_struct in asm/current.h
 #define task_struct exec_domain
 
-// linux/include/asm-ia64/machvec.h (linux/arch/ia64/lib/io.c)
-#define platform_inb   __ia64_inb
-#define platform_inw   __ia64_inw
-#define platform_inl   __ia64_inl
-#define platform_outb  __ia64_outb
-#define platform_outw  __ia64_outw
-#define platform_outl  __ia64_outl
-
 // FIXME: This just overrides a use in a typedef (not allowed in ia64,
 //  or maybe just in older gcc's?) used in ac_timer.c but should be OK
 //  (and indeed is probably required!) elsewhere
Index: xeno-unstable.bk/xen/arch/ia64/patch/linux-2.6.11/sn_console.c
===================================================================
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
+++ xeno-unstable.bk/xen/arch/ia64/patch/linux-2.6.11/sn_console.c      
2005-06-02 09:05:09.264163252 -0500
@@ -0,0 +1,69 @@
+--- /data/lwork/attica1/edwardsg/linux-2.6.11/drivers/serial/sn_console.c      
2005-03-02 01:38:08 -06:00
++++ drivers/char/sn_console.c  2005-06-02 07:46:40 -05:00
+@@ -49,6 +49,9 @@
+ #include <linux/delay.h> /* for mdelay */
+ #include <linux/miscdevice.h>
+ #include <linux/serial_core.h>
++#ifdef XEN
++#include <xen/serial.h>
++#endif
+
+ #include <asm/io.h>
+ #include <asm/sn/simulator.h>
+@@ -86,6 +89,14 @@ static char *sysrq_serial_ptr = sysrq_se
+ static unsigned long sysrq_requested;
+ #endif /* CONFIG_MAGIC_SYSRQ */
+
++#ifdef XEN
++void snt_xen_hw_putc(struct serial_port *, char);
++
++static struct uart_driver sn_xen_poll_ops = {
++      .putc = snt_xen_hw_putc,
++};
++
++#else /* !XEN */
+ /*
+  * Port definition - this kinda drives it all
+  */
+@@ -1073,6 +1084,7 @@ static struct console sal_console_early
+       .flags = CON_PRINTBUFFER,
+       .index = -1,
+ };
++#endif /* !XEN */
+
+ /**
+  * sn_serial_console_early_setup - Sets up early console output support
+@@ -1088,13 +1100,19 @@ int __init sn_serial_console_early_setup
+       if (!ia64_platform_is("sn2"))
+               return -1;
+
++#ifndef XEN
+       sal_console_port.sc_ops = &poll_ops;
+       early_sn_setup();       /* Find SAL entry points */
+       register_console(&sal_console_early);
++#else
++      early_sn_setup();       /* Find SAL entry points */
++      serial_register_uart(0, &sn_xen_poll_ops, NULL);
++#endif
+
+       return 0;
+ }
+
++#ifndef XEN
+ /**
+  * sn_sal_serial_console_init - Early console output - set up for register
+  *
+@@ -1119,3 +1137,13 @@ static int __init sn_sal_serial_console_
+ }
+
+ console_initcall(sn_sal_serial_console_init);
++
++#else /* XEN */
++/*
++ * snt_xen_hw_putc - Send a character to the console, polled or interrupt mode
++ */
++void snt_xen_hw_putc(struct serial_port *port, char c)
++{
++      return ia64_sn_console_putc(c);
++}
++#endif /* !XEN */
Index: xeno-unstable.bk/xen/arch/ia64/tools/mkbuildtree
===================================================================
--- xeno-unstable.bk.orig/xen/arch/ia64/tools/mkbuildtree       2005-06-02 
09:05:07.916521691 -0500
+++ xeno-unstable.bk/xen/arch/ia64/tools/mkbuildtree    2005-06-02 
09:05:09.267092908 -0500
@@ -45,6 +45,7 @@ fi
 mkdir include/asm-generic
 mkdir include/asm-ia64/linux
 mkdir include/asm-ia64/linux/byteorder
+mkdir include/asm-ia64/sn
 # use "gcc -Iinclude/asm-ia64" to find these linux includes
 #ln -s $XEN/include/xen $XEN/include/linux
 #ln -s $XEN/include/asm-ia64/linux $XEN/include/asm-ia64/xen 
@@ -145,7 +146,17 @@ softlink arch/ia64/lib/xor.S arch/ia64/l
 
 softlink lib/cmdline.c arch/ia64/cmdline.c
 
+softlink arch/ia64/dig/machvec.c arch/ia64/dig_machvec.c
 softlink arch/ia64/hp/sim/hpsim.S arch/ia64/hpsim.S
+softlink arch/ia64/hp/sim/hpsim_machvec.c arch/ia64/hpsim_machvec.c
+softlink arch/ia64/hp/zx1/hpzx1_machvec.c arch/ia64/hpzx1_machvec.c
+softlink arch/ia64/hp/zx1/hpzx1_swiotlb_machvec.c 
arch/ia64/hpzx1_swiotlb_machvec.c
+softlink arch/ia64/sn/kernel/machvec.c arch/ia64/sn_machvec.c
+cp_patch arch/ia64/sn/kernel/setup.c arch/ia64/sn_setup.c sn_setup.c
+
+# consoles
+cp_patch drivers/serial/sn_console.c drivers/char/sn_console.c sn_console.c
+cp_patch arch/ia64/hp/sim/hpsim_console.c drivers/char/hpsim_console.c 
hpsim_console.c
 
 # xen/include/asm-generic files
 
@@ -188,7 +199,9 @@ softlink include/asm-ia64/sal.h include/
 cp_patch include/asm-ia64/system.h include/asm-ia64/system.h system.h
 cp_patch include/asm-ia64/types.h include/asm-ia64/types.h types.h
 
-null include/asm-ia64/desc.h 
+cp_patch include/asm-ia64/sn/sn_sal.h include/asm-ia64/sn/sn_sal.h sn_sal.h
+
+null include/asm-ia64/desc.h
 #null include/asm-ia64/domain_page.h
 #null include/asm-ia64/flushtlb.h
 null include/asm-ia64/io_apic.h
@@ -197,6 +210,19 @@ null include/asm-ia64/module.h
 null include/asm-ia64/ia32.h
 null include/asm-ia64/tlbflush.h
 
+null include/asm-ia64/sn/addrs.h
+null include/asm-ia64/sn/arch.h
+null include/asm-ia64/sn/bte.h
+null include/asm-ia64/sn/clksupport.h
+null include/asm-ia64/sn/geo.h
+null include/asm-ia64/sn/klconfig.h
+null include/asm-ia64/sn/leds.h
+null include/asm-ia64/sn/nodepda.h
+null include/asm-ia64/sn/pda.h
+null include/asm-ia64/sn/shub_mmr.h
+null include/asm-ia64/sn/simulator.h
+null include/asm-ia64/sn/sn_cpuid.h
+
 softlink include/asm-ia64/acpi.h include/asm-ia64/acpi.h
 softlink include/asm-ia64/asmmacro.h include/asm-ia64/asmmacro.h
 softlink include/asm-ia64/atomic.h include/asm-ia64/atomic.h
@@ -219,8 +245,13 @@ cp_patch include/asm-ia64/ia64regs.h inc
 softlink include/asm-ia64/intrinsics.h include/asm-ia64/intrinsics.h
 softlink include/asm-ia64/ioctl.h include/asm-ia64/ioctl.h
 softlink include/asm-ia64/linkage.h include/asm-ia64/linkage.h
-softlink include/asm-ia64/machvec.h include/asm-ia64/machvec.h
+cp_patch include/asm-ia64/machvec.h include/asm-ia64/machvec.h machvec.h
+cp_patch include/asm-ia64/machvec_dig.h include/asm-ia64/machvec_dig.h 
machvec_dig.h
 softlink include/asm-ia64/machvec_hpsim.h include/asm-ia64/machvec_hpsim.h
+cp_patch include/asm-ia64/machvec_hpzx1.h include/asm-ia64/machvec_hpzx1.h 
machvec_hpzx1.h
+cp_patch include/asm-ia64/machvec_hpzx1_swiotlb.h 
include/asm-ia64/machvec_hpzx1_swiotlb.h machvec_hpzx1_swiotlb.h
+cp_patch include/asm-ia64/machvec_sn2.h include/asm-ia64/machvec_sn2.h 
machvec_sn2.h
+softlink include/asm-ia64/machvec_init.h include/asm-ia64/machvec_init.h
 #softlink include/asm-ia64/mca_asm.h include/asm-ia64/mca_asm.h
 cp_patch include/asm-ia64/mca_asm.h include/asm-ia64/mca_asm.h mca_asm.h
 softlink include/asm-ia64/mca.h include/asm-ia64/mca.h
@@ -315,7 +346,6 @@ null include/asm-ia64/linux/device.h
 null include/asm-ia64/linux/proc_fs.h
 null include/asm-ia64/linux/rtc.h
 null include/asm-ia64/linux/profile.h
-null include/asm-ia64/linux/seqlock.h
 null include/asm-ia64/linux/smp_lock.h
 null include/asm-ia64/linux/tty.h
 null include/asm-ia64/linux/kernel_stat.h
@@ -328,6 +358,20 @@ null include/asm-ia64/linux/serial_core.
 null include/asm-ia64/linux/seq_file.h
 null include/asm-ia64/linux/cpu.h
 null include/asm-ia64/linux/ioport.h
+null include/asm-ia64/linux/fs.h
+null include/asm-ia64/linux/kdev_t.h
+null include/asm-ia64/linux/major.h
+null include/asm-ia64/linux/miscdevice.h
+null include/asm-ia64/linux/nodemask.h
+null include/asm-ia64/linux/root_dev.h
+null include/asm-ia64/linux/sysrq.h
+null include/asm-ia64/linux/termios.h
+null include/asm-ia64/linux/workqueue.h
+null include/asm-ia64/linux/serial_reg.h
+null include/asm-ia64/linux/tty_driver.h
+null include/asm-ia64/linux/tty_ldisc.h
+null include/asm-ia64/linux/param.h
+null include/asm-ia64/linux/circ_buf.h
 
 softlink include/linux/byteorder/generic.h 
include/asm-ia64/linux/byteorder/generic.h
 softlink include/linux/byteorder/little_endian.h 
include/asm-ia64/linux/byteorder/little_endian.h
Index: xeno-unstable.bk/xen/arch/ia64/patch/linux-2.6.11/sn_setup.c
===================================================================
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
+++ xeno-unstable.bk/xen/arch/ia64/patch/linux-2.6.11/sn_setup.c        
2005-06-02 09:05:09.268069460 -0500
@@ -0,0 +1,38 @@
+--- ../../linux-2.6.11/arch/ia64/sn/kernel/setup.c     2005-03-02 01:37:50 
-06:00
++++ arch/ia64/sn_setup.c       2005-04-14 11:59:53 -05:00
+@@ -47,11 +47,13 @@
+ #include <asm/sn/clksupport.h>
+ #include <asm/sn/sn_sal.h>
+ #include <asm/sn/geo.h>
++#ifndef XEN
+ #include "xtalk/xwidgetdev.h"
+ #include "xtalk/hubdev.h"
++#endif
+ #include <asm/sn/klconfig.h>
+
+-
++#ifndef XEN
+ DEFINE_PER_CPU(struct pda_s, pda_percpu);
+
+ #define MAX_PHYS_MEMORY               (1UL << 49)     /* 1 TB */
+@@ -153,6 +155,7 @@ static int __init pxm_to_nasid(int pxm)
+       }
+       return -1;
+ }
++#endif /* !XEN */
+
+ /**
+  * early_sn_setup - early setup routine for SN platforms
+@@ -201,6 +204,7 @@ void __init early_sn_setup(void)
+       printk(KERN_ERR "failed to find SAL entry point\n");
+ }
+
++#ifndef XEN
+ extern int platform_intr_list[];
+ extern nasid_t master_nasid;
+ static int shub_1_1_found __initdata;
+@@ -609,3 +613,4 @@ nasid_slice_to_cpuid(int nasid, int slic
+
+       return -1;
+ }
++#endif /* !XEN */
Index: xeno-unstable.bk/xen/arch/ia64/patch/linux-2.6.11/sn_sal.h
===================================================================
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
+++ xeno-unstable.bk/xen/arch/ia64/patch/linux-2.6.11/sn_sal.h  2005-06-02 
09:05:09.270022563 -0500
@@ -0,0 +1,33 @@
+--- /data/lwork/attica1/edwardsg/linux-2.6.11/include/asm-ia64/sn/sn_sal.h     
2005-03-02 01:38:33 -06:00
++++ include/asm-ia64/sn/sn_sal.h       2005-06-01 14:31:47 -05:00
+@@ -123,6 +123,7 @@
+ #define SALRET_ERROR          (-3)
+
+
++#ifndef XEN
+ /**
+  * sn_sal_rev_major - get the major SGI SAL revision number
+  *
+@@ -226,6 +227,7 @@ ia64_sn_get_klconfig_addr(nasid_t nasid)
+       }
+       return ret_stuff.v0 ? __va(ret_stuff.v0) : NULL;
+ }
++#endif /* !XEN */
+
+ /*
+  * Returns the next console character.
+@@ -304,6 +306,7 @@ ia64_sn_console_putb(const char *buf, in
+       return (u64)0;
+ }
+
++#ifndef XEN
+ /*
+  * Print a platform error record
+  */
+@@ -987,5 +990,5 @@ ia64_sn_hwperf_op(nasid_t nasid, u64 opc
+               *v0 = (int) rv.v0;
+       return (int) rv.status;
+ }
+-
++#endif /* !XEN */
+ #endif /* _ASM_IA64_SN_SN_SAL_H */
Index: xeno-unstable.bk/xen/arch/ia64/Makefile
===================================================================
--- xeno-unstable.bk.orig/xen/arch/ia64/Makefile        2005-06-02 
09:05:07.916521691 -0500
+++ xeno-unstable.bk/xen/arch/ia64/Makefile     2005-06-02 09:05:09.270999115 
-0500
@@ -9,7 +9,9 @@ OBJS = xensetup.o setup.o time.o irq.o i
        xenmem.o sal.o cmdline.o mm_init.o tlb.o smpboot.o \
        extable.o linuxextable.o xenirq.o xentime.o \
        regionreg.o entry.o unaligned.o privop.o vcpu.o \
-       irq_ia64.o irq_lsapic.o vhpt.o xenasm.o hyperprivop.o dom_fw.o
+       irq_ia64.o irq_lsapic.o vhpt.o xenasm.o hyperprivop.o dom_fw.o \
+       sn_setup.o dig_machvec.o hpsim_machvec.o hpzx1_machvec.o \
+       hpzx1_swiotlb_machvec.o sn_machvec.o
 
 ifeq ($(CONFIG_VTI),y)
 OBJS += vmx_init.o vmx_virt.o vmx_vcpu.o vmx_process.o vmx_vsa.o vmx_ivt.o \
Index: xeno-unstable.bk/xen/arch/ia64/irq.c
===================================================================
--- xeno-unstable.bk.orig/xen/arch/ia64/irq.c   2005-06-02 09:05:07.916521691 
-0500
+++ xeno-unstable.bk/xen/arch/ia64/irq.c        2005-06-02 09:05:09.271975667 
-0500
@@ -71,6 +71,7 @@
 #endif
 #include <asm/delay.h>
 #include <asm/irq.h>
+#include <asm/hw_irq.h>
 
 #ifdef XEN
 #include <xen/event.h>
Index: xeno-unstable.bk/xen/arch/ia64/patch/linux-2.6.11/machvec_dig.h
===================================================================
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
+++ xeno-unstable.bk/xen/arch/ia64/patch/linux-2.6.11/machvec_dig.h     
2005-06-02 09:05:09.272952219 -0500
@@ -0,0 +1,29 @@
+--- /data/lwork/attica1/edwardsg/linux-2.6.11/include/asm-ia64/machvec_dig.h   
2005-03-02 01:37:52 -06:00
++++ include/asm-ia64/machvec_dig.h     2005-05-27 13:08:27 -05:00
+@@ -1,8 +1,13 @@
+ #ifndef _ASM_IA64_MACHVEC_DIG_h
+ #define _ASM_IA64_MACHVEC_DIG_h
+
++#ifndef XEN
+ extern ia64_mv_setup_t dig_setup;
+ extern ia64_mv_irq_init_t dig_irq_init;
++#else
++extern ia64_mv_setup_t hpsim_setup;
++extern ia64_mv_irq_init_t hpsim_irq_init;
++#endif /* !XEN */
+
+ /*
+  * This stuff has dual use!
+@@ -12,7 +17,12 @@ extern ia64_mv_irq_init_t dig_irq_init;
+  * the macros are used directly.
+  */
+ #define platform_name         "dig"
++#ifndef XEN
+ #define platform_setup                dig_setup
+ #define platform_irq_init     dig_irq_init
++#else
++#define platform_setup                hpsim_setup
++#define platform_irq_init     hpsim_irq_init
++#endif /* !XEN */
+
+ #endif /* _ASM_IA64_MACHVEC_DIG_h */
Index: xeno-unstable.bk/xen/arch/ia64/patch/linux-2.6.11/machvec_hpzx1.h
===================================================================
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
+++ xeno-unstable.bk/xen/arch/ia64/patch/linux-2.6.11/machvec_hpzx1.h   
2005-06-02 09:05:09.274905323 -0500
@@ -0,0 +1,39 @@
+--- /data/lwork/attica1/edwardsg/linux-2.6.11/include/asm-ia64/machvec_hpzx1.h 
2005-03-02 01:37:48 -06:00
++++ include/asm-ia64/machvec_hpzx1.h   2005-05-27 13:09:21 -05:00
+@@ -1,6 +1,7 @@
+ #ifndef _ASM_IA64_MACHVEC_HPZX1_h
+ #define _ASM_IA64_MACHVEC_HPZX1_h
+
++#ifndef XEN
+ extern ia64_mv_setup_t dig_setup;
+ extern ia64_mv_setup_t                        sba_setup;
+ extern ia64_mv_dma_alloc_coherent     sba_alloc_coherent;
+@@ -11,6 +12,10 @@ extern ia64_mv_dma_map_sg           sba_map_sg;
+ extern ia64_mv_dma_unmap_sg           sba_unmap_sg;
+ extern ia64_mv_dma_supported          sba_dma_supported;
+ extern ia64_mv_dma_mapping_error      sba_dma_mapping_error;
++#else
++extern ia64_mv_setup_t hpsim_setup;
++extern ia64_mv_irq_init_t hpsim_irq_init;
++#endif /* !XEN */
+
+ /*
+  * This stuff has dual use!
+@@ -20,6 +25,7 @@ extern ia64_mv_dma_mapping_error     sba_dma
+  * the macros are used directly.
+  */
+ #define platform_name                 "hpzx1"
++#ifndef XEN
+ #define platform_setup                        sba_setup
+ #define platform_dma_init             machvec_noop
+ #define platform_dma_alloc_coherent   sba_alloc_coherent
+@@ -34,5 +40,9 @@ extern ia64_mv_dma_mapping_error     sba_dma
+ #define platform_dma_sync_sg_for_device               machvec_dma_sync_sg
+ #define platform_dma_supported                        sba_dma_supported
+ #define platform_dma_mapping_error            sba_dma_mapping_error
++#else
++#define platform_setup                hpsim_setup
++#define platform_irq_init     hpsim_irq_init
++#endif /* !XEN */
+
+ #endif /* _ASM_IA64_MACHVEC_HPZX1_h */
Index: xeno-unstable.bk/xen/arch/ia64/patch/linux-2.6.11/machvec_hpzx1_swiotlb.h
===================================================================
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
+++ xeno-unstable.bk/xen/arch/ia64/patch/linux-2.6.11/machvec_hpzx1_swiotlb.h   
2005-06-02 09:05:09.275881875 -0500
@@ -0,0 +1,39 @@
+--- 
/data/lwork/attica1/edwardsg/linux-2.6.11/include/asm-ia64/machvec_hpzx1_swiotlb.h
 2005-03-02 01:37:48 -06:00
++++ include/asm-ia64/machvec_hpzx1_swiotlb.h   2005-05-27 13:10:09 -05:00
+@@ -1,6 +1,7 @@
+ #ifndef _ASM_IA64_MACHVEC_HPZX1_SWIOTLB_h
+ #define _ASM_IA64_MACHVEC_HPZX1_SWIOTLB_h
+
++#ifndef XEN
+ extern ia64_mv_setup_t                                dig_setup;
+ extern ia64_mv_dma_init                               hwsw_init;
+ extern ia64_mv_dma_alloc_coherent             hwsw_alloc_coherent;
+@@ -15,6 +16,10 @@ extern ia64_mv_dma_sync_single_for_cpu
+ extern ia64_mv_dma_sync_sg_for_cpu            hwsw_sync_sg_for_cpu;
+ extern ia64_mv_dma_sync_single_for_device     hwsw_sync_single_for_device;
+ extern ia64_mv_dma_sync_sg_for_device         hwsw_sync_sg_for_device;
++#else
++extern ia64_mv_setup_t hpsim_setup;
++extern ia64_mv_irq_init_t hpsim_irq_init;
++#endif /* !XEN */
+
+ /*
+  * This stuff has dual use!
+@@ -25,6 +30,7 @@ extern ia64_mv_dma_sync_sg_for_device                h
+  */
+ #define platform_name                         "hpzx1_swiotlb"
+
++#ifndef XEN
+ #define platform_setup                                dig_setup
+ #define platform_dma_init                     hwsw_init
+ #define platform_dma_alloc_coherent           hwsw_alloc_coherent
+@@ -39,5 +45,9 @@ extern ia64_mv_dma_sync_sg_for_device                h
+ #define platform_dma_sync_sg_for_cpu          hwsw_sync_sg_for_cpu
+ #define platform_dma_sync_single_for_device   hwsw_sync_single_for_device
+ #define platform_dma_sync_sg_for_device               hwsw_sync_sg_for_device
++#else
++#define platform_setup                hpsim_setup
++#define platform_irq_init     hpsim_irq_init
++#endif /* !XEN */
+
+ #endif /* _ASM_IA64_MACHVEC_HPZX1_SWIOTLB_h */
Index: xeno-unstable.bk/xen/arch/ia64/patch/linux-2.6.11/machvec_sn2.h
===================================================================
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
+++ xeno-unstable.bk/xen/arch/ia64/patch/linux-2.6.11/machvec_sn2.h     
2005-06-02 09:05:09.276858426 -0500
@@ -0,0 +1,39 @@
+--- /data/lwork/attica1/edwardsg/linux-2.6.11/include/asm-ia64/machvec_sn2.h   
2005-03-02 01:38:06 -06:00
++++ include/asm-ia64/machvec_sn2.h     2005-05-27 13:11:20 -05:00
+@@ -33,6 +33,7 @@
+ #ifndef _ASM_IA64_MACHVEC_SN2_H
+ #define _ASM_IA64_MACHVEC_SN2_H
+
++#ifndef XEN
+ extern ia64_mv_setup_t sn_setup;
+ extern ia64_mv_cpu_init_t sn_cpu_init;
+ extern ia64_mv_irq_init_t sn_irq_init;
+@@ -71,6 +72,10 @@ extern ia64_mv_dma_sync_single_for_devic
+ extern ia64_mv_dma_sync_sg_for_device sn_dma_sync_sg_for_device;
+ extern ia64_mv_dma_mapping_error      sn_dma_mapping_error;
+ extern ia64_mv_dma_supported          sn_dma_supported;
++#else
++extern ia64_mv_setup_t hpsim_setup;
++extern ia64_mv_irq_init_t hpsim_irq_init;
++#endif /* !XEN */
+
+ /*
+  * This stuff has dual use!
+@@ -80,6 +85,7 @@ extern ia64_mv_dma_supported         sn_dma_sup
+  * the macros are used directly.
+  */
+ #define platform_name                 "sn2"
++#ifndef XEN
+ #define platform_setup                        sn_setup
+ #define platform_cpu_init             sn_cpu_init
+ #define platform_irq_init             sn_irq_init
+@@ -122,5 +128,9 @@ extern ia64_mv_dma_supported               sn_dma_sup
+ #define platform_dma_supported                sn_dma_supported
+
+ #include <asm/sn/io.h>
++#else
++#define platform_setup                hpsim_setup
++#define platform_irq_init     hpsim_irq_init
++#endif /* !XEN */
+
+ #endif /* _ASM_IA64_MACHVEC_SN2_H */
Index: xeno-unstable.bk/xen/arch/ia64/lib/Makefile
===================================================================
--- xeno-unstable.bk.orig/xen/arch/ia64/lib/Makefile    2005-06-02 
09:05:07.917498243 -0500
+++ xeno-unstable.bk/xen/arch/ia64/lib/Makefile 2005-06-02 09:05:09.278811530 
-0500
@@ -9,7 +9,7 @@ OBJS := __divsi3.o __udivsi3.o __modsi3.
        bitop.o checksum.o clear_page.o csum_partial_copy.o copy_page.o \
        clear_user.o strncpy_from_user.o strlen_user.o strnlen_user.o   \
        flush.o ip_fast_csum.o do_csum.o copy_user.o                    \
-       memset.o strlen.o memcpy.o 
+       memset.o strlen.o memcpy.o io.o
 
 default: $(OBJS)
        $(LD) -r -o ia64lib.o $(OBJS)
Index: xeno-unstable.bk/xen/arch/ia64/patch/linux-2.6.11/machvec.h
===================================================================
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
+++ xeno-unstable.bk/xen/arch/ia64/patch/linux-2.6.11/machvec.h 2005-06-02 
09:05:09.280764634 -0500
@@ -0,0 +1,138 @@
+--- /data/lwork/attica1/edwardsg/linux-2.6.11/include/asm-ia64/machvec.h       
2005-03-02 01:38:10 -06:00
++++ include/asm-ia64/machvec.h 2005-05-31 13:23:26 -05:00
+@@ -291,55 +291,119 @@ extern ia64_mv_dma_supported            swiotlb_dm
+ # define platform_tlb_migrate_finish  machvec_noop_mm
+ #endif
+ #ifndef platform_dma_init
+-# define platform_dma_init            swiotlb_init
++# ifndef XEN
++#  define platform_dma_init           swiotlb_init
++# else
++#  define platform_dma_init           machvec_noop
++# endif
+ #endif
+ #ifndef platform_dma_alloc_coherent
+-# define platform_dma_alloc_coherent  swiotlb_alloc_coherent
++# ifndef XEN
++#  define platform_dma_alloc_coherent swiotlb_alloc_coherent
++# else
++#  define platform_dma_alloc_coherent machvec_noop
++# endif
+ #endif
+ #ifndef platform_dma_free_coherent
+-# define platform_dma_free_coherent   swiotlb_free_coherent
++# ifndef XEN
++#  define platform_dma_free_coherent  swiotlb_free_coherent
++# else
++#  define platform_dma_free_coherent  machvec_noop
++# endif
+ #endif
+ #ifndef platform_dma_map_single
+-# define platform_dma_map_single      swiotlb_map_single
++# ifndef XEN
++#  define platform_dma_map_single     swiotlb_map_single
++# else
++#  define platform_dma_map_single     machvec_noop
++# endif
+ #endif
+ #ifndef platform_dma_unmap_single
+-# define platform_dma_unmap_single    swiotlb_unmap_single
++# ifndef XEN
++#  define platform_dma_unmap_single   swiotlb_unmap_single
++# else
++#  define platform_dma_unmap_single   machvec_noop
++# endif
+ #endif
+ #ifndef platform_dma_map_sg
+-# define platform_dma_map_sg          swiotlb_map_sg
++# ifndef XEN
++#  define platform_dma_map_sg         swiotlb_map_sg
++# else
++#  define platform_dma_map_sg         machvec_noop
++# endif
+ #endif
+ #ifndef platform_dma_unmap_sg
+-# define platform_dma_unmap_sg                swiotlb_unmap_sg
++# ifndef XEN
++#  define platform_dma_unmap_sg               swiotlb_unmap_sg
++# else
++#  define platform_dma_unmap_sg               machvec_noop
++# endif
+ #endif
+ #ifndef platform_dma_sync_single_for_cpu
+-# define platform_dma_sync_single_for_cpu     swiotlb_sync_single_for_cpu
++# ifndef XEN
++#  define platform_dma_sync_single_for_cpu    swiotlb_sync_single_for_cpu
++# else
++#  define platform_dma_sync_single_for_cpu    machvec_noop
++# endif
+ #endif
+ #ifndef platform_dma_sync_sg_for_cpu
+-# define platform_dma_sync_sg_for_cpu         swiotlb_sync_sg_for_cpu
++# ifndef XEN
++#  define platform_dma_sync_sg_for_cpu                swiotlb_sync_sg_for_cpu
++# else
++#  define platform_dma_sync_sg_for_cpu                machvec_noop
++# endif
+ #endif
+ #ifndef platform_dma_sync_single_for_device
+-# define platform_dma_sync_single_for_device  swiotlb_sync_single_for_device
++# ifndef XEN
++#  define platform_dma_sync_single_for_device swiotlb_sync_single_for_device
++# else
++#  define platform_dma_sync_single_for_device machvec_noop
++# endif
+ #endif
+ #ifndef platform_dma_sync_sg_for_device
+-# define platform_dma_sync_sg_for_device      swiotlb_sync_sg_for_device
++# ifndef XEN
++#  define platform_dma_sync_sg_for_device     swiotlb_sync_sg_for_device
++# else
++#  define platform_dma_sync_sg_for_device     machvec_noop
++# endif
+ #endif
+ #ifndef platform_dma_mapping_error
+-# define platform_dma_mapping_error           swiotlb_dma_mapping_error
++# ifndef XEN
++#  define platform_dma_mapping_error          swiotlb_dma_mapping_error
++# else
++#  define platform_dma_mapping_error          machvec_noop
++# endif
+ #endif
+ #ifndef platform_dma_supported
+-# define  platform_dma_supported      swiotlb_dma_supported
++# ifndef XEN
++#  define  platform_dma_supported     swiotlb_dma_supported
++# else
++#  define  platform_dma_supported     machvec_noop
++# endif
+ #endif
+ #ifndef platform_local_vector_to_irq
+ # define platform_local_vector_to_irq __ia64_local_vector_to_irq
+ #endif
+ #ifndef platform_pci_get_legacy_mem
+-# define platform_pci_get_legacy_mem  ia64_pci_get_legacy_mem
++# ifndef XEN
++#  define platform_pci_get_legacy_mem ia64_pci_get_legacy_mem
++# else
++#  define platform_pci_get_legacy_mem machvec_noop
++# endif
+ #endif
+ #ifndef platform_pci_legacy_read
+-# define platform_pci_legacy_read     ia64_pci_legacy_read
++# ifndef XEN
++#  define platform_pci_legacy_read    ia64_pci_legacy_read
++# else
++#  define platform_pci_legacy_read    machvec_noop
++# endif
+ #endif
+ #ifndef platform_pci_legacy_write
+-# define platform_pci_legacy_write    ia64_pci_legacy_write
++# ifndef XEN
++#  define platform_pci_legacy_write   ia64_pci_legacy_write
++# else
++#  define platform_pci_legacy_write   machvec_noop
++# endif
+ #endif
+ #ifndef platform_inb
+ # define platform_inb         __ia64_inb
Index: xeno-unstable.bk/xen/arch/ia64/patch/linux-2.6.11/setup.c
===================================================================
--- xeno-unstable.bk.orig/xen/arch/ia64/patch/linux-2.6.11/setup.c      
2005-06-02 09:05:07.915545140 -0500
+++ xeno-unstable.bk/xen/arch/ia64/patch/linux-2.6.11/setup.c   2005-06-02 
09:05:09.281741186 -0500
@@ -1,5 +1,5 @@
 --- /data/lwork/attica1/edwardsg/linux-2.6.11/arch/ia64/kernel/setup.c 
2005-03-02 01:37:49 -06:00
-+++ arch/ia64/setup.c  2005-06-01 11:01:43 -05:00
++++ arch/ia64/setup.c  2005-06-02 08:09:56 -05:00
 @@ -51,6 +51,9 @@
  #include <asm/smp.h>
  #include <asm/system.h>
@@ -40,7 +40,25 @@
        n++;
  
  #ifdef CONFIG_BLK_DEV_INITRD
-@@ -299,17 +316,29 @@ mark_bsp_online (void)
+@@ -285,7 +302,16 @@ early_console_setup (char *cmdline)
+       if (!early_serial_console_init(cmdline))
+               return 0;
+ #endif
+-
++#if defined(XEN) && defined(CONFIG_HP_SIMSERIAL_CONSOLE)
++      extern unsigned long running_on_sim;
++      extern struct uart_driver simcons;
++
++      /* ia64_platform_is("hpsim") doesn't work with CONFIG_IA64_GENERIC */
++      if (running_on_sim) {
++              serial_register_uart(0, &simcons, NULL);
++              return 0;
++      }
++#endif
+       return -1;
+ }
+
+@@ -299,17 +325,27 @@ mark_bsp_online (void)
  }
  
  void __init
@@ -58,8 +76,6 @@
 -      strlcpy(saved_command_line, *cmdline_p, COMMAND_LINE_SIZE);
  
 +#ifdef XEN
-+      early_cmdline_parse(cmdline_p);
-+      cmdline_parse(*cmdline_p);
 +#undef CONFIG_ACPI_BOOT
 +#else
 +      strlcpy(saved_command_line, *cmdline_p, COMMAND_LINE_SIZE);
@@ -71,7 +87,18 @@
  
  #ifdef CONFIG_IA64_GENERIC
        {
-@@ -351,8 +380,18 @@ setup_arch (char **cmdline_p)
+@@ -335,6 +371,10 @@ setup_arch (char **cmdline_p)
+               machvec_init(mvec_name);
+       }
+ #endif
++#ifdef XEN
++      early_cmdline_parse(cmdline_p);
++      cmdline_parse(*cmdline_p);
++#endif
+
+       if (early_console_setup(*cmdline_p) == 0)
+               mark_bsp_online();
+@@ -351,8 +391,18 @@ setup_arch (char **cmdline_p)
  # endif
  #endif /* CONFIG_APCI_BOOT */
  
@@ -90,7 +117,7 @@
        /* process SAL system table: */
        ia64_sal_init(efi.sal_systab);
  
-@@ -360,6 +399,10 @@ setup_arch (char **cmdline_p)
+@@ -360,6 +410,10 @@ setup_arch (char **cmdline_p)
        cpu_physical_id(0) = hard_smp_processor_id();
  #endif
  
@@ -101,7 +128,7 @@
        cpu_init();     /* initialize the bootstrap CPU */
  
  #ifdef CONFIG_ACPI_BOOT
-@@ -492,12 +535,14 @@ c_stop (struct seq_file *m, void *v)
+@@ -492,12 +546,14 @@ c_stop (struct seq_file *m, void *v)
  {
  }
  
@@ -116,7 +143,7 @@
  
  void
  identify_cpu (struct cpuinfo_ia64 *c)
-@@ -551,6 +596,12 @@ identify_cpu (struct cpuinfo_ia64 *c)
+@@ -551,6 +607,12 @@ identify_cpu (struct cpuinfo_ia64 *c)
        }
        c->unimpl_va_mask = ~((7L<<61) | ((1L << (impl_va_msb + 1)) - 1));
        c->unimpl_pa_mask = ~((1L<<63) | ((1L << phys_addr_size) - 1));
@@ -129,7 +156,7 @@
  }
  
  void
-@@ -659,7 +710,11 @@ cpu_init (void)
+@@ -659,7 +721,11 @@ cpu_init (void)
                                        | IA64_DCR_DA | IA64_DCR_DD | 
IA64_DCR_LC));
        atomic_inc(&init_mm.mm_count);
        current->active_mm = &init_mm;
Index: xeno-unstable.bk/xen/arch/ia64/patch/linux-2.6.11/hpsim_console.c
===================================================================
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
+++ xeno-unstable.bk/xen/arch/ia64/patch/linux-2.6.11/hpsim_console.c   
2005-06-02 09:05:09.283694289 -0500
@@ -0,0 +1,30 @@
+--- /data/lwork/attica1/edwardsg/linux-2.6.11/arch/ia64/hp/sim/hpsim_console.c 
2005-03-02 01:38:25 -06:00
++++ drivers/char/hpsim_console.c       2005-06-01 16:00:14 -05:00
+@@ -23,7 +23,10 @@
+ #include <asm/pgtable.h>
+ #include <asm/sal.h>
+
+-#include "hpsim_ssc.h"
++#include <asm/hpsim_ssc.h>
++#include <xen/serial.h>
++
++#ifndef XEN
+
+ static int simcons_init (struct console *, char *);
+ static void simcons_write (struct console *, const char *, unsigned);
+@@ -63,3 +66,15 @@ static struct tty_driver *simcons_consol
+       *index = c->index;
+       return hp_simserial_driver;
+ }
++
++#else /* XEN */
++void simcons_xen_putc(struct serial_port *port, char ch);
++
++struct uart_driver simcons = {
++      .putc = simcons_xen_putc
++};
++void simcons_xen_putc(struct serial_port *port, char ch)
++{
++      ia64_ssc(ch, 0, 0, 0, SSC_PUTCHAR);
++}
++#endif /* !XEN */

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-ia64-devel] [patch] console setup, Greg Edwards <=