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 | |
Stefan Roese | 153b3e2 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 25 | #if defined(CONFIG_405GP) || defined(CONFIG_405CR) || defined(CONFIG_440) || \ |
| 26 | defined(CONFIG_405EP) || defined(CONFIG_405EZ) || defined(CONFIG_405EX) || \ |
Poonam Aggrwal | 8a1f364 | 2009-07-02 16:15:01 +0530 | [diff] [blame] | 27 | defined(CONFIG_MPC5xxx) || defined(CONFIG_MPC83xx) || \ |
| 28 | defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) |
wdenk | 96c7a8c | 2005-01-09 22:28:56 +0000 | [diff] [blame] | 29 | extern struct serial_device serial0_device; |
| 30 | extern struct serial_device serial1_device; |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 31 | #if defined(CONFIG_SYS_NS16550_SERIAL) |
Wolfgang Denk | 44df561 | 2006-08-30 23:02:10 +0200 | [diff] [blame] | 32 | extern struct serial_device eserial1_device; |
| 33 | extern struct serial_device eserial2_device; |
| 34 | extern struct serial_device eserial3_device; |
| 35 | extern struct serial_device eserial4_device; |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 36 | #endif /* CONFIG_SYS_NS16550_SERIAL */ |
Wolfgang Denk | 44df561 | 2006-08-30 23:02:10 +0200 | [diff] [blame] | 37 | |
wdenk | 96c7a8c | 2005-01-09 22:28:56 +0000 | [diff] [blame] | 38 | #endif |
| 39 | |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 40 | #if defined(CONFIG_S3C2410) |
| 41 | extern struct serial_device s3c24xx_serial0_device; |
| 42 | extern struct serial_device s3c24xx_serial1_device; |
| 43 | extern struct serial_device s3c24xx_serial2_device; |
| 44 | #endif |
wdenk | 96c7a8c | 2005-01-09 22:28:56 +0000 | [diff] [blame] | 45 | |
Minkyu Kang | fca3084 | 2009-10-01 17:20:28 +0900 | [diff] [blame] | 46 | #if defined(CONFIG_S5PC1XX) |
| 47 | extern struct serial_device s5pc1xx_serial0_device; |
| 48 | extern struct serial_device s5pc1xx_serial1_device; |
| 49 | extern struct serial_device s5pc1xx_serial2_device; |
| 50 | extern struct serial_device s5pc1xx_serial3_device; |
| 51 | #endif |
| 52 | |
Tom Rix | 93bed9b | 2009-05-31 12:44:37 +0200 | [diff] [blame] | 53 | #if defined(CONFIG_OMAP3_ZOOM2) |
| 54 | extern struct serial_device zoom2_serial_device0; |
| 55 | extern struct serial_device zoom2_serial_device1; |
| 56 | extern struct serial_device zoom2_serial_device2; |
| 57 | extern struct serial_device zoom2_serial_device3; |
| 58 | #endif |
| 59 | |
stefano babic | 5ab4f03 | 2007-08-30 22:57:04 +0200 | [diff] [blame] | 60 | extern struct serial_device serial_ffuart_device; |
| 61 | extern struct serial_device serial_btuart_device; |
| 62 | extern struct serial_device serial_stuart_device; |
| 63 | |
wdenk | 7ac1610 | 2004-08-01 22:48:16 +0000 | [diff] [blame] | 64 | extern void serial_initialize(void); |
Jean-Christophe PLAGNIOL-VILLARD | 2a7a031 | 2009-05-16 12:14:54 +0200 | [diff] [blame] | 65 | extern void serial_stdio_init(void); |
wdenk | 7ac1610 | 2004-08-01 22:48:16 +0000 | [diff] [blame] | 66 | extern int serial_assign(char * name); |
| 67 | extern void serial_reinit_all(void); |
| 68 | |
Tom Rix | a36796b | 2009-10-31 12:37:44 -0500 | [diff] [blame] | 69 | /* For usbtty */ |
Tom Rix | 7bea868 | 2009-10-31 12:37:45 -0500 | [diff] [blame] | 70 | #ifdef CONFIG_USB_TTY |
| 71 | |
Tom Rix | a36796b | 2009-10-31 12:37:44 -0500 | [diff] [blame] | 72 | extern int usbtty_getc(void); |
| 73 | extern void usbtty_putc(const char c); |
| 74 | extern void usbtty_puts(const char *str); |
| 75 | extern int usbtty_tstc(void); |
| 76 | |
Tom Rix | 7bea868 | 2009-10-31 12:37:45 -0500 | [diff] [blame] | 77 | #else |
| 78 | |
| 79 | /* stubs */ |
| 80 | #define usbtty_getc() 0 |
| 81 | #define usbtty_putc(a) |
| 82 | #define usbtty_puts(a) |
| 83 | #define usbtty_tstc() 0 |
| 84 | |
| 85 | #endif /* CONFIG_USB_TTY */ |
| 86 | |
wdenk | 7ac1610 | 2004-08-01 22:48:16 +0000 | [diff] [blame] | 87 | #endif |