From patchwork Wed Apr 6 21:49:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Schwingen X-Patchwork-Id: 90078 X-Patchwork-Delegate: marek.vasut@gmail.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 736B7B6F44 for ; Thu, 7 Apr 2011 07:56:42 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 077D228116; Wed, 6 Apr 2011 23:56:38 +0200 (CEST) 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 0bCrbTZ3mq-z; Wed, 6 Apr 2011 23:56:37 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3485B280D9; Wed, 6 Apr 2011 23:56:21 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A8CF7280DC for ; Wed, 6 Apr 2011 23:56:18 +0200 (CEST) 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 jUOjvCIpj4kd for ; Wed, 6 Apr 2011 23:56:18 +0200 (CEST) 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.dascon.de (pve-mail.dascon.de [93.159.248.171]) by theia.denx.de (Postfix) with ESMTP id 0B1EE280BE for ; Wed, 6 Apr 2011 23:56:16 +0200 (CEST) Received: by mail.dascon.de (Postfix, from userid 10) id CA0BD2086; Wed, 6 Apr 2011 23:50:06 +0200 (CEST) Received: from discworld.ms.intern (discworld.dascon.de [192.168.11.1]) by a-tuin.dascon.de (Postfix) with ESMTP id 57F0E8082D for ; Wed, 6 Apr 2011 23:49:18 +0200 (CEST) From: Michael Schwingen To: u-boot@lists.denx.de Date: Wed, 6 Apr 2011 23:49:04 +0200 Message-Id: <1302126558-1318-4-git-send-email-michael@schwingen.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1302126558-1318-1-git-send-email-michael@schwingen.org> References: <1302126558-1318-1-git-send-email-michael@schwingen.org> Subject: [U-Boot] [IXP42x PATCH series v4 03/17] trigger hardware watchdog in IXP42x serial driver X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 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 Signed-off-by: Michael Schwingen Acked-by: Marek Vasut --- Changes for V2: Changes for V3: - coding style fixes Changes for V4: - add changelog drivers/serial/serial_ixp.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/serial/serial_ixp.c b/drivers/serial/serial_ixp.c index dd26af4..a9acd47 100644 --- a/drivers/serial/serial_ixp.c +++ b/drivers/serial/serial_ixp.c @@ -30,6 +30,7 @@ #include #include +#include /* * 14.7456 MHz @@ -85,7 +86,8 @@ int serial_init (void) void serial_putc (const char c) { /* wait for room in the tx FIFO on UART */ - while ((LSR(CONFIG_SYS_IXP425_CONSOLE) & LSR_TEMT) == 0); + while ((LSR(CONFIG_SYS_IXP425_CONSOLE) & LSR_TEMT) == 0) + WATCHDOG_RESET(); /* Reset HW Watchdog, if needed */ THR(CONFIG_SYS_IXP425_CONSOLE) = c; @@ -111,7 +113,8 @@ int serial_tstc (void) */ int serial_getc (void) { - while (!(LSR(CONFIG_SYS_IXP425_CONSOLE) & LSR_DR)); + while (!(LSR(CONFIG_SYS_IXP425_CONSOLE) & LSR_DR)) + WATCHDOG_RESET(); /* Reset HW Watchdog, if needed */ return (char) RBR(CONFIG_SYS_IXP425_CONSOLE) & 0xff; }