]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/stdio.c
x86: Add CBMEM console driver for coreboot
[karo-tx-uboot.git] / common / stdio.c
index 870ddfd5ef9ac770d2d29a800d8a399dcb94b9ec..9f48e5f5034da70cda786d8569a7287780868c9c 100644 (file)
@@ -76,18 +76,10 @@ static void drv_system_init (void)
 
        strcpy (dev.name, "serial");
        dev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_INPUT | DEV_FLAGS_SYSTEM;
-#ifdef CONFIG_SERIAL_SOFTWARE_FIFO
-       dev.putc = serial_buffered_putc;
-       dev.puts = serial_buffered_puts;
-       dev.getc = serial_buffered_getc;
-       dev.tstc = serial_buffered_tstc;
-#else
        dev.putc = serial_putc;
        dev.puts = serial_puts;
        dev.getc = serial_getc;
        dev.tstc = serial_tstc;
-#endif
-
        stdio_register (&dev);
 
 #ifdef CONFIG_SYS_DEVICE_NULLDEV
@@ -113,7 +105,7 @@ struct list_head* stdio_get_list(void)
        return &(devs.list);
 }
 
-struct stdio_dev* stdio_get_by_name(char* name)
+struct stdio_dev* stdio_get_by_name(const char *name)
 {
        struct list_head *pos;
        struct stdio_dev *dev;
@@ -163,12 +155,12 @@ int stdio_register (struct stdio_dev * dev)
  * returns 0 if success, -1 if device is assigned and 1 if devname not found
  */
 #ifdef CONFIG_SYS_STDIO_DEREGISTER
-int stdio_deregister(char *devname)
+int stdio_deregister(const char *devname)
 {
        int l;
        struct list_head *pos;
        struct stdio_dev *dev;
-       char temp_names[3][8];
+       char temp_names[3][16];
 
        dev = stdio_get_by_name(devname);
 
@@ -182,7 +174,7 @@ int stdio_deregister(char *devname)
                }
                memcpy (&temp_names[l][0],
                        stdio_devices[l]->name,
-                       sizeof(stdio_devices[l]->name));
+                       sizeof(temp_names[l]));
        }
 
        list_del(&(dev->list));
@@ -201,7 +193,7 @@ int stdio_deregister(char *devname)
 
 int stdio_init (void)
 {
-#if !defined(CONFIG_RELOC_FIXUP_WORKS)
+#if defined(CONFIG_NEEDS_MANUAL_RELOC)
        /* already relocated for current ARM implementation */
        ulong relocation_offset = gd->reloc_off;
        int i;
@@ -211,7 +203,7 @@ int stdio_init (void)
                stdio_names[i] = (char *) (((ulong) stdio_names[i]) +
                                                relocation_offset);
        }
-#endif /* !CONFIG_RELOC_FIXUP_WORKS */
+#endif /* CONFIG_NEEDS_MANUAL_RELOC */
 
        /* Initialize the list */
        INIT_LIST_HEAD(&(devs.list));
@@ -235,9 +227,7 @@ int stdio_init (void)
        drv_logbuff_init ();
 #endif
        drv_system_init ();
-#ifdef CONFIG_SERIAL_MULTI
        serial_stdio_init ();
-#endif
 #ifdef CONFIG_USB_TTY
        drv_usbtty_init ();
 #endif
@@ -247,6 +237,8 @@ int stdio_init (void)
 #ifdef CONFIG_JTAG_CONSOLE
        drv_jtag_console_init ();
 #endif
-
+#ifdef CONFIG_CBMEM_CONSOLE
+       cbmemc_init();
+#endif
        return (0);
 }