Commit e53e597f authored by Timur Tabi's avatar Timur Tabi Committed by Greg Kroah-Hartman

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: d8a4995b ("tty: pl011: Work around QDF2400 E44 stuck BUSY bit")
Signed-off-by: default avatarTimur Tabi <timur@codeaurora.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 49e1590c
...@@ -2452,18 +2452,37 @@ static void pl011_early_write(struct console *con, const char *s, unsigned n) ...@@ -2452,18 +2452,37 @@ static void pl011_early_write(struct console *con, const char *s, unsigned n)
uart_console_write(&dev->port, s, n, pl011_putc); uart_console_write(&dev->port, s, n, pl011_putc);
} }
/*
* On non-ACPI systems, earlycon is enabled by specifying
* "earlycon=pl011,<address>" on the kernel command line.
*
* On ACPI ARM64 systems, an "early" console is enabled via the SPCR table,
* by specifying only "earlycon" on the command line. Because it requires
* SPCR, the console starts after ACPI is parsed, which is later than a
* traditional early console.
*
* To get the traditional early console that starts before ACPI is parsed,
* specify the full "earlycon=pl011,<address>" option.
*/
static int __init pl011_early_console_setup(struct earlycon_device *device, static int __init pl011_early_console_setup(struct earlycon_device *device,
const char *opt) const char *opt)
{ {
if (!device->port.membase) if (!device->port.membase)
return -ENODEV; return -ENODEV;
device->con->write = qdf2400_e44_present ? /* On QDF2400 SOCs affected by Erratum 44, the "qdf2400_e44" must
qdf2400_e44_early_write : pl011_early_write; * also be specified, e.g. "earlycon=pl011,<address>,qdf2400_e44".
*/
if (!strcmp(device->options, "qdf2400_e44"))
device->con->write = qdf2400_e44_early_write;
else
device->con->write = pl011_early_write;
return 0; return 0;
} }
OF_EARLYCON_DECLARE(pl011, "arm,pl011", pl011_early_console_setup); OF_EARLYCON_DECLARE(pl011, "arm,pl011", pl011_early_console_setup);
OF_EARLYCON_DECLARE(pl011, "arm,sbsa-uart", pl011_early_console_setup); OF_EARLYCON_DECLARE(pl011, "arm,sbsa-uart", pl011_early_console_setup);
EARLYCON_DECLARE(qdf2400_e44, pl011_early_console_setup);
#else #else
#define AMBA_CONSOLE NULL #define AMBA_CONSOLE NULL
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment