diff options
author | zbb <zbb@FreeBSD.org> | 2016-01-20 13:51:14 +0000 |
---|---|---|
committer | zbb <zbb@FreeBSD.org> | 2016-01-20 13:51:14 +0000 |
commit | 19b37ef8afb9fde30a55cb62fc4d4a5b6de7613d (patch) | |
tree | 874c6b84a353064a8caaf957674be82bdbe24056 | |
parent | 5650a12965765b4bd92330ad77e219939ba96523 (diff) | |
download | FreeBSD-src-19b37ef8afb9fde30a55cb62fc4d4a5b6de7613d.zip FreeBSD-src-19b37ef8afb9fde30a55cb62fc4d4a5b6de7613d.tar.gz |
Fix busy-detect when using DesignWare UART
uart_dev_ns8250 now relies on compatible property instead of additional
'busy-detect' cell. All drivers with compatible = "snps,dw-apb-uart" have
busy detection turned on. DTS files of devices affected by the change
were modified and 'busy-detect' property was removed.
Reviewed by: andrew, ian, imp
Obtained from: Semihalf
Sponsored by: Stormshield
Submitted by: Bartosz Szczepanek <bsz@semihalf.com>
Differential revision: https://reviews.freebsd.org/D4218
-rw-r--r-- | sys/boot/fdt/dts/arm/db78460.dts | 12 | ||||
-rw-r--r-- | sys/boot/fdt/dts/arm/rk3188.dtsi | 12 | ||||
-rw-r--r-- | sys/boot/fdt/dts/arm/sun4i-a10.dtsi | 3 | ||||
-rw-r--r-- | sys/boot/fdt/dts/arm/sun7i-a20.dtsi | 3 | ||||
-rw-r--r-- | sys/dev/uart/uart_dev_ns8250.c | 7 |
5 files changed, 15 insertions, 22 deletions
diff --git a/sys/boot/fdt/dts/arm/db78460.dts b/sys/boot/fdt/dts/arm/db78460.dts index 1407f62..8bc04f8 100644 --- a/sys/boot/fdt/dts/arm/db78460.dts +++ b/sys/boot/fdt/dts/arm/db78460.dts @@ -111,45 +111,41 @@ }; serial0: serial@12000 { - compatible = "ns16550"; + compatible = "snps,dw-apb-uart"; reg = <0x12000 0x20>; reg-shift = <2>; current-speed = <115200>; clock-frequency = <0>; - busy-detect = <1>; interrupts = <41>; interrupt-parent = <&MPIC>; }; serial1: serial@12100 { - compatible = "ns16550"; + compatible = "snps,dw-apb-uart"; reg = <0x12100 0x20>; reg-shift = <2>; current-speed = <115200>; clock-frequency = <0>; - busy-detect = <1>; interrupts = <42>; interrupt-parent = <&MPIC>; }; serial2: serial@12200 { - compatible = "ns16550"; + compatible = "snps,dw-apb-uart"; reg = <0x12200 0x20>; reg-shift = <2>; current-speed = <115200>; clock-frequency = <0>; - busy-detect = <1>; interrupts = <43>; interrupt-parent = <&MPIC>; }; serial3: serial@12300 { - compatible = "ns16550"; + compatible = "snps,dw-apb-uart"; reg = <0x12300 0x20>; reg-shift = <2>; current-speed = <115200>; clock-frequency = <0>; - busy-detect = <1>; interrupts = <44>; interrupt-parent = <&MPIC>; }; diff --git a/sys/boot/fdt/dts/arm/rk3188.dtsi b/sys/boot/fdt/dts/arm/rk3188.dtsi index f16c1b8..66284aa 100644 --- a/sys/boot/fdt/dts/arm/rk3188.dtsi +++ b/sys/boot/fdt/dts/arm/rk3188.dtsi @@ -179,53 +179,49 @@ }; uart0: serial@10124000 { - compatible = "ns16550"; + compatible = "snps,dw-apb-uart"; reg = <0x10124000 0x400>; reg-shift = <2>; interrupts = <66>; interrupt-parent = <&GIC>; current-speed = <115200>; clock-frequency = < 24000000 >; - busy-detect = <1>; broken-txfifo = <1>; status = "disabled"; }; uart1: serial@10126000 { - compatible = "ns16550"; + compatible = "snps,dw-apb-uart"; reg = <0x10126000 0x400>; reg-shift = <2>; interrupts = <67>; interrupt-parent = <&GIC>; current-speed = <115200>; clock-frequency = < 24000000 >; - busy-detect = <1>; broken-txfifo = <1>; status = "disabled"; }; uart2: serial@20064000 { - compatible = "ns16550"; + compatible = "snps,dw-apb-uart"; reg = <0x20064000 0x400>; reg-shift = <2>; interrupts = <68>; interrupt-parent = <&GIC>; current-speed = <115200>; clock-frequency = < 24000000 >; - busy-detect = <1>; broken-txfifo = <1>; status = "disabled"; }; uart3: serial@20068000 { - compatible = "ns16550"; + compatible = "snps,dw-apb-uart"; reg = <0x20068000 0x400>; reg-shift = <2>; interrupts = <69>; interrupt-parent = <&GIC>; current-speed = <115200>; clock-frequency = < 24000000 >; - busy-detect = <1>; broken-txfifo = <1>; status = "disabled"; }; diff --git a/sys/boot/fdt/dts/arm/sun4i-a10.dtsi b/sys/boot/fdt/dts/arm/sun4i-a10.dtsi index 03e2883..8b32725 100644 --- a/sys/boot/fdt/dts/arm/sun4i-a10.dtsi +++ b/sys/boot/fdt/dts/arm/sun4i-a10.dtsi @@ -120,14 +120,13 @@ }; UART0: serial@01c28000 { - compatible = "ns16550"; + compatible = "snps,dw-apb-uart"; reg = <0x01c28000 0x400>; reg-shift = <2>; interrupts = <1>; interrupt-parent = <&AINTC>; current-speed = <115200>; clock-frequency = < 24000000 >; - busy-detect = <1>; }; emac@01c0b000 { diff --git a/sys/boot/fdt/dts/arm/sun7i-a20.dtsi b/sys/boot/fdt/dts/arm/sun7i-a20.dtsi index e468677..b559e5e 100644 --- a/sys/boot/fdt/dts/arm/sun7i-a20.dtsi +++ b/sys/boot/fdt/dts/arm/sun7i-a20.dtsi @@ -126,14 +126,13 @@ }; UART0: serial@01c28000 { - compatible = "ns16550"; + compatible = "snps,dw-apb-uart"; reg = <0x01c28000 0x400>; reg-shift = <2>; interrupts = <1>; interrupt-parent = <&GIC>; current-speed = <115200>; clock-frequency = < 24000000 >; - busy-detect = <1>; }; emac@01c0b000 { diff --git a/sys/dev/uart/uart_dev_ns8250.c b/sys/dev/uart/uart_dev_ns8250.c index 68d3ff9..3bba676 100644 --- a/sys/dev/uart/uart_dev_ns8250.c +++ b/sys/dev/uart/uart_dev_ns8250.c @@ -457,9 +457,12 @@ ns8250_bus_attach(struct uart_softc *sc) * Check whether uart requires to read USR reg when IIR_BUSY and * has broken txfifo. */ + ns8250->busy_detect = ofw_bus_is_compatible(sc->sc_dev, "snps,dw-apb-uart"); node = ofw_bus_get_node(sc->sc_dev); - if ((OF_getencprop(node, "busy-detect", &cell, sizeof(cell))) > 0) - ns8250->busy_detect = cell ? 1 : 0; + /* XXX: This is kept for a short time for compatibility with older device trees */ + if ((OF_getencprop(node, "busy-detect", &cell, sizeof(cell))) > 0 + && cell != 0) + ns8250->busy_detect = 1; if ((OF_getencprop(node, "broken-txfifo", &cell, sizeof(cell))) > 0) broken_txfifo = cell ? 1 : 0; #endif |