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] VGA Fixes (2/3)

To: xen-ia64-devel <xen-ia64-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-ia64-devel] [PATCH] VGA Fixes (2/3)
From: Alex Williamson <alex.williamson@xxxxxx>
Date: Tue, 24 Jul 2007 17:28:28 -0600
Delivery-date: Tue, 24 Jul 2007 16:26:14 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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>
Organization: HP OSLO R&D
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
   This patch enables console autodetection for VGA on systems
implementing a PCDP table.  With this, setting the primary console to
VGA or serial will cause both Xen and Dom0 output to go to the right
place automatically (overridden by manually specifying a console=).
This shouldn't help or hurt systems without an HCDP/PCDP table.

Signed-off-by: Alex Williamson <alex.williamson@xxxxxx>
---

diff -r fcdd56b88acd xen/arch/ia64/xen/pcdp.c
--- a/xen/arch/ia64/xen/pcdp.c  Thu Jul 19 20:02:04 2007 -0600
+++ b/xen/arch/ia64/xen/pcdp.c  Tue Jul 24 12:56:30 2007 -0600
@@ -137,7 +137,7 @@ setup_pcdp_irq(struct pcdp *pcdp, struct
 }
 
 static int __init
-setup_serial_console(struct pcdp *pcdp, struct pcdp_uart *uart)
+setup_serial_console(struct pcdp_uart *uart)
 {
 
        ns16550_com1.baud = uart->baud ? uart->baud : BAUD_AUTO;
@@ -145,11 +145,43 @@ setup_serial_console(struct pcdp *pcdp, 
        if (uart->bits)
                ns16550_com1.data_bits = uart->bits;
 
-       setup_pcdp_irq(pcdp, uart);
-
-       return 0;
-}
-#else
+       setup_pcdp_irq(efi.hcdp, uart);
+
+       /* Hide the HCDP table from dom0, xencons will be the console */
+       efi.hcdp = NULL;
+
+       return 0;
+}
+
+static int __init
+setup_vga_console(struct pcdp_vga *vga)
+{
+#ifdef CONFIG_VGA
+       /*
+        * There was no console= in the original cmdline, and the PCDP
+        * is telling us VGA is the primary console.  We can call
+        * cmdline_parse() manually to make things appear automagic.
+        *
+        * NB - cmdline_parse() expects the first part of the cmdline
+        * to be the image name.  So "pcdp" below is just filler.
+        */
+       char *console_cmdline = "pcdp console=vga";
+
+       cmdline_parse(console_cmdline);
+
+       /*
+        * Leave efi.hcdp intact since dom0 will take ownership.
+        * vga=keep is handled in start_kernel().
+        */
+
+       return 0;
+#else
+       return -ENODEV;
+#endif
+}
+
+#else /* XEN */
+
 static int __init
 setup_serial_console(struct pcdp_uart *uart)
 {
@@ -184,33 +216,27 @@ setup_vga_console(struct pcdp_vga *vga)
        return -ENODEV;
 #endif
 }
-#endif
+#endif /* XEN */
 
 int __init
 efi_setup_pcdp_console(char *cmdline)
 {
        struct pcdp *pcdp;
        struct pcdp_uart *uart;
-#ifndef XEN
        struct pcdp_device *dev, *end;
-#endif
        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;
        }
 
@@ -220,17 +246,12 @@ efi_setup_pcdp_console(char *cmdline)
        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) {
-#ifndef XEN
                                return setup_serial_console(uart);
-#else
-                               return setup_serial_console(pcdp, uart);
-#endif
                                
                        }
                }
        }
 
-#ifndef XEN
        end = (struct pcdp_device *) ((u8 *) pcdp + pcdp->length);
        for (dev = (struct pcdp_device *) (pcdp->uart + pcdp->num_uarts);
             dev < end;
@@ -241,7 +262,6 @@ efi_setup_pcdp_console(char *cmdline)
                        }
                }
        }
-#endif
-
-       return -ENODEV;
-}
+
+       return -ENODEV;
+}
diff -r fcdd56b88acd xen/arch/ia64/xen/xensetup.c
--- a/xen/arch/ia64/xen/xensetup.c      Thu Jul 19 20:02:04 2007 -0600
+++ b/xen/arch/ia64/xen/xensetup.c      Tue Jul 24 17:04:18 2007 -0600
@@ -546,9 +561,6 @@ printk("num_online_cpus=%d, max_cpus=%d\
             }
         }
         serial_init_postirq();
-
-        /* Hide the HCDP table from dom0 */
-        efi.hcdp = NULL;
     }
 
     expose_p2m_init();



_______________________________________________
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] VGA Fixes (2/3), Alex Williamson <=