ia64/xen-unstable

changeset 5408:a871bb5722c7

bitkeeper revision 1.1668.1.11 (42a8bd5aCFsumaFg9rk2nWmEBa7opA)

Oops, yet another file for Greg's checkin
author djm@kirby.fc.hp.com
date Thu Jun 09 22:06:18 2005 +0000 (2005-06-09)
parents e2c063dd8eea
children ca1fb1af953d
files .rootkeys xen/arch/ia64/sn_console.c
line diff
     1.1 --- a/.rootkeys	Thu Jun 09 22:04:26 2005 +0000
     1.2 +++ b/.rootkeys	Thu Jun 09 22:06:18 2005 +0000
     1.3 @@ -1099,6 +1099,7 @@ 41a26ebc4BOHDUsT0TSnryPeV2xfRA xen/arch/
     1.4  41a26ebcJ30TFl1v2kR8rqpEBvOtVw xen/arch/ia64/regionreg.c
     1.5  421098b69pUiIJrqu_w0JMUnZ2uc2A xen/arch/ia64/smp.c
     1.6  421098b6_ToSGrf6Pk1Uwg5aMAIBxg xen/arch/ia64/smpboot.c
     1.7 +42a8bd43dIEIsS-EoQqt5Df1RTr5Hg xen/arch/ia64/sn_console.c
     1.8  428b9f38JJDW35iDn5DlfXTu700rkQ xen/arch/ia64/tools/README.RunVT
     1.9  421098b6AUdbxR3wyn1ATcmNuTao_Q xen/arch/ia64/tools/README.xenia64
    1.10  42376c6dfyY0eq8MS2dK3BW2rFuEGg xen/arch/ia64/tools/README.xenia64linux
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/xen/arch/ia64/sn_console.c	Thu Jun 09 22:06:18 2005 +0000
     2.3 @@ -0,0 +1,84 @@
     2.4 +/*
     2.5 + * C-Brick Serial Port (and console) driver for SGI Altix machines.
     2.6 + *
     2.7 + * Copyright (c) 2005 Silicon Graphics, Inc.  All Rights Reserved.
     2.8 + */
     2.9 +
    2.10 +#include <asm/acpi.h>
    2.11 +#include <asm/sn/sn_sal.h>
    2.12 +#include <xen/serial.h>
    2.13 +
    2.14 +void sn_putc(struct serial_port *, char);
    2.15 +
    2.16 +static struct uart_driver sn_sal_console = {
    2.17 +	.putc = sn_putc,
    2.18 +};
    2.19 +
    2.20 +/**
    2.21 + * early_sn_setup - early setup routine for SN platforms
    2.22 + *
    2.23 + * pulled from arch/ia64/sn/kernel/setup.c
    2.24 + */
    2.25 +static void __init early_sn_setup(void)
    2.26 +{
    2.27 +	efi_system_table_t *efi_systab;
    2.28 +	efi_config_table_t *config_tables;
    2.29 +	struct ia64_sal_systab *sal_systab;
    2.30 +	struct ia64_sal_desc_entry_point *ep;
    2.31 +	char *p;
    2.32 +	int i, j;
    2.33 +
    2.34 +	/*
    2.35 +	 * Parse enough of the SAL tables to locate the SAL entry point. Since, console
    2.36 +	 * IO on SN2 is done via SAL calls, early_printk won't work without this.
    2.37 +	 *
    2.38 +	 * This code duplicates some of the ACPI table parsing that is in efi.c & sal.c.
    2.39 +	 * Any changes to those file may have to be made hereas well.
    2.40 +	 */
    2.41 +	efi_systab = (efi_system_table_t *) __va(ia64_boot_param->efi_systab);
    2.42 +	config_tables = __va(efi_systab->tables);
    2.43 +	for (i = 0; i < efi_systab->nr_tables; i++) {
    2.44 +		if (efi_guidcmp(config_tables[i].guid, SAL_SYSTEM_TABLE_GUID) ==
    2.45 +		    0) {
    2.46 +			sal_systab = __va(config_tables[i].table);
    2.47 +			p = (char *)(sal_systab + 1);
    2.48 +			for (j = 0; j < sal_systab->entry_count; j++) {
    2.49 +				if (*p == SAL_DESC_ENTRY_POINT) {
    2.50 +					ep = (struct ia64_sal_desc_entry_point
    2.51 +					      *)p;
    2.52 +					ia64_sal_handler_init(__va
    2.53 +							      (ep->sal_proc),
    2.54 +							      __va(ep->gp));
    2.55 +					return;
    2.56 +				}
    2.57 +				p += SAL_DESC_SIZE(*p);
    2.58 +			}
    2.59 +		}
    2.60 +	}
    2.61 +	/* Uh-oh, SAL not available?? */
    2.62 +	printk(KERN_ERR "failed to find SAL entry point\n");
    2.63 +}
    2.64 +
    2.65 +/**
    2.66 + * sn_serial_console_early_setup - Sets up early console output support
    2.67 + *
    2.68 + * pulled from drivers/serial/sn_console.c
    2.69 + */
    2.70 +int __init sn_serial_console_early_setup(void)
    2.71 +{
    2.72 +	if (strcmp("sn2",acpi_get_sysname()))
    2.73 +		return -1;
    2.74 +
    2.75 +	early_sn_setup();	/* Find SAL entry points */
    2.76 +	serial_register_uart(0, &sn_sal_console, NULL);
    2.77 +
    2.78 +	return 0;
    2.79 +}
    2.80 +
    2.81 +/*
    2.82 + * sn_putc - Send a character to the console, polled or interrupt mode
    2.83 + */
    2.84 +void sn_putc(struct serial_port *port, char c)
    2.85 +{
    2.86 +	return ia64_sn_console_putc(c);
    2.87 +}