public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] dt-bindings: serial: imx: clarify rs485 support usage
@ 2018-06-28  7:25 Baruch Siach
  2018-06-28  8:14 ` Uwe Kleine-König
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Baruch Siach @ 2018-06-28  7:25 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Greg Kroah-Hartman
  Cc: devicetree, Baruch Siach, linux-serial, Uwe Kleine-König,
	linux-arm-kernel, Lothar Waßmann

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.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
v2: Fix commit log typos (Lothar Waßmann)
---
 Documentation/devicetree/bindings/serial/fsl-imx-uart.txt | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/serial/fsl-imx-uart.txt b/Documentation/devicetree/bindings/serial/fsl-imx-uart.txt
index afcfbc34e243..35957cbf1571 100644
--- a/Documentation/devicetree/bindings/serial/fsl-imx-uart.txt
+++ b/Documentation/devicetree/bindings/serial/fsl-imx-uart.txt
@@ -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.
-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] dt-bindings: serial: imx: clarify rs485 support usage
  2018-06-28  7:25 [PATCH v2] dt-bindings: serial: imx: clarify rs485 support usage Baruch Siach
@ 2018-06-28  8:14 ` Uwe Kleine-König
  2018-06-28 16:30 ` Fabio Estevam
  2018-07-03 23:10 ` Rob Herring
  2 siblings, 0 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2018-06-28  8:14 UTC (permalink / raw)
  To: Baruch Siach
  Cc: devicetree, linux-serial, Greg Kroah-Hartman, Sascha Hauer,
	NXP Linux Team, Pengutronix Kernel Team, Fabio Estevam, Shawn Guo,
	linux-arm-kernel, Lothar Waßmann

On Thu, Jun 28, 2018 at 10:25:32AM +0300, Baruch Siach wrote:
> 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.

> Add a note in the DT binding document about that, to reduce the
> confusion somewhat.
> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
> v2: Fix commit log typos (Lothar Waßmann)
> ---
>  Documentation/devicetree/bindings/serial/fsl-imx-uart.txt | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/serial/fsl-imx-uart.txt b/Documentation/devicetree/bindings/serial/fsl-imx-uart.txt
> index afcfbc34e243..35957cbf1571 100644
> --- a/Documentation/devicetree/bindings/serial/fsl-imx-uart.txt
> +++ b/Documentation/devicetree/bindings/serial/fsl-imx-uart.txt
> @@ -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:
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] dt-bindings: serial: imx: clarify rs485 support usage
  2018-06-28  7:25 [PATCH v2] dt-bindings: serial: imx: clarify rs485 support usage Baruch Siach
  2018-06-28  8:14 ` Uwe Kleine-König
@ 2018-06-28 16:30 ` Fabio Estevam
  2018-07-03 23:10 ` Rob Herring
  2 siblings, 0 replies; 4+ messages in thread
From: Fabio Estevam @ 2018-06-28 16:30 UTC (permalink / raw)
  To: Baruch Siach
  Cc: open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	linux-serial, Greg Kroah-Hartman, Sascha Hauer, NXP Linux Team,
	Pengutronix Kernel Team, Uwe Kleine-König, Fabio Estevam,
	Shawn Guo,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	Lothar Waßmann

Hi Baruch,

On Thu, Jun 28, 2018 at 4:25 AM, Baruch Siach <baruch@tkos.co.il> wrote:
> 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.
>
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>

Yes, this is helpful:

Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] dt-bindings: serial: imx: clarify rs485 support usage
  2018-06-28  7:25 [PATCH v2] dt-bindings: serial: imx: clarify rs485 support usage Baruch Siach
  2018-06-28  8:14 ` Uwe Kleine-König
  2018-06-28 16:30 ` Fabio Estevam
@ 2018-07-03 23:10 ` Rob Herring
  2 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2018-07-03 23:10 UTC (permalink / raw)
  To: Baruch Siach
  Cc: devicetree, linux-serial, Greg Kroah-Hartman, Sascha Hauer,
	NXP Linux Team, Pengutronix Kernel Team, Uwe Kleine-König,
	Fabio Estevam, Shawn Guo, linux-arm-kernel, Lothar Waßmann

On Thu, Jun 28, 2018 at 10:25:32AM +0300, Baruch Siach wrote:
> The i.MX UART peripheral uses the RST_B signal as input, and CTS_B as

s/RST_B/RTS_B/

> 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.
> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
> 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,

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-07-03 23:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-28  7:25 [PATCH v2] dt-bindings: serial: imx: clarify rs485 support usage Baruch Siach
2018-06-28  8:14 ` Uwe Kleine-König
2018-06-28 16:30 ` Fabio Estevam
2018-07-03 23:10 ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox