[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-ia64-devel] [patch] sn2 console
Dan, Attached patch adds sn2 console support for xen/ia64. Rather than patching the original files for only a couple functions, I just pulled the relevant hunks and dumped them in arch/ia64/sn_console.c (modeling what you did with arch/ia64/hpsimserial.c). Greg xen/arch/ia64/Makefile | 3 - xen/arch/ia64/patch/linux-2.6.11/sn_sal.h | 33 +++++++++++++ xen/arch/ia64/sn_console.c | 85 ++++++++++++++++++++++++++++++++++ xen/arch/ia64/tools/mkbuildtree | 7 ++ xen/include/asm-ia64/config.h | 1 5 files changed, 128 insertions(+), 1 deletion(-) Index: a/xen/include/asm-ia64/config.h =================================================================== --- a/xen/include/asm-ia64/config.h 2005-06-06 14:59:05.034434974 -0500 +++ b/xen/include/asm-ia64/config.h 2005-06-06 14:59:09.762896518 -0500 @@ -19,6 +19,7 @@ #define CONFIG_IA64_GRANULE_16MB #define CONFIG_EFI_PCDP +#define CONFIG_SERIAL_SGI_L1_CONSOLE #ifndef __ASSEMBLY__ Index: a/xen/arch/ia64/tools/mkbuildtree =================================================================== --- a/xen/arch/ia64/tools/mkbuildtree 2005-06-06 14:59:05.035411526 -0500 +++ b/xen/arch/ia64/tools/mkbuildtree 2005-06-06 14:59:09.770708927 -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 @@ -198,6 +199,12 @@ null include/asm-ia64/module.h null include/asm-ia64/ia32.h null include/asm-ia64/tlbflush.h +null include/asm-ia64/sn/arch.h +null include/asm-ia64/sn/geo.h +null include/asm-ia64/sn/nodepda.h +null include/asm-ia64/sn/sn_cpuid.h +cp_patch include/asm-ia64/sn/sn_sal.h include/asm-ia64/sn/sn_sal.h sn_sal.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 Index: a/xen/arch/ia64/patch/linux-2.6.11/sn_sal.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ b/xen/arch/ia64/patch/linux-2.6.11/sn_sal.h 2005-06-06 14:59:09.776568234 -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: a/xen/arch/ia64/Makefile =================================================================== --- a/xen/arch/ia64/Makefile 2005-06-06 14:59:09.366416750 -0500 +++ b/xen/arch/ia64/Makefile 2005-06-06 14:59:09.777544785 -0500 @@ -9,7 +9,8 @@ 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_console.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: a/xen/arch/ia64/sn_console.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ b/xen/arch/ia64/sn_console.c 2005-06-06 15:04:14.804275668 -0500 @@ -0,0 +1,85 @@ +/* + * C-Brick Serial Port (and console) driver for SGI Altix machines. + * + * Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved. + */ + +#include <asm/machvec.h> +#include <asm/sn/sn_sal.h> +#include <xen/serial.h> + +extern const char *acpi_get_sysname(); +void sn_putc(struct serial_port *, char); + +static struct uart_driver sn_sal_console = { + .putc = sn_putc, +}; + +/** + * early_sn_setup - early setup routine for SN platforms + * + * pulled from arch/ia64/sn/kernel/setup.c + */ +static void __init early_sn_setup(void) +{ + efi_system_table_t *efi_systab; + efi_config_table_t *config_tables; + struct ia64_sal_systab *sal_systab; + struct ia64_sal_desc_entry_point *ep; + char *p; + int i, j; + + /* + * Parse enough of the SAL tables to locate the SAL entry point. Since, console + * IO on SN2 is done via SAL calls, early_printk won't work without this. + * + * This code duplicates some of the ACPI table parsing that is in efi.c & sal.c. + * Any changes to those file may have to be made hereas well. + */ + efi_systab = (efi_system_table_t *) __va(ia64_boot_param->efi_systab); + config_tables = __va(efi_systab->tables); + for (i = 0; i < efi_systab->nr_tables; i++) { + if (efi_guidcmp(config_tables[i].guid, SAL_SYSTEM_TABLE_GUID) == + 0) { + sal_systab = __va(config_tables[i].table); + p = (char *)(sal_systab + 1); + for (j = 0; j < sal_systab->entry_count; j++) { + if (*p == SAL_DESC_ENTRY_POINT) { + ep = (struct ia64_sal_desc_entry_point + *)p; + ia64_sal_handler_init(__va + (ep->sal_proc), + __va(ep->gp)); + return; + } + p += SAL_DESC_SIZE(*p); + } + } + } + /* Uh-oh, SAL not available?? */ + printk(KERN_ERR "failed to find SAL entry point\n"); +} + +/** + * sn_serial_console_early_setup - Sets up early console output support + * + * pulled from drivers/serial/sn_console.c + */ +int __init sn_serial_console_early_setup(void) +{ + if (strcmp("sn2",acpi_get_sysname())) + return -1; + + early_sn_setup(); /* Find SAL entry points */ + serial_register_uart(0, &sn_sal_console, NULL); + + return 0; +} + +/* + * sn_putc - Send a character to the console, polled or interrupt mode + */ +void sn_putc(struct serial_port *port, char c) +{ + return ia64_sn_console_putc(c); +} _______________________________________________ Xen-ia64-devel mailing list Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-ia64-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |