MX31: Add support for MXC EHCI controller
[oweals/u-boot.git] / drivers / serial / atmel_usart.c
index f3b146c22d783ae2eb8b2bab77499c38dfc16850..cad34122b9da7639a35cb1555ca2a7507e83972b 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 #include <common.h>
+#ifndef CONFIG_AT91_LEGACY
+#define CONFIG_AT91_LEGACY
+#warning Please update to use C structur SoC access !
+#endif
+#include <watchdog.h>
 
 #include <asm/io.h>
 #include <asm/arch/clk.h>
@@ -87,7 +92,8 @@ void serial_puts(const char *s)
 
 int serial_getc(void)
 {
-       while (!(usart3_readl(CSR) & USART3_BIT(RXRDY))) ;
+       while (!(usart3_readl(CSR) & USART3_BIT(RXRDY)))
+                WATCHDOG_RESET();
        return usart3_readl(RHR);
 }