aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.rootkeys1
-rw-r--r--xen/arch/ia64/Makefile2
-rw-r--r--xen/arch/ia64/pcdp.c120
-rw-r--r--xen/arch/ia64/tools/mkbuildtree2
-rw-r--r--xen/arch/ia64/xensetup.c5
-rw-r--r--xen/drivers/char/ns16550.c2
-rw-r--r--xen/include/asm-ia64/config.h2
7 files changed, 131 insertions, 3 deletions
diff --git a/.rootkeys b/.rootkeys
index 81fc2bb5b5..e8aeae1a95 100644
--- a/.rootkeys
+++ b/.rootkeys
@@ -1091,6 +1091,7 @@
421098b5DWbgK-tBR4um8PEAqPwqTA xen/arch/ia64/patch/linux-2.6.7/types.h
421098b5il9YfZM0HpeCnaMgVN_q9g xen/arch/ia64/patch/linux-2.6.7/unaligned.c
421098b65M5cPramsLGbODg8lQwUjQ xen/arch/ia64/patch/linux-2.6.7/wait.h
+42a0d69cCiNxr2Y1GY1khO7qRiNkbw xen/arch/ia64/pcdp.c
421098b6cYDwzXP86ViTLlTO2x7ovA xen/arch/ia64/pdb-stub.c
41a26ebcqaSGVQ8qTMwpPwOJSJ7qSw xen/arch/ia64/privop.c
41a26ebc4BOHDUsT0TSnryPeV2xfRA xen/arch/ia64/process.c
diff --git a/xen/arch/ia64/Makefile b/xen/arch/ia64/Makefile
index 3e997229b0..d323f407c5 100644
--- a/xen/arch/ia64/Makefile
+++ b/xen/arch/ia64/Makefile
@@ -4,7 +4,7 @@ include $(BASEDIR)/Rules.mk
OBJS = xensetup.o setup.o time.o irq.o ia64_ksyms.o process.o smp.o \
xenmisc.o pdb-stub.o acpi.o hypercall.o \
- machvec.o dom0_ops.o domain.o hpsimserial.o \
+ machvec.o dom0_ops.o domain.o hpsimserial.o pcdp.o \
idle0_task.o pal.o hpsim.o efi.o efi_stub.o ivt.o mm_contig.o \
xenmem.o sal.o cmdline.o mm_init.o tlb.o smpboot.o \
extable.o linuxextable.o xenirq.o xentime.o \
diff --git a/xen/arch/ia64/pcdp.c b/xen/arch/ia64/pcdp.c
new file mode 100644
index 0000000000..e2ab84a8c7
--- /dev/null
+++ b/xen/arch/ia64/pcdp.c
@@ -0,0 +1,120 @@
+/*
+ * Parse the EFI PCDP table to locate the console device.
+ *
+ * (c) Copyright 2002, 2003, 2004 Hewlett-Packard Development Company, L.P.
+ * Khalid Aziz <khalid.aziz@hp.com>
+ * Alex Williamson <alex.williamson@hp.com>
+ * Bjorn Helgaas <bjorn.helgaas@hp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/acpi.h>
+#include <linux/console.h>
+#include <linux/efi.h>
+#include <linux/serial.h>
+#ifdef XEN
+#include <linux/errno.h>
+#endif
+#include "pcdp.h"
+
+static int __init
+setup_serial_console(struct pcdp_uart *uart)
+{
+#ifdef XEN
+ extern char opt_com1[1];
+ if (opt_com1[0]) return 0;
+ sprintf(&opt_com1[0], "0x%lx,%lu,%dn1",
+ uart->addr.address, uart->baud,
+ uart->bits ? uart->bits : 8);
+ return 0;
+#else
+#ifdef CONFIG_SERIAL_8250_CONSOLE
+ int mmio;
+ static char options[64];
+
+ mmio = (uart->addr.address_space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY);
+ snprintf(options, sizeof(options), "console=uart,%s,0x%lx,%lun%d",
+ mmio ? "mmio" : "io", uart->addr.address, uart->baud,
+ uart->bits ? uart->bits : 8);
+
+ return early_serial_console_init(options);
+#else
+ return -ENODEV;
+#endif
+#endif
+}
+
+#ifndef XEN
+static int __init
+setup_vga_console(struct pcdp_vga *vga)
+{
+#if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE)
+ if (efi_mem_type(0xA0000) == EFI_CONVENTIONAL_MEMORY) {
+ printk(KERN_ERR "PCDP: VGA selected, but frame buffer is not MMIO!\n");
+ return -ENODEV;
+ }
+
+ conswitchp = &vga_con;
+ printk(KERN_INFO "PCDP: VGA console\n");
+ return 0;
+#else
+ return -ENODEV;
+#endif
+}
+#endif
+
+int __init
+efi_setup_pcdp_console(char *cmdline)
+{
+ struct pcdp *pcdp;
+ struct pcdp_uart *uart;
+ struct pcdp_device *dev, *end;
+ int i, serial = 0;
+
+ pcdp = efi.hcdp;
+ if (!pcdp)
+ return -ENODEV;
+
+#ifndef XEN
+ printk(KERN_INFO "PCDP: v%d at 0x%lx\n", pcdp->rev, __pa(pcdp));
+#endif
+
+ if (strstr(cmdline, "console=hcdp")) {
+ if (pcdp->rev < 3)
+ serial = 1;
+ } else if (strstr(cmdline, "console=")) {
+#ifndef XEN
+ printk(KERN_INFO "Explicit \"console=\"; ignoring PCDP\n");
+#endif
+ return -ENODEV;
+ }
+
+ if (pcdp->rev < 3 && efi_uart_console_only())
+ serial = 1;
+
+ for (i = 0, uart = pcdp->uart; i < pcdp->num_uarts; i++, uart++) {
+ if (uart->flags & PCDP_UART_PRIMARY_CONSOLE || serial) {
+ if (uart->type == PCDP_CONSOLE_UART) {
+ return setup_serial_console(uart);
+ }
+ }
+ }
+
+#ifndef XEN
+ end = (struct pcdp_device *) ((u8 *) pcdp + pcdp->length);
+ for (dev = (struct pcdp_device *) (pcdp->uart + pcdp->num_uarts);
+ dev < end;
+ dev = (struct pcdp_device *) ((u8 *) dev + dev->length)) {
+ if (dev->flags & PCDP_PRIMARY_CONSOLE) {
+ if (dev->type == PCDP_CONSOLE_VGA) {
+ return setup_vga_console((struct pcdp_vga *) dev);
+ }
+ }
+ }
+#endif
+
+ return -ENODEV;
+}
diff --git a/xen/arch/ia64/tools/mkbuildtree b/xen/arch/ia64/tools/mkbuildtree
index c88b9841b9..e1d373f545 100644
--- a/xen/arch/ia64/tools/mkbuildtree
+++ b/xen/arch/ia64/tools/mkbuildtree
@@ -309,6 +309,8 @@ softlink include/linux/topology.h include/asm-ia64/linux/topology.h
softlink include/linux/seqlock.h include/asm-ia64/linux/seqlock.h
softlink include/linux/jiffies.h include/asm-ia64/linux/jiffies.h
+softlink drivers/firmware/pcdp.h arch/ia64/pcdp.h
+
null include/asm-ia64/linux/file.h
null include/asm-ia64/linux/module.h
null include/asm-ia64/linux/swap.h
diff --git a/xen/arch/ia64/xensetup.c b/xen/arch/ia64/xensetup.c
index 162fe145e9..413cf66b89 100644
--- a/xen/arch/ia64/xensetup.c
+++ b/xen/arch/ia64/xensetup.c
@@ -107,12 +107,15 @@ static void __init do_initcalls(void)
* "com2=57600,8n1 console=com2 -- console=ttyS1 console=tty
* root=/dev/sda3 ro"
*/
+static char null[4] = { 0 };
+
void early_cmdline_parse(char **cmdline_p)
{
char *guest_cmd;
char *split = "--";
if (*cmdline_p == NULL) {
+ *cmdline_p = &null[0];
saved_command_line[0] = '\0';
return;
}
@@ -121,7 +124,7 @@ void early_cmdline_parse(char **cmdline_p)
/* If no spliter, whole line is for guest */
if (guest_cmd == NULL) {
guest_cmd = *cmdline_p;
- *cmdline_p = NULL;
+ *cmdline_p = &null[0];
} else {
*guest_cmd = '\0'; /* Split boot parameters for xen and guest */
guest_cmd += strlen(split);
diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 3a58e34767..ea094c843c 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -16,7 +16,7 @@
#include <asm/io.h>
/* Config serial port with a string <baud>,DPS,<io-base>,<irq>. */
-static char opt_com1[30] = "", opt_com2[30] = "";
+char opt_com1[30] = "", opt_com2[30] = "";
string_param("com1", opt_com1);
string_param("com2", opt_com2);
diff --git a/xen/include/asm-ia64/config.h b/xen/include/asm-ia64/config.h
index c419adf8be..f0e556f69b 100644
--- a/xen/include/asm-ia64/config.h
+++ b/xen/include/asm-ia64/config.h
@@ -18,6 +18,8 @@
#define CONFIG_IA64_PAGE_SIZE_16KB // 4KB doesn't work?!?
#define CONFIG_IA64_GRANULE_16MB
+#define CONFIG_EFI_PCDP
+
#ifndef __ASSEMBLY__
// can't find where this typedef was before?!?