brcm63xx: rename target to bcm63xx
[openwrt/staging/wigyori.git] / target / linux / brcm2708 / patches-4.19 / 950-0036-amba_pl011-Add-cts-event-workaround-DT-property.patch
1 From 17a4507175ca6018ea40e91c9d753bc39f043d99 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Fri, 29 Sep 2017 10:32:19 +0100
4 Subject: [PATCH] amba_pl011: Add cts-event-workaround DT property
5
6 The BCM2835 PL011 implementation seems to have a bug that can lead to a
7 transmission lockup if CTS changes frequently. A workaround was added to
8 the driver with a vendor-specific flag to enable it, but this flag is
9 currently not set for ARM implementations.
10
11 Add a "cts-event-workaround" property to Pi DTBs and use the presence
12 of that property to force the flag to be enabled in the driver.
13
14 See: https://github.com/raspberrypi/linux/issues/1280
15
16 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
17 ---
18 Documentation/devicetree/bindings/serial/pl011.txt | 3 +++
19 drivers/tty/serial/amba-pl011.c | 5 +++++
20 2 files changed, 8 insertions(+)
21
22 --- a/Documentation/devicetree/bindings/serial/pl011.txt
23 +++ b/Documentation/devicetree/bindings/serial/pl011.txt
24 @@ -35,6 +35,9 @@ Optional properties:
25 - poll-timeout-ms:
26 Poll timeout when auto-poll is set, default
27 3000ms.
28 +- cts-event-workaround:
29 + Enables the (otherwise vendor-specific) workaround for the
30 + CTS-induced TX lockup.
31
32 See also bindings/arm/primecell.txt
33
34 --- a/drivers/tty/serial/amba-pl011.c
35 +++ b/drivers/tty/serial/amba-pl011.c
36 @@ -2659,6 +2659,11 @@ static int pl011_probe(struct amba_devic
37 if (IS_ERR(uap->clk))
38 return PTR_ERR(uap->clk);
39
40 + if (of_property_read_bool(dev->dev.of_node, "cts-event-workaround")) {
41 + vendor->cts_event_workaround = true;
42 + dev_info(&dev->dev, "cts_event_workaround enabled\n");
43 + }
44 +
45 uap->reg_offset = vendor->reg_offset;
46 uap->vendor = vendor;
47 uap->fifosize = vendor->get_fifosize(dev);