From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030647AbdAGNqM (ORCPT ); Sat, 7 Jan 2017 08:46:12 -0500 Received: from mail.pqgruber.com ([178.189.19.235]:10088 "EHLO mail.pqgruber.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751646AbdAGNqC (ORCPT ); Sat, 7 Jan 2017 08:46:02 -0500 Date: Sat, 7 Jan 2017 14:45:57 +0100 From: Clemens Gruber To: Fabio Estevam Cc: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Sascha Hauer , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Nandor Han , Lucas Stach , Fabio Estevam , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: imx: RS-485 problems during TX, maybe DMA related Message-ID: <20170107134557.GA12299@archie.localdomain> References: <20170104160024.GA13442@archie.localdomain> <20170106225026.GA3804@archie.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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