[PATCH] PCDP: handle tables that don't supply baud rate
authorBjorn Helgaas <bjorn.helgaas@hp.com>
Thu, 23 Jun 2005 07:10:16 +0000 (00:10 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 23 Jun 2005 16:45:32 +0000 (09:45 -0700)
The HCDP specs (i.e., PCDP revision < 3) allow zero as a default value for
baud rate and data bits.  So if firmware doesn't supply them, let
early_serial_console_init() probe for them rather than telling it the baud
rate is zero.

Also, update the URL for the PCDP spec.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/firmware/pcdp.c
drivers/firmware/pcdp.h

index df1b721154d2728504541e023a43701db5e6d2f5..839b44a7e08bea58dba9ad8e1e459dff30c44afe 100644 (file)
@@ -23,12 +23,15 @@ setup_serial_console(struct pcdp_uart *uart)
 {
 #ifdef CONFIG_SERIAL_8250_CONSOLE
        int mmio;
-       static char options[64];
+       static char options[64], *p = options;
 
        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);
+       p += sprintf(p, "console=uart,%s,0x%lx",
+               mmio ? "mmio" : "io", uart->addr.address);
+       if (uart->baud)
+               p += sprintf(p, ",%lu", uart->baud);
+       if (uart->bits)
+               p += sprintf(p, "n%d", uart->bits);
 
        return early_serial_console_init(options);
 #else
index 863bb6f768c37238e6bf205333517125668887eb..1dc7c88b7b4dd06e37f74e0766a8c208c8b41218 100644 (file)
@@ -2,7 +2,7 @@
  * Definitions for PCDP-defined console devices
  *
  * v1.0a: http://www.dig64.org/specifications/DIG64_HCDPv10a_01.pdf
- * v2.0:  http://www.dig64.org/specifications/DIG64_HCDPv20_042804.pdf
+ * v2.0:  http://www.dig64.org/specifications/DIG64_PCDPv20.pdf
  *
  * (c) Copyright 2002, 2004 Hewlett-Packard Development Company, L.P.
  *     Khalid Aziz <khalid.aziz@hp.com>