From patchwork Sat Feb 8 06:10:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 318373 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 C647A2C00A4 for ; Sat, 8 Feb 2014 17:10:41 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 93A2A4BB08; Sat, 8 Feb 2014 07:10:36 +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 23QxACtMqBja; Sat, 8 Feb 2014 07:10:36 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8CFBF4BADF; Sat, 8 Feb 2014 07:10:34 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DFC804BAF3 for ; Sat, 8 Feb 2014 07:10:30 +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 1r9GKthHe64g for ; Sat, 8 Feb 2014 07:10:18 +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 smtprelay.synopsys.com (smtprelay2.synopsys.com [198.182.60.111]) by theia.denx.de (Postfix) with ESMTPS id 7276E4BAD9 for ; Sat, 8 Feb 2014 07:10:13 +0100 (CET) Received: from us02secmta1.synopsys.com (us02secmta1.synopsys.com [10.12.235.96]) by smtprelay.synopsys.com (Postfix) with ESMTP id 2959410C0E47; Fri, 7 Feb 2014 22:10:11 -0800 (PST) Received: from us02secmta1.internal.synopsys.com (us02secmta1.internal.synopsys.com [127.0.0.1]) by us02secmta1.internal.synopsys.com (Service) with ESMTP id 02B5E4E216; Fri, 7 Feb 2014 22:10:11 -0800 (PST) Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.9.202.240]) by us02secmta1.internal.synopsys.com (Service) with ESMTP id C2C5B4E202; Fri, 7 Feb 2014 22:10:10 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id B681193C; Fri, 7 Feb 2014 22:10:10 -0800 (PST) Received: from abrodkin-8560l.internal.synopsys.com (unknown [10.225.15.76]) by mailhost.synopsys.com (Postfix) with ESMTP id 2162C934; Fri, 7 Feb 2014 22:10:08 -0800 (PST) From: Alexey Brodkin To: u-boot@lists.denx.de Date: Sat, 8 Feb 2014 10:10:01 +0400 Message-Id: <1391839802-11494-2-git-send-email-abrodkin@synopsys.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1391839802-11494-1-git-send-email-abrodkin@synopsys.com> References: <1391839802-11494-1-git-send-email-abrodkin@synopsys.com> Cc: Tom Rini , Vineet Gupta , Alexey Brodkin , Noam Camus Subject: [U-Boot] [PATCH 1/2] serial/serial_arc: add work-around of ISS bug 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Explanation is in in-lined comment. Signed-off-by: Alexey Brodkin Cc: Vineet Gupta Cc: Noam Camus Cc: Tom Rini --- drivers/serial/serial_arc.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/serial/serial_arc.c b/drivers/serial/serial_arc.c index e63d25d..55d0769 100644 --- a/drivers/serial/serial_arc.c +++ b/drivers/serial/serial_arc.c @@ -39,7 +39,23 @@ static void arc_serial_setbrg(void) arc_console_baud = gd->cpu_clk / (gd->baudrate * 4) - 1; writel(arc_console_baud & 0xff, ®s->baudl); + +#ifdef CONFIG_ARC + /* + * UART ISS(Instruction Set simulator) emulation has a subtle bug: + * A existing value of Baudh = 0 is used as a indication to startup + * it's internal state machine. + * Thus if baudh is set to 0, 2 times, it chokes. + * This happens with BAUD=115200 and the formaula above + * Until that is fixed, when running on ISS, we will set baudh to !0 + */ + if (gd->arch.running_on_hw) + writel((arc_console_baud & 0xff00) >> 8, ®s->baudh); + else + writel(1, ®s->baudh); +#else writel((arc_console_baud & 0xff00) >> 8, ®s->baudh); +#endif } static int arc_serial_init(void)