]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/serial/serial-uclass.c
dm: serial: Reset the watchdog while waiting in getc()
[karo-tx-uboot.git] / drivers / serial / serial-uclass.c
index 1a75950d19fa4c738f7f5c881da08561d416faf2..1983a3d55bde3850bcd7369e8a5a807260fcf4f5 100644 (file)
 #include <os.h>
 #include <serial.h>
 #include <stdio_dev.h>
+#include <watchdog.h>
 #include <dm/lists.h>
 #include <dm/device-internal.h>
 
+#include <ns16550.h>
+
 DECLARE_GLOBAL_DATA_PTR;
 
 /* The currently-selected console serial device */
@@ -119,6 +122,8 @@ static int serial_getc_dev(struct udevice *dev)
 
        do {
                err = ops->getc(dev);
+               if (err == -EAGAIN)
+                       WATCHDOG_RESET();
        } while (err == -EAGAIN);
 
        return err >= 0 ? err : 0;