]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - cpu/mpc8xx/serial.c
* Restrict baudrate settings on LWMON to higher speeds
[karo-tx-uboot.git] / cpu / mpc8xx / serial.c
index 0690300b24ebd31ba288a399e41ea54c3eafa88b..2871084fcdd4be978e75316bc989c13c8ae43299 100644 (file)
@@ -24,6 +24,7 @@
 #include <common.h>
 #include <commproc.h>
 #include <command.h>
+#include <watchdog.h>
 
 #if !defined(CONFIG_8xx_CONS_NONE)     /* No Console at all */
 
@@ -265,20 +266,16 @@ serial_putc(const char c)
        */
 
        buf = (char *)tbdf->cbd_bufaddr;
-#if 0
-       __asm__("eieio");
-       while (tbdf->cbd_sc & BD_SC_READY)
-               __asm__("eieio");
-#endif
 
        *buf = c;
        tbdf->cbd_datlen = 1;
        tbdf->cbd_sc |= BD_SC_READY;
        __asm__("eieio");
-#if 1
-       while (tbdf->cbd_sc & BD_SC_READY)
+
+       while (tbdf->cbd_sc & BD_SC_READY) {
+               WATCHDOG_RESET ();
                __asm__("eieio");
-#endif
+       }
 }
 
 int
@@ -298,8 +295,10 @@ serial_getc(void)
        /* Wait for character to show up.
        */
        buf = (unsigned char *)rbdf->cbd_bufaddr;
+
        while (rbdf->cbd_sc & BD_SC_EMPTY)
-               ;
+               WATCHDOG_RESET ();
+
        c = *buf;
        rbdf->cbd_sc |= BD_SC_EMPTY;
 
@@ -524,20 +523,16 @@ serial_putc(const char c)
        */
 
        buf = (char *)tbdf->cbd_bufaddr;
-#if 0
-       __asm__("eieio");
-       while (tbdf->cbd_sc & BD_SC_READY)
-               __asm__("eieio");
-#endif
 
        *buf = c;
        tbdf->cbd_datlen = 1;
        tbdf->cbd_sc |= BD_SC_READY;
        __asm__("eieio");
-#if 1
-       while (tbdf->cbd_sc & BD_SC_READY)
+
+       while (tbdf->cbd_sc & BD_SC_READY) {
                __asm__("eieio");
-#endif
+               WATCHDOG_RESET ();
+       }
 }
 
 int
@@ -557,8 +552,10 @@ serial_getc(void)
        /* Wait for character to show up.
        */
        buf = (unsigned char *)rbdf->cbd_bufaddr;
+
        while (rbdf->cbd_sc & BD_SC_EMPTY)
-               ;
+               WATCHDOG_RESET ();
+
        c = *buf;
        rbdf->cbd_sc |= BD_SC_EMPTY;