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

Re: [Xen-ia64-devel] serial console settings on Tiger4

On Fri, 2007-02-09 at 09:26 -0700, Alex Williamson wrote:

>    If anyone wants to write some auto-detection of these, it should be
> pretty easy.  I would start with something like
> xen/arch/ia64/xen/pcdp.c:pcdp_hp_irq_fixup(), determine you're on a
> Tiger2 or Tiger4 based on XSDT oem_id and oem_table_id and poke the
> right values into the ns16550_com1 and ns16550_com2 structures.  Based
> on google searches for boot logs, you're probably looking for "INTEL"
> and "SR870xxx", where the last 3 characters of the oem_table_id might
> distinguish between a Tiger2 and Tiger4.  Thanks,

   I went ahead and wrote some code for this.  The patch below should be
able to detect between a SR870BH2 (Tiger2, I think) and a SR870BN4
(Tiger4, I hope).  Could someone with these systems please fill in the
appropriate ns16550_com1/com2 value and try it out?  I took a guess, but
have no idea if they're correct.  If Tiger4 only has one exposed UART, I
think we should probably set it up as com1.  The ns16550 code should be
able to read the baud out of the UART, so if all goes well, maybe Tiger
users won't have to specify all those console parameters that they do
now.  This patch should be used in addition to the previous patch I sent
out in this thread.  Thanks,

        Alex

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

diff -r 3050c8339da6 xen/arch/ia64/linux-xen/setup.c
--- a/xen/arch/ia64/linux-xen/setup.c   Thu Feb 08 18:18:56 2007 +0000
+++ b/xen/arch/ia64/linux-xen/setup.c   Fri Feb 09 10:38:35 2007 -0700
@@ -314,6 +314,76 @@ 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", sizeof(hdr->oem_id)))
+               return -ENODEV;
+
+       if (!strncmp(hdr->oem_table_id, "SR870BH2",
+                    sizeof(hdr->oem_table_id))) {
+               /* 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",
+                           sizeof(hdr->oem_table_id))) {
+               /* 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 +414,10 @@ early_console_setup (char *cmdline)
                earlycons++;
 #endif
 
+#ifdef XEN
+       if (!intel_tiger_console_setup())
+               earlycons++;
+#endif
        return (earlycons) ? 0 : -1;
 }
 



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