linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Clemens Gruber <clemens.gruber@pqgruber.com>
To: Fabio Estevam <festevam@gmail.com>
Cc: linux-serial@vger.kernel.org,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Nandor Han" <nandor.han@ge.com>,
	"Lucas Stach" <l.stach@pengutronix.de>,
	"Fabio Estevam" <fabio.estevam@freescale.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: imx: RS-485 problems during TX, maybe DMA related
Date: Sat, 7 Jan 2017 14:45:57 +0100	[thread overview]
Message-ID: <20170107134557.GA12299@archie.localdomain> (raw)
In-Reply-To: <CAOMZO5CywajwZEL8K2ATfS80WzqY69YVX+3S7hq9_HmNdNAwaw@mail.gmail.com>

Hi Fabio,

On Fri, Jan 06, 2017 at 10:31:16PM -0200, Fabio Estevam wrote:
> Yes, I have tried like this:
> 
> &uart4 {
>     pinctrl-names = "default";
>     pinctrl-0 = <&pinctrl_uart4>;
>     uart-has-rtscts;
>     status = "okay";
> };
> 
> pinctrl_uart4: uart4grp {
> fsl,pins = <
>     MX6QDL_PAD_CSI0_DAT12__UART4_TX_DATA 0x1b0b1
>     MX6QDL_PAD_KEY_ROW0__UART4_RX_DATA 0x1b0b1
>    MX6QDL_PAD_CSI0_DAT16__UART4_CTS_B 0x1b0b1
> >;
> };

I also mux RTS_B even though it is unused, not sure if it this makes a
difference to also add MX6QDL_PAD_CSI0_DAT17_UART4_RTS_B in your case?

It should work like this, I don't think using an extra GPIO is
necessary.

> 
> So I was never able to observe the DE pin toggling correctly.

But did you set SER_RS485_RX_DURING_TX in your flags? This is counter
intuitive, but I observed that it would not work otherwise.

> Maybe you could share your userspace application with me offline?

I am using a patched version of the busybox stty utility, I posted the
patch here, feel free to use it:
https://gist.github.com/clemensg/29bd68b3cfd719bd01002a2acde9662c

I use stty -F /dev/ttymxc4 clocal cread -hupcl -ixon -opost rs485
-rs485rtsonsend rs485rtsaftersend rs485rxduringtx

But for you it is probably rs485rtsonsend and -rs485rtsaftersend?

Regards,
Clemens

  reply	other threads:[~2017-01-07 13:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-04 16:00 imx: RS-485 problems during TX, maybe DMA related Clemens Gruber
2017-01-06 21:22 ` Fabio Estevam
2017-01-06 22:50   ` Clemens Gruber
2017-01-07  0:31     ` Fabio Estevam
2017-01-07 13:45       ` Clemens Gruber [this message]
2017-01-07 14:57         ` Fabio Estevam
2017-01-07 15:34           ` Clemens Gruber
2017-01-07 16:48             ` Fabio Estevam
2017-01-07 20:59               ` Clemens Gruber
2017-01-07 21:43                 ` Fabio Estevam
2017-01-07 23:06                   ` Clemens Gruber
2017-01-08  2:30                     ` Fabio Estevam
2017-01-08 18:06                       ` Clemens Gruber
2017-01-08 21:46                         ` Fabio Estevam
2017-01-11  0:33                           ` Clemens Gruber
2017-01-11 11:51                             ` Fabio Estevam
2017-01-08 15:12                     ` Fabio Estevam

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=20170107134557.GA12299@archie.localdomain \
    --to=clemens.gruber@pqgruber.com \
    --cc=fabio.estevam@freescale.com \
    --cc=festevam@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=nandor.han@ge.com \
    --cc=s.hauer@pengutronix.de \
    --cc=u.kleine-koenig@pengutronix.de \
    /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).