[PATCH 07/10] arm64: dts: imx8mp-skov: configure uart1 for RS485

Ahmad Fatoum posted 10 patches 12 months ago
There is a newer version of this series
[PATCH 07/10] arm64: dts: imx8mp-skov: configure uart1 for RS485
Posted by Ahmad Fatoum 12 months ago
uart1 TX, RX and RTS signals go off the base board and to a RS485
transceiver. Describe this in the device tree.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm64/boot/dts/freescale/imx8mp-skov-reva.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mp-skov-reva.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-skov-reva.dtsi
index 7ae686d37dda..bce23d62cd27 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp-skov-reva.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp-skov-reva.dtsi
@@ -404,6 +404,13 @@ &uart1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_uart1>;
 	status = "okay";
+	/*
+	 * While there is no CTS line, the property "uart-has-rtscts" is still
+	 * the right thing to do to enable the UART to do RS485. In RS485-Mode
+	 * CTS isn't used anyhow and there is no dedicated property
+	 * "uart-has-rts-but-no-cts".
+	 */
+	uart-has-rtscts;
 };
 
 &uart2 {
@@ -618,6 +625,8 @@ pinctrl_uart1: uart1grp {
 			MX8MP_IOMUXC_UART1_RXD__UART1_DCE_RX			0x140
 			MX8MP_IOMUXC_UART1_TXD__UART1_DCE_TX			0x140
 			MX8MP_IOMUXC_UART3_RXD__UART1_DTE_RTS			0x140
+			/* CTS pin is not connected, but needed as workaround */
+			MX8MP_IOMUXC_UART3_TXD__UART1_DTE_CTS			0x140
 		>;
 	};
 

-- 
2.39.5
Re: [PATCH 07/10] arm64: dts: imx8mp-skov: configure uart1 for RS485
Posted by Frank Li 12 months ago
On Thu, Dec 19, 2024 at 08:25:31AM +0100, Ahmad Fatoum wrote:
> uart1 TX, RX and RTS signals go off the base board and to a RS485
> transceiver. Describe this in the device tree.

Look like it is not related what your did in this patch.

Add uart-has-rtscts in uart1 to ... (because ....)

Frank
>
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  arch/arm64/boot/dts/freescale/imx8mp-skov-reva.dtsi | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/freescale/imx8mp-skov-reva.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-skov-reva.dtsi
> index 7ae686d37dda..bce23d62cd27 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mp-skov-reva.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mp-skov-reva.dtsi
> @@ -404,6 +404,13 @@ &uart1 {
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&pinctrl_uart1>;
>  	status = "okay";
> +	/*
> +	 * While there is no CTS line, the property "uart-has-rtscts" is still
> +	 * the right thing to do to enable the UART to do RS485. In RS485-Mode
> +	 * CTS isn't used anyhow and there is no dedicated property
> +	 * "uart-has-rts-but-no-cts".
> +	 */
> +	uart-has-rtscts;
>  };
>
>  &uart2 {
> @@ -618,6 +625,8 @@ pinctrl_uart1: uart1grp {
>  			MX8MP_IOMUXC_UART1_RXD__UART1_DCE_RX			0x140
>  			MX8MP_IOMUXC_UART1_TXD__UART1_DCE_TX			0x140
>  			MX8MP_IOMUXC_UART3_RXD__UART1_DTE_RTS			0x140
> +			/* CTS pin is not connected, but needed as workaround */

what' means here! what's problem to be workaround?

> +			MX8MP_IOMUXC_UART3_TXD__UART1_DTE_CTS			0x140
>  		>;
>  	};
>
>
> --
> 2.39.5
>
Re: [PATCH 07/10] arm64: dts: imx8mp-skov: configure uart1 for RS485
Posted by Ahmad Fatoum 12 months ago
On 19.12.24 18:42, Frank Li wrote:
> On Thu, Dec 19, 2024 at 08:25:31AM +0100, Ahmad Fatoum wrote:
>> uart1 TX, RX and RTS signals go off the base board and to a RS485
>> transceiver. Describe this in the device tree.
> 
> Look like it is not related what your did in this patch.
> 
> Add uart-has-rtscts in uart1 to ... (because ....)

because they go off to the base board to a RS485 transceiver?

>> +	/*
>> +	 * While there is no CTS line, the property "uart-has-rtscts" is still
>> +	 * the right thing to do to enable the UART to do RS485. In RS485-Mode
>> +	 * CTS isn't used anyhow and there is no dedicated property
>> +	 * "uart-has-rts-but-no-cts".
>> +	 */
>> +	uart-has-rtscts;
>>  };
>>
>>  &uart2 {
>> @@ -618,6 +625,8 @@ pinctrl_uart1: uart1grp {
>>  			MX8MP_IOMUXC_UART1_RXD__UART1_DCE_RX			0x140
>>  			MX8MP_IOMUXC_UART1_TXD__UART1_DCE_TX			0x140
>>  			MX8MP_IOMUXC_UART3_RXD__UART1_DTE_RTS			0x140
>> +			/* CTS pin is not connected, but needed as workaround */
> 
> what' means here! what's problem to be workaround?

See the more descriptive comment above. We don't actually have CTS connected in hardware,
but we mux it anyway, so the i.MX UART is cleared to send always.

Thanks,
Ahmad

> 
>> +			MX8MP_IOMUXC_UART3_TXD__UART1_DTE_CTS			0x140
>>  		>;
>>  	};
>>
>>
>> --
>> 2.39.5
>>
> 


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |