Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: pl011: use "qdf2400_e44" as the earlycon name for QDF2400 E44

Define a new early console name for Qualcomm Datacenter Technologies
QDF2400 SOCs affected by erratum 44, instead of piggy-backing on "pl011".
Previously, to enable traditional (non-SPCR) earlycon, the documentation
said to specify "earlycon=pl011,<address>,qdf2400_e44", but the code was
broken and this didn't actually work.

So instead, the method for specifying the E44 work-around with traditional
earlycon is "earlycon=qdf2400_e44,<address>". Both methods of earlycon
are now enabled with the same function.

Fixes: e53e597fd4c4 ("tty: pl011: fix earlycon work-around for QDF2400 erratum 44")
Signed-off-by: Timur Tabi <timur@codeaurora.org>
Cc: stable <stable@vger.kernel.org> # 4.11
Tested-by: Shanker Donthineni <shankerd@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Timur Tabi and committed by
Greg Kroah-Hartman
5a0722b8 15a06548

+23 -8
+23 -8
drivers/tty/serial/amba-pl011.c
··· 2475 2475 if (!device->port.membase) 2476 2476 return -ENODEV; 2477 2477 2478 - /* On QDF2400 SOCs affected by Erratum 44, the "qdf2400_e44" must 2479 - * also be specified, e.g. "earlycon=pl011,<address>,qdf2400_e44". 2480 - */ 2481 - if (!strcmp(device->options, "qdf2400_e44")) 2482 - device->con->write = qdf2400_e44_early_write; 2483 - else 2484 - device->con->write = pl011_early_write; 2478 + device->con->write = pl011_early_write; 2485 2479 2486 2480 return 0; 2487 2481 } 2488 2482 OF_EARLYCON_DECLARE(pl011, "arm,pl011", pl011_early_console_setup); 2489 2483 OF_EARLYCON_DECLARE(pl011, "arm,sbsa-uart", pl011_early_console_setup); 2490 - EARLYCON_DECLARE(qdf2400_e44, pl011_early_console_setup); 2484 + 2485 + /* 2486 + * On Qualcomm Datacenter Technologies QDF2400 SOCs affected by 2487 + * Erratum 44, traditional earlycon can be enabled by specifying 2488 + * "earlycon=qdf2400_e44,<address>". Any options are ignored. 2489 + * 2490 + * Alternatively, you can just specify "earlycon", and the early console 2491 + * will be enabled with the information from the SPCR table. In this 2492 + * case, the SPCR code will detect the need for the E44 work-around, 2493 + * and set the console name to "qdf2400_e44". 2494 + */ 2495 + static int __init 2496 + qdf2400_e44_early_console_setup(struct earlycon_device *device, 2497 + const char *opt) 2498 + { 2499 + if (!device->port.membase) 2500 + return -ENODEV; 2501 + 2502 + device->con->write = qdf2400_e44_early_write; 2503 + return 0; 2504 + } 2505 + EARLYCON_DECLARE(qdf2400_e44, qdf2400_e44_early_console_setup); 2491 2506 2492 2507 #else 2493 2508 #define AMBA_CONSOLE NULL