]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - common/console.c
Merge branch 'master' of git://git.denx.de/u-boot-x86
[people/ms/u-boot.git] / common / console.c
index bc37b6d962b0aa9eb2032a63b5d5c2044c329cb7..12293f383624947cc716319a862df4340c44b1c2 100644 (file)
@@ -227,11 +227,6 @@ static void console_puts(int file, const char *s)
        }
 }
 
-static inline void console_printdevs(int file)
-{
-       iomux_printdevs(file);
-}
-
 static inline void console_doenv(int file, struct stdio_dev *dev)
 {
        iomux_doenv(file, dev->name);
@@ -265,11 +260,6 @@ static inline void console_puts(int file, const char *s)
        stdio_devices[file]->puts(stdio_devices[file], s);
 }
 
-static inline void console_printdevs(int file)
-{
-       printf("%s\n", stdio_devices[file]->name);
-}
-
 static inline void console_doenv(int file, struct stdio_dev *dev)
 {
        console_setfile(file, dev);
@@ -525,8 +515,6 @@ void puts(const char *s)
                        int ch = *s++;
 
                        printch(ch);
-                       if (ch == '\n')
-                               printch('\r');
                }
                return;
        }
@@ -653,44 +641,6 @@ void clear_ctrlc(void)
        ctrlc_was_pressed = 0;
 }
 
-#ifdef CONFIG_MODEM_SUPPORT_DEBUG
-char   screen[1024];
-char *cursor = screen;
-int once = 0;
-inline void dbg(const char *fmt, ...)
-{
-       va_list args;
-       uint    i;
-       char    printbuffer[CONFIG_SYS_PBSIZE];
-
-       if (!once) {
-               memset(screen, 0, sizeof(screen));
-               once++;
-       }
-
-       va_start(args, fmt);
-
-       /* For this to work, printbuffer must be larger than
-        * anything we ever want to print.
-        */
-       i = vsnprintf(printbuffer, sizeof(printbuffer), fmt, args);
-       va_end(args);
-
-       if ((screen + sizeof(screen) - 1 - cursor)
-           < strlen(printbuffer) + 1) {
-               memset(screen, 0, sizeof(screen));
-               cursor = screen;
-       }
-       sprintf(cursor, printbuffer);
-       cursor += strlen(printbuffer);
-
-}
-#else
-static inline void dbg(const char *fmt, ...)
-{
-}
-#endif
-
 /** U-Boot INIT FUNCTIONS *************************************************/
 
 struct stdio_dev *search_device(int flags, const char *name)
@@ -698,6 +648,10 @@ struct stdio_dev *search_device(int flags, const char *name)
        struct stdio_dev *dev;
 
        dev = stdio_get_by_name(name);
+#ifdef CONFIG_VIDCONSOLE_AS_LCD
+       if (!dev && !strcmp(name, "lcd"))
+               dev = stdio_get_by_name("vidconsole");
+#endif
 
        if (dev && (dev->flags & flags))
                return dev;
@@ -843,6 +797,10 @@ done:
 #ifndef CONFIG_SYS_CONSOLE_INFO_QUIET
        stdio_print_current_devices();
 #endif /* CONFIG_SYS_CONSOLE_INFO_QUIET */
+#ifdef CONFIG_VIDCONSOLE_AS_LCD
+       if (strstr(stdoutname, "lcd"))
+               printf("Warning: Please change 'lcd' to 'vidconsole' in stdout/stderr environment vars\n");
+#endif
 
 #ifdef CONFIG_SYS_CONSOLE_ENV_OVERWRITE
        /* set the environment variables (will overwrite previous env settings) */