ia64/xen-unstable

changeset 5307:4c831628f463

bitkeeper revision 1.1666 (42a087d7jWz6dz5gEHhjSiLqLjqGvA)

Basic update to new ns16550 driver (not all working yet)

Signed-off by: Dan Magenheimer <dan.magenheimer@hp.com>
Signed-off-by Kevin Tian <Kevin.tian@intel.com>
author djm@kirby.fc.hp.com
date Fri Jun 03 16:39:51 2005 +0000 (2005-06-03)
parents 1bc9c3554d61
children e59a94732dd2
files .rootkeys xen/arch/ia64/Makefile xen/arch/ia64/hpsimserial.c xen/arch/ia64/patch/linux-2.6.11/setup.c xen/arch/ia64/xensetup.c xen/include/asm-ia64/init.h
line diff
     1.1 --- a/.rootkeys	Fri Jun 03 15:21:42 2005 +0000
     1.2 +++ b/.rootkeys	Fri Jun 03 16:39:51 2005 +0000
     1.3 @@ -1010,6 +1010,7 @@ 421098b26C_0yoypoHqjDcJA9UrG_g xen/arch/
     1.4  421098b2PHgzf_Gg4R65YRNi_QzMKQ xen/arch/ia64/dom0_ops.c
     1.5  421098b2O7jsNfzQXA1v3rbAc1QhpA xen/arch/ia64/dom_fw.c
     1.6  421098b2ZlaBcyiuuPr3WpzaSDwg6Q xen/arch/ia64/domain.c
     1.7 +42a08294zRikvZk_CR1iVojHjcVFZw xen/arch/ia64/hpsimserial.c
     1.8  4239e98a_HX-FCIcXtVqY0BbrDqVug xen/arch/ia64/hypercall.c
     1.9  4295e18f42gf1T-8W97A3KSlBaY1tA xen/arch/ia64/hyperprivop.S
    1.10  421098b3LYAS8xJkQiGP7tiTlyBt0Q xen/arch/ia64/idle0_task.c
     2.1 --- a/xen/arch/ia64/Makefile	Fri Jun 03 15:21:42 2005 +0000
     2.2 +++ b/xen/arch/ia64/Makefile	Fri Jun 03 16:39:51 2005 +0000
     2.3 @@ -4,7 +4,7 @@ include $(BASEDIR)/Rules.mk
     2.4  
     2.5  OBJS = xensetup.o setup.o time.o irq.o ia64_ksyms.o process.o smp.o \
     2.6  	xenmisc.o pdb-stub.o acpi.o hypercall.o \
     2.7 -	machvec.o dom0_ops.o domain.o \
     2.8 +	machvec.o dom0_ops.o domain.o hpsimserial.o \
     2.9  	idle0_task.o pal.o hpsim.o efi.o efi_stub.o ivt.o mm_contig.o \
    2.10  	xenmem.o sal.o cmdline.o mm_init.o tlb.o smpboot.o \
    2.11  	extable.o linuxextable.o xenirq.o xentime.o \
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/xen/arch/ia64/hpsimserial.c	Fri Jun 03 16:39:51 2005 +0000
     3.3 @@ -0,0 +1,23 @@
     3.4 +/*
     3.5 + * HP Ski simulator serial I/O
     3.6 + *
     3.7 + * Copyright (C) 2004 Hewlett-Packard Co
     3.8 + *	Dan Magenheimer <dan.magenheimer@hp.com>
     3.9 + */
    3.10 +
    3.11 +#include <linux/config.h>
    3.12 +#include <xen/sched.h>
    3.13 +#include <xen/serial.h>
    3.14 +#include <asm/hpsim_ssc.h>
    3.15 +
    3.16 +static void hp_ski_putc(struct serial_port *port, char c)
    3.17 +{
    3.18 +	ia64_ssc(c,0,0,0,SSC_PUTCHAR);
    3.19 +}
    3.20 +
    3.21 +static struct uart_driver hp_ski = { .putc = hp_ski_putc };
    3.22 +
    3.23 +void hpsim_serial_init(void)
    3.24 +{
    3.25 +	serial_register_uart(0, &hp_ski, 0);
    3.26 +}
     4.1 --- a/xen/arch/ia64/patch/linux-2.6.11/setup.c	Fri Jun 03 15:21:42 2005 +0000
     4.2 +++ b/xen/arch/ia64/patch/linux-2.6.11/setup.c	Fri Jun 03 16:39:51 2005 +0000
     4.3 @@ -1,5 +1,5 @@
     4.4 ---- /home/adsharma/disk2/xen-ia64/xeno-unstable-rebase.bk/xen/../../linux-2.6.11/arch/ia64/kernel/setup.c	2005-03-01 23:37:49.000000000 -0800
     4.5 -+++ /home/adsharma/disk2/xen-ia64/xeno-unstable-rebase.bk/xen/arch/ia64/setup.c	2005-05-18 12:40:50.000000000 -0700
     4.6 +--- ../../linux-2.6.11/arch/ia64/kernel/setup.c	2005-03-02 00:37:49.000000000 -0700
     4.7 ++++ arch/ia64/setup.c	2005-06-03 10:14:24.000000000 -0600
     4.8  @@ -51,6 +51,10 @@
     4.9   #include <asm/smp.h>
    4.10   #include <asm/system.h>
    4.11 @@ -11,7 +11,7 @@
    4.12   
    4.13   #if defined(CONFIG_SMP) && (IA64_CPU_SIZE > PAGE_SIZE)
    4.14   # error "struct cpuinfo_ia64 too big!"
    4.15 -@@ -127,7 +130,16 @@
    4.16 +@@ -127,7 +131,16 @@
    4.17   		range_end   = min(end, rsvd_region[i].start);
    4.18   
    4.19   		if (range_start < range_end)
    4.20 @@ -28,7 +28,7 @@
    4.21   
    4.22   		/* nothing more available in this segment */
    4.23   		if (range_end == end) return 0;
    4.24 -@@ -185,7 +197,12 @@
    4.25 +@@ -185,7 +198,12 @@
    4.26   	n++;
    4.27   
    4.28   	rsvd_region[n].start = (unsigned long) ia64_imva((void *)KERNEL_START);
    4.29 @@ -41,7 +41,7 @@
    4.30   	n++;
    4.31   
    4.32   #ifdef CONFIG_BLK_DEV_INITRD
    4.33 -@@ -299,7 +316,11 @@
    4.34 +@@ -299,17 +317,25 @@
    4.35   }
    4.36   
    4.37   void __init
    4.38 @@ -53,22 +53,33 @@
    4.39   {
    4.40   	unw_init();
    4.41   
    4.42 -@@ -308,8 +329,14 @@
    4.43 + 	ia64_patch_vtop((u64) __start___vtop_patchlist, (u64) __end___vtop_patchlist);
    4.44 + 
    4.45   	*cmdline_p = __va(ia64_boot_param->command_line);
    4.46 ++#ifdef XEN
    4.47 ++	efi_init();
    4.48 ++#else
    4.49   	strlcpy(saved_command_line, *cmdline_p, COMMAND_LINE_SIZE);
    4.50   
    4.51 -+#ifdef XEN
    4.52 -+	cmdline_parse(*cmdline_p);
    4.53 -+#undef CONFIG_ACPI_BOOT
    4.54 -+#endif
    4.55   	efi_init();
    4.56 -+#ifndef XEN
    4.57   	io_port_init();
    4.58  +#endif
    4.59   
    4.60   #ifdef CONFIG_IA64_GENERIC
    4.61   	{
    4.62 -@@ -351,8 +378,18 @@
    4.63 +@@ -336,6 +362,11 @@
    4.64 + 	}
    4.65 + #endif
    4.66 + 
    4.67 ++#ifdef XEN
    4.68 ++	early_cmdline_parse(cmdline_p);
    4.69 ++	cmdline_parse(*cmdline_p);
    4.70 ++#undef CONFIG_ACPI_BOOT
    4.71 ++#endif
    4.72 + 	if (early_console_setup(*cmdline_p) == 0)
    4.73 + 		mark_bsp_online();
    4.74 + 
    4.75 +@@ -351,8 +382,18 @@
    4.76   # endif
    4.77   #endif /* CONFIG_APCI_BOOT */
    4.78   
    4.79 @@ -87,7 +98,7 @@
    4.80   	/* process SAL system table: */
    4.81   	ia64_sal_init(efi.sal_systab);
    4.82   
    4.83 -@@ -360,6 +397,10 @@
    4.84 +@@ -360,6 +401,10 @@
    4.85   	cpu_physical_id(0) = hard_smp_processor_id();
    4.86   #endif
    4.87   
    4.88 @@ -98,7 +109,7 @@
    4.89   	cpu_init();	/* initialize the bootstrap CPU */
    4.90   
    4.91   #ifdef CONFIG_ACPI_BOOT
    4.92 -@@ -492,12 +533,14 @@
    4.93 +@@ -492,12 +537,14 @@
    4.94   {
    4.95   }
    4.96   
    4.97 @@ -113,7 +124,7 @@
    4.98   
    4.99   void
   4.100   identify_cpu (struct cpuinfo_ia64 *c)
   4.101 -@@ -551,6 +594,12 @@
   4.102 +@@ -551,6 +598,12 @@
   4.103   	}
   4.104   	c->unimpl_va_mask = ~((7L<<61) | ((1L << (impl_va_msb + 1)) - 1));
   4.105   	c->unimpl_pa_mask = ~((1L<<63) | ((1L << phys_addr_size) - 1));
   4.106 @@ -126,7 +137,7 @@
   4.107   }
   4.108   
   4.109   void
   4.110 -@@ -659,7 +708,11 @@
   4.111 +@@ -659,7 +712,11 @@
   4.112   					| IA64_DCR_DA | IA64_DCR_DD | IA64_DCR_LC));
   4.113   	atomic_inc(&init_mm.mm_count);
   4.114   	current->active_mm = &init_mm;
     5.1 --- a/xen/arch/ia64/xensetup.c	Fri Jun 03 15:21:42 2005 +0000
     5.2 +++ b/xen/arch/ia64/xensetup.c	Fri Jun 03 16:39:51 2005 +0000
     5.3 @@ -19,6 +19,7 @@
     5.4  #include <asm/meminit.h>
     5.5  #include <asm/page.h>
     5.6  #include <asm/setup.h>
     5.7 +#include <xen/string.h>
     5.8  
     5.9  unsigned long xenheap_phys_end;
    5.10  
    5.11 @@ -35,39 +36,18 @@ extern unsigned long domain0_ready;
    5.12  int find_max_pfn (unsigned long, unsigned long, void *);
    5.13  void start_of_day(void);
    5.14  
    5.15 -/* opt_console: comma-separated list of console outputs. */
    5.16 -#ifdef IA64
    5.17 -unsigned char opt_console[30] = "com1";
    5.18 -#else
    5.19 -unsigned char opt_console[30] = "com1,vga";
    5.20 -#endif
    5.21 -/* opt_conswitch: a character pair controlling console switching. */
    5.22 -/* Char 1: CTRL+<char1> is used to switch console input between Xen and DOM0 */
    5.23 -/* Char 2: If this character is 'x', then do not auto-switch to DOM0 when it */
    5.24 -/*         boots. Any other value, or omitting the char, enables auto-switch */
    5.25 -unsigned char opt_conswitch[5] = "a"; /* NB. '`' would disable switching. */
    5.26 -/* opt_com[12]: Config serial port with a string <baud>,DPS,<io-base>,<irq>. */
    5.27 -unsigned char opt_com1[30] = "", opt_com2[30] = "";
    5.28 -/* opt_dom0_mem: Kilobytes of memory allocated to domain 0. */
    5.29 -unsigned int opt_dom0_mem = 16000;
    5.30  /* opt_noht: If true, Hyperthreading is ignored. */
    5.31 -int opt_noht=0;
    5.32 +int opt_noht = 0;
    5.33 +boolean_param("noht", opt_noht);
    5.34 +
    5.35  /* opt_nosmp: If true, secondary processors are ignored. */
    5.36 -int opt_nosmp=0;
    5.37 -/* opt_noreboot: If true, machine will need manual reset on error. */
    5.38 -int opt_noreboot=0;
    5.39 -/* opt_watchdog: If true, run a watchdog NMI on each processor. */
    5.40 -int opt_watchdog=0;
    5.41 -/* opt_pdb: Name of serial port for Xen pervasive debugger (and enable pdb) */
    5.42 -unsigned char opt_pdb[10] = "none";
    5.43 -/* opt_tbuf_size: trace buffer size (in pages) */
    5.44 -unsigned int opt_tbuf_size = 10;
    5.45 -/* opt_sched: scheduler - default to Borrowed Virtual Time */
    5.46 -char opt_sched[10] = "bvt";
    5.47 -/* opt_leveltrigger, opt_edgetrigger: Force an IO-APIC-routed IRQ to be */
    5.48 -/*                                    level- or edge-triggered.         */
    5.49 -/* Example: 'leveltrigger=4,5,6,20 edgetrigger=21'. */
    5.50 -char opt_leveltrigger[30] = "", opt_edgetrigger[30] = "";
    5.51 +static int opt_nosmp = 0;
    5.52 +boolean_param("nosmp", opt_nosmp);
    5.53 +
    5.54 +/* maxcpus: maximum number of CPUs to activate. */
    5.55 +static unsigned int max_cpus = NR_CPUS;
    5.56 +integer_param("maxcpus", max_cpus); 
    5.57 +
    5.58  /*
    5.59   * opt_xenheap_megabytes: Size of Xen heap in megabytes, including:
    5.60   *	xen image
    5.61 @@ -80,23 +60,6 @@ char opt_leveltrigger[30] = "", opt_edge
    5.62   */
    5.63  unsigned int opt_xenheap_megabytes = XENHEAP_DEFAULT_MB;
    5.64  unsigned long xenheap_size = XENHEAP_DEFAULT_SIZE;
    5.65 -/*
    5.66 - * opt_nmi: one of 'ignore', 'dom0', or 'fatal'.
    5.67 - *  fatal:  Xen prints diagnostic message and then hangs.
    5.68 - *  dom0:   The NMI is virtualised to DOM0.
    5.69 - *  ignore: The NMI error is cleared and ignored.
    5.70 - */
    5.71 -#ifdef NDEBUG
    5.72 -char opt_nmi[10] = "dom0";
    5.73 -#else
    5.74 -char opt_nmi[10] = "fatal";
    5.75 -#endif
    5.76 -/*
    5.77 - * Comma-separated list of hexadecimal page numbers containing bad bytes.
    5.78 - * e.g. 'badpage=0x3f45,0x8a321'.
    5.79 - */
    5.80 -char opt_badpage[100] = "";
    5.81 -
    5.82  extern long running_on_sim;
    5.83  unsigned long xen_pstart;
    5.84  
    5.85 @@ -133,6 +96,42 @@ static void __init do_initcalls(void)
    5.86          (*call)();
    5.87  }
    5.88  
    5.89 +/*
    5.90 + * IPF loader only supports one commaind line currently, for
    5.91 + * both xen and guest kernel. This function provides pre-parse
    5.92 + * to mixed command line, to split it into two parts.
    5.93 + *
    5.94 + * User should split the parameters by "--", with strings after
    5.95 + * spliter for guest kernel. Missing "--" means whole line belongs
    5.96 + * to guest. Example:
    5.97 + *	"com2=57600,8n1 console=com2 -- console=ttyS1 console=tty
    5.98 + * root=/dev/sda3 ro"
    5.99 + */
   5.100 +void early_cmdline_parse(char **cmdline_p)
   5.101 +{
   5.102 +    char *guest_cmd;
   5.103 +    char *split = "--";
   5.104 +
   5.105 +    if (*cmdline_p == NULL) {
   5.106 +	saved_command_line[0] = '\0';
   5.107 +	return;
   5.108 +    }
   5.109 +
   5.110 +    guest_cmd = strstr(*cmdline_p, split);
   5.111 +    /* If no spliter, whole line is for guest */
   5.112 +    if (guest_cmd == NULL) {
   5.113 +	guest_cmd = *cmdline_p;
   5.114 +	*cmdline_p = NULL;
   5.115 +    } else {
   5.116 +	*guest_cmd = '\0';	/* Split boot parameters for xen and guest */
   5.117 +	guest_cmd += strlen(split);
   5.118 +	while (*guest_cmd == ' ') guest_cmd++;
   5.119 +    }
   5.120 +
   5.121 +    strlcpy(saved_command_line, guest_cmd, COMMAND_LINE_SIZE);
   5.122 +    return;
   5.123 +}
   5.124 +
   5.125  void start_kernel(void)
   5.126  {
   5.127      unsigned char *cmdline;
   5.128 @@ -154,7 +153,8 @@ void start_kernel(void)
   5.129      early_setup_arch(&cmdline);
   5.130  
   5.131      /* We initialise the serial devices very early so we can get debugging. */
   5.132 -    ns16550_init();
   5.133 +    if (running_on_sim) hpsim_serial_init();
   5.134 +    else ns16550_init();
   5.135      serial_init_preirq();
   5.136  
   5.137      init_console();
     6.1 --- a/xen/include/asm-ia64/init.h	Fri Jun 03 15:21:42 2005 +0000
     6.2 +++ b/xen/include/asm-ia64/init.h	Fri Jun 03 16:39:51 2005 +0000
     6.3 @@ -14,7 +14,7 @@
     6.4  #define __exitdata   \
     6.5      __attribute_used__ __attribute__ ((__section__ (".data.exit")))
     6.6  #define __initsetup  \
     6.7 -    __attribute_used__ __attribute__ ((__section__ (".setup.init")))
     6.8 +    __attribute_used__ __attribute__ ((__section__ (".init.setup")))
     6.9  #define __init_call  \
    6.10      __attribute_used__ __attribute__ ((__section__ (".initcall1.init")))
    6.11  #define __exit_call  \