*/
#include <common.h>
#include <asm/processor.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include "ps2kbd.h"
int drv_isa_kbd_init (void)
{
int error;
- device_t kbddev ;
+ struct stdio_dev kbddev ;
char *stdinname = getenv ("stdin");
if(isa_kbd_init() == -1)
kbddev.getc = kbd_getc ;
kbddev.tstc = kbd_testc ;
- error = device_register (&kbddev);
+ error = stdio_register (&kbddev);
if(error==0) {
/* check if this is the standard input device */
if(strcmp(stdinname,DEVNAME)==0) {
*/
#include <common.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include "memio.h"
#include <part.h>
int drv_video_init(void)
{
int error, devices = 1 ;
- device_t vgadev ;
+ struct stdio_dev vgadev ;
if (video_inited) return 1;
video_inited = 1;
video_init();
vgadev.tstc = NULL;
vgadev.start = video_start;
- error = device_register (&vgadev);
+ error = stdio_register (&vgadev);
if (error == 0)
{
#include <asm/mach-common/bits/dma.h>
#include <i2c.h>
#include <linux/types.h>
-#include <devices.h>
+#include <stdio_dev.h>
int gunzip(void *, int, unsigned char *, unsigned long *);
int drv_video_init(void)
{
int error, devices = 1;
- device_t videodev;
+ struct stdio_dev videodev;
u8 *dst;
u32 fbmem_size = LCD_X_RES * LCD_Y_RES * LCD_PIXEL_SIZE + ACTIVE_VIDEO_MEM_OFFSET;
videodev.putc = video_putc; /* 'putc' function */
videodev.puts = video_puts; /* 'puts' function */
- error = device_register(&videodev);
+ error = stdio_register(&videodev);
return (error == 0) ? devices : error;
}
#include <asm/mach-common/bits/dma.h>
#include <i2c.h>
#include <linux/types.h>
-#include <devices.h>
+#include <stdio_dev.h>
int gunzip(void *, int, unsigned char *, unsigned long *);
int drv_video_init(void)
{
- device_t videodev;
+ struct stdio_dev videodev;
video_init((void *)NTSC_FRAME_ADDR);
videodev.ext = DEV_EXT_VIDEO;
videodev.flags = DEV_FLAGS_SYSTEM;
- return device_register(&videodev);
+ return stdio_register(&videodev);
}
#include <asm/mach-common/bits/dma.h>
#include <i2c.h>
#include <linux/types.h>
-#include <devices.h>
+#include <stdio_dev.h>
int gunzip(void *, int, unsigned char *, unsigned long *);
int drv_video_init(void)
{
int error, devices = 1;
- device_t videodev;
+ struct stdio_dev videodev;
u8 *dst;
u32 fbmem_size = LCD_X_RES * LCD_Y_RES * LCD_PIXEL_SIZE + ACTIVE_VIDEO_MEM_OFFSET;
videodev.putc = video_putc; /* 'putc' function */
videodev.puts = video_puts; /* 'puts' function */
- error = device_register(&videodev);
+ error = stdio_register(&videodev);
return (error == 0) ? devices : error;
}
#include <watchdog.h>
#include <command.h>
#include <malloc.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <net.h>
#include <timestamp.h>
#include <dtt.h>
#include "../common/fsl_diu_fb.h"
#if defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE)
-#include <devices.h>
+#include <stdio_dev.h>
#include <video_fb.h>
#endif
*/
#include <common.h>
#include <ns16550.h>
-#include <console.h>
+#include <stdio_dev.h>
/* Button codes from the AVR */
#define PWRR 0x20 /* Power button release */
#include <asm/processor.h>
#include <asm/byteorder.h>
#include <i2c.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <pci.h>
#include <malloc.h>
#include <bzlib.h>
#include <common.h>
#include <asm/processor.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include "isa.h"
#include "piix4_pci.h"
#include "kbd.h"
*/
#include <common.h>
#include <asm/processor.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include "isa.h"
#include "kbd.h"
int drv_isa_kbd_init (void)
{
int error;
- device_t kbddev ;
+ struct stdio_dev kbddev ;
char *stdinname = getenv ("stdin");
if(isa_kbd_init()==-1)
kbddev.getc = kbd_getc ;
kbddev.tstc = kbd_testc ;
- error = device_register (&kbddev);
+ error = stdio_register (&kbddev);
if(error==0) {
/* check if this is the standard input device */
if(strcmp(stdinname,DEVNAME)==0) {
#include <common.h>
#include <mpc5xx.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <pci_ids.h>
#define PLX9056_LOC
#include "plx9056.h"
int recbuf[REC_BUFFER_SIZE];
static int r_ptr = 0;
int w_ptr;
-device_t pci_con_dev;
+struct stdio_dev pci_con_dev;
int conn=0;
int buff_full=0;
pci_con_dev.puts = pci_con_puts;
pci_con_dev.getc = pci_con_getc;
pci_con_dev.tstc = pci_con_tstc;
- device_register (&pci_con_dev);
+ stdio_register (&pci_con_dev);
printf("PATI ready for PCI connection, type ctrl-c for exit\n");
do {
udelay(10);
#include <version.h>
#include <linux/types.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <sed156x.h>
int drv_phone_init(void)
{
- device_t console_dev;
+ struct stdio_dev console_dev;
console_init();
console_dev.tstc = phone_tstc; /* 'tstc' function */
console_dev.getc = phone_getc; /* 'getc' function */
- if (device_register(&console_dev) == 0)
+ if (stdio_register(&console_dev) == 0)
return 1;
return 0;
#include <common.h>
#include <watchdog.h>
#include <commproc.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <lcd.h>
DECLARE_GLOBAL_DATA_PTR;
int drv_keyboard_init(void)
{
int error = 0;
- device_t kbd_dev;
+ struct stdio_dev kbd_dev;
if (0) {
/* register the keyboard */
- memset (&kbd_dev, 0, sizeof(device_t));
+ memset (&kbd_dev, 0, sizeof(struct stdio_dev));
strcpy(kbd_dev.name, "kbd");
kbd_dev.flags = DEV_FLAGS_INPUT | DEV_FLAGS_SYSTEM;
kbd_dev.putc = NULL;
kbd_dev.puts = NULL;
kbd_dev.getc = smc1_getc;
kbd_dev.tstc = smc1_tstc;
- error = device_register (&kbd_dev);
+ error = stdio_register (&kbd_dev);
} else {
lcd_is_enabled = 0;
lcd_disable();
#include <version.h>
#include <stdarg.h>
#include <linux/types.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <s3c2400.h>
DECLARE_GLOBAL_DATA_PTR;
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
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
*/
#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,
#include <common.h>
#include <command.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <post.h>
#include <logbuff.h>
int drv_logbuff_init (void)
{
- device_t logdev;
+ struct stdio_dev logdev;
int rc;
/* Device initialization */
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;
}
*/
#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;
#include <common.h>
#include <stdarg.h>
#include <malloc.h>
-#include <console.h>
+#include <stdio_dev.h>
#include <exports.h>
DECLARE_GLOBAL_DATA_PTR;
#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;
#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];
/*
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++) {
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];
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];
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);
}
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);
}
/** 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;
int console_assign(int file, char *devname)
{
int flag;
- device_t *dev;
+ struct stdio_dev *dev;
/* Check for valid file */
switch (file) {
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 */
/* 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
/*
/* 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;
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];
{
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)
*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);
} 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;
}
#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
int drv_lcd_init (void)
{
- device_t lcddev;
+ struct stdio_dev lcddev;
int rc;
lcd_base = (void *)(gd->fb_base);
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;
}
#include <common.h>
#include <serial.h>
-#include <devices.h>
+#include <stdio_dev.h>
DECLARE_GLOBAL_DATA_PTR;
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) {
dev.getc = s->getc;
dev.tstc = s->tstc;
- device_register (&dev);
+ stdio_register (&dev);
s = s->next;
}
#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>
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)
static void drv_system_init (void)
{
- device_t dev;
+ struct stdio_dev dev;
memset (&dev, 0, sizeof (dev));
dev.tstc = serial_tstc;
#endif
- device_register (&dev);
+ stdio_register (&dev);
#ifdef CONFIG_SYS_DEVICE_NULLDEV
memset (&dev, 0, sizeof (dev));
dev.getc = nulldev_input;
dev.tstc = nulldev_input;
- device_register (&dev);
+ stdio_register (&dev);
#endif
}
* 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;
}
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));
/* 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;
/* 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;
}
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;
#endif
drv_system_init ();
#ifdef CONFIG_SERIAL_MULTI
- serial_devices_init ();
+ serial_stdio_init ();
#endif
#ifdef CONFIG_USB_TTY
drv_usbtty_init ();
*
*/
#include <common.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <asm/byteorder.h>
#include <usb.h>
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");
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");
}
/* 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;
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) {
/* 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
*/
#include <common.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <asm/blackfin.h>
#ifndef CONFIG_JTAG_CONSOLE_TIMEOUT
int drv_jtag_console_init(void)
{
- device_t dev;
+ struct stdio_dev dev;
int ret;
memset(&dev, 0x00, sizeof(dev));
dev.tstc = jtag_tstc;
dev.getc = jtag_getc;
- ret = device_register(&dev);
+ ret = stdio_register(&dev);
return (ret == 0 ? 1 : ret);
}
#include "../../board/freescale/common/fsl_diu_fb.h"
#if defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE)
-#include <devices.h>
+#include <stdio_dev.h>
#include <video_fb.h>
#endif
#include <stdarg.h>
#include <lcdvideo.h>
#include <linux/types.h>
-#include <devices.h>
+#include <stdio_dev.h>
#if defined(CONFIG_POST)
#include <post.h>
#endif
#include <timestamp.h>
#include <i2c.h>
#include <linux/types.h>
-#include <devices.h>
+#include <stdio_dev.h>
#ifdef CONFIG_VIDEO
{
int error, devices = 1;
- device_t videodev;
+ struct stdio_dev videodev;
video_init ((void *)(gd->fb_base)); /* Video initialization */
videodev.putc = video_putc; /* 'putc' function */
videodev.puts = video_puts; /* 'puts' function */
- error = device_register (&videodev);
+ error = stdio_register (&videodev);
return (error == 0) ? devices : error;
}
#include <version.h>
#include <stdarg.h>
#include <linux/types.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <lcd.h>
#include <asm/arch/pxa-regs.h>
#include <common.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <keyboard.h>
#undef KBG_DEBUG
int kbd_init (void)
{
int error;
- device_t kbddev ;
+ struct stdio_dev kbddev ;
char *stdinname = getenv ("stdin");
if(kbd_init_hw()==-1)
kbddev.getc = kbd_getc ;
kbddev.tstc = kbd_testc ;
- error = device_register (&kbddev);
+ error = stdio_register (&kbddev);
if(error==0) {
/* check if this is the standard input device */
if(strcmp(stdinname,DEVNAME)==0) {
#include <common.h>
#include <command.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <net.h>
DECLARE_GLOBAL_DATA_PTR;
int drv_nc_init (void)
{
- device_t dev;
+ struct stdio_dev dev;
int rc;
memset (&dev, 0, sizeof (dev));
dev.getc = nc_getc;
dev.tstc = nc_tstc;
- rc = device_register (&dev);
+ rc = stdio_register (&dev);
return (rc == 0) ? 1 : rc;
}
*/
#include <common.h>
-#include <devices.h>
+#include <stdio_dev.h>
#if defined(CONFIG_CPU_V6)
/*
}
#ifdef CONFIG_ARM_DCC_MULTI
-static device_t arm_dcc_dev;
+static struct stdio_dev arm_dcc_dev;
int drv_arm_dcc_init(void)
{
arm_dcc_dev.putc = arm_dcc_putc; /* 'putc' function */
arm_dcc_dev.puts = arm_dcc_puts; /* 'puts' function */
- return device_register(&arm_dcc_dev);
+ return stdio_register(&arm_dcc_dev);
}
#endif
#include <common.h>
#include <config.h>
#include <circbuf.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include "usbtty.h"
#include "usb_cdc_acm.h"
#include "usbdescriptors.h"
/*
* Instance variables
*/
-static device_t usbttydev;
+static struct stdio_dev usbttydev;
static struct usb_device_instance device_instance[1];
static struct usb_bus_instance bus_instance[1];
static struct usb_configuration_instance config_instance[NUM_CONFIGS];
usbttydev.putc = usbtty_putc; /* 'putc' function */
usbttydev.puts = usbtty_puts; /* 'puts' function */
- rc = device_register (&usbttydev);
+ rc = stdio_register (&usbttydev);
return (rc == 0) ? 1 : rc;
}
*/
void usb_event_poll()
{
- device_t *dev;
+ struct stdio_dev *dev;
struct usb_device *usb_kbd_dev;
struct usb_interface_descriptor *iface;
struct usb_endpoint_descriptor *ep;
int maxp;
/* Get the pointer to USB Keyboard device pointer */
- dev = device_get_by_name("usbkbd");
+ dev = stdio_get_by_name("usbkbd");
usb_kbd_dev = (struct usb_device *)dev->priv;
iface = &usb_kbd_dev->config.if_desc[0];
ep = &iface->ep_desc[0];
#include "musb_core.h"
#ifdef CONFIG_USB_KEYBOARD
-#include <devices.h>
+#include <stdio_dev.h>
extern unsigned char new[];
#endif
#include <version.h>
#include <linux/types.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <video_font.h>
#if defined(CONFIG_CMD_DATE)
int drv_video_init (void)
{
int skip_dev_init;
- device_t console_dev;
+ struct stdio_dev console_dev;
/* Check if video initialization should be skipped */
if (board_video_skip())
console_dev.getc = VIDEO_GETC_FCT; /* 'getc' function */
#endif /* CONFIG_VGA_AS_SINGLE_DEVICE */
- if (device_register (&console_dev) != 0)
+ if (stdio_register (&console_dev) != 0)
return 0;
/* Return success */
#define CONFIG_USB_UHCI 1
#define CONFIG_USB_STORAGE 1
#define CONFIG_USB_KEYBOARD 1
-#define CONFIG_SYS_DEVICE_DEREGISTER 1 /* needed by CONFIG_USB_KEYBOARD */
+#define CONFIG_SYS_STDIO_DEREGISTER 1 /* needed by CONFIG_USB_KEYBOARD */
/*
* Autoboot stuff
#define CONFIG_USB_STORAGE
/* Enable needed helper functions */
-#define CONFIG_SYS_DEVICE_DEREGISTER /* needs device_deregister */
+#define CONFIG_SYS_STDIO_DEREGISTER /* needs stdio_deregister */
#endif
/************************************************************
* Debug support
#define CONFIG_PCI_OHCI 1
#define CONFIG_USB_OHCI_NEW 1
#define CONFIG_USB_KEYBOARD 1
-#define CONFIG_SYS_DEVICE_DEREGISTER
+#define CONFIG_SYS_STDIO_DEREGISTER
#define CONFIG_SYS_USB_EVENT_POLL 1
#define CONFIG_SYS_USB_OHCI_SLOT_NAME "ohci_pci"
#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 15
#define CONFIG_PCI_OHCI 1
#define CONFIG_USB_OHCI_NEW 1
#define CONFIG_USB_KEYBOARD 1
-#define CONFIG_SYS_DEVICE_DEREGISTER
+#define CONFIG_SYS_STDIO_DEREGISTER
#define CONFIG_SYS_USB_EVENT_POLL 1
#define CONFIG_SYS_USB_OHCI_SLOT_NAME "ohci_pci"
#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 15
#define CONFIG_USB_STORAGE
/* Enable needed helper functions */
-#define CONFIG_SYS_DEVICE_DEREGISTER /* needs device_deregister */
+#define CONFIG_SYS_STDIO_DEREGISTER /* needs stdio_deregister */
/************************************************************
* Debug support
#define CONFIG_DOS_PARTITION 1
/* Enable needed helper functions */
-#define CONFIG_SYS_DEVICE_DEREGISTER /* needs device_deregister */
+#define CONFIG_SYS_STDIO_DEREGISTER /* needs stdio_deregister */
/************************************************************
* RTC
#define CONFIG_CMD_USB
#define CONFIG_USB_STORAGE
/* Enable needed helper functions */
-#define CONFIG_SYS_DEVICE_DEREGISTER /* needs device_deregister */
+#define CONFIG_SYS_STDIO_DEREGISTER /* needs stdio_deregister */
#endif
/*
#define CONFIG_SYS_MAXARGS 32 /* max number of command args */
#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */
-#define CONFIG_SYS_DEVICE_DEREGISTER /* needs device_deregister */
+#define CONFIG_SYS_STDIO_DEREGISTER /* needs stdio_deregister */
#define CONFIG_SYS_HZ 1000
#define CONFIG_SYS_HZ_CLOCK (AT91C_MASTER_CLOCK/2) /* AT91C_TC0_CMR is implicitly set to */
+++ /dev/null
-/*
- * (C) Copyright 2000
- * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#ifndef _CONSOLE_H_
-#define _CONSOLE_H_
-
-#include <devices.h>
-
-/*
-** VARIABLES
-*/
-
-extern device_t *stdio_devices[] ;
-extern char *stdio_names[MAX_FILES] ;
-
-#endif
#ifndef _IO_MUX_H
#define _IO_MUX_H
-#include <devices.h>
+#include <stdio_dev.h>
/*
* Stuff required to support console multiplexing.
* Pointers to devices used for each file type. Defined in console.c
* but storage is allocated in iomux.c.
*/
-extern device_t **console_devices[MAX_FILES];
+extern struct stdio_dev **console_devices[MAX_FILES];
/*
* The count of devices assigned to each FILE. Defined in console.c
* and populated in iomux.c.
int iomux_doenv(const int, const char *);
void iomux_printdevs(const int);
-device_t *search_device(int, char *);
+struct stdio_dev *search_device(int, char *);
#endif /* _IO_MUX_H */
extern struct serial_device serial_stuart_device;
extern void serial_initialize(void);
-extern void serial_devices_init(void);
+extern void serial_stdio_init(void);
extern int serial_assign(char * name);
extern void serial_reinit_all(void);
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* MA 02111-1307 USA
*/
-#include <linux/list.h>
+#ifndef _STDIO_DEV_H_
+#define _STDIO_DEV_H_
-#ifndef _DEVICES_H_
-#define _DEVICES_H_
+#include <linux/list.h>
/*
- * CONSOLE DEVICES
+ * STDIO DEVICES
*/
#define DEV_FLAGS_INPUT 0x00000001 /* Device can be used as input console */
#define DEV_EXT_VIDEO 0x00000001 /* Video extensions supported */
/* Device information */
-typedef struct {
+struct stdio_dev {
int flags; /* Device flags: input/output/system */
int ext; /* Supported extensions */
char name[16]; /* Device name */
void *priv; /* Private extensions */
struct list_head list;
-} device_t;
+};
/*
* VIDEO EXTENSIONS
/*
* VARIABLES
*/
-extern device_t *stdio_devices[];
+extern struct stdio_dev *stdio_devices[];
extern char *stdio_names[MAX_FILES];
/*
* PROTOTYPES
*/
-int device_register (device_t * dev);
-int devices_init (void);
-#ifdef CONFIG_SYS_DEVICE_DEREGISTER
-int device_deregister(char *devname);
+int stdio_register (struct stdio_dev * dev);
+int stdio_init (void);
+#ifdef CONFIG_SYS_STDIO_DEREGISTER
+int stdio_deregister(char *devname);
#endif
-struct list_head* device_get_list(void);
-device_t* device_get_by_name(char* name);
-device_t* device_clone(device_t *dev);
+struct list_head* stdio_get_list(void);
+struct stdio_dev* stdio_get_by_name(char* name);
+struct stdio_dev* stdio_clone(struct stdio_dev *dev);
#ifdef CONFIG_ARM_DCC_MULTI
int drv_arm_dcc_init(void);
int drv_jtag_console_init (void);
#endif
-#endif /* _DEVICES_H_ */
+#endif
#include <common.h>
#include <command.h>
#include <malloc.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <timestamp.h>
#include <version.h>
#include <net.h>
/* IP Address */
gd->bd->bi_ip_addr = getenv_IPaddr ("ipaddr");
- devices_init (); /* get the devices list going. */
+ stdio_init (); /* get the devices list going. */
jumptable_init ();
#include <common.h>
#include <command.h>
#include <malloc.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <timestamp.h>
#include <version.h>
#include <net.h>
bd->bi_ip_addr = getenv_IPaddr ("ipaddr");
- devices_init();
+ stdio_init();
jumptable_init();
console_init_r();
#include <common.h>
#include <command.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <environment.h>
#include <malloc.h>
#include <net.h>
/* relocate environment function pointers etc. */
env_relocate();
- /* Initialize devices */
- devices_init();
+ /* Initialize stdio devices */
+ stdio_init();
jumptable_init();
/* Initialize the console (after the relocation and devices init) */
*/
#include <common.h>
-#include <console.h>
+#include <stdio_dev.h>
#include <watchdog.h>
#include <post.h>
#include <common.h>
#include <watchdog.h>
#include <command.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <timestamp.h>
#include <version.h>
#include <malloc.h>
show_boot_progress(0x27);
- devices_init ();
+ stdio_init ();
jumptable_init ();
#include <common.h>
#include <pci.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <i8042.h>
#include <asm/ptrace.h>
#include <asm/realmode.h>
{
u16 pos;
- static device_t vga_dev;
- static device_t kbd_dev;
+ static struct stdio_dev vga_dev;
+ static struct stdio_dev kbd_dev;
vidmem = (char *) 0xb8000;
vidport = 0x3d4;
vga_dev.tstc = NULL; /* 'tstc' function */
vga_dev.getc = NULL; /* 'getc' function */
- if (device_register(&vga_dev) == 0) {
+ if (stdio_register(&vga_dev) == 0) {
return 1;
}
kbd_dev.tstc = i8042_tstc; /* 'tstc' function */
kbd_dev.getc = i8042_getc; /* 'getc' function */
- if (device_register(&kbd_dev) == 0) {
+ if (stdio_register(&kbd_dev) == 0) {
return 1;
}
return 0;
#include <watchdog.h>
#include <command.h>
#include <malloc.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <asm/immap.h>
#endif
/** leave this here (after malloc(), environment and PCI are working) **/
- /* Initialize devices */
- devices_init ();
+ /* Initialize stdio devices */
+ stdio_init ();
/* Initialize the jump table for applications */
jumptable_init ();
#include <common.h>
#include <command.h>
#include <malloc.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <timestamp.h>
#include <version.h>
#include <net.h>
#endif
/** leave this here (after malloc(), environment and PCI are working) **/
- /* Initialize devices */
- devices_init ();
+ /* Initialize stdio devices */
+ stdio_init ();
jumptable_init ();
*/
#include <common.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <watchdog.h>
#include <net.h>
#ifdef CONFIG_STATUS_LED
bd->bi_ip_addr = getenv_IPaddr ("ipaddr");
WATCHDOG_RESET ();
- devices_init();
+ stdio_init();
jumptable_init();
console_init_r();
/*
*/
#include <common.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <watchdog.h>
#include <net.h>
#ifdef CONFIG_STATUS_LED
bd->bi_ip_addr = getenv_IPaddr ("ipaddr");
WATCHDOG_RESET ();
- devices_init();
+ stdio_init();
jumptable_init();
console_init_r();
#include <watchdog.h>
#include <command.h>
#include <malloc.h>
-#include <devices.h>
+#include <stdio_dev.h>
#ifdef CONFIG_8xx
#include <mpc8xx.h>
#endif
#endif
/** leave this here (after malloc(), environment and PCI are working) **/
- /* Initialize devices */
- devices_init ();
+ /* Initialize stdio devices */
+ stdio_init ();
/* Initialize the jump table for applications */
jumptable_init ();
#include <common.h>
#include <command.h>
#include <malloc.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <timestamp.h>
#include <version.h>
#include <watchdog.h>
sh_flash_init, /* Flash memory(NOR) init*/
INIT_FUNC_NAND_INIT/* Flash memory (NAND) init */
INIT_FUNC_PCI_INIT /* PCI init */
- devices_init,
+ stdio_init,
console_init_r,
interrupt_init,
#ifdef BOARD_LATE_INIT
#include <common.h>
#include <command.h>
#include <malloc.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <config.h>
#if defined(CONFIG_CMD_IDE)
#include <ide.h>
pci_init();
#endif
- /* Initialize devices */
- devices_init();
+ /* Initialize stdio devices */
+ stdio_init();
/* Initialize the jump table for applications */
jumptable_init();
*/
#include <common.h>
-#include <console.h>
+#include <stdio_dev.h>
#include <watchdog.h>
#include <post.h>