bcm27xx: update patches from RPi foundation
[oweals/openwrt.git] / target / linux / bcm27xx / patches-5.4 / 950-0034-amba_pl011-Add-cts-event-workaround-DT-property.patch
1 From 2cb280484c8dde281972690cd67299005a796485 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.yaml | 6 ++++++
19  drivers/tty/serial/amba-pl011.c                     | 5 +++++
20  2 files changed, 11 insertions(+)
21
22 --- a/Documentation/devicetree/bindings/serial/pl011.yaml
23 +++ b/Documentation/devicetree/bindings/serial/pl011.yaml
24 @@ -100,6 +100,12 @@ properties:
25        - $ref: /schemas/types.yaml#/definitions/uint32
26        - default: 3000
27  
28 +  cts-event-workaround:
29 +    description:
30 +      Enables the (otherwise vendor-specific) workaround for the
31 +      CTS-induced TX lockup.
32 +    type: boolean
33 +
34  required:
35    - compatible
36    - reg
37 --- a/drivers/tty/serial/amba-pl011.c
38 +++ b/drivers/tty/serial/amba-pl011.c
39 @@ -2659,6 +2659,11 @@ static int pl011_probe(struct amba_devic
40         if (IS_ERR(uap->clk))
41                 return PTR_ERR(uap->clk);
42  
43 +       if (of_property_read_bool(dev->dev.of_node, "cts-event-workaround")) {
44 +           vendor->cts_event_workaround = true;
45 +           dev_info(&dev->dev, "cts_event_workaround enabled\n");
46 +       }
47 +
48         uap->reg_offset = vendor->reg_offset;
49         uap->vendor = vendor;
50         uap->fifosize = vendor->get_fifosize(dev);