]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.11.2/tty-pl011-use-qdf2400_e44-as-the-earlycon-name-for-qdf2400-e44.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.11.2 / tty-pl011-use-qdf2400_e44-as-the-earlycon-name-for-qdf2400-e44.patch
CommitLineData
12ecb97d
GKH
1From 5a0722b898f851b9ef108ea7babc529e4efc773d Mon Sep 17 00:00:00 2001
2From: Timur Tabi <timur@codeaurora.org>
3Date: Thu, 13 Apr 2017 08:55:08 -0500
4Subject: tty: pl011: use "qdf2400_e44" as the earlycon name for QDF2400 E44
5
6From: Timur Tabi <timur@codeaurora.org>
7
8commit 5a0722b898f851b9ef108ea7babc529e4efc773d upstream.
9
10Define a new early console name for Qualcomm Datacenter Technologies
11QDF2400 SOCs affected by erratum 44, instead of piggy-backing on "pl011".
12Previously, to enable traditional (non-SPCR) earlycon, the documentation
13said to specify "earlycon=pl011,<address>,qdf2400_e44", but the code was
14broken and this didn't actually work.
15
16So instead, the method for specifying the E44 work-around with traditional
17earlycon is "earlycon=qdf2400_e44,<address>". Both methods of earlycon
18are now enabled with the same function.
19
20Fixes: e53e597fd4c4 ("tty: pl011: fix earlycon work-around for QDF2400 erratum 44")
21Signed-off-by: Timur Tabi <timur@codeaurora.org>
22Tested-by: Shanker Donthineni <shankerd@codeaurora.org>
23Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24
25---
26 drivers/tty/serial/amba-pl011.c | 31 +++++++++++++++++++++++--------
27 1 file changed, 23 insertions(+), 8 deletions(-)
28
29--- a/drivers/tty/serial/amba-pl011.c
30+++ b/drivers/tty/serial/amba-pl011.c
31@@ -2470,19 +2470,34 @@ static int __init pl011_early_console_se
32 if (!device->port.membase)
33 return -ENODEV;
34
35- /* On QDF2400 SOCs affected by Erratum 44, the "qdf2400_e44" must
36- * also be specified, e.g. "earlycon=pl011,<address>,qdf2400_e44".
37- */
38- if (!strcmp(device->options, "qdf2400_e44"))
39- device->con->write = qdf2400_e44_early_write;
40- else
41- device->con->write = pl011_early_write;
42+ device->con->write = pl011_early_write;
43
44 return 0;
45 }
46 OF_EARLYCON_DECLARE(pl011, "arm,pl011", pl011_early_console_setup);
47 OF_EARLYCON_DECLARE(pl011, "arm,sbsa-uart", pl011_early_console_setup);
48-EARLYCON_DECLARE(qdf2400_e44, pl011_early_console_setup);
49+
50+/*
51+ * On Qualcomm Datacenter Technologies QDF2400 SOCs affected by
52+ * Erratum 44, traditional earlycon can be enabled by specifying
53+ * "earlycon=qdf2400_e44,<address>". Any options are ignored.
54+ *
55+ * Alternatively, you can just specify "earlycon", and the early console
56+ * will be enabled with the information from the SPCR table. In this
57+ * case, the SPCR code will detect the need for the E44 work-around,
58+ * and set the console name to "qdf2400_e44".
59+ */
60+static int __init
61+qdf2400_e44_early_console_setup(struct earlycon_device *device,
62+ const char *opt)
63+{
64+ if (!device->port.membase)
65+ return -ENODEV;
66+
67+ device->con->write = qdf2400_e44_early_write;
68+ return 0;
69+}
70+EARLYCON_DECLARE(qdf2400_e44, qdf2400_e44_early_console_setup);
71
72 #else
73 #define AMBA_CONSOLE NULL