Skip to content

Commit 280dedb

Browse files
Bjorn HelgaasLinus Torvalds
authored andcommitted
[PATCH] PCDP: handle tables that don't supply baud rate
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>
1 parent bb93e3a commit 280dedb

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

‎drivers/firmware/pcdp.c‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,15 @@ setup_serial_console(struct pcdp_uart *uart)
2323
{
2424
#ifdef CONFIG_SERIAL_8250_CONSOLE
2525
int mmio;
26-
static char options[64];
26+
static char options[64], *p = options;
2727

2828
mmio = (uart->addr.address_space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY);
29-
snprintf(options, sizeof(options), "console=uart,%s,0x%lx,%lun%d",
30-
mmio ? "mmio" : "io", uart->addr.address, uart->baud,
31-
uart->bits ? uart->bits : 8);
29+
p += sprintf(p, "console=uart,%s,0x%lx",
30+
mmio ? "mmio" : "io", uart->addr.address);
31+
if (uart->baud)
32+
p += sprintf(p, ",%lu", uart->baud);
33+
if (uart->bits)
34+
p += sprintf(p, "n%d", uart->bits);
3235

3336
return early_serial_console_init(options);
3437
#else

‎drivers/firmware/pcdp.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Definitions for PCDP-defined console devices
33
*
44
* v1.0a: http://www.dig64.org/specifications/DIG64_HCDPv10a_01.pdf
5-
* v2.0: http://www.dig64.org/specifications/DIG64_HCDPv20_042804.pdf
5+
* v2.0: http://www.dig64.org/specifications/DIG64_PCDPv20.pdf
66
*
77
* (c) Copyright 2002, 2004 Hewlett-Packard Development Company, L.P.
88
* Khalid Aziz <khalid.aziz@hp.com>

0 commit comments

Comments
 (0)