summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/Makefile2
-rw-r--r--common/cmd_console.c8
-rw-r--r--common/cmd_flash.c6
-rw-r--r--common/cmd_i2c.c6
-rw-r--r--common/cmd_log.c6
-rw-r--r--common/cmd_mmc.c2
-rw-r--r--common/cmd_sata.c24
-rw-r--r--common/cmd_terminal.c6
-rw-r--r--common/console.c36
-rw-r--r--common/iomux.c14
-rw-r--r--common/lcd.c45
-rw-r--r--common/serial.c8
-rw-r--r--common/stdio.c (renamed from common/devices.c)50
-rw-r--r--common/usb_kbd.c14
14 files changed, 131 insertions, 96 deletions
diff --git a/common/Makefile b/common/Makefile
index dd6636b..89f1c88 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -32,7 +32,6 @@ COBJS-y += main.o
COBJS-y += circbuf.o
COBJS-y += console.o
COBJS-y += command.o
-COBJS-y += devices.o
COBJS-y += dlmalloc.o
COBJS-y += exports.o
COBJS-$(CONFIG_SYS_HUSH_PARSER) += hush.o
@@ -40,6 +39,7 @@ COBJS-y += image.o
COBJS-y += memsize.o
COBJS-y += s_record.o
COBJS-$(CONFIG_SERIAL_MULTI) += serial.o
+COBJS-y += stdio.o
COBJS-y += xyzModem.o
# core command
diff --git a/common/cmd_console.c b/common/cmd_console.c
index f861f83..178fbfe 100644
--- a/common/cmd_console.c
+++ b/common/cmd_console.c
@@ -26,22 +26,22 @@
*/
#include <common.h>
#include <command.h>
-#include <devices.h>
+#include <stdio_dev.h>
extern void _do_coninfo (void);
int do_coninfo (cmd_tbl_t * cmd, int flag, int argc, char *argv[])
{
int l;
- struct list_head *list = device_get_list();
+ struct list_head *list = stdio_get_list();
struct list_head *pos;
- device_t *dev;
+ struct stdio_dev *dev;
/* Scan for valid output and input devices */
puts ("List of available devices:\n");
list_for_each(pos, list) {
- dev = list_entry(pos, device_t, list);
+ dev = list_entry(pos, struct stdio_dev, list);
printf ("%-8s %08x %c%c%c ",
dev->name,
diff --git a/common/cmd_flash.c b/common/cmd_flash.c
index 9f27ab0..bc651fa 100644
--- a/common/cmd_flash.c
+++ b/common/cmd_flash.c
@@ -467,18 +467,18 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
flash_info_t *info;
ulong bank;
int i, n, sect_first, sect_last;
-#endif /* CONFIG_SYS_NO_FLASH */
ulong addr_first, addr_last;
- int p;
+#endif /* CONFIG_SYS_NO_FLASH */
#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
struct mtd_device *dev;
struct part_info *part;
u8 dev_type, dev_num, pnum;
#endif
- int rcode = 0;
#ifdef CONFIG_HAS_DATAFLASH
int status;
#endif
+ int p;
+ int rcode = 0;
if (argc < 3) {
cmd_usage(cmdtp);
diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index ae26845..8f0fc9e 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -1282,17 +1282,17 @@ int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
return do_i2c_crc(cmdtp, flag, argc, argv);
if (!strncmp(argv[0], "pr", 2))
return do_i2c_probe(cmdtp, flag, argc, argv);
- if (!strncmp(argv[0], "re", 2))
+ if (!strncmp(argv[0], "re", 2)) {
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
return 0;
+ }
if (!strncmp(argv[0], "lo", 2))
return do_i2c_loop(cmdtp, flag, argc, argv);
#if defined(CONFIG_CMD_SDRAM)
if (!strncmp(argv[0], "sd", 2))
return do_sdram(cmdtp, flag, argc, argv);
#endif
- else
- cmd_usage(cmdtp);
+ cmd_usage(cmdtp);
return 0;
}
diff --git a/common/cmd_log.c b/common/cmd_log.c
index d422d9f..3653fe1 100644
--- a/common/cmd_log.c
+++ b/common/cmd_log.c
@@ -42,7 +42,7 @@
#include <common.h>
#include <command.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <post.h>
#include <logbuff.h>
@@ -142,7 +142,7 @@ void logbuff_reset (void)
int drv_logbuff_init (void)
{
- device_t logdev;
+ struct stdio_dev logdev;
int rc;
/* Device initialization */
@@ -154,7 +154,7 @@ int drv_logbuff_init (void)
logdev.putc = logbuff_putc; /* 'putc' function */
logdev.puts = logbuff_puts; /* 'puts' function */
- rc = device_register (&logdev);
+ rc = stdio_register (&logdev);
return (rc == 0) ? 1 : rc;
}
diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
index 32fe49b..0e3393b 100644
--- a/common/cmd_mmc.c
+++ b/common/cmd_mmc.c
@@ -26,7 +26,7 @@
#include <mmc.h>
#ifndef CONFIG_GENERIC_MMC
-int curr_device = -1;
+static int curr_device = -1;
int do_mmc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
diff --git a/common/cmd_sata.c b/common/cmd_sata.c
index a8147e0..1693a7e 100644
--- a/common/cmd_sata.c
+++ b/common/cmd_sata.c
@@ -28,7 +28,7 @@
#include <part.h>
#include <sata.h>
-int curr_device = -1;
+int sata_curr_device = -1;
block_dev_desc_t sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE];
int __sata_initialize(void)
@@ -52,7 +52,7 @@ int __sata_initialize(void)
if ((sata_dev_desc[i].lba > 0) && (sata_dev_desc[i].blksz > 0))
init_part(&sata_dev_desc[i]);
}
- curr_device = 0;
+ sata_curr_device = 0;
return rc;
}
int sata_initialize(void) __attribute__((weak,alias("__sata_initialize")));
@@ -70,7 +70,7 @@ int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return sata_initialize();
/* If the user has not yet run `sata init`, do it now */
- if (curr_device == -1)
+ if (sata_curr_device == -1)
if (sata_initialize())
return 1;
@@ -91,12 +91,12 @@ int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
return 0;
} else if (strncmp(argv[1],"dev", 3) == 0) {
- if ((curr_device < 0) || (curr_device >= CONFIG_SYS_SATA_MAX_DEVICE)) {
+ if ((sata_curr_device < 0) || (sata_curr_device >= CONFIG_SYS_SATA_MAX_DEVICE)) {
puts("\nno SATA devices available\n");
return 1;
}
- printf("\nSATA device %d: ", curr_device);
- dev_print(&sata_dev_desc[curr_device]);
+ printf("\nSATA device %d: ", sata_curr_device);
+ dev_print(&sata_dev_desc[sata_curr_device]);
return 0;
} else if (strncmp(argv[1],"part",4) == 0) {
int dev, ok;
@@ -131,7 +131,7 @@ int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
if (sata_dev_desc[dev].type == DEV_TYPE_UNKNOWN)
return 1;
- curr_device = dev;
+ sata_curr_device = dev;
puts("... is now current device\n");
@@ -158,12 +158,12 @@ int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
lbaint_t blk = simple_strtoul(argv[3], NULL, 16);
printf("\nSATA read: device %d block # %ld, count %ld ... ",
- curr_device, blk, cnt);
+ sata_curr_device, blk, cnt);
- n = sata_read(curr_device, blk, cnt, (u32 *)addr);
+ n = sata_read(sata_curr_device, blk, cnt, (u32 *)addr);
/* flush cache after read */
- flush_cache(addr, cnt * sata_dev_desc[curr_device].blksz);
+ flush_cache(addr, cnt * sata_dev_desc[sata_curr_device].blksz);
printf("%ld blocks read: %s\n",
n, (n==cnt) ? "OK" : "ERROR");
@@ -176,9 +176,9 @@ int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
lbaint_t blk = simple_strtoul(argv[3], NULL, 16);
printf("\nSATA write: device %d block # %ld, count %ld ... ",
- curr_device, blk, cnt);
+ sata_curr_device, blk, cnt);
- n = sata_write(curr_device, blk, cnt, (u32 *)addr);
+ n = sata_write(sata_curr_device, blk, cnt, (u32 *)addr);
printf("%ld blocks written: %s\n",
n, (n == cnt) ? "OK" : "ERROR");
diff --git a/common/cmd_terminal.c b/common/cmd_terminal.c
index fd3dd48..60ec378 100644
--- a/common/cmd_terminal.c
+++ b/common/cmd_terminal.c
@@ -26,19 +26,19 @@
*/
#include <common.h>
#include <command.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <serial.h>
int do_terminal(cmd_tbl_t * cmd, int flag, int argc, char *argv[])
{
int last_tilde = 0;
- device_t *dev = NULL;
+ struct stdio_dev *dev = NULL;
if (argc < 1)
return -1;
/* Scan for selected output/input device */
- dev = device_get_by_name(argv[1]);
+ dev = stdio_get_by_name(argv[1]);
if (!dev)
return -1;
diff --git a/common/console.c b/common/console.c
index 2add047..0a36d2f 100644
--- a/common/console.c
+++ b/common/console.c
@@ -24,7 +24,7 @@
#include <common.h>
#include <stdarg.h>
#include <malloc.h>
-#include <console.h>
+#include <stdio_dev.h>
#include <exports.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -48,7 +48,7 @@ extern int overwrite_console(void);
#endif /* CONFIG_SYS_CONSOLE_IS_IN_ENV */
-static int console_setfile(int file, device_t * dev)
+static int console_setfile(int file, struct stdio_dev * dev)
{
int error = 0;
@@ -96,8 +96,8 @@ static int console_setfile(int file, device_t * dev)
#if defined(CONFIG_CONSOLE_MUX)
/** Console I/O multiplexing *******************************************/
-static device_t *tstcdev;
-device_t **console_devices[MAX_FILES];
+static struct stdio_dev *tstcdev;
+struct stdio_dev **console_devices[MAX_FILES];
int cd_count[MAX_FILES];
/*
@@ -119,7 +119,7 @@ static int console_getc(int file)
static int console_tstc(int file)
{
int i, ret;
- device_t *dev;
+ struct stdio_dev *dev;
disable_ctrlc(1);
for (i = 0; i < cd_count[file]; i++) {
@@ -141,7 +141,7 @@ static int console_tstc(int file)
static void console_putc(int file, const char c)
{
int i;
- device_t *dev;
+ struct stdio_dev *dev;
for (i = 0; i < cd_count[file]; i++) {
dev = console_devices[file][i];
@@ -153,7 +153,7 @@ static void console_putc(int file, const char c)
static void console_puts(int file, const char *s)
{
int i;
- device_t *dev;
+ struct stdio_dev *dev;
for (i = 0; i < cd_count[file]; i++) {
dev = console_devices[file][i];
@@ -167,7 +167,7 @@ static inline void console_printdevs(int file)
iomux_printdevs(file);
}
-static inline void console_doenv(int file, device_t *dev)
+static inline void console_doenv(int file, struct stdio_dev *dev)
{
iomux_doenv(file, dev->name);
}
@@ -197,7 +197,7 @@ static inline void console_printdevs(int file)
printf("%s\n", stdio_devices[file]->name);
}
-static inline void console_doenv(int file, device_t *dev)
+static inline void console_doenv(int file, struct stdio_dev *dev)
{
console_setfile(file, dev);
}
@@ -479,11 +479,11 @@ inline void dbg(const char *fmt, ...)
/** U-Boot INIT FUNCTIONS *************************************************/
-device_t *search_device(int flags, char *name)
+struct stdio_dev *search_device(int flags, char *name)
{
- device_t *dev;
+ struct stdio_dev *dev;
- dev = device_get_by_name(name);
+ dev = stdio_get_by_name(name);
if (dev && (dev->flags & flags))
return dev;
@@ -494,7 +494,7 @@ device_t *search_device(int flags, char *name)
int console_assign(int file, char *devname)
{
int flag;
- device_t *dev;
+ struct stdio_dev *dev;
/* Check for valid file */
switch (file) {
@@ -537,7 +537,7 @@ int console_init_f(void)
int console_init_r(void)
{
char *stdinname, *stdoutname, *stderrname;
- device_t *inputdev = NULL, *outputdev = NULL, *errdev = NULL;
+ struct stdio_dev *inputdev = NULL, *outputdev = NULL, *errdev = NULL;
#ifdef CONFIG_SYS_CONSOLE_ENV_OVERWRITE
int i;
#endif /* CONFIG_SYS_CONSOLE_ENV_OVERWRITE */
@@ -645,11 +645,11 @@ done:
/* Called after the relocation - use desired console functions */
int console_init_r(void)
{
- device_t *inputdev = NULL, *outputdev = NULL;
+ struct stdio_dev *inputdev = NULL, *outputdev = NULL;
int i;
- struct list_head *list = device_get_list();
+ struct list_head *list = stdio_get_list();
struct list_head *pos;
- device_t *dev;
+ struct stdio_dev *dev;
#ifdef CONFIG_SPLASH_SCREEN
/*
@@ -662,7 +662,7 @@ int console_init_r(void)
/* Scan devices looking for input and output devices */
list_for_each(pos, list) {
- dev = list_entry(pos, device_t, list);
+ dev = list_entry(pos, struct stdio_dev, list);
if ((dev->flags & DEV_FLAGS_INPUT) && (inputdev == NULL)) {
inputdev = dev;
diff --git a/common/iomux.c b/common/iomux.c
index bdcc853..91d98e9 100644
--- a/common/iomux.c
+++ b/common/iomux.c
@@ -29,7 +29,7 @@
void iomux_printdevs(const int console)
{
int i;
- device_t *dev;
+ struct stdio_dev *dev;
for (i = 0; i < cd_count[console]; i++) {
dev = console_devices[console][i];
@@ -43,8 +43,8 @@ int iomux_doenv(const int console, const char *arg)
{
char *console_args, *temp, **start;
int i, j, k, io_flag, cs_idx, repeat;
- device_t *dev;
- device_t **cons_set;
+ struct stdio_dev *dev;
+ struct stdio_dev **cons_set;
console_args = strdup(arg);
if (console_args == NULL)
@@ -85,7 +85,7 @@ int iomux_doenv(const int console, const char *arg)
*temp = '\0';
start[i] = temp + 1;
}
- cons_set = (device_t **)calloc(i, sizeof(device_t *));
+ cons_set = (struct stdio_dev **)calloc(i, sizeof(struct stdio_dev *));
if (cons_set == NULL) {
free(start);
free(console_args);
@@ -158,14 +158,14 @@ int iomux_doenv(const int console, const char *arg)
} else {
/* Works even if console_devices[console] is NULL. */
console_devices[console] =
- (device_t **)realloc(console_devices[console],
- cs_idx * sizeof(device_t *));
+ (struct stdio_dev **)realloc(console_devices[console],
+ cs_idx * sizeof(struct stdio_dev *));
if (console_devices[console] == NULL) {
free(cons_set);
return 1;
}
memcpy(console_devices[console], cons_set, cs_idx *
- sizeof(device_t *));
+ sizeof(struct stdio_dev *));
cd_count[console] = cs_idx;
}
diff --git a/common/lcd.c b/common/lcd.c
index 74a5c77..c87de0b 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -34,7 +34,7 @@
#include <command.h>
#include <stdarg.h>
#include <linux/types.h>
-#include <devices.h>
+#include <stdio_dev.h>
#if defined(CONFIG_POST)
#include <post.h>
#endif
@@ -355,7 +355,7 @@ static void test_pattern (void)
int drv_lcd_init (void)
{
- device_t lcddev;
+ struct stdio_dev lcddev;
int rc;
lcd_base = (void *)(gd->fb_base);
@@ -373,7 +373,7 @@ int drv_lcd_init (void)
lcddev.putc = lcd_putc; /* 'putc' function */
lcddev.puts = lcd_puts; /* 'puts' function */
- rc = device_register (&lcddev);
+ rc = stdio_register (&lcddev);
return (rc == 0) ? 1 : rc;
}
@@ -620,6 +620,11 @@ void bitmap_plot (int x, int y)
* Display the BMP file located at address bmp_image.
* Only uncompressed.
*/
+
+#ifdef CONFIG_SPLASH_SCREEN_ALIGN
+#define BMP_ALIGN_CENTER 0x7FFF
+#endif
+
int lcd_display_bitmap(ulong bmp_image, int x, int y)
{
#if !defined(CONFIG_MCC200)
@@ -731,6 +736,19 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
#endif
padded_line = (width&0x3) ? ((width&~0x3)+4) : (width);
+
+#ifdef CONFIG_SPLASH_SCREEN_ALIGN
+ if (x == BMP_ALIGN_CENTER)
+ x = max(0, (pwidth - width) / 2);
+ else if (x < 0)
+ x = max(0, pwidth - width + x + 1);
+
+ if (y == BMP_ALIGN_CENTER)
+ y = max(0, (panel_info.vl_row - height) / 2);
+ else if (y < 0)
+ y = max(0, panel_info.vl_row - height + y + 1);
+#endif /* CONFIG_SPLASH_SCREEN_ALIGN */
+
if ((x + width)>pwidth)
width = pwidth - x;
if ((y + height)>panel_info.vl_row)
@@ -809,9 +827,26 @@ static void *lcd_logo (void)
static int do_splash = 1;
if (do_splash && (s = getenv("splashimage")) != NULL) {
- addr = simple_strtoul(s, NULL, 16);
+ int x = 0, y = 0;
do_splash = 0;
+ addr = simple_strtoul (s, NULL, 16);
+#ifdef CONFIG_SPLASH_SCREEN_ALIGN
+ if ((s = getenv ("splashpos")) != NULL) {
+ if (s[0] == 'm')
+ x = BMP_ALIGN_CENTER;
+ else
+ x = simple_strtol (s, NULL, 0);
+
+ if ((s = strchr (s + 1, ',')) != NULL) {
+ if (s[1] == 'm')
+ y = BMP_ALIGN_CENTER;
+ else
+ y = simple_strtol (s + 1, NULL, 0);
+ }
+ }
+#endif /* CONFIG_SPLASH_SCREEN_ALIGN */
+
#ifdef CONFIG_VIDEO_BMP_GZIP
bmp_image_t *bmp = (bmp_image_t *)addr;
unsigned long len;
@@ -822,7 +857,7 @@ static void *lcd_logo (void)
}
#endif
- if (lcd_display_bitmap (addr, 0, 0) == 0) {
+ if (lcd_display_bitmap (addr, x, y) == 0) {
return ((void *)lcd_base);
}
}
diff --git a/common/serial.c b/common/serial.c
index 5d0a73c..41a24c2 100644
--- a/common/serial.c
+++ b/common/serial.c
@@ -23,7 +23,7 @@
#include <common.h>
#include <serial.h>
-#include <devices.h>
+#include <stdio_dev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -142,9 +142,9 @@ void serial_initialize (void)
serial_assign (default_serial_console ()->name);
}
-void serial_devices_init (void)
+void serial_stdio_init (void)
{
- device_t dev;
+ struct stdio_dev dev;
struct serial_device *s = serial_devices;
while (s) {
@@ -159,7 +159,7 @@ void serial_devices_init (void)
dev.getc = s->getc;
dev.tstc = s->tstc;
- device_register (&dev);
+ stdio_register (&dev);
s = s->next;
}
diff --git a/common/devices.c b/common/stdio.c
index ba53c9b..697df5a 100644
--- a/common/devices.c
+++ b/common/stdio.c
@@ -25,7 +25,7 @@
#include <common.h>
#include <stdarg.h>
#include <malloc.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <serial.h>
#ifdef CONFIG_LOGBUFFER
#include <logbuff.h>
@@ -36,8 +36,8 @@
DECLARE_GLOBAL_DATA_PTR;
-static device_t devs;
-device_t *stdio_devices[] = { NULL, NULL, NULL };
+static struct stdio_dev devs;
+struct stdio_dev *stdio_devices[] = { NULL, NULL, NULL };
char *stdio_names[MAX_FILES] = { "stdin", "stdout", "stderr" };
#if defined(CONFIG_SPLASH_SCREEN) && !defined(CONFIG_SYS_DEVICE_NULLDEV)
@@ -70,7 +70,7 @@ int nulldev_input(void)
static void drv_system_init (void)
{
- device_t dev;
+ struct stdio_dev dev;
memset (&dev, 0, sizeof (dev));
@@ -88,7 +88,7 @@ static void drv_system_init (void)
dev.tstc = serial_tstc;
#endif
- device_register (&dev);
+ stdio_register (&dev);
#ifdef CONFIG_SYS_DEVICE_NULLDEV
memset (&dev, 0, sizeof (dev));
@@ -100,7 +100,7 @@ static void drv_system_init (void)
dev.getc = nulldev_input;
dev.tstc = nulldev_input;
- device_register (&dev);
+ stdio_register (&dev);
#endif
}
@@ -108,21 +108,21 @@ static void drv_system_init (void)
* DEVICES
**************************************************************************
*/
-struct list_head* device_get_list(void)
+struct list_head* stdio_get_list(void)
{
return &(devs.list);
}
-device_t* device_get_by_name(char* name)
+struct stdio_dev* stdio_get_by_name(char* name)
{
struct list_head *pos;
- device_t *dev;
+ struct stdio_dev *dev;
if(!name)
return NULL;
list_for_each(pos, &(devs.list)) {
- dev = list_entry(pos, device_t, list);
+ dev = list_entry(pos, struct stdio_dev, list);
if(strcmp(dev->name, name) == 0)
return dev;
}
@@ -130,29 +130,29 @@ device_t* device_get_by_name(char* name)
return NULL;
}
-device_t* device_clone(device_t *dev)
+struct stdio_dev* stdio_clone(struct stdio_dev *dev)
{
- device_t *_dev;
+ struct stdio_dev *_dev;
if(!dev)
return NULL;
- _dev = calloc(1, sizeof(device_t));
+ _dev = calloc(1, sizeof(struct stdio_dev));
if(!_dev)
return NULL;
- memcpy(_dev, dev, sizeof(device_t));
+ memcpy(_dev, dev, sizeof(struct stdio_dev));
strncpy(_dev->name, dev->name, 16);
return _dev;
}
-int device_register (device_t * dev)
+int stdio_register (struct stdio_dev * dev)
{
- device_t *_dev;
+ struct stdio_dev *_dev;
- _dev = device_clone(dev);
+ _dev = stdio_clone(dev);
if(!_dev)
return -1;
list_add_tail(&(_dev->list), &(devs.list));
@@ -162,15 +162,15 @@ int device_register (device_t * dev)
/* deregister the device "devname".
* returns 0 if success, -1 if device is assigned and 1 if devname not found
*/
-#ifdef CONFIG_SYS_DEVICE_DEREGISTER
-int device_deregister(char *devname)
+#ifdef CONFIG_SYS_STDIO_DEREGISTER
+int stdio_deregister(char *devname)
{
int l;
struct list_head *pos;
- device_t *dev;
+ struct stdio_dev *dev;
char temp_names[3][8];
- dev = device_get_by_name(devname);
+ dev = stdio_get_by_name(devname);
if(!dev) /* device not found */
return -1;
@@ -189,7 +189,7 @@ int device_deregister(char *devname)
/* reassign Device list */
list_for_each(pos, &(devs.list)) {
- dev = list_entry(pos, device_t, list);
+ dev = list_entry(pos, struct stdio_dev, list);
for (l=0 ; l< MAX_FILES; l++) {
if(strcmp(dev->name, temp_names[l]) == 0)
stdio_devices[l] = dev;
@@ -197,9 +197,9 @@ int device_deregister(char *devname)
}
return 0;
}
-#endif /* CONFIG_SYS_DEVICE_DEREGISTER */
+#endif /* CONFIG_SYS_STDIO_DEREGISTER */
-int devices_init (void)
+int stdio_init (void)
{
#ifndef CONFIG_ARM /* already relocated for current ARM implementation */
ulong relocation_offset = gd->reloc_off;
@@ -235,7 +235,7 @@ int devices_init (void)
#endif
drv_system_init ();
#ifdef CONFIG_SERIAL_MULTI
- serial_devices_init ();
+ serial_stdio_init ();
#endif
#ifdef CONFIG_USB_TTY
drv_usbtty_init ();
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index e0d006c..b458d77 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -25,7 +25,7 @@
*
*/
#include <common.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <asm/byteorder.h>
#include <usb.h>
@@ -153,7 +153,7 @@ static int usb_kbd_probe(struct usb_device *dev, unsigned int ifnum);
int drv_usb_kbd_init(void)
{
int error,i;
- device_t usb_kbd_dev,*old_dev;
+ struct stdio_dev usb_kbd_dev,*old_dev;
struct usb_device *dev;
char *stdinname = getenv ("stdin");
@@ -168,7 +168,7 @@ int drv_usb_kbd_init(void)
if(usb_kbd_probe(dev,0)==1) { /* Ok, we found a keyboard */
/* check, if it is already registered */
USB_KBD_PRINTF("USB KBD found set up device.\n");
- old_dev = device_get_by_name(DEVNAME);
+ old_dev = stdio_get_by_name(DEVNAME);
if(old_dev) {
/* ok, already registered, just return ok */
USB_KBD_PRINTF("USB KBD is already registered.\n");
@@ -176,7 +176,7 @@ int drv_usb_kbd_init(void)
}
/* register the keyboard */
USB_KBD_PRINTF("USB KBD register.\n");
- memset (&usb_kbd_dev, 0, sizeof(device_t));
+ memset (&usb_kbd_dev, 0, sizeof(struct stdio_dev));
strcpy(usb_kbd_dev.name, DEVNAME);
usb_kbd_dev.flags = DEV_FLAGS_INPUT | DEV_FLAGS_SYSTEM;
usb_kbd_dev.putc = NULL;
@@ -184,7 +184,7 @@ int drv_usb_kbd_init(void)
usb_kbd_dev.getc = usb_kbd_getc;
usb_kbd_dev.tstc = usb_kbd_testc;
usb_kbd_dev.priv = (void *)dev;
- error = device_register (&usb_kbd_dev);
+ error = stdio_register (&usb_kbd_dev);
if(error==0) {
/* check if this is the standard input device */
if(strcmp(stdinname,DEVNAME)==0) {
@@ -212,8 +212,8 @@ int drv_usb_kbd_init(void)
/* deregistering the keyboard */
int usb_kbd_deregister(void)
{
-#ifdef CONFIG_SYS_DEVICE_DEREGISTER
- return device_deregister(DEVNAME);
+#ifdef CONFIG_SYS_STDIO_DEREGISTER
+ return stdio_deregister(DEVNAME);
#else
return 1;
#endif