diff options
author | Timur Tabi <timur@codeaurora.org> | 2017-03-31 18:05:02 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-04-01 05:07:29 -0400 |
commit | e53e597fd4c4a0b6ae58e57d76a240927fd17eaa (patch) | |
tree | 6fcc6f9220d0ec88b84a1c10803690303f34245f | |
parent | 49e1590c2ead870f4ae5568816241c4cb9bc1606 (diff) |
tty: pl011: fix earlycon work-around for QDF2400 erratum 44
The work-around for the Qualcomm Datacenter Technologies QDF2400
erratum 44 sets the "qdf2400_e44_present" global variable if the
work-around is needed. However, this check does not happen until after
earlycon is initialized, which means the work-around is not
used, and the console hangs as soon as it displays one character.
Fixes: d8a4995bcea1 ("tty: pl011: Work around QDF2400 E44 stuck BUSY bit")
Signed-off-by: Timur Tabi <timur@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/amba-pl011.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 56f92d7348bf..b0a377725d63 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c | |||
@@ -2452,18 +2452,37 @@ static void pl011_early_write(struct console *con, const char *s, unsigned n) | |||
2452 | uart_console_write(&dev->port, s, n, pl011_putc); | 2452 | uart_console_write(&dev->port, s, n, pl011_putc); |
2453 | } | 2453 | } |
2454 | 2454 | ||
2455 | /* | ||
2456 | * On non-ACPI systems, earlycon is enabled by specifying | ||
2457 | * "earlycon=pl011,<address>" on the kernel command line. | ||
2458 | * | ||
2459 | * On ACPI ARM64 systems, an "early" console is enabled via the SPCR table, | ||
2460 | * by specifying only "earlycon" on the command line. Because it requires | ||
2461 | * SPCR, the console starts after ACPI is parsed, which is later than a | ||
2462 | * traditional early console. | ||
2463 | * | ||
2464 | * To get the traditional early console that starts before ACPI is parsed, | ||
2465 | * specify the full "earlycon=pl011,<address>" option. | ||
2466 | */ | ||
2455 | static int __init pl011_early_console_setup(struct earlycon_device *device, | 2467 | static int __init pl011_early_console_setup(struct earlycon_device *device, |
2456 | const char *opt) | 2468 | const char *opt) |
2457 | { | 2469 | { |
2458 | if (!device->port.membase) | 2470 | if (!device->port.membase) |
2459 | return -ENODEV; | 2471 | return -ENODEV; |
2460 | 2472 | ||
2461 | device->con->write = qdf2400_e44_present ? | 2473 | /* On QDF2400 SOCs affected by Erratum 44, the "qdf2400_e44" must |
2462 | qdf2400_e44_early_write : pl011_early_write; | 2474 | * also be specified, e.g. "earlycon=pl011,<address>,qdf2400_e44". |
2475 | */ | ||
2476 | if (!strcmp(device->options, "qdf2400_e44")) | ||
2477 | device->con->write = qdf2400_e44_early_write; | ||
2478 | else | ||
2479 | device->con->write = pl011_early_write; | ||
2480 | |||
2463 | return 0; | 2481 | return 0; |
2464 | } | 2482 | } |
2465 | OF_EARLYCON_DECLARE(pl011, "arm,pl011", pl011_early_console_setup); | 2483 | OF_EARLYCON_DECLARE(pl011, "arm,pl011", pl011_early_console_setup); |
2466 | OF_EARLYCON_DECLARE(pl011, "arm,sbsa-uart", pl011_early_console_setup); | 2484 | OF_EARLYCON_DECLARE(pl011, "arm,sbsa-uart", pl011_early_console_setup); |
2485 | EARLYCON_DECLARE(qdf2400_e44, pl011_early_console_setup); | ||
2467 | 2486 | ||
2468 | #else | 2487 | #else |
2469 | #define AMBA_CONSOLE NULL | 2488 | #define AMBA_CONSOLE NULL |