blob: 48800595d7816bed37ad1685bf081d87f58f842a [file] [log] [blame]
wdenk281e00a2004-08-01 22:48:16 +00001#ifndef __SERIAL_H__
2#define __SERIAL_H__
3
4#define NAMESIZE 16
5#define CTLRSIZE 8
6
7struct serial_device {
8 char name[NAMESIZE];
9 char ctlr[CTLRSIZE];
10
11 int (*init) (void);
12 void (*setbrg) (void);
13 int (*getc) (void);
14 int (*tstc) (void);
15 void (*putc) (const char c);
16 void (*puts) (const char *s);
17
18 struct serial_device *next;
19};
20
21extern struct serial_device serial_smc_device;
22extern struct serial_device serial_scc_device;
23extern struct serial_device * default_serial_console (void);
24
wdenkff36fd82005-01-09 22:28:56 +000025#if defined(CONFIG_405GP) || defined(CONFIG_405CR) || defined(CONFIG_440) \
Wolfgang Denkc12cffc2006-06-16 17:04:45 +020026 || defined(CONFIG_405EP) || defined(CONFIG_MPC5xxx)
wdenkff36fd82005-01-09 22:28:56 +000027extern struct serial_device serial0_device;
28extern struct serial_device serial1_device;
Wolfgang Denk0fd30252006-08-30 23:02:10 +020029#if defined(CFG_NS16550_SERIAL)
30extern struct serial_device eserial1_device;
31extern struct serial_device eserial2_device;
32extern struct serial_device eserial3_device;
33extern struct serial_device eserial4_device;
34#endif /* CFG_NS16550_SERIAL */
35
wdenkff36fd82005-01-09 22:28:56 +000036#endif
37
38
wdenk281e00a2004-08-01 22:48:16 +000039extern void serial_initialize(void);
40extern void serial_devices_init(void);
41extern int serial_assign(char * name);
42extern void serial_reinit_all(void);
43
44#endif