]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/devices.c
Merge with git://www.denx.de/git/u-boot.git
[karo-tx-uboot.git] / common / devices.c
index 7489eac41eccae4904f08b45ffe50b20604e9cf8..ddf8f8ee2d9f8d9c220cb73198ee93a0b5335c87 100644 (file)
@@ -26,6 +26,7 @@
 #include <stdarg.h>
 #include <malloc.h>
 #include <devices.h>
+#include <serial.h>
 #ifdef CONFIG_LOGBUFFER
 #include <logbuff.h>
 #endif
 #include <i2c.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 list_t devlist = 0;
 device_t *stdio_devices[] = { NULL, NULL, NULL };
 char *stdio_names[MAX_FILES] = { "stdin", "stdout", "stderr" };
 
+#if defined(CONFIG_SPLASH_SCREEN) && !defined(CFG_DEVICE_NULLDEV)
+#define        CFG_DEVICE_NULLDEV      1
+#endif
+
+
 #ifdef CFG_DEVICE_NULLDEV
 void nulldev_putc(const char c)
 {
@@ -68,7 +76,7 @@ static void drv_system_init (void)
 
        strcpy (dev.name, "serial");
        dev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_INPUT | DEV_FLAGS_SYSTEM;
-#if CONFIG_SERIAL_SOFTWARE_FIFO
+#ifdef CONFIG_SERIAL_SOFTWARE_FIFO
        dev.putc = serial_buffered_putc;
        dev.puts = serial_buffered_puts;
        dev.getc = serial_buffered_getc;
@@ -153,16 +161,16 @@ int device_deregister(char *devname)
 
 int devices_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
-       int i;
+#ifndef CONFIG_ARM     /* already relocated for current ARM implementation */
        ulong relocation_offset = gd->reloc_off;
+       int i;
 
        /* relocate device name pointers */
        for (i = 0; i < (sizeof (stdio_names) / sizeof (char *)); ++i) {
                stdio_names[i] = (char *) (((ulong) stdio_names[i]) +
                                                relocation_offset);
        }
+#endif
 
        /* Initialize the list */
        devlist = ListCreate (sizeof (device_t));
@@ -177,18 +185,25 @@ int devices_init (void)
 #ifdef CONFIG_LCD
        drv_lcd_init ();
 #endif
-#ifdef CONFIG_VIDEO
+#if defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE)
        drv_video_init ();
 #endif
-#ifdef CONFIG_WL_4PPM_KEYBOARD
-       drv_wlkbd_init ();
+#ifdef CONFIG_KEYBOARD
+       drv_keyboard_init ();
 #endif
 #ifdef CONFIG_LOGBUFFER
        drv_logbuff_init ();
 #endif
        drv_system_init ();
-
-       gd-> flags |= GD_FLG_DEVINIT;   /* device initialization done */
+#ifdef CONFIG_SERIAL_MULTI
+       serial_devices_init ();
+#endif
+#ifdef CONFIG_USB_TTY
+       drv_usbtty_init ();
+#endif
+#ifdef CONFIG_NETCONSOLE
+       drv_nc_init ();
+#endif
 
        return (0);
 }