1 From decd99704aba1800c3e62a7ed1f5cbd9c5f6526a 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
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.
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.
14 See: https://github.com/raspberrypi/linux/issues/1280
16 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
18 Documentation/devicetree/bindings/serial/pl011.yaml | 6 ++++++
19 drivers/tty/serial/amba-pl011.c | 5 +++++
20 2 files changed, 11 insertions(+)
22 --- a/Documentation/devicetree/bindings/serial/pl011.yaml
23 +++ b/Documentation/devicetree/bindings/serial/pl011.yaml
24 @@ -91,6 +91,12 @@ properties:
28 + cts-event-workaround:
30 + Enables the (otherwise vendor-specific) workaround for the
31 + CTS-induced TX lockup.
37 --- a/drivers/tty/serial/amba-pl011.c
38 +++ b/drivers/tty/serial/amba-pl011.c
39 @@ -2847,6 +2847,11 @@ static int pl011_probe(struct amba_devic
41 return PTR_ERR(uap->clk);
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");
48 uap->reg_offset = vendor->reg_offset;
50 uap->fifosize = vendor->get_fifosize(dev);