mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* 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

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®