* Wrong RS485 RTS polarity in 8250 OMAP UART Driver vs DT binding?
@ 2023-03-15 20:41 Francesco Dolcini
2023-03-16 9:51 ` Lukas Wunner
0 siblings, 1 reply; 2+ messages in thread
From: Francesco Dolcini @ 2023-03-15 20:41 UTC (permalink / raw)
To: Lukas Wunner, Vignesh Raghavendra, Bin Liu, linux-serial, Zeng Chao
Cc: Rob Herring, Greg Kroah-Hartman, Jiri Slaby, ilpo.jarvinen, tony,
andriy.shevchenko, matthias.schiffer, linux-kernel,
Max Krummenacher
Hello all,
I have been recently working on RS485 on a TI K3 AM62 (using 8250_omap.c
driver) and there is something that I do not really understand about
the RTS polarity.
According to the DT binding (Documentation/devicetree/bindings/serial/rs485.yaml)
when `rs485-rts-active-low` is present the behavior should be "drive RTS
low when sending", however in the code it seems that this is handled the
opposite way (drivers/tty/serial/8250/8250_omap.c:861).
/*
* Retain same polarity semantics as RS485 software emulation,
* i.e. SER_RS485_RTS_ON_SEND means driving RTS low on send.
*/
We have working hardware, using another UART that expect
rs485-rts-active-low, and the exact same HW, when using OMAP uart,
requires rs485-rts-active-high (the HW is modular, so we are really just
changing the uart, keeping the same RS485 transceiver / connections).
What's going on there? Is the semantic of the 8250_omap driver just the
opposite as it should be? Am I doing something wrong in the device tree?
This is the relevant DTS part.
&main_uart1 {
linux,rs485-enabled-at-boot-time;
rs485-rts-active-high;
rs485-rx-during-tx;
status = "okay";
};
Francesco
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: Wrong RS485 RTS polarity in 8250 OMAP UART Driver vs DT binding?
2023-03-15 20:41 Wrong RS485 RTS polarity in 8250 OMAP UART Driver vs DT binding? Francesco Dolcini
@ 2023-03-16 9:51 ` Lukas Wunner
0 siblings, 0 replies; 2+ messages in thread
From: Lukas Wunner @ 2023-03-16 9:51 UTC (permalink / raw)
To: Francesco Dolcini
Cc: Vignesh Raghavendra, Bin Liu, linux-serial, Zeng Chao,
Rob Herring, Greg Kroah-Hartman, Jiri Slaby, ilpo.jarvinen, tony,
andriy.shevchenko, matthias.schiffer, linux-kernel,
Max Krummenacher
On Wed, Mar 15, 2023 at 09:41:56PM +0100, Francesco Dolcini wrote:
> We have working hardware, using another UART that expect
> rs485-rts-active-low, and the exact same HW, when using OMAP uart,
> requires rs485-rts-active-high (the HW is modular, so we are really just
> changing the uart, keeping the same RS485 transceiver / connections).
>
> What's going on there? Is the semantic of the 8250_omap driver just the
> opposite as it should be?
Yes, sadly, for historic reasons.
See these threads:
https://lore.kernel.org/linux-serial/20220329085050.311408-1-matthias.schiffer@ew.tq-group.com/
https://lore.kernel.org/linux-serial/2de36eba3fbe11278d5002e4e501afe0ceaca039.1663863805.git.lukas@wunner.de/
> Am I doing something wrong in the device tree?
No, but regrettably you need a separate device tree depending on which SoC
you're using.
Thanks,
Lukas
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-03-16 10:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-15 20:41 Wrong RS485 RTS polarity in 8250 OMAP UART Driver vs DT binding? Francesco Dolcini
2023-03-16 9:51 ` Lukas Wunner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®