Skip to contentSkip to conversation

dt-bindings: serial: imx: clarify rs485 support usage

PATCH New Baruch Siach 4 participants 4 messages Jun 28, 2018 – Jul 3, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 dt-bindings: serial: imx: clarify rs485 support usage

The i.MX UART peripheral uses the RST_B signal as input, and CTS_B as output. This is just like the DCE role in RS-232. This is true regardless of the "DTE mode" setting of this peripheral.

As a result, rs485 support hardware must use the CTS_B signal to control the RS-485 transceiver. This is in contrast to generic rs485 kernel code, documentation, and DT property names that consistently refer to the RTS as transceiver control signal.

Add a note in the DT binding document about that, to reduce the confusion somewhat.

---
v2: Fix commit log typos (Lothar Wa?mann)

---
 Documentation/devicetree/bindings/serial/fsl-imx-uart.txt | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/serial/fsl-imx-uart.txt +5 -1
index afcfbc34e243..35957cbf1571 100644
@@ -9,7 +9,11 @@ Optional properties:
 - fsl,dte-mode : Indicate the uart works in DTE mode. The uart works
                   in DCE mode by default.
 - rs485-rts-delay, rs485-rts-active-low, rs485-rx-during-tx,
-  linux,rs485-enabled-at-boot-time: see rs485.txt
+  linux,rs485-enabled-at-boot-time: see rs485.txt. Note that for RS485
+  you must enable either the "uart-has-rtscts" or the "rts-gpios"
+  properties. In case you use "uart-has-rtscts" the signal that controls
+  the transceiver is actually CTS_B, not RTS_B. CTS_B is always output,
+  and RTS_B is input, regardless of dte-mode.
 
 Please check Documentation/devicetree/bindings/serial/serial.txt
 for the complete list of generic properties.
Signature · 1 line
2.18.0
#1 lore raw

PATCH v2 1/1 dt-bindings: serial: imx: clarify rs485 support usage

Quoted 8 lines · Baruch Siach

The i.MX UART peripheral uses the RST_B signal as input, and CTS_B as output. This is just like the DCE role in RS-232. This is true regardless of the "DTE mode" setting of this peripheral.

As a result, rs485 support hardware must use the CTS_B signal to control the RS-485 transceiver. This is in contrast to generic rs485 kernel code, documentation, and DT property names that consistently refer to the RTS as transceiver control signal.

Well, the reason is that the pin function is called CTS because Freescale chose to name it from the DCE's POV which is unusual. So this isn't exactly specific to rs485 but also affect rs232 operation.

Quoted 15 lines

Add a note in the DT binding document about that, to reduce the confusion somewhat.

---
v2: Fix commit log typos (Lothar Wa?mann)

---
 Documentation/devicetree/bindings/serial/fsl-imx-uart.txt | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/serial/fsl-imx-uart.txt +0 -0
index afcfbc34e243..35957cbf1571 100644

Documentation/devicetree/bindings/serial/fsl-imx-uart.txt Optional properties: · line 16

Quoted 9 lines
Documentation/devicetree/bindings/serial/fsl-imx-uart.txt +5 -1
@@ -9,7 +9,11 @@ Optional properties:
 - fsl,dte-mode : Indicate the uart works in DTE mode. The uart works
                   in DCE mode by default.
 - rs485-rts-delay, rs485-rts-active-low, rs485-rx-during-tx,
-  linux,rs485-enabled-at-boot-time: see rs485.txt
+  linux,rs485-enabled-at-boot-time: see rs485.txt. Note that for RS485
+  you must enable either the "uart-has-rtscts" or the "rts-gpios"
+  properties. In case you use "uart-has-rtscts" the signal that controls
+  the transceiver is actually CTS_B, not RTS_B. CTS_B is always output,
+  and RTS_B is input, regardless of dte-mode.

Still this section is correct and better than what we had (not) before. So:

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
reviewer
#2 lore raw

PATCH v2 1/1 dt-bindings: serial: imx: clarify rs485 support usage

In reply to Baruch Siach

Hi Baruch,

Quoted 9 lines · Baruch Siach

The i.MX UART peripheral uses the RST_B signal as input, and CTS_B as output. This is just like the DCE role in RS-232. This is true regardless of the "DTE mode" setting of this peripheral.

As a result, rs485 support hardware must use the CTS_B signal to control the RS-485 transceiver. This is in contrast to generic rs485 kernel code, documentation, and DT property names that consistently refer to the RTS as transceiver control signal.

Quoted 4 lines

Add a note in the DT binding document about that, to reduce the confusion somewhat.

Yes, this is helpful:

maintainer
#3 lore raw

PATCH v2 1/1 dt-bindings: serial: imx: clarify rs485 support usage

In reply to Baruch Siach
Quoted 1 line · Baruch Siach

The i.MX UART peripheral uses the RST_B signal as input, and CTS_B as

s/RST_B/RTS_B/

Quoted 11 lines

output. This is just like the DCE role in RS-232. This is true regardless of the "DTE mode" setting of this peripheral.

As a result, rs485 support hardware must use the CTS_B signal to control the RS-485 transceiver. This is in contrast to generic rs485 kernel code, documentation, and DT property names that consistently refer to the RTS as transceiver control signal.

Add a note in the DT binding document about that, to reduce the confusion somewhat.

Quoted 6 lines

---
v2: Fix commit log typos (Lothar Wa?mann)

---
 Documentation/devicetree/bindings/serial/fsl-imx-uart.txt | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

With that,