wdenk | 7ac1610 | 2004-08-01 22:48:16 +0000 | [diff] [blame] | 1 | #ifndef __SERIAL_H__ |
| 2 | #define __SERIAL_H__ |
| 3 | |
| 4 | #define NAMESIZE 16 |
| 5 | #define CTLRSIZE 8 |
| 6 | |
| 7 | struct 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 | |
| 21 | extern struct serial_device serial_smc_device; |
| 22 | extern struct serial_device serial_scc_device; |
| 23 | extern struct serial_device * default_serial_console (void); |
| 24 | |
wdenk | 96c7a8c | 2005-01-09 22:28:56 +0000 | [diff] [blame] | 25 | #if defined(CONFIG_405GP) || defined(CONFIG_405CR) || defined(CONFIG_440) \ |
Stefan Roese | f6c7b76 | 2007-03-24 15:45:34 +0100 | [diff] [blame] | 26 | || defined(CONFIG_405EP) || defined(CONFIG_405EZ) || defined(CONFIG_MPC5xxx) |
wdenk | 96c7a8c | 2005-01-09 22:28:56 +0000 | [diff] [blame] | 27 | extern struct serial_device serial0_device; |
| 28 | extern struct serial_device serial1_device; |
Wolfgang Denk | 44df561 | 2006-08-30 23:02:10 +0200 | [diff] [blame] | 29 | #if defined(CFG_NS16550_SERIAL) |
| 30 | extern struct serial_device eserial1_device; |
| 31 | extern struct serial_device eserial2_device; |
| 32 | extern struct serial_device eserial3_device; |
| 33 | extern struct serial_device eserial4_device; |
| 34 | #endif /* CFG_NS16550_SERIAL */ |
| 35 | |
wdenk | 96c7a8c | 2005-01-09 22:28:56 +0000 | [diff] [blame] | 36 | #endif |
| 37 | |
| 38 | |
wdenk | 7ac1610 | 2004-08-01 22:48:16 +0000 | [diff] [blame] | 39 | extern void serial_initialize(void); |
| 40 | extern void serial_devices_init(void); |
| 41 | extern int serial_assign(char * name); |
| 42 | extern void serial_reinit_all(void); |
| 43 | |
| 44 | #endif |