Blame view
include/serial.h
1.95 KB
281e00a3b
|
1 2 |
#ifndef __SERIAL_H__ #define __SERIAL_H__ |
7b826c2f3
|
3 |
#include <post.h> |
281e00a3b
|
4 |
struct serial_device { |
f6add132f
|
5 |
/* enough bytes to match alignment of following func pointer */ |
78322d63e
|
6 |
char name[16]; |
281e00a3b
|
7 |
|
89143fb3b
|
8 9 |
int (*start)(void); int (*stop)(void); |
78322d63e
|
10 11 12 13 14 |
void (*setbrg)(void); int (*getc)(void); int (*tstc)(void); void (*putc)(const char c); void (*puts)(const char *s); |
7b826c2f3
|
15 |
#if CONFIG_POST & CONFIG_SYS_POST_UART |
78322d63e
|
16 |
void (*loop)(int); |
7b826c2f3
|
17 |
#endif |
78322d63e
|
18 |
struct serial_device *next; |
281e00a3b
|
19 |
}; |
bfb7d7a3d
|
20 |
void default_serial_puts(const char *s); |
281e00a3b
|
21 22 |
extern struct serial_device serial_smc_device; extern struct serial_device serial_scc_device; |
a6e6f7f4d
|
23 |
extern struct serial_device *default_serial_console(void); |
3fb858891
|
24 |
#if defined(CONFIG_405GP) || \ |
a6e6f7f4d
|
25 26 27 28 29 |
defined(CONFIG_405EP) || defined(CONFIG_405EZ) || \ defined(CONFIG_405EX) || defined(CONFIG_440) || \ defined(CONFIG_MB86R0x) || defined(CONFIG_MPC5xxx) || \ defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) || \ defined(CONFIG_MPC86xx) || defined(CONFIG_SYS_SC520) || \ |
6d6c0baeb
|
30 |
defined(CONFIG_TEGRA) || defined(CONFIG_SYS_COREBOOT) || \ |
7636ebe1d
|
31 |
defined(CONFIG_MICROBLAZE) |
ff36fd859
|
32 33 |
extern struct serial_device serial0_device; extern struct serial_device serial1_device; |
abc0ed8da
|
34 |
#endif |
0fd30252c
|
35 36 |
extern struct serial_device eserial1_device; extern struct serial_device eserial2_device; |
ff36fd859
|
37 |
|
635f330fc
|
38 |
extern void serial_register(struct serial_device *); |
281e00a3b
|
39 |
extern void serial_initialize(void); |
52cb4d4fb
|
40 |
extern void serial_stdio_init(void); |
7813ca9b6
|
41 |
extern int serial_assign(const char *name); |
281e00a3b
|
42 |
extern void serial_reinit_all(void); |
6299487ef
|
43 |
/* For usbtty */ |
2ec1abea4
|
44 |
#ifdef CONFIG_USB_TTY |
6299487ef
|
45 46 47 48 |
extern int usbtty_getc(void); extern void usbtty_putc(const char c); extern void usbtty_puts(const char *str); extern int usbtty_tstc(void); |
2ec1abea4
|
49 50 51 52 53 54 55 56 57 |
#else /* stubs */ #define usbtty_getc() 0 #define usbtty_putc(a) #define usbtty_puts(a) #define usbtty_tstc() 0 #endif /* CONFIG_USB_TTY */ |
036036d79
|
58 |
#if defined(CONFIG_MPC512X) |
8e234e33b
|
59 60 61 62 63 |
extern struct stdio_dev *open_port(int num, int baudrate); extern int close_port(int num); extern int write_port(struct stdio_dev *port, char *buf); extern int read_port(struct stdio_dev *port, char *buf, int size); #endif |
281e00a3b
|
64 |
#endif |