]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/console.c
Merge branch 'master' of git://git.denx.de/u-boot-socfpga
[karo-tx-uboot.git] / common / console.c
index 5576dfd94ae3ed3db5d3532de1b895ade291680d..4695386a332ab867c12df32e938d4976ce7f0115 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <stdarg.h>
+#include <iomux.h>
 #include <malloc.h>
 #include <os.h>
 #include <serial.h>
@@ -417,7 +418,7 @@ static inline void print_pre_console_buffer(void) {}
 void putc(const char c)
 {
 #ifdef CONFIG_SANDBOX
-       if (!gd) {
+       if (!gd || !(gd->flags & GD_FLG_SERIAL_READY)) {
                os_putc(c);
                return;
        }
@@ -447,7 +448,7 @@ void putc(const char c)
 void puts(const char *s)
 {
 #ifdef CONFIG_SANDBOX
-       if (!gd) {
+       if (!gd || !(gd->flags & GD_FLG_SERIAL_READY)) {
                os_puts(s);
                return;
        }
@@ -524,6 +525,7 @@ static int ctrlc_disabled = 0;      /* see disable_ctrl() */
 static int ctrlc_was_pressed = 0;
 int ctrlc(void)
 {
+#ifndef CONFIG_SANDBOX
        if (!ctrlc_disabled && gd->have_console) {
                if (tstc()) {
                        switch (getc()) {
@@ -535,6 +537,8 @@ int ctrlc(void)
                        }
                }
        }
+#endif
+
        return 0;
 }
 /* Reads user's confirmation.
@@ -618,7 +622,7 @@ inline void dbg(const char *fmt, ...)
 
 }
 #else
-inline void dbg(const char *fmt, ...)
+static inline void dbg(const char *fmt, ...)
 {
 }
 #endif