From patchwork Mon Mar 25 22:02:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: man.huber@arcor.de X-Patchwork-Id: 230994 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id AB72D2C00B2 for ; Tue, 26 Mar 2013 09:03:23 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C70EA4A107; Mon, 25 Mar 2013 23:03:14 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jpsoAo3-qi4E; Mon, 25 Mar 2013 23:03:14 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5B5C74A111; Mon, 25 Mar 2013 23:03:10 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BFD044A111 for ; Mon, 25 Mar 2013 23:03:05 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E0z5Uyd71sEC for ; Mon, 25 Mar 2013 23:02:56 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-in-06.arcor-online.net (mail-in-06.arcor-online.net [151.189.21.46]) by theia.denx.de (Postfix) with ESMTPS id 8DAF04A107 for ; Mon, 25 Mar 2013 23:02:54 +0100 (CET) Received: from mail-in-05-z2.arcor-online.net (mail-in-05-z2.arcor-online.net [151.189.8.17]) by mx.arcor.de (Postfix) with ESMTP id 4F3BD10B8BA; Mon, 25 Mar 2013 23:02:53 +0100 (CET) Received: from mail-in-09.arcor-online.net (mail-in-09.arcor-online.net [151.189.21.49]) by mail-in-05-z2.arcor-online.net (Postfix) with ESMTP id 4AD896F35FF; Mon, 25 Mar 2013 23:02:53 +0100 (CET) X-Greylist: Passed host: 88.65.41.105 X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-09.arcor-online.net D9194197563 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arcor.de; s=mail-in; t=1364248973; bh=Y7My51vzZikRxCyOL5RFMwMTujZfXcTxcFMvxkMYku8=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=lIvJRRySz8BOSVg2AEgeaRYksKHuJtlxZZum1/0/TkNixWnhUKz0Ro1DZWn/TqTXR KX6BROPNpF2NVr8k9dn03nAgGVj+xfLEyzI/5IAFkty4p5TGy0aeCSOzyyZvqRsdEA 0zRrvvOVwKdSWvZNANv42hrowazno7k4eMlTea78= X-Greylist: Passed host: 88.65.41.105 X-Greylist: Passed host: 88.65.41.105 X-Greylist: Passed host: 88.65.41.105 Received: from [192.168.2.103] (dslb-088-065-041-105.pools.arcor-ip.net [88.65.41.105]) (Authenticated sender: man.huber@arcor.de) by mail-in-09.arcor-online.net (Postfix) with ESMTPA id D9194197563; Mon, 25 Mar 2013 23:02:52 +0100 (CET) Message-ID: <5150C987.1040802@arcor.de> Date: Mon, 25 Mar 2013 23:02:47 +0100 From: Manfred Huber User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130308 Thunderbird/17.0.4 MIME-Version: 1.0 To: Tom Rini References: <1679653192.50708.1361970554739.JavaMail.ngmail@webmail21.arcor-online.net> <51447012.6010303@arcor.de> <20130319144957.GF25919@bill-the-cat> In-Reply-To: Cc: Scott Wood , u-boot@lists.denx.de Subject: [U-Boot] [PATCH 1/1 v2] omap3_beagle: Enabling UART3 first allows the Transmitter to be empty X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Manfred Huber Due to a Bug in the ROM code of some OMAP3 devices, the TEMT bit is not set if UART3 is configured before (only THRE is set). Reason is the disabling of UART3 even though the Transmitter is not empty. Enabling UART3 allows the Transmitter to be empty. Signed-off-by: Manfred Huber --- drivers/serial/ns16550.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) #if (defined(CONFIG_OMAP) && !defined(CONFIG_OMAP3_ZOOM2)) || \ diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index b2da8b3..24ff84f 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -36,10 +36,18 @@ void NS16550_init(NS16550_t com_port, int baud_divisor) { -#if (!defined(CONFIG_SYS_NS16550_BROKEN_TEMT)) +#if (defined(CONFIG_SPL_BUILD) && defined(CONFIG_OMAP34XX)) + if ((serial_in(&com_port->lsr) & (UART_LSR_TEMT | UART_LSR_THRE)) == UART_LSR_THRE) { + serial_out(UART_LCR_DLAB, &com_port->lcr); + serial_out(baud_divisor & 0xff, &com_port->dll); + serial_out((baud_divisor >> 8) & 0xff, &com_port->dlm); + serial_out(UART_LCRVAL, &com_port->lcr); + serial_out(0, &com_port->mdr1); + } +#endif + while (!(serial_in(&com_port->lsr) & UART_LSR_TEMT)) ; -#endif serial_out(CONFIG_SYS_NS16550_IER, &com_port->ier);