blob: bbda3f08c6001d6add64f7dfa8d1d882e5ab4eed [file] [log] [blame]
wdenk281e00a2004-08-01 22:48:16 +00001#ifndef __SERIAL_H__
2#define __SERIAL_H__
3
4#define NAMESIZE 16
5#define CTLRSIZE 8
6
7struct 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
21extern struct serial_device serial_smc_device;
22extern struct serial_device serial_scc_device;
23extern struct serial_device * default_serial_console (void);
24
Stefan Roesedbbd1252007-10-05 17:10:59 +020025#if defined(CONFIG_405GP) || defined(CONFIG_405CR) || defined(CONFIG_440) || \
26 defined(CONFIG_405EP) || defined(CONFIG_405EZ) || defined(CONFIG_405EX) || \
Poonam Aggrwal039594a2009-07-02 16:15:01 +053027 defined(CONFIG_MPC5xxx) || defined(CONFIG_MPC83xx) || \
28 defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
wdenkff36fd82005-01-09 22:28:56 +000029extern struct serial_device serial0_device;
30extern struct serial_device serial1_device;
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020031#if defined(CONFIG_SYS_NS16550_SERIAL)
Wolfgang Denk0fd30252006-08-30 23:02:10 +020032extern struct serial_device eserial1_device;
33extern struct serial_device eserial2_device;
34extern struct serial_device eserial3_device;
35extern struct serial_device eserial4_device;
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020036#endif /* CONFIG_SYS_NS16550_SERIAL */
Wolfgang Denk0fd30252006-08-30 23:02:10 +020037
wdenkff36fd82005-01-09 22:28:56 +000038#endif
39
Harald Weltea7c185e2007-12-19 14:24:40 +010040#if defined(CONFIG_S3C2410)
41extern struct serial_device s3c24xx_serial0_device;
42extern struct serial_device s3c24xx_serial1_device;
43extern struct serial_device s3c24xx_serial2_device;
44#endif
wdenkff36fd82005-01-09 22:28:56 +000045
Minkyu Kangdd2c9e62009-10-01 17:20:28 +090046#if defined(CONFIG_S5PC1XX)
47extern struct serial_device s5pc1xx_serial0_device;
48extern struct serial_device s5pc1xx_serial1_device;
49extern struct serial_device s5pc1xx_serial2_device;
50extern struct serial_device s5pc1xx_serial3_device;
51#endif
52
Tom Rix660888b2009-05-31 12:44:37 +020053#if defined(CONFIG_OMAP3_ZOOM2)
54extern struct serial_device zoom2_serial_device0;
55extern struct serial_device zoom2_serial_device1;
56extern struct serial_device zoom2_serial_device2;
57extern struct serial_device zoom2_serial_device3;
58#endif
59
stefano babic80172c62007-08-30 22:57:04 +020060extern struct serial_device serial_ffuart_device;
61extern struct serial_device serial_btuart_device;
62extern struct serial_device serial_stuart_device;
63
wdenk281e00a2004-08-01 22:48:16 +000064extern void serial_initialize(void);
Jean-Christophe PLAGNIOL-VILLARD52cb4d42009-05-16 12:14:54 +020065extern void serial_stdio_init(void);
wdenk281e00a2004-08-01 22:48:16 +000066extern int serial_assign(char * name);
67extern void serial_reinit_all(void);
68
69#endif