summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Babic <sbabic@denx.de>2010-08-18 10:22:42 +0200
committerStefano Babic <sbabic@denx.de>2010-09-29 11:24:31 +0200
commit4ec3d2a7456eec28fd5bd33680f5e677ac5b0370 (patch)
tree0b37a5918ade8ef84c833670caf1cb16f33124df
parent9583dfab1df155bf81e67859a3c2907ac0418260 (diff)
downloadbootable_bootloader_goldelico_gta04-4ec3d2a7456eec28fd5bd33680f5e677ac5b0370.zip
bootable_bootloader_goldelico_gta04-4ec3d2a7456eec28fd5bd33680f5e677ac5b0370.tar.gz
bootable_bootloader_goldelico_gta04-4ec3d2a7456eec28fd5bd33680f5e677ac5b0370.tar.bz2
MXC: Add watchdog support to serial driver
Calls WATCHDOG_RESET() inside serial driver for boards enabling watchdog. Signed-off-by: Stefano Babic <sbabic@denx.de>
-rw-r--r--drivers/serial/serial_mxc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/serial/serial_mxc.c b/drivers/serial/serial_mxc.c
index 4b93e7b..f96b21f 100644
--- a/drivers/serial/serial_mxc.c
+++ b/drivers/serial/serial_mxc.c
@@ -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')