wdenk | 281e00a | 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); |
Anatolij Gustschin | fbb0030 | 2010-04-24 19:27:04 +0200 | [diff] [blame^] | 12 | int (*uninit) (void); |
wdenk | 281e00a | 2004-08-01 22:48:16 +0000 | [diff] [blame] | 13 | void (*setbrg) (void); |
| 14 | int (*getc) (void); |
| 15 | int (*tstc) (void); |
| 16 | void (*putc) (const char c); |
| 17 | void (*puts) (const char *s); |
| 18 | |
| 19 | struct serial_device *next; |
| 20 | }; |
| 21 | |
| 22 | extern struct serial_device serial_smc_device; |
| 23 | extern struct serial_device serial_scc_device; |
| 24 | extern struct serial_device * default_serial_console (void); |
| 25 | |
Stefan Roese | dbbd125 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 26 | #if defined(CONFIG_405GP) || defined(CONFIG_405CR) || defined(CONFIG_440) || \ |
| 27 | defined(CONFIG_405EP) || defined(CONFIG_405EZ) || defined(CONFIG_405EX) || \ |
Poonam Aggrwal | 039594a | 2009-07-02 16:15:01 +0530 | [diff] [blame] | 28 | defined(CONFIG_MPC5xxx) || defined(CONFIG_MPC83xx) || \ |
| 29 | defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) |
wdenk | ff36fd8 | 2005-01-09 22:28:56 +0000 | [diff] [blame] | 30 | extern struct serial_device serial0_device; |
| 31 | extern struct serial_device serial1_device; |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 32 | #if defined(CONFIG_SYS_NS16550_SERIAL) |
Wolfgang Denk | 0fd3025 | 2006-08-30 23:02:10 +0200 | [diff] [blame] | 33 | extern struct serial_device eserial1_device; |
| 34 | extern struct serial_device eserial2_device; |
| 35 | extern struct serial_device eserial3_device; |
| 36 | extern struct serial_device eserial4_device; |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 37 | #endif /* CONFIG_SYS_NS16550_SERIAL */ |
Wolfgang Denk | 0fd3025 | 2006-08-30 23:02:10 +0200 | [diff] [blame] | 38 | |
wdenk | ff36fd8 | 2005-01-09 22:28:56 +0000 | [diff] [blame] | 39 | #endif |
| 40 | |
Harald Welte | a7c185e | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 41 | #if defined(CONFIG_S3C2410) |
| 42 | extern struct serial_device s3c24xx_serial0_device; |
| 43 | extern struct serial_device s3c24xx_serial1_device; |
| 44 | extern struct serial_device s3c24xx_serial2_device; |
| 45 | #endif |
wdenk | ff36fd8 | 2005-01-09 22:28:56 +0000 | [diff] [blame] | 46 | |
Minkyu Kang | dd2c9e6 | 2009-10-01 17:20:28 +0900 | [diff] [blame] | 47 | #if defined(CONFIG_S5PC1XX) |
| 48 | extern struct serial_device s5pc1xx_serial0_device; |
| 49 | extern struct serial_device s5pc1xx_serial1_device; |
| 50 | extern struct serial_device s5pc1xx_serial2_device; |
| 51 | extern struct serial_device s5pc1xx_serial3_device; |
| 52 | #endif |
| 53 | |
Tom Rix | 660888b | 2009-05-31 12:44:37 +0200 | [diff] [blame] | 54 | #if defined(CONFIG_OMAP3_ZOOM2) |
| 55 | extern struct serial_device zoom2_serial_device0; |
| 56 | extern struct serial_device zoom2_serial_device1; |
| 57 | extern struct serial_device zoom2_serial_device2; |
| 58 | extern struct serial_device zoom2_serial_device3; |
| 59 | #endif |
| 60 | |
stefano babic | 80172c6 | 2007-08-30 22:57:04 +0200 | [diff] [blame] | 61 | extern struct serial_device serial_ffuart_device; |
| 62 | extern struct serial_device serial_btuart_device; |
| 63 | extern struct serial_device serial_stuart_device; |
| 64 | |
wdenk | 281e00a | 2004-08-01 22:48:16 +0000 | [diff] [blame] | 65 | extern void serial_initialize(void); |
Jean-Christophe PLAGNIOL-VILLARD | 52cb4d4 | 2009-05-16 12:14:54 +0200 | [diff] [blame] | 66 | extern void serial_stdio_init(void); |
wdenk | 281e00a | 2004-08-01 22:48:16 +0000 | [diff] [blame] | 67 | extern int serial_assign(char * name); |
| 68 | extern void serial_reinit_all(void); |
| 69 | |
Tom Rix | 6299487 | 2009-10-31 12:37:44 -0500 | [diff] [blame] | 70 | /* For usbtty */ |
Tom Rix | 2ec1abe | 2009-10-31 12:37:45 -0500 | [diff] [blame] | 71 | #ifdef CONFIG_USB_TTY |
| 72 | |
Tom Rix | 6299487 | 2009-10-31 12:37:44 -0500 | [diff] [blame] | 73 | extern int usbtty_getc(void); |
| 74 | extern void usbtty_putc(const char c); |
| 75 | extern void usbtty_puts(const char *str); |
| 76 | extern int usbtty_tstc(void); |
| 77 | |
Tom Rix | 2ec1abe | 2009-10-31 12:37:45 -0500 | [diff] [blame] | 78 | #else |
| 79 | |
| 80 | /* stubs */ |
| 81 | #define usbtty_getc() 0 |
| 82 | #define usbtty_putc(a) |
| 83 | #define usbtty_puts(a) |
| 84 | #define usbtty_tstc() 0 |
| 85 | |
| 86 | #endif /* CONFIG_USB_TTY */ |
| 87 | |
wdenk | 281e00a | 2004-08-01 22:48:16 +0000 | [diff] [blame] | 88 | #endif |