]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
MXC: Add watchdog support to serial driver
authorStefano Babic <sbabic@denx.de>
Wed, 18 Aug 2010 08:22:42 +0000 (10:22 +0200)
committerStefano Babic <sbabic@denx.de>
Wed, 29 Sep 2010 09:24:31 +0000 (11:24 +0200)
Calls WATCHDOG_RESET() inside serial driver
for boards enabling watchdog.

Signed-off-by: Stefano Babic <sbabic@denx.de>
drivers/serial/serial_mxc.c

index 4b93e7b97fece8009d4a23ac826a606ac2d10569..f96b21f7b1bc32f7390241661e08e89550620d6e 100644 (file)
@@ -18,6 +18,7 @@
  */
 
 #include <common.h>
+#include <watchdog.h>
 #ifdef CONFIG_MX31
 #include <asm/arch/mx31.h>
 #else
@@ -189,7 +190,8 @@ void serial_setbrg (void)
 
 int serial_getc (void)
 {
-       while (__REG(UART_PHYS + UTS) & UTS_RXEMPTY);
+       while (__REG(UART_PHYS + UTS) & UTS_RXEMPTY)
+               WATCHDOG_RESET();
        return (__REG(UART_PHYS + URXD) & URXD_RX_DATA); /* mask out status from upper word */
 }
 
@@ -198,7 +200,8 @@ void serial_putc (const char c)
        __REG(UART_PHYS + UTXD) = c;
 
        /* wait for transmitter to be ready */
-       while(!(__REG(UART_PHYS + UTS) & UTS_TXEMPTY));
+       while (!(__REG(UART_PHYS + UTS) & UTS_TXEMPTY))
+               WATCHDOG_RESET();
 
        /* If \n, also do \r */
        if (c == '\n')