From: Stefano Babic Date: Wed, 18 Aug 2010 08:22:42 +0000 (+0200) Subject: MXC: Add watchdog support to serial driver X-Git-Tag: v2010.12-rc1~111^2~16^2~5 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4ec3d2a7456eec28fd5bd33680f5e677ac5b0370;p=u-boot MXC: Add watchdog support to serial driver Calls WATCHDOG_RESET() inside serial driver for boards enabling watchdog. Signed-off-by: Stefano Babic --- diff --git a/drivers/serial/serial_mxc.c b/drivers/serial/serial_mxc.c index 4b93e7b97f..f96b21f7b1 100644 --- a/drivers/serial/serial_mxc.c +++ b/drivers/serial/serial_mxc.c @@ -18,6 +18,7 @@ */ #include +#include #ifdef CONFIG_MX31 #include #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')