From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv4 2/3] tty/serial: at91: fix hardware handshake with GPIOs
Date: Tue, 4 Oct 2016 09:25:25 +0200 [thread overview]
Message-ID: <20161004072525.josgoglunmvufcn2@pengutronix.de> (raw)
In-Reply-To: <CACQ1gAgE+BvteH9y62PcRx_tA9_e2X11RCJ12PC98FK+5z98QQ@mail.gmail.com>
On Fri, Sep 30, 2016 at 01:04:28PM +0200, Richard Genoud wrote:
> 2016-09-30 11:12 GMT+02:00 Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>:
> > Hello Richard,
> >
> > On Fri, Sep 30, 2016 at 10:58:00AM +0200, Richard Genoud wrote:
> >> Commit 1cf6e8fc8341 ("tty/serial: at91: fix RTS line management when
> >> hardware handshake is enabled") broke the hardware handshake when GPIOs
> >> were used.
> >>
> >> Hardware handshake with GPIOs used to work before this commit because
> >> the CRTSCTS flag (termios->c_cflag) was set, but not the
> >> ATMEL_US_USMODE_HWHS flag (controller register) ; so hardware handshake
> >> enabled, but not handled by the controller.
> >
> > What does the HWHS flag control? What if only RTS is a gpio and CTS is
> > not? Or the other way round?
> First, HWHS flag is used only in SAMA5D2. (if I correctly understood
> Atmel HW guys,
> all other platforms (sam9, sam9x5, sama5d3...) have this flag, but it
> is unusable,
> because they don't have Fifos nor PDC).
> So, on SAMA5D2, the HWHS flag tells the controller to drive the RTS
> pin according to
> the number of char present in the rx fifo (cf Figure 44-29 ?44.7.3.15 p.1438 of
> http://www.atmel.com/Images/Atmel-11267-32-bit-Cortex-A5-Microcontroller-SAMA5D2_Datasheet.pdf).
> The controller will also start/stop the transmission on CTS changes.
> But, as I haven't got this hard, I couldn't test it. (but Cyrille did I guess).
> With this flag set, It's mandatory to have CTS and RTS not handled via
> GPIO, because if
> they were, the controller couldn't, well, control them.
Assuming the respective pin doesn't reach the hardware both are no
problem though. And it would keep the driver simpler to just ignore
this. There would be no need for patch 1 and also this patch could be
dropped. So I guess there is really something to fix, otherwise you
wouldn't start patching the driver. But I don't understand the issue, so
I'd like to have a better picture.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
next prev parent reply other threads:[~2016-10-04 7:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-30 8:57 [PATCHv4 0/3] Fix hardware handshake on SAM9x5 platforms Richard Genoud
2016-09-30 8:57 ` [PATCHv4 1/3] serial: mctrl_gpio: implement mctrl_gpio_use_rtscts Richard Genoud
2016-10-04 7:28 ` Uwe Kleine-König
2016-09-30 8:58 ` [PATCHv4 2/3] tty/serial: at91: fix hardware handshake with GPIOs Richard Genoud
2016-09-30 9:12 ` Uwe Kleine-König
2016-09-30 11:04 ` Richard Genoud
2016-09-30 11:16 ` Alexandre Belloni
2016-09-30 11:45 ` Richard Genoud
2016-09-30 11:54 ` Alexandre Belloni
2016-09-30 12:26 ` Richard Genoud
2016-10-04 7:25 ` Uwe Kleine-König [this message]
2016-10-07 15:26 ` Richard Genoud
2016-09-30 8:58 ` [PATCHv4 3/3] tty/serial: at91: fix hardware handshake on SAM9x5 (without GPIOs) Richard Genoud
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=20161004072525.josgoglunmvufcn2@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).