ARM: imx: ddr: Add missing PHY reset
[oweals/u-boot.git] / common / cli_readline.c
index ecded11ca3985f27b132ef4d20f7e79ee02c8379..1f1e28c6d85787983adb683379e3b4acbdb047c0 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2000
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
@@ -5,13 +6,13 @@
  * Add to readline cmdline-editing by
  * (C) Copyright 2005
  * JinHua Luo, GuangDong Linux Center, <luo.jinhua@gd-linux.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <bootretry.h>
 #include <cli.h>
+#include <command.h>
+#include <time.h>
 #include <watchdog.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -274,6 +275,10 @@ static int cread_line(const char *const prompt, char *buf, unsigned int *len,
 
                ichar = getcmd_getch();
 
+               /* ichar=0x0 when error occurs in U-Boot getc */
+               if (!ichar)
+                       continue;
+
                if ((ichar == '\n') || (ichar == '\r')) {
                        putc('\n');
                        break;
@@ -566,12 +571,6 @@ int cli_readline_into_buffer(const char *const prompt, char *buffer,
                        return -2;      /* timed out */
                WATCHDOG_RESET();       /* Trigger watchdog, if needed */
 
-#ifdef CONFIG_SHOW_ACTIVITY
-               while (!tstc()) {
-                       show_activity(0);
-                       WATCHDOG_RESET();
-               }
-#endif
                c = getc();
 
                /*