[U-Boot] [PATCH 1/2] usb_kbd: Add support for watchdog

Michal Simek michal.simek at xilinx.com
Wed Jun 27 13:10:20 UTC 2018


There is need to service watchdog in while loop or system will be
restarted when idlying.

Signed-off-by: Michal Simek <michal.simek at xilinx.com>
---

 common/usb_kbd.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 4c394d5613d1..20255dcf951f 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -16,6 +16,7 @@
 #include <malloc.h>
 #include <memalign.h>
 #include <stdio_dev.h>
+#include <watchdog.h>
 #include <asm/byteorder.h>
 
 #include <usb.h>
@@ -398,8 +399,10 @@ static int usb_kbd_getc(struct stdio_dev *sdev)
 	usb_kbd_dev = (struct usb_device *)dev->priv;
 	data = usb_kbd_dev->privptr;
 
-	while (data->usb_in_pointer == data->usb_out_pointer)
+	while (data->usb_in_pointer == data->usb_out_pointer) {
+		WATCHDOG_RESET();
 		usb_kbd_poll_for_event(usb_kbd_dev);
+	}
 
 	if (data->usb_out_pointer == USB_KBD_BUFFER_LEN - 1)
 		data->usb_out_pointer = 0;
-- 
1.9.1



More information about the U-Boot mailing list