2 * linux/include/asm-arm/hardware/serial_amba.h
4 * Internal header file for AMBA serial ports
6 * Copyright (C) ARM Limited
7 * Copyright (C) 2000 Deep Blue Solutions Ltd.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #ifndef ASM_ARM_HARDWARE_SERIAL_AMBA_H
24 #define ASM_ARM_HARDWARE_SERIAL_AMBA_H
26 /* -------------------------------------------------------------------------------
27 * From AMBA UART (PL010) Block Specification
28 * -------------------------------------------------------------------------------
29 * UART Register Offsets.
31 #define UART01x_DR 0x00 /* Data read or written from the interface. */
32 #define UART01x_RSR 0x04 /* Receive status register (Read). */
33 #define UART01x_ECR 0x04 /* Error clear register (Write). */
34 #define UART010_LCRH 0x08 /* Line control register, high byte. */
35 #define ST_UART011_DMAWM 0x08 /* DMA watermark configure register. */
36 #define UART010_LCRM 0x0C /* Line control register, middle byte. */
37 #define ST_UART011_TIMEOUT 0x0C /* Timeout period register. */
38 #define UART010_LCRL 0x10 /* Line control register, low byte. */
39 #define UART010_CR 0x14 /* Control register. */
40 #define UART01x_FR 0x18 /* Flag register (Read only). */
41 #define UART010_IIR 0x1C /* Interrupt indentification register (Read). */
42 #define UART010_ICR 0x1C /* Interrupt clear register (Write). */
43 #define ST_UART011_LCRH_RX 0x1C /* Rx line control register. */
44 #define UART01x_ILPR 0x20 /* IrDA low power counter register. */
45 #define UART011_IBRD 0x24 /* Integer baud rate divisor register. */
46 #define UART011_FBRD 0x28 /* Fractional baud rate divisor register. */
47 #define UART011_LCRH 0x2c /* Line control register. */
48 #define ST_UART011_LCRH_TX 0x2c /* Tx Line control register. */
49 #define UART011_CR 0x30 /* Control register. */
50 #define UART011_IFLS 0x34 /* Interrupt fifo level select. */
51 #define UART011_IMSC 0x38 /* Interrupt mask. */
52 #define UART011_RIS 0x3c /* Raw interrupt status. */
53 #define UART011_MIS 0x40 /* Masked interrupt status. */
54 #define UART011_ICR 0x44 /* Interrupt clear register. */
55 #define UART011_DMACR 0x48 /* DMA control register. */
56 #define ST_UART011_XFCR 0x50 /* XON/XOFF control register. */
57 #define ST_UART011_XON1 0x54 /* XON1 register. */
58 #define ST_UART011_XON2 0x58 /* XON2 register. */
59 #define ST_UART011_XOFF1 0x5C /* XON1 register. */
60 #define ST_UART011_XOFF2 0x60 /* XON2 register. */
61 #define ST_UART011_ITCR 0x80 /* Integration test control register. */
62 #define ST_UART011_ITIP 0x84 /* Integration test input register. */
63 #define ST_UART011_ABCR 0x100 /* Autobaud control register. */
64 #define ST_UART011_ABIMSC 0x15C /* Autobaud interrupt mask/clear register. */
66 #define UART011_DR_OE (1 << 11)
67 #define UART011_DR_BE (1 << 10)
68 #define UART011_DR_PE (1 << 9)
69 #define UART011_DR_FE (1 << 8)
71 #define UART01x_RSR_OE 0x08
72 #define UART01x_RSR_BE 0x04
73 #define UART01x_RSR_PE 0x02
74 #define UART01x_RSR_FE 0x01
76 #define UART011_FR_RI 0x100
77 #define UART011_FR_TXFE 0x080
78 #define UART011_FR_RXFF 0x040
79 #define UART01x_FR_TXFF 0x020
80 #define UART01x_FR_RXFE 0x010
81 #define UART01x_FR_BUSY 0x008
82 #define UART01x_FR_DCD 0x004
83 #define UART01x_FR_DSR 0x002
84 #define UART01x_FR_CTS 0x001
85 #define UART01x_FR_TMSK (UART01x_FR_TXFF + UART01x_FR_BUSY)
87 #define UART011_CR_CTSEN 0x8000 /* CTS hardware flow control */
88 #define UART011_CR_RTSEN 0x4000 /* RTS hardware flow control */
89 #define UART011_CR_OUT2 0x2000 /* OUT2 */
90 #define UART011_CR_OUT1 0x1000 /* OUT1 */
91 #define UART011_CR_RTS 0x0800 /* RTS */
92 #define UART011_CR_DTR 0x0400 /* DTR */
93 #define UART011_CR_RXE 0x0200 /* receive enable */
94 #define UART011_CR_TXE 0x0100 /* transmit enable */
95 #define UART011_CR_LBE 0x0080 /* loopback enable */
96 #define UART010_CR_RTIE 0x0040
97 #define UART010_CR_TIE 0x0020
98 #define UART010_CR_RIE 0x0010
99 #define UART010_CR_MSIE 0x0008
100 #define ST_UART011_CR_OVSFACT 0x0008 /* Oversampling factor */
101 #define UART01x_CR_IIRLP 0x0004 /* SIR low power mode */
102 #define UART01x_CR_SIREN 0x0002 /* SIR enable */
103 #define UART01x_CR_UARTEN 0x0001 /* UART enable */
105 #define UART011_LCRH_SPS 0x80
106 #define UART01x_LCRH_WLEN_8 0x60
107 #define UART01x_LCRH_WLEN_7 0x40
108 #define UART01x_LCRH_WLEN_6 0x20
109 #define UART01x_LCRH_WLEN_5 0x00
110 #define UART01x_LCRH_FEN 0x10
111 #define UART01x_LCRH_STP2 0x08
112 #define UART01x_LCRH_EPS 0x04
113 #define UART01x_LCRH_PEN 0x02
114 #define UART01x_LCRH_BRK 0x01
116 #define ST_UART011_DMAWM_RX_1 (0 << 3)
117 #define ST_UART011_DMAWM_RX_2 (1 << 3)
118 #define ST_UART011_DMAWM_RX_4 (2 << 3)
119 #define ST_UART011_DMAWM_RX_8 (3 << 3)
120 #define ST_UART011_DMAWM_RX_16 (4 << 3)
121 #define ST_UART011_DMAWM_RX_32 (5 << 3)
122 #define ST_UART011_DMAWM_RX_48 (6 << 3)
123 #define ST_UART011_DMAWM_TX_1 0
124 #define ST_UART011_DMAWM_TX_2 1
125 #define ST_UART011_DMAWM_TX_4 2
126 #define ST_UART011_DMAWM_TX_8 3
127 #define ST_UART011_DMAWM_TX_16 4
128 #define ST_UART011_DMAWM_TX_32 5
129 #define ST_UART011_DMAWM_TX_48 6
131 #define UART010_IIR_RTIS 0x08
132 #define UART010_IIR_TIS 0x04
133 #define UART010_IIR_RIS 0x02
134 #define UART010_IIR_MIS 0x01
136 #define UART011_IFLS_RX1_8 (0 << 3)
137 #define UART011_IFLS_RX2_8 (1 << 3)
138 #define UART011_IFLS_RX4_8 (2 << 3)
139 #define UART011_IFLS_RX6_8 (3 << 3)
140 #define UART011_IFLS_RX7_8 (4 << 3)
141 #define UART011_IFLS_TX1_8 (0 << 0)
142 #define UART011_IFLS_TX2_8 (1 << 0)
143 #define UART011_IFLS_TX4_8 (2 << 0)
144 #define UART011_IFLS_TX6_8 (3 << 0)
145 #define UART011_IFLS_TX7_8 (4 << 0)
146 /* special values for ST vendor with deeper fifo */
147 #define UART011_IFLS_RX_HALF (5 << 3)
148 #define UART011_IFLS_TX_HALF (5 << 0)
150 #define UART011_OEIM (1 << 10) /* overrun error interrupt mask */
151 #define UART011_BEIM (1 << 9) /* break error interrupt mask */
152 #define UART011_PEIM (1 << 8) /* parity error interrupt mask */
153 #define UART011_FEIM (1 << 7) /* framing error interrupt mask */
154 #define UART011_RTIM (1 << 6) /* receive timeout interrupt mask */
155 #define UART011_TXIM (1 << 5) /* transmit interrupt mask */
156 #define UART011_RXIM (1 << 4) /* receive interrupt mask */
157 #define UART011_DSRMIM (1 << 3) /* DSR interrupt mask */
158 #define UART011_DCDMIM (1 << 2) /* DCD interrupt mask */
159 #define UART011_CTSMIM (1 << 1) /* CTS interrupt mask */
160 #define UART011_RIMIM (1 << 0) /* RI interrupt mask */
162 #define UART011_OEIS (1 << 10) /* overrun error interrupt status */
163 #define UART011_BEIS (1 << 9) /* break error interrupt status */
164 #define UART011_PEIS (1 << 8) /* parity error interrupt status */
165 #define UART011_FEIS (1 << 7) /* framing error interrupt status */
166 #define UART011_RTIS (1 << 6) /* receive timeout interrupt status */
167 #define UART011_TXIS (1 << 5) /* transmit interrupt status */
168 #define UART011_RXIS (1 << 4) /* receive interrupt status */
169 #define UART011_DSRMIS (1 << 3) /* DSR interrupt status */
170 #define UART011_DCDMIS (1 << 2) /* DCD interrupt status */
171 #define UART011_CTSMIS (1 << 1) /* CTS interrupt status */
172 #define UART011_RIMIS (1 << 0) /* RI interrupt status */
174 #define UART011_OEIC (1 << 10) /* overrun error interrupt clear */
175 #define UART011_BEIC (1 << 9) /* break error interrupt clear */
176 #define UART011_PEIC (1 << 8) /* parity error interrupt clear */
177 #define UART011_FEIC (1 << 7) /* framing error interrupt clear */
178 #define UART011_RTIC (1 << 6) /* receive timeout interrupt clear */
179 #define UART011_TXIC (1 << 5) /* transmit interrupt clear */
180 #define UART011_RXIC (1 << 4) /* receive interrupt clear */
181 #define UART011_DSRMIC (1 << 3) /* DSR interrupt clear */
182 #define UART011_DCDMIC (1 << 2) /* DCD interrupt clear */
183 #define UART011_CTSMIC (1 << 1) /* CTS interrupt clear */
184 #define UART011_RIMIC (1 << 0) /* RI interrupt clear */
186 #define UART011_DMAONERR (1 << 2) /* disable dma on error */
187 #define UART011_TXDMAE (1 << 1) /* enable transmit dma */
188 #define UART011_RXDMAE (1 << 0) /* enable receive dma */
190 #define UART01x_RSR_ANY (UART01x_RSR_OE|UART01x_RSR_BE|UART01x_RSR_PE|UART01x_RSR_FE)
191 #define UART01x_FR_MODEM_ANY (UART01x_FR_DCD|UART01x_FR_DSR|UART01x_FR_CTS)
194 struct amba_device
; /* in uncompress this is included but amba/bus.h is not */
195 struct amba_pl010_data
{
196 void (*set_mctrl
)(struct amba_device
*dev
, void __iomem
*base
, unsigned int mctrl
);
200 struct amba_pl011_data
{
201 bool (*dma_filter
)(struct dma_chan
*chan
, void *filter_param
);
206 void (*reset
) (void);