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