From patchwork Mon Jul 28 22:38:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Pringlemeir X-Patchwork-Id: 4637771 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C89ABC0338 for ; Mon, 28 Jul 2014 22:53:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E21912018E for ; Mon, 28 Jul 2014 22:53:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B14002018B for ; Mon, 28 Jul 2014 22:53:25 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XBtlc-0005vQ-9d; Mon, 28 Jul 2014 22:51:40 +0000 Received: from 71-19-161-253.dedicated.allstream.net ([71.19.161.253] helo=nsa.nbspaymentsolutions.com) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XBtlZ-0005oL-Cr for linux-arm-kernel@lists.infradead.org; Mon, 28 Jul 2014 22:51:38 +0000 Received: from DeadDuck (unknown [172.20.177.82]) by nsa.nbspaymentsolutions.com (Postfix) with ESMTP id 570633FC437; Mon, 28 Jul 2014 18:54:58 -0400 (EDT) From: Bill Pringlemeir To: Stefan Agner Subject: Re: fsl_lpuart/VF610: Division by zero. Organization: NBS Payment Solutions References: <87ha256q8l.fsf@nbsps.com> <87d2ct6p77.fsf@nbsps.com> <1aa4c71fa7441f217f33e7be9a8fa1b9@agner.ch> Date: Mon, 28 Jul 2014 18:38:39 -0400 In-Reply-To: <1aa4c71fa7441f217f33e7be9a8fa1b9@agner.ch> (Stefan Agner's message of "Sat, 26 Jul 2014 14:08:38 +0200") Message-ID: <87zjftaz2o.fsf@nbsps.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140728_155137_723399_5FBAE704 X-CRM114-Status: GOOD ( 13.10 ) X-Spam-Score: 0.4 (/) Cc: linux-arm-kernel@lists.infradead.org, Greg Kroah-Hartman , Yuan Yao , linux-serial@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 26 Jul 2014, stefan@agner.ch wrote: > Hi Bill, > > Am 2014-07-26 00:36, schrieb Bill Pringlemeir: >> On 25 Jul 2014, bpringlemeir@nbsps.com wrote: > >>> I looked at the vmlinux objdump and it is here, >>> >>> static int lpuart_dma_rx_request(struct uart_port *port) >>> { >>> ... >>> sport->dma_rx_timeout = (sport->port.timeout - HZ / 50) * >>> FSL_UART_RX_DMA_BUFFER_SIZE * 3 / >>> sport->rxfifo_size / 2; >>> >>> The variable 'sport->rxfifo_size' is set in lpuart_setup_watermark() >>> and this is called after lpuart_dma_rx_request() in >>> lpuart_startup(). > I observed this division by zero too, I recently sent a patch for > that. > http://lists.infradead.org/pipermail/linux-arm-kernel/2014-July/268772.html > Greg already added that to his tty-next tree: > https://git.kernel.org/cgit/linux/kernel/git/gregkh/tty.git/tree/drivers/tty/serial/fsl_lpuart.c?h=tty-next#n1309 > I also observed that DMA did not work yet, hence I a created a second > patch: > http://lists.infradead.org/pipermail/linux-arm-kernel/2014-July/268773.html > > But eDMA in general was broken too, this patch solved that, hence you > might want apply that patch too: > http://lists.infradead.org/pipermail/linux-arm-kernel/2014-July/268199.html > > All patches are lined up for 3.17, so things should be smooth from > that release on. Thanks, I applied all three patches to the arm-soc 'for-next' and now the serial ports seems to be working. I am using the Tower board and they have a 'TWR-SER2' card. http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=TWR-SER2 Unfortunately, the IOMUX conflicts with the Audio daughter-board in vf610-twr.dts. The I/O conflicts are, VF610_PAD_PTB6__FTM0_CH6 VF610_PAD_PTB7__FTM0_CH7 versus VF610_PAD_PTB6__UART2_TX VF610_PAD_PTB7__UART2_RX Below are the DT changes to get two 'ttyLP' working with the Tower System which probably will never apply cleanly, but are just meant for reference. >; }; - +*/ pinctrl_sai2: sai2grp { fsl,pins = < VF610_PAD_PTA16__SAI2_TX_BCLK 0x02ed @@ -271,6 +273,13 @@ VF610_PAD_PTB5__UART1_RX 0x21a1 >; }; + + pinctrl_uart2: uart2grp { + fsl,pins = < + VF610_PAD_PTB6__UART2_TX 0x21a2 + VF610_PAD_PTB7__UART2_RX 0x21a1 + >; + }; }; }; @@ -284,21 +293,31 @@ status = "okay"; }; +/* &pwm0 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pwm0>; status = "okay"; }; - &sai2 { #sound-dai-cells = <0>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_sai2>; status = "okay"; }; - +*/ +&uart2 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_uart2>; + status = "okay"; +}; The standard jumpers on the Tower will either route ttyLP1 to the 'USB' or to the 'serial board'; ttyLP2 will be the opposite with the 'serial board' or the 'USB'. Thanks again. I should have read the linux-arm list more diligently. Bill Pringlemeir. --- a/arch/arm/boot/dts/vf610-twr.dts +++ b/arch/arm/boot/dts/vf610-twr.dts @@ -58,7 +59,7 @@ regulator-max-microvolt = <3300000>; }; }; - +/* sound { compatible = "simple-audio-card"; simple-audio-card,format = "i2s"; @@ -87,6 +88,7 @@ bitclock-master; }; }; +*/ }; &adc0 { @@ -241,7 +243,7 @@ }; - +/* pinctrl_pwm0: pwm0grp { fsl,pins = < VF610_PAD_PTB0__FTM0_CH0 0x1582 @@ -252,7 +254,7 @@ VF610_PAD_PTB7__FTM0_CH7 0x1582