From: Lukas Wunner <lukas@wunner.de>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-serial <linux-serial@vger.kernel.org>,
Jiri Slaby <jirislaby@kernel.org>,
Matthias Schiffer <matthias.schiffer@ew.tq-group.com>,
Jan Kiszka <jan.kiszka@siemens.com>,
Su Bao Cheng <baocheng.su@siemens.com>,
Vignesh Raghavendra <vigneshr@ti.com>, Nishanth Menon <nm@ti.com>,
Lino Sanfilippo <LinoSanfilippo@gmx.de>
Subject: Re: [PATCH] serial: 8250: 8250_omap: Support native RS485
Date: Mon, 3 Oct 2022 21:54:59 +0200 [thread overview]
Message-ID: <20221003195459.GA11858@wunner.de> (raw)
In-Reply-To: <42986e92-d12e-bfde-2f5c-f580c113c3b@linux.intel.com>
On Wed, Sep 28, 2022 at 02:38:40PM +0300, Ilpo Järvinen wrote:
> On Tue, 27 Sep 2022, Lukas Wunner wrote:
> > Recent TI Sitara SoCs such as AM64/AM65 have gained the ability to
> > automatically assert RTS when data is transmitted, obviating the need
> > to emulate this functionality in software.
> >
> > The feature is controlled through new DIR_EN and DIR_POL bits in the
> > Mode Definition Register 3. For details see page 8783 and 8890 of the
> > AM65 TRM: https://www.ti.com/lit/ug/spruid7e/spruid7e.pdf
[...]
> > @@ -1335,10 +1387,7 @@ static int omap8250_probe(struct platform_device *pdev)
> > up.port.shutdown = omap_8250_shutdown;
> > up.port.throttle = omap_8250_throttle;
> > up.port.unthrottle = omap_8250_unthrottle;
> > - up.port.rs485_config = serial8250_em485_config;
> > up.port.rs485_supported = serial8250_em485_supported;
> > - up.rs485_start_tx = serial8250_em485_start_tx;
> > - up.rs485_stop_tx = serial8250_em485_stop_tx;
> > up.port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_8250_CONSOLE);
> >
> > ret = of_alias_get_id(np, "serial");
> > @@ -1377,6 +1426,14 @@ static int omap8250_probe(struct platform_device *pdev)
> > DEFAULT_CLK_SPEED);
> > }
> >
> > + if (priv->habit & UART_HAS_NATIVE_RS485) {
> > + up.port.rs485_config = omap8250_rs485_config;
> > + } else {
> > + up.port.rs485_config = serial8250_em485_config;
> > + up.rs485_start_tx = serial8250_em485_start_tx;
> > + up.rs485_stop_tx = serial8250_em485_stop_tx;
> > + }
>
> I guess .rs485_supported shouldn't be equal in both cases?
I contemplated whether it should be different for hardware-assisted
RS485 but came to the conclusion that it shouldn't:
The polarity may be chosen both for hardware- and software-controlled RTS.
Whether RX_DURING_TX is possible depends on how the RS485 transceiver
is wired to the UART: If RTS asserts !RE on the transceiver when sending,
the UART cannot receive data, regardless whether hardware- or software-
controlled RTS is used.
TERMINATE_BUS works independently from RTS control.
And ADDRB doesn't seem to be supported in either mode AFAICS.
Am I missing something?
Thanks,
Lukas
next prev parent reply other threads:[~2022-10-03 19:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-27 12:10 [PATCH] serial: 8250: 8250_omap: Support native RS485 Lukas Wunner
2022-09-28 11:38 ` Ilpo Järvinen
2022-10-03 19:54 ` Lukas Wunner [this message]
2022-10-04 9:06 ` Ilpo Järvinen
2022-10-06 6:21 ` Lukas Wunner
2022-10-06 7:16 ` Vignesh Raghavendra
2022-10-06 7:43 ` Vignesh Raghavendra
2022-10-06 10:59 ` Ilpo Järvinen
2022-10-03 15:10 ` Bin Liu
2022-10-03 19:42 ` Lukas Wunner
2022-10-04 13:45 ` Bin Liu
2022-10-06 7:07 ` Vignesh Raghavendra
2022-10-06 7:27 ` 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=20221003195459.GA11858@wunner.de \
--to=lukas@wunner.de \
--cc=LinoSanfilippo@gmx.de \
--cc=baocheng.su@siemens.com \
--cc=gregkh@linuxfoundation.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jan.kiszka@siemens.com \
--cc=jirislaby@kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=matthias.schiffer@ew.tq-group.com \
--cc=nm@ti.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.