]>
Commit | Line | Data |
---|---|---|
281e00a3 WD |
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); | |
fbb0030e | 12 | int (*uninit) (void); |
281e00a3 WD |
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 | ||
dbbd1257 SR |
26 | #if defined(CONFIG_405GP) || defined(CONFIG_405CR) || defined(CONFIG_440) || \ |
27 | defined(CONFIG_405EP) || defined(CONFIG_405EZ) || defined(CONFIG_405EX) || \ | |
039594a4 PA |
28 | defined(CONFIG_MPC5xxx) || defined(CONFIG_MPC83xx) || \ |
29 | defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) | |
ff36fd85 WD |
30 | extern struct serial_device serial0_device; |
31 | extern struct serial_device serial1_device; | |
6d0f6bcf | 32 | #if defined(CONFIG_SYS_NS16550_SERIAL) |
0fd30252 WD |
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; | |
6d0f6bcf | 37 | #endif /* CONFIG_SYS_NS16550_SERIAL */ |
0fd30252 | 38 | |
ff36fd85 WD |
39 | #endif |
40 | ||
e3b28e67 AG |
41 | #if defined(CONFIG_MPC512X) |
42 | extern struct serial_device serial1_device; | |
43 | extern struct serial_device serial3_device; | |
44 | extern struct serial_device serial4_device; | |
45 | extern struct serial_device serial6_device; | |
46 | #endif | |
47 | ||
a7c185ed HW |
48 | #if defined(CONFIG_S3C2410) |
49 | extern struct serial_device s3c24xx_serial0_device; | |
50 | extern struct serial_device s3c24xx_serial1_device; | |
51 | extern struct serial_device s3c24xx_serial2_device; | |
52 | #endif | |
ff36fd85 | 53 | |
dd2c9e6a | 54 | #if defined(CONFIG_S5PC1XX) |
46a3b5c8 MK |
55 | extern struct serial_device s5p_serial0_device; |
56 | extern struct serial_device s5p_serial1_device; | |
57 | extern struct serial_device s5p_serial2_device; | |
58 | extern struct serial_device s5p_serial3_device; | |
dd2c9e6a MK |
59 | #endif |
60 | ||
660888b7 TR |
61 | #if defined(CONFIG_OMAP3_ZOOM2) |
62 | extern struct serial_device zoom2_serial_device0; | |
63 | extern struct serial_device zoom2_serial_device1; | |
64 | extern struct serial_device zoom2_serial_device2; | |
65 | extern struct serial_device zoom2_serial_device3; | |
66 | #endif | |
67 | ||
80172c61 SB |
68 | extern struct serial_device serial_ffuart_device; |
69 | extern struct serial_device serial_btuart_device; | |
70 | extern struct serial_device serial_stuart_device; | |
71 | ||
281e00a3 | 72 | extern void serial_initialize(void); |
52cb4d4f | 73 | extern void serial_stdio_init(void); |
281e00a3 WD |
74 | extern int serial_assign(char * name); |
75 | extern void serial_reinit_all(void); | |
76 | ||
6299487e | 77 | /* For usbtty */ |
2ec1abea TR |
78 | #ifdef CONFIG_USB_TTY |
79 | ||
6299487e TR |
80 | extern int usbtty_getc(void); |
81 | extern void usbtty_putc(const char c); | |
82 | extern void usbtty_puts(const char *str); | |
83 | extern int usbtty_tstc(void); | |
84 | ||
2ec1abea TR |
85 | #else |
86 | ||
87 | /* stubs */ | |
88 | #define usbtty_getc() 0 | |
89 | #define usbtty_putc(a) | |
90 | #define usbtty_puts(a) | |
91 | #define usbtty_tstc() 0 | |
92 | ||
93 | #endif /* CONFIG_USB_TTY */ | |
94 | ||
8e234e33 AG |
95 | #if defined(CONFIG_MPC512X) && defined(CONFIG_SERIAL_MULTI) |
96 | extern struct stdio_dev *open_port(int num, int baudrate); | |
97 | extern int close_port(int num); | |
98 | extern int write_port(struct stdio_dev *port, char *buf); | |
99 | extern int read_port(struct stdio_dev *port, char *buf, int size); | |
100 | #endif | |
101 | ||
281e00a3 | 102 | #endif |