xref: /openbmc/u-boot/include/serial.h (revision a380279b)
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);
12 	void (*setbrg) (void);
13 	int (*getc) (void);
14 	int (*tstc) (void);
15 	void (*putc) (const char c);
16 	void (*puts) (const char *s);
17 
18 	struct serial_device *next;
19 };
20 
21 extern struct serial_device serial_smc_device;
22 extern struct serial_device serial_scc_device;
23 extern struct serial_device * default_serial_console (void);
24 
25 #if defined(CONFIG_405GP) || defined(CONFIG_405CR) || defined(CONFIG_440) || \
26     defined(CONFIG_405EP) || defined(CONFIG_405EZ) || defined(CONFIG_405EX) || \
27     defined(CONFIG_MPC5xxx) || defined(CONFIG_MPC83xx) || \
28     defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
29 extern struct serial_device serial0_device;
30 extern struct serial_device serial1_device;
31 #if defined(CONFIG_SYS_NS16550_SERIAL)
32 extern struct serial_device eserial1_device;
33 extern struct serial_device eserial2_device;
34 extern struct serial_device eserial3_device;
35 extern struct serial_device eserial4_device;
36 #endif /* CONFIG_SYS_NS16550_SERIAL */
37 
38 #endif
39 
40 #if defined(CONFIG_S3C2410)
41 extern struct serial_device s3c24xx_serial0_device;
42 extern struct serial_device s3c24xx_serial1_device;
43 extern struct serial_device s3c24xx_serial2_device;
44 #endif
45 
46 #if defined(CONFIG_OMAP3_ZOOM2)
47 extern struct serial_device zoom2_serial_device0;
48 extern struct serial_device zoom2_serial_device1;
49 extern struct serial_device zoom2_serial_device2;
50 extern struct serial_device zoom2_serial_device3;
51 #endif
52 
53 extern struct serial_device serial_ffuart_device;
54 extern struct serial_device serial_btuart_device;
55 extern struct serial_device serial_stuart_device;
56 
57 extern void serial_initialize(void);
58 extern void serial_stdio_init(void);
59 extern int serial_assign(char * name);
60 extern void serial_reinit_all(void);
61 
62 #endif
63