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-changelog

[Xen-changelog] [xen-unstable] [IA64] Fix serial console on Tiger2 & Tig

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [IA64] Fix serial console on Tiger2 & Tiger4
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 23 Feb 2007 09:50:18 -0800
Delivery-date: Fri, 23 Feb 2007 09:50:34 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User awilliam@xxxxxxxxxxxx
# Date 1171473277 25200
# Node ID 6c63ff5488888b836ebc9f04c26757716006db40
# Parent  8bdbe88e422f85f14e1451e6cfc7e8aa2da6a1c8
[IA64] Fix serial console on Tiger2 & Tiger4

I inadvertently broke the serial console on Intel Tiger systems by
assuming they were registering a com1 at 0x3f8.  Instead, unconditionally
register both com ports (the ns16550 driver will throw away any that
don't have baud == 0) and create a function to detect the Tiger systems.
This should setup reasonable default com port values, but they can still
be superceded using com1= and com2= boot time parameters.

Signed-off-by: Alex Williamson <alex.williamson@xxxxxx>
---
 xen/arch/ia64/linux-xen/setup.c |   72 ++++++++++++++++++++++++++++++++++++++++
 xen/arch/ia64/xen/pcdp.c        |    2 -
 xen/arch/ia64/xen/xensetup.c    |    9 -----
 3 files changed, 74 insertions(+), 9 deletions(-)

diff -r 8bdbe88e422f -r 6c63ff548888 xen/arch/ia64/linux-xen/setup.c
--- a/xen/arch/ia64/linux-xen/setup.c   Mon Feb 12 10:10:37 2007 -0700
+++ b/xen/arch/ia64/linux-xen/setup.c   Wed Feb 14 10:14:37 2007 -0700
@@ -314,6 +314,74 @@ io_port_init (void)
        num_io_spaces = 1;
 }
 
+#ifdef XEN
+static int __init
+intel_tiger_console_setup(void)
+{
+       extern struct ns16550_defaults ns16550_com1, ns16550_com2;
+       efi_system_table_t *systab;
+       efi_config_table_t *tables;
+       struct acpi20_table_rsdp *rsdp = NULL;
+       struct acpi_table_xsdt *xsdt;
+       struct acpi_table_header *hdr;
+       int i;
+
+       /* Don't duplicate setup if an HCDP table is present */
+       if (efi.hcdp)
+               return -ENODEV;
+
+       /* Manually walk firmware provided tables to get to the XSDT.  */
+       systab = __va(ia64_boot_param->efi_systab);
+
+       if (!systab || systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE)
+               return -ENODEV;
+
+       tables = __va(systab->tables);
+
+       for (i = 0 ; i < (int)systab->nr_tables && !rsdp ; i++) {
+               if (efi_guidcmp(tables[i].guid, ACPI_20_TABLE_GUID) == 0)
+                       rsdp =
+                            (struct acpi20_table_rsdp *)__va(tables[i].table);
+       }
+
+       if (!rsdp || strncmp(rsdp->signature, RSDP_SIG, sizeof(RSDP_SIG) - 1))
+               return -ENODEV;
+
+       xsdt = (struct acpi_table_xsdt *)__va(rsdp->xsdt_address);
+       hdr = &xsdt->header;
+
+       if (strncmp(hdr->signature, XSDT_SIG, sizeof(XSDT_SIG) - 1))
+               return -ENODEV;
+
+       /* Only looking for Intel systems */
+       if (strncmp(hdr->oem_id, "INTEL", 5))
+               return -ENODEV;
+
+       if (!strncmp(hdr->oem_table_id, "SR870BH2", 8)) {
+               /* Tiger 2 */
+               ns16550_com1.baud = BAUD_AUTO;
+               ns16550_com1.io_base = 0x3f8;
+               ns16550_com1.irq = 4;
+
+               ns16550_com2.baud = BAUD_AUTO;
+               ns16550_com2.io_base = 0x2f8;
+               ns16550_com2.irq = 3;
+
+               return 0;
+
+       } else if (!strncmp(hdr->oem_table_id, "SR870BN4", 8)) {
+               /* Tiger 4 */
+               ns16550_com1.baud = BAUD_AUTO;
+               ns16550_com1.io_base = 0x2f8;
+               ns16550_com1.irq = 3;
+               
+               return 0;
+       }
+
+       return -ENODEV;
+}
+#endif
+
 /**
  * early_console_setup - setup debugging console
  *
@@ -344,6 +412,10 @@ early_console_setup (char *cmdline)
                earlycons++;
 #endif
 
+#ifdef XEN
+       if (!intel_tiger_console_setup())
+               earlycons++;
+#endif
        return (earlycons) ? 0 : -1;
 }
 
diff -r 8bdbe88e422f -r 6c63ff548888 xen/arch/ia64/xen/pcdp.c
--- a/xen/arch/ia64/xen/pcdp.c  Mon Feb 12 10:10:37 2007 -0700
+++ b/xen/arch/ia64/xen/pcdp.c  Wed Feb 14 10:14:37 2007 -0700
@@ -140,7 +140,7 @@ setup_serial_console(struct pcdp *pcdp, 
 setup_serial_console(struct pcdp *pcdp, struct pcdp_uart *uart)
 {
 
-       ns16550_com1.baud = uart->baud;
+       ns16550_com1.baud = uart->baud ? uart->baud : BAUD_AUTO;
        ns16550_com1.io_base = uart->addr.address;
        if (uart->bits)
                ns16550_com1.data_bits = uart->bits;
diff -r 8bdbe88e422f -r 6c63ff548888 xen/arch/ia64/xen/xensetup.c
--- a/xen/arch/ia64/xen/xensetup.c      Mon Feb 12 10:10:37 2007 -0700
+++ b/xen/arch/ia64/xen/xensetup.c      Wed Feb 14 10:14:37 2007 -0700
@@ -147,7 +147,6 @@ void early_cmdline_parse(char **cmdline_
 }
 
 struct ns16550_defaults ns16550_com1 = {
-    .baud      = BAUD_AUTO,
     .data_bits = 8,
     .parity    = 'n',
     .stop_bits = 1
@@ -158,7 +157,6 @@ unsigned int ns16550_com1_trigger;
 unsigned int ns16550_com1_trigger;
 
 struct ns16550_defaults ns16550_com2 = {
-    .baud      = BAUD_AUTO,
     .data_bits = 8,
     .parity    = 'n',
     .stop_bits = 1
@@ -271,12 +269,7 @@ void start_kernel(void)
         hpsim_serial_init();
     else {
         ns16550_init(0, &ns16550_com1);
-        if (ns16550_com1.io_base == 0x3f8) {
-            /* Also init com2 for Tiger4. */
-            ns16550_com2.io_base = 0x2f8;
-            ns16550_com2.irq     = 3;
-            ns16550_init(1, &ns16550_com2);
-        }
+        ns16550_init(1, &ns16550_com2);
     }
     serial_init_preirq();
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [IA64] Fix serial console on Tiger2 & Tiger4, Xen patchbot-unstable <=