3 * originally from linux source (arch/ppc/boot/ns16550.h)
5 * have addresses as offsets from CFG_ISA_BASE
6 * added a few more definitions
7 * added prototypes for ns16550.c
8 * reduced no of com ports to 2
9 * modifications (c) Rob Taylor, Flying Pig Systems. 2000.
12 #if (CFG_NS16550_REG_SIZE == 1)
14 unsigned char rbr; /* 0 */
15 unsigned char ier; /* 1 */
16 unsigned char fcr; /* 2 */
17 unsigned char lcr; /* 3 */
18 unsigned char mcr; /* 4 */
19 unsigned char lsr; /* 5 */
20 unsigned char msr; /* 6 */
21 unsigned char scr; /* 7 */
22 #if defined(CONFIG_OMAP730)
23 unsigned char mdr1; /* 8 */
24 unsigned char reg9; /* 9 */
25 unsigned char regA; /* A */
26 unsigned char regB; /* B */
27 unsigned char regC; /* C */
28 unsigned char regD; /* D */
29 unsigned char regE; /* E */
30 unsigned char regF; /* F */
31 unsigned char reg10; /* 10 */
32 unsigned char ssr; /* 11*/
34 } __attribute__ ((packed));
35 #elif (CFG_NS16550_REG_SIZE == 2)
37 unsigned short rbr; /* 0 */
38 unsigned short ier; /* 1 */
39 unsigned short fcr; /* 2 */
40 unsigned short lcr; /* 3 */
41 unsigned short mcr; /* 4 */
42 unsigned short lsr; /* 5 */
43 unsigned short msr; /* 6 */
44 unsigned short scr; /* 7 */
45 } __attribute__ ((packed));
46 #elif (CFG_NS16550_REG_SIZE == 4)
48 unsigned long rbr; /* 0 */
49 unsigned long ier; /* 1 */
50 unsigned long fcr; /* 2 */
51 unsigned long lcr; /* 3 */
52 unsigned long mcr; /* 4 */
53 unsigned long lsr; /* 5 */
54 unsigned long msr; /* 6 */
55 unsigned long scr; /* 7 */
56 } __attribute__ ((packed));
57 #elif (CFG_NS16550_REG_SIZE == -4)
59 unsigned char rbr; /* 0 */
61 unsigned char ier; /* 1 */
63 unsigned char fcr; /* 2 */
65 unsigned char lcr; /* 3 */
67 unsigned char mcr; /* 4 */
69 unsigned char lsr; /* 5 */
71 unsigned char msr; /* 6 */
73 unsigned char scr; /* 7 */
75 #if defined(CONFIG_OMAP)
76 unsigned char mdr1; /* mode select reset TL16C750*/
78 #ifdef CONFIG_OMAP1510
80 unsigned long pad[10];
81 unsigned char osc_12m_sel;
84 } __attribute__ ((packed));
86 #error "Please define NS16550 registers size."
94 typedef volatile struct NS16550 *NS16550_t;
96 #define FCR_FIFO_EN 0x01 /* Fifo enable */
97 #define FCR_RXSR 0x02 /* Receiver soft reset */
98 #define FCR_TXSR 0x04 /* Transmitter soft reset */
102 #define MCR_DMA_EN 0x04
103 #define MCR_TX_DFR 0x08
105 #define LCR_WLS_MSK 0x03 /* character length slect mask */
106 #define LCR_WLS_5 0x00 /* 5 bit character length */
107 #define LCR_WLS_6 0x01 /* 6 bit character length */
108 #define LCR_WLS_7 0x02 /* 7 bit character length */
109 #define LCR_WLS_8 0x03 /* 8 bit character length */
110 #define LCR_STB 0x04 /* Number of stop Bits, off = 1, on = 1.5 or 2) */
111 #define LCR_PEN 0x08 /* Parity eneble */
112 #define LCR_EPS 0x10 /* Even Parity Select */
113 #define LCR_STKP 0x20 /* Stick Parity */
114 #define LCR_SBRK 0x40 /* Set Break */
115 #define LCR_BKSE 0x80 /* Bank select enable */
117 #define LSR_DR 0x01 /* Data ready */
118 #define LSR_OE 0x02 /* Overrun */
119 #define LSR_PE 0x04 /* Parity error */
120 #define LSR_FE 0x08 /* Framing error */
121 #define LSR_BI 0x10 /* Break */
122 #define LSR_THRE 0x20 /* Xmit holding register empty */
123 #define LSR_TEMT 0x40 /* Xmitter empty */
124 #define LSR_ERR 0x80 /* Error */
126 #ifdef CONFIG_OMAP1510
127 #define OSC_12M_SEL 0x01 /* selects 6.5 * current clk div */
130 /* useful defaults for LCR */
133 void NS16550_init (NS16550_t com_port, int baud_divisor);
134 void NS16550_putc (NS16550_t com_port, char c);
135 char NS16550_getc (NS16550_t com_port);
136 int NS16550_tstc (NS16550_t com_port);
137 void NS16550_reinit (NS16550_t com_port, int baud_divisor);