]>
Commit | Line | Data |
---|---|---|
281e00a3 WD |
1 | #ifndef __SERIAL_H__ |
2 | #define __SERIAL_H__ | |
3 | ||
7b826c2f MF |
4 | #include <post.h> |
5 | ||
281e00a3 | 6 | struct serial_device { |
f6add132 | 7 | /* enough bytes to match alignment of following func pointer */ |
78322d63 | 8 | char name[16]; |
281e00a3 | 9 | |
89143fb3 MV |
10 | int (*start)(void); |
11 | int (*stop)(void); | |
78322d63 MV |
12 | void (*setbrg)(void); |
13 | int (*getc)(void); | |
14 | int (*tstc)(void); | |
15 | void (*putc)(const char c); | |
16 | void (*puts)(const char *s); | |
7b826c2f | 17 | #if CONFIG_POST & CONFIG_SYS_POST_UART |
78322d63 | 18 | void (*loop)(int); |
7b826c2f | 19 | #endif |
78322d63 | 20 | struct serial_device *next; |
281e00a3 WD |
21 | }; |
22 | ||
bfb7d7a3 MV |
23 | void default_serial_puts(const char *s); |
24 | ||
281e00a3 WD |
25 | extern struct serial_device serial_smc_device; |
26 | extern struct serial_device serial_scc_device; | |
a6e6f7f4 GF |
27 | extern struct serial_device *default_serial_console(void); |
28 | ||
29 | #if defined(CONFIG_405GP) || defined(CONFIG_405CR) || \ | |
30 | defined(CONFIG_405EP) || defined(CONFIG_405EZ) || \ | |
31 | defined(CONFIG_405EX) || defined(CONFIG_440) || \ | |
32 | defined(CONFIG_MB86R0x) || defined(CONFIG_MPC5xxx) || \ | |
33 | defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) || \ | |
34 | defined(CONFIG_MPC86xx) || defined(CONFIG_SYS_SC520) || \ | |
6d6c0bae | 35 | defined(CONFIG_TEGRA) || defined(CONFIG_SYS_COREBOOT) || \ |
7636ebe1 | 36 | defined(CONFIG_MICROBLAZE) |
ff36fd85 WD |
37 | extern struct serial_device serial0_device; |
38 | extern struct serial_device serial1_device; | |
abc0ed8d MV |
39 | #endif |
40 | ||
0fd30252 WD |
41 | extern struct serial_device eserial1_device; |
42 | extern struct serial_device eserial2_device; | |
ff36fd85 | 43 | |
635f330f | 44 | extern void serial_register(struct serial_device *); |
281e00a3 | 45 | extern void serial_initialize(void); |
52cb4d4f | 46 | extern void serial_stdio_init(void); |
7813ca9b | 47 | extern int serial_assign(const char *name); |
281e00a3 WD |
48 | extern void serial_reinit_all(void); |
49 | ||
6299487e | 50 | /* For usbtty */ |
2ec1abea TR |
51 | #ifdef CONFIG_USB_TTY |
52 | ||
6299487e TR |
53 | extern int usbtty_getc(void); |
54 | extern void usbtty_putc(const char c); | |
55 | extern void usbtty_puts(const char *str); | |
56 | extern int usbtty_tstc(void); | |
57 | ||
2ec1abea TR |
58 | #else |
59 | ||
60 | /* stubs */ | |
61 | #define usbtty_getc() 0 | |
62 | #define usbtty_putc(a) | |
63 | #define usbtty_puts(a) | |
64 | #define usbtty_tstc() 0 | |
65 | ||
66 | #endif /* CONFIG_USB_TTY */ | |
67 | ||
036036d7 | 68 | #if defined(CONFIG_MPC512X) |
8e234e33 AG |
69 | extern struct stdio_dev *open_port(int num, int baudrate); |
70 | extern int close_port(int num); | |
71 | extern int write_port(struct stdio_dev *port, char *buf); | |
72 | extern int read_port(struct stdio_dev *port, char *buf, int size); | |
73 | #endif | |
74 | ||
281e00a3 | 75 | #endif |