All of lore.kernel.org
 help / color / mirror / Atom feed
From: Francesco Dolcini <francesco@dolcini.it>
To: Lukas Wunner <lukas@wunner.de>,
	Vignesh Raghavendra <vigneshr@ti.com>, Bin Liu <b-liu@ti.com>,
	linux-serial@vger.kernel.org, Zeng Chao <chao.zeng@siemens.com>
Cc: Rob Herring <robh@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	ilpo.jarvinen@linux.intel.com, tony@atomide.com,
	andriy.shevchenko@linux.intel.com,
	matthias.schiffer@ew.tq-group.com, linux-kernel@vger.kernel.org,
	Max Krummenacher <max.krummenacher@toradex.com>
Subject: Wrong RS485 RTS polarity in 8250 OMAP UART Driver vs DT binding?
Date: Wed, 15 Mar 2023 21:41:56 +0100	[thread overview]
Message-ID: <ZBItlBhzo+YETcJO@francesco-nb.int.toradex.com> (raw)

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


             reply	other threads:[~2023-03-15 20:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-15 20:41 Francesco Dolcini [this message]
2023-03-16  9:51 ` Wrong RS485 RTS polarity in 8250 OMAP UART Driver vs DT binding? Lukas Wunner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZBItlBhzo+YETcJO@francesco-nb.int.toradex.com \
    --to=francesco@dolcini.it \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=b-liu@ti.com \
    --cc=chao.zeng@siemens.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=matthias.schiffer@ew.tq-group.com \
    --cc=max.krummenacher@toradex.com \
    --cc=robh@kernel.org \
    --cc=tony@atomide.com \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.