blackfin architecture
[safe/jmp/linux-2.6] / include / asm-blackfin / mach-bf537 / blackfin.h
1 /*
2  * File:         include/asm-blackfin/mach-bf537/blackfin.h
3  * Based on:
4  * Author:
5  *
6  * Created:
7  * Description:
8  *
9  * Rev:
10  *
11  * Modified:
12  *
13  *
14  * Bugs:         Enter bugs at http://blackfin.uclinux.org/
15  *
16  * This program is free software; you can redistribute it and/or modify
17  * it under the terms of the GNU General Public License as published by
18  * the Free Software Foundation; either version 2, or (at your option)
19  * any later version.
20  *
21  * This program is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24  * GNU General Public License for more details.
25  *
26  * You should have received a copy of the GNU General Public License
27  * along with this program; see the file COPYING.
28  * If not, write to the Free Software Foundation,
29  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30  */
31
32 #ifndef _MACH_BLACKFIN_H_
33 #define _MACH_BLACKFIN_H_
34
35 #define BF537_FAMILY
36
37 #include "bf537.h"
38 #include "mem_map.h"
39 #include "defBF534.h"
40 #include "anomaly.h"
41
42 #if defined(CONFIG_BF537) || defined(CONFIG_BF536)
43 #include "defBF537.h"
44 #endif
45
46 #if !(defined(__ASSEMBLY__) || defined(ASSEMBLY))
47 #include "cdefBF534.h"
48
49 /* UART 0*/
50 #define bfin_read_UART_THR() bfin_read_UART0_THR()
51 #define bfin_write_UART_THR(val) bfin_write_UART0_THR(val)
52 #define bfin_read_UART_RBR() bfin_read_UART0_RBR()
53 #define bfin_write_UART_RBR(val) bfin_write_UART0_RBR(val)
54 #define bfin_read_UART_DLL() bfin_read_UART0_DLL()
55 #define bfin_write_UART_DLL(val) bfin_write_UART0_DLL(val)
56 #define bfin_read_UART_IER() bfin_read_UART0_IER()
57 #define bfin_write_UART_IER(val) bfin_write_UART0_IER(val)
58 #define bfin_read_UART_DLH() bfin_read_UART0_DLH()
59 #define bfin_write_UART_DLH(val) bfin_write_UART0_DLH(val)
60 #define bfin_read_UART_IIR() bfin_read_UART0_IIR()
61 #define bfin_write_UART_IIR(val) bfin_write_UART0_IIR(val)
62 #define bfin_read_UART_LCR() bfin_read_UART0_LCR()
63 #define bfin_write_UART_LCR(val) bfin_write_UART0_LCR(val)
64 #define bfin_read_UART_MCR() bfin_read_UART0_MCR()
65 #define bfin_write_UART_MCR(val) bfin_write_UART0_MCR(val)
66 #define bfin_read_UART_LSR() bfin_read_UART0_LSR()
67 #define bfin_write_UART_LSR(val) bfin_write_UART0_LSR(val)
68 #define bfin_read_UART_SCR() bfin_read_UART0_SCR()
69 #define bfin_write_UART_SCR(val) bfin_write_UART0_SCR(val)
70 #define bfin_read_UART_GCTL() bfin_read_UART0_GCTL()
71 #define bfin_write_UART_GCTL(val) bfin_write_UART0_GCTL(val)
72
73 #if defined(CONFIG_BF537) || defined(CONFIG_BF536)
74 #include "cdefBF537.h"
75 #endif
76 #endif
77
78 /* MAP used DEFINES from BF533 to BF537 - so we don't need to change them in the driver, kernel, etc. */
79
80 /* UART_IIR Register */
81 #define STATUS(x)       ((x << 1) & 0x06)
82 #define STATUS_P1       0x02
83 #define STATUS_P0       0x01
84
85 /* UART 0*/
86
87 /* DMA Channnel */
88 #define bfin_read_CH_UART_RX() bfin_read_CH_UART0_RX()
89 #define bfin_write_CH_UART_RX(val) bfin_write_CH_UART0_RX(val)
90 #define CH_UART_RX CH_UART0_RX
91 #define bfin_read_CH_UART_TX() bfin_read_CH_UART0_TX()
92 #define bfin_write_CH_UART_TX(val) bfin_write_CH_UART0_TX(val)
93 #define CH_UART_TX CH_UART0_TX
94
95 /* System Interrupt Controller */
96 #define bfin_read_IRQ_UART_RX() bfin_read_IRQ_UART0_RX()
97 #define bfin_write_IRQ_UART_RX(val) bfin_write_IRQ_UART0_RX(val)
98 #define IRQ_UART_RX IRQ_UART0_RX
99 #define bfin_read_IRQ_UART_TX() bfin_read_IRQ_UART0_TX()
100 #define bfin_write_IRQ_UART_TX(val) bfin_write_IRQ_UART0_TX(val)
101 #define IRQ_UART_TX IRQ_UART0_TX
102 #define bfin_read_IRQ_UART_ERROR() bfin_read_IRQ_UART0_ERROR()
103 #define bfin_write_IRQ_UART_ERROR(val) bfin_write_IRQ_UART0_ERROR(val)
104 #define IRQ_UART_ERROR IRQ_UART0_ERROR
105
106 /* MMR Registers*/
107 #define bfin_read_UART_THR() bfin_read_UART0_THR()
108 #define bfin_write_UART_THR(val) bfin_write_UART0_THR(val)
109 #define UART_THR UART0_THR
110 #define bfin_read_UART_RBR() bfin_read_UART0_RBR()
111 #define bfin_write_UART_RBR(val) bfin_write_UART0_RBR(val)
112 #define UART_RBR UART0_RBR
113 #define bfin_read_UART_DLL() bfin_read_UART0_DLL()
114 #define bfin_write_UART_DLL(val) bfin_write_UART0_DLL(val)
115 #define UART_DLL UART0_DLL
116 #define bfin_read_UART_IER() bfin_read_UART0_IER()
117 #define bfin_write_UART_IER(val) bfin_write_UART0_IER(val)
118 #define UART_IER UART0_IER
119 #define bfin_read_UART_DLH() bfin_read_UART0_DLH()
120 #define bfin_write_UART_DLH(val) bfin_write_UART0_DLH(val)
121 #define UART_DLH UART0_DLH
122 #define bfin_read_UART_IIR() bfin_read_UART0_IIR()
123 #define bfin_write_UART_IIR(val) bfin_write_UART0_IIR(val)
124 #define UART_IIR UART0_IIR
125 #define bfin_read_UART_LCR() bfin_read_UART0_LCR()
126 #define bfin_write_UART_LCR(val) bfin_write_UART0_LCR(val)
127 #define UART_LCR UART0_LCR
128 #define bfin_read_UART_MCR() bfin_read_UART0_MCR()
129 #define bfin_write_UART_MCR(val) bfin_write_UART0_MCR(val)
130 #define UART_MCR UART0_MCR
131 #define bfin_read_UART_LSR() bfin_read_UART0_LSR()
132 #define bfin_write_UART_LSR(val) bfin_write_UART0_LSR(val)
133 #define UART_LSR UART0_LSR
134 #define bfin_read_UART_SCR() bfin_read_UART0_SCR()
135 #define bfin_write_UART_SCR(val) bfin_write_UART0_SCR(val)
136 #define UART_SCR  UART0_SCR
137 #define bfin_read_UART_GCTL() bfin_read_UART0_GCTL()
138 #define bfin_write_UART_GCTL(val) bfin_write_UART0_GCTL(val)
139 #define UART_GCTL UART0_GCTL
140
141 /* DPMC*/
142 #define bfin_read_STOPCK_OFF() bfin_read_STOPCK()
143 #define bfin_write_STOPCK_OFF(val) bfin_write_STOPCK(val)
144 #define STOPCK_OFF STOPCK
145
146 /* FIO USE PORT F*/
147 #ifdef CONFIG_BF537_PORT_F
148 #define bfin_read_PORT_FER() bfin_read_PORTF_FER()
149 #define bfin_write_PORT_FER(val) bfin_write_PORTF_FER(val)
150 #define bfin_read_FIO_FLAG_D() bfin_read_PORTFIO()
151 #define bfin_write_FIO_FLAG_D(val) bfin_write_PORTFIO(val)
152 #define bfin_read_FIO_FLAG_C() bfin_read_PORTFIO_CLEAR()
153 #define bfin_write_FIO_FLAG_C(val) bfin_write_PORTFIO_CLEAR(val)
154 #define bfin_read_FIO_FLAG_S() bfin_read_PORTFIO_SET()
155 #define bfin_write_FIO_FLAG_S(val) bfin_write_PORTFIO_SET(val)
156 #define bfin_read_FIO_FLAG_T() bfin_read_PORTFIO_TOGGLE()
157 #define bfin_write_FIO_FLAG_T(val) bfin_write_PORTFIO_TOGGLE(val)
158 #define bfin_read_FIO_MASKA_D() bfin_read_PORTFIO_MASKA()
159 #define bfin_write_FIO_MASKA_D(val) bfin_write_PORTFIO_MASKA(val)
160 #define bfin_read_FIO_MASKA_C() bfin_read_PORTFIO_MASKA_CLEAR()
161 #define bfin_write_FIO_MASKA_C(val) bfin_write_PORTFIO_MASKA_CLEAR(val)
162 #define bfin_read_FIO_MASKA_S() bfin_read_PORTFIO_MASKA_SET()
163 #define bfin_write_FIO_MASKA_S(val) bfin_write_PORTFIO_MASKA_SET(val)
164 #define bfin_read_FIO_MASKA_T() bfin_read_PORTFIO_MASKA_TOGGLE()
165 #define bfin_write_FIO_MASKA_T(val) bfin_write_PORTFIO_MASKA_TOGGLE(val)
166 #define bfin_read_FIO_MASKB_D() bfin_read_PORTFIO_MASKB()
167 #define bfin_write_FIO_MASKB_D(val) bfin_write_PORTFIO_MASKB(val)
168 #define bfin_read_FIO_MASKB_C() bfin_read_PORTFIO_MASKB_CLEAR()
169 #define bfin_write_FIO_MASKB_C(val) bfin_write_PORTFIO_MASKB_CLEAR(val)
170 #define bfin_read_FIO_MASKB_S() bfin_read_PORTFIO_MASKB_SET()
171 #define bfin_write_FIO_MASKB_S(val) bfin_write_PORTFIO_MASKB_SET(val)
172 #define bfin_read_FIO_MASKB_T() bfin_read_PORTFIO_MASKB_TOGGLE()
173 #define bfin_write_FIO_MASKB_T(val) bfin_write_PORTFIO_MASKB_TOGGLE(val)
174 #define bfin_read_FIO_DIR() bfin_read_PORTFIO_DIR()
175 #define bfin_write_FIO_DIR(val) bfin_write_PORTFIO_DIR(val)
176 #define bfin_read_FIO_POLAR() bfin_read_PORTFIO_POLAR()
177 #define bfin_write_FIO_POLAR(val) bfin_write_PORTFIO_POLAR(val)
178 #define bfin_read_FIO_EDGE() bfin_read_PORTFIO_EDGE()
179 #define bfin_write_FIO_EDGE(val) bfin_write_PORTFIO_EDGE(val)
180 #define bfin_read_FIO_BOTH() bfin_read_PORTFIO_BOTH()
181 #define bfin_write_FIO_BOTH(val) bfin_write_PORTFIO_BOTH(val)
182 #define bfin_read_FIO_INEN() bfin_read_PORTFIO_INEN()
183 #define bfin_write_FIO_INEN(val) bfin_write_PORTFIO_INEN(val)
184
185 #define bfin_read_FIO_FLAG_D() bfin_read_PORTFIO()
186 #define bfin_write_FIO_FLAG_D(val) bfin_write_PORTFIO(val)
187 #define FIO_FLAG_D              PORTFIO
188 #define bfin_read_FIO_FLAG_C() bfin_read_PORTFIO_CLEAR()
189 #define bfin_write_FIO_FLAG_C(val) bfin_write_PORTFIO_CLEAR(val)
190 #define FIO_FLAG_C              PORTFIO_CLEAR
191 #define bfin_read_FIO_FLAG_S() bfin_read_PORTFIO_SET()
192 #define bfin_write_FIO_FLAG_S(val) bfin_write_PORTFIO_SET(val)
193 #define FIO_FLAG_S              PORTFIO_SET
194 #define bfin_read_FIO_FLAG_T() bfin_read_PORTFIO_TOGGLE()
195 #define bfin_write_FIO_FLAG_T(val) bfin_write_PORTFIO_TOGGLE(val)
196 #define FIO_FLAG_T              PORTFIO_TOGGLE
197 #define bfin_read_FIO_MASKA_D() bfin_read_PORTFIO_MASKA()
198 #define bfin_write_FIO_MASKA_D(val) bfin_write_PORTFIO_MASKA(val)
199 #define FIO_MASKA_D         PORTFIO_MASKA
200 #define bfin_read_FIO_MASKA_C() bfin_read_PORTFIO_MASKA_CLEAR()
201 #define bfin_write_FIO_MASKA_C(val) bfin_write_PORTFIO_MASKA_CLEAR(val)
202 #define FIO_MASKA_C     PORTFIO_MASKA_CLEAR
203 #define bfin_read_FIO_MASKA_S() bfin_read_PORTFIO_MASKA_SET()
204 #define bfin_write_FIO_MASKA_S(val) bfin_write_PORTFIO_MASKA_SET(val)
205 #define FIO_MASKA_S     PORTFIO_MASKA_SET
206 #define bfin_read_FIO_MASKA_T() bfin_read_PORTFIO_MASKA_TOGGLE()
207 #define bfin_write_FIO_MASKA_T(val) bfin_write_PORTFIO_MASKA_TOGGLE(val)
208 #define FIO_MASKA_T     PORTFIO_MASKA_TOGGLE
209 #define bfin_read_FIO_MASKB_D() bfin_read_PORTFIO_MASKB()
210 #define bfin_write_FIO_MASKB_D(val) bfin_write_PORTFIO_MASKB(val)
211 #define FIO_MASKB_D     PORTFIO_MASKB
212 #define bfin_read_FIO_MASKB_C() bfin_read_PORTFIO_MASKB_CLEAR()
213 #define bfin_write_FIO_MASKB_C(val) bfin_write_PORTFIO_MASKB_CLEAR(val)
214 #define FIO_MASKB_C     PORTFIO_MASKB_CLEAR
215 #define bfin_read_FIO_MASKB_S() bfin_read_PORTFIO_MASKB_SET()
216 #define bfin_write_FIO_MASKB_S(val) bfin_write_PORTFIO_MASKB_SET(val)
217 #define FIO_MASKB_S     PORTFIO_MASKB_SET
218 #define bfin_read_FIO_MASKB_T() bfin_read_PORTFIO_MASKB_TOGGLE()
219 #define bfin_write_FIO_MASKB_T(val) bfin_write_PORTFIO_MASKB_TOGGLE(val)
220 #define FIO_MASKB_T     PORTFIO_MASKB_TOGGLE
221 #define bfin_read_FIO_DIR() bfin_read_PORTFIO_DIR()
222 #define bfin_write_FIO_DIR(val) bfin_write_PORTFIO_DIR(val)
223 #define FIO_DIR             PORTFIO_DIR
224 #define bfin_read_FIO_POLAR() bfin_read_PORTFIO_POLAR()
225 #define bfin_write_FIO_POLAR(val) bfin_write_PORTFIO_POLAR(val)
226 #define FIO_POLAR               PORTFIO_POLAR
227 #define bfin_read_FIO_EDGE() bfin_read_PORTFIO_EDGE()
228 #define bfin_write_FIO_EDGE(val) bfin_write_PORTFIO_EDGE(val)
229 #define FIO_EDGE                PORTFIO_EDGE
230 #define bfin_read_FIO_BOTH() bfin_read_PORTFIO_BOTH()
231 #define bfin_write_FIO_BOTH(val) bfin_write_PORTFIO_BOTH(val)
232 #define FIO_BOTH                PORTFIO_BOTH
233 #define bfin_read_FIO_INEN() bfin_read_PORTFIO_INEN()
234 #define bfin_write_FIO_INEN(val) bfin_write_PORTFIO_INEN(val)
235 #define FIO_INEN                PORTFIO_INEN
236 #endif
237
238 /* FIO USE PORT G*/
239 #ifdef CONFIG_BF537_PORT_G
240 #define bfin_read_PORT_FER() bfin_read_PORTG_FER()
241 #define bfin_write_PORT_FER(val) bfin_write_PORTG_FER(val)
242 #define bfin_read_FIO_FLAG_D() bfin_read_PORTGIO()
243 #define bfin_write_FIO_FLAG_D(val) bfin_write_PORTGIO(val)
244 #define bfin_read_FIO_FLAG_C() bfin_read_PORTGIO_CLEAR()
245 #define bfin_write_FIO_FLAG_C(val) bfin_write_PORTGIO_CLEAR(val)
246 #define bfin_read_FIO_FLAG_S() bfin_read_PORTGIO_SET()
247 #define bfin_write_FIO_FLAG_S(val) bfin_write_PORTGIO_SET(val)
248 #define bfin_read_FIO_FLAG_T() bfin_read_PORTGIO_TOGGLE()
249 #define bfin_write_FIO_FLAG_T(val) bfin_write_PORTGIO_TOGGLE(val)
250 #define bfin_read_FIO_MASKA_D() bfin_read_PORTGIO_MASKA()
251 #define bfin_write_FIO_MASKA_D(val) bfin_write_PORTGIO_MASKA(val)
252 #define bfin_read_FIO_MASKA_C() bfin_read_PORTGIO_MASKA_CLEAR()
253 #define bfin_write_FIO_MASKA_C(val) bfin_write_PORTGIO_MASKA_CLEAR(val)
254 #define bfin_read_FIO_MASKA_S() bfin_read_PORTGIO_MASKA_SET()
255 #define bfin_write_FIO_MASKA_S(val) bfin_write_PORTGIO_MASKA_SET(val)
256 #define bfin_read_FIO_MASKA_T() bfin_read_PORTGIO_MASKA_TOGGLE()
257 #define bfin_write_FIO_MASKA_T(val) bfin_write_PORTGIO_MASKA_TOGGLE(val)
258 #define bfin_read_FIO_MASKB_D() bfin_read_PORTGIO_MASKB()
259 #define bfin_write_FIO_MASKB_D(val) bfin_write_PORTGIO_MASKB(val)
260 #define bfin_read_FIO_MASKB_C() bfin_read_PORTGIO_MASKB_CLEAR()
261 #define bfin_write_FIO_MASKB_C(val) bfin_write_PORTGIO_MASKB_CLEAR(val)
262 #define bfin_read_FIO_MASKB_S() bfin_read_PORTGIO_MASKB_SET()
263 #define bfin_write_FIO_MASKB_S(val) bfin_write_PORTGIO_MASKB_SET(val)
264 #define bfin_read_FIO_MASKB_T() bfin_read_PORTGIO_MASKB_TOGGLE()
265 #define bfin_write_FIO_MASKB_T(val) bfin_write_PORTGIO_MASKB_TOGGLE(val)
266 #define bfin_read_FIO_DIR() bfin_read_PORTGIO_DIR()
267 #define bfin_write_FIO_DIR(val) bfin_write_PORTGIO_DIR(val)
268 #define bfin_read_FIO_POLAR() bfin_read_PORTGIO_POLAR()
269 #define bfin_write_FIO_POLAR(val) bfin_write_PORTGIO_POLAR(val)
270 #define bfin_read_FIO_EDGE() bfin_read_PORTGIO_EDGE()
271 #define bfin_write_FIO_EDGE(val) bfin_write_PORTGIO_EDGE(val)
272 #define bfin_read_FIO_BOTH() bfin_read_PORTGIO_BOTH()
273 #define bfin_write_FIO_BOTH(val) bfin_write_PORTGIO_BOTH(val)
274 #define bfin_read_FIO_INEN() bfin_read_PORTGIO_INEN()
275 #define bfin_write_FIO_INEN(val) bfin_write_PORTGIO_INEN(val)
276
277 #define bfin_read_FIO_FLAG_D() bfin_read_PORTGIO()
278 #define bfin_write_FIO_FLAG_D(val) bfin_write_PORTGIO(val)
279 #define FIO_FLAG_D              PORTGIO
280 #define bfin_read_FIO_FLAG_C() bfin_read_PORTGIO_CLEAR()
281 #define bfin_write_FIO_FLAG_C(val) bfin_write_PORTGIO_CLEAR(val)
282 #define FIO_FLAG_C              PORTGIO_CLEAR
283 #define bfin_read_FIO_FLAG_S() bfin_read_PORTGIO_SET()
284 #define bfin_write_FIO_FLAG_S(val) bfin_write_PORTGIO_SET(val)
285 #define FIO_FLAG_S              PORTGIO_SET
286 #define bfin_read_FIO_FLAG_T() bfin_read_PORTGIO_TOGGLE()
287 #define bfin_write_FIO_FLAG_T(val) bfin_write_PORTGIO_TOGGLE(val)
288 #define FIO_FLAG_T              PORTGIO_TOGGLE
289 #define bfin_read_FIO_MASKA_D() bfin_read_PORTGIO_MASKA()
290 #define bfin_write_FIO_MASKA_D(val) bfin_write_PORTGIO_MASKA(val)
291 #define FIO_MASKA_D         PORTGIO_MASKA
292 #define bfin_read_FIO_MASKA_C() bfin_read_PORTGIO_MASKA_CLEAR()
293 #define bfin_write_FIO_MASKA_C(val) bfin_write_PORTGIO_MASKA_CLEAR(val)
294 #define FIO_MASKA_C         PORTGIO_MASKA_CLEAR
295 #define bfin_read_FIO_MASKA_S() bfin_read_PORTGIO_MASKA_SET()
296 #define bfin_write_FIO_MASKA_S(val) bfin_write_PORTGIO_MASKA_SET(val)
297 #define FIO_MASKA_S         PORTGIO_MASKA_SET
298 #define bfin_read_FIO_MASKA_T() bfin_read_PORTGIO_MASKA_TOGGLE()
299 #define bfin_write_FIO_MASKA_T(val) bfin_write_PORTGIO_MASKA_TOGGLE(val)
300 #define FIO_MASKA_T         PORTGIO_MASKA_TOGGLE
301 #define bfin_read_FIO_MASKB_D() bfin_read_PORTGIO_MASKB()
302 #define bfin_write_FIO_MASKB_D(val) bfin_write_PORTGIO_MASKB(val)
303 #define FIO_MASKB_D         PORTGIO_MASKB
304 #define bfin_read_FIO_MASKB_C() bfin_read_PORTGIO_MASKB_CLEAR()
305 #define bfin_write_FIO_MASKB_C(val) bfin_write_PORTGIO_MASKB_CLEAR(val)
306 #define FIO_MASKB_C         PORTGIO_MASKB_CLEAR
307 #define bfin_read_FIO_MASKB_S() bfin_read_PORTGIO_MASKB_SET()
308 #define bfin_write_FIO_MASKB_S(val) bfin_write_PORTGIO_MASKB_SET(val)
309 #define FIO_MASKB_S         PORTGIO_MASKB_SET
310 #define bfin_read_FIO_MASKB_T() bfin_read_PORTGIO_MASKB_TOGGLE()
311 #define bfin_write_FIO_MASKB_T(val) bfin_write_PORTGIO_MASKB_TOGGLE(val)
312 #define FIO_MASKB_T         PORTGIO_MASKB_TOGGLE
313 #define bfin_read_FIO_DIR() bfin_read_PORTGIO_DIR()
314 #define bfin_write_FIO_DIR(val) bfin_write_PORTGIO_DIR(val)
315 #define FIO_DIR             PORTGIO_DIR
316 #define bfin_read_FIO_POLAR() bfin_read_PORTGIO_POLAR()
317 #define bfin_write_FIO_POLAR(val) bfin_write_PORTGIO_POLAR(val)
318 #define FIO_POLAR               PORTGIO_POLAR
319 #define bfin_read_FIO_EDGE() bfin_read_PORTGIO_EDGE()
320 #define bfin_write_FIO_EDGE(val) bfin_write_PORTGIO_EDGE(val)
321 #define FIO_EDGE                PORTGIO_EDGE
322 #define bfin_read_FIO_BOTH() bfin_read_PORTGIO_BOTH()
323 #define bfin_write_FIO_BOTH(val) bfin_write_PORTGIO_BOTH(val)
324 #define FIO_BOTH                PORTGIO_BOTH
325 #define bfin_read_FIO_INEN() bfin_read_PORTGIO_INEN()
326 #define bfin_write_FIO_INEN(val) bfin_write_PORTGIO_INEN(val)
327 #define FIO_INEN                PORTGIO_INEN
328
329 #endif
330
331 /* FIO USE PORT H*/
332 #ifdef CONFIG_BF537_PORT_H
333 #define bfin_read_PORT_FER() bfin_read_PORTH_FER()
334 #define bfin_write_PORT_FER(val) bfin_write_PORTH_FER(val)
335 #define bfin_read_FIO_FLAG_D() bfin_read_PORTHIO()
336 #define bfin_write_FIO_FLAG_D(val) bfin_write_PORTHIO(val)
337 #define bfin_read_FIO_FLAG_C() bfin_read_PORTHIO_CLEAR()
338 #define bfin_write_FIO_FLAG_C(val) bfin_write_PORTHIO_CLEAR(val)
339 #define bfin_read_FIO_FLAG_S() bfin_read_PORTHIO_SET()
340 #define bfin_write_FIO_FLAG_S(val) bfin_write_PORTHIO_SET(val)
341 #define bfin_read_FIO_FLAG_T() bfin_read_PORTHIO_TOGGLE()
342 #define bfin_write_FIO_FLAG_T(val) bfin_write_PORTHIO_TOGGLE(val)
343 #define bfin_read_FIO_MASKA_D() bfin_read_PORTHIO_MASKA()
344 #define bfin_write_FIO_MASKA_D(val) bfin_write_PORTHIO_MASKA(val)
345 #define bfin_read_FIO_MASKA_C() bfin_read_PORTHIO_MASKA_CLEAR()
346 #define bfin_write_FIO_MASKA_C(val) bfin_write_PORTHIO_MASKA_CLEAR(val)
347 #define bfin_read_FIO_MASKA_S() bfin_read_PORTHIO_MASKA_SET()
348 #define bfin_write_FIO_MASKA_S(val) bfin_write_PORTHIO_MASKA_SET(val)
349 #define bfin_read_FIO_MASKA_T() bfin_read_PORTHIO_MASKA_TOGGLE()
350 #define bfin_write_FIO_MASKA_T(val) bfin_write_PORTHIO_MASKA_TOGGLE(val)
351 #define bfin_read_FIO_MASKB_D() bfin_read_PORTHIO_MASKB()
352 #define bfin_write_FIO_MASKB_D(val) bfin_write_PORTHIO_MASKB(val)
353 #define bfin_read_FIO_MASKB_C() bfin_read_PORTHIO_MASKB_CLEAR()
354 #define bfin_write_FIO_MASKB_C(val) bfin_write_PORTHIO_MASKB_CLEAR(val)
355 #define bfin_read_FIO_MASKB_S() bfin_read_PORTHIO_MASKB_SET()
356 #define bfin_write_FIO_MASKB_S(val) bfin_write_PORTHIO_MASKB_SET(val)
357 #define bfin_read_FIO_MASKB_T() bfin_read_PORTHIO_MASKB_TOGGLE()
358 #define bfin_write_FIO_MASKB_T(val) bfin_write_PORTHIO_MASKB_TOGGLE(val)
359 #define bfin_read_FIO_DIR() bfin_read_PORTHIO_DIR()
360 #define bfin_write_FIO_DIR(val) bfin_write_PORTHIO_DIR(val)
361 #define bfin_read_FIO_POLAR() bfin_read_PORTHIO_POLAR()
362 #define bfin_write_FIO_POLAR(val) bfin_write_PORTHIO_POLAR(val)
363 #define bfin_read_FIO_EDGE() bfin_read_PORTHIO_EDGE()
364 #define bfin_write_FIO_EDGE(val) bfin_write_PORTHIO_EDGE(val)
365 #define bfin_read_FIO_BOTH() bfin_read_PORTHIO_BOTH()
366 #define bfin_write_FIO_BOTH(val) bfin_write_PORTHIO_BOTH(val)
367 #define bfin_read_FIO_INEN() bfin_read_PORTHIO_INEN()
368 #define bfin_write_FIO_INEN(val) bfin_write_PORTHIO_INEN(val)
369
370 #define bfin_read_FIO_FLAG_D() bfin_read_PORTHIO()
371 #define bfin_write_FIO_FLAG_D(val) bfin_write_PORTHIO(val)
372 #define FIO_FLAG_D              PORTHIO
373 #define bfin_read_FIO_FLAG_C() bfin_read_PORTHIO_CLEAR()
374 #define bfin_write_FIO_FLAG_C(val) bfin_write_PORTHIO_CLEAR(val)
375 #define FIO_FLAG_C              PORTHIO_CLEAR
376 #define bfin_read_FIO_FLAG_S() bfin_read_PORTHIO_SET()
377 #define bfin_write_FIO_FLAG_S(val) bfin_write_PORTHIO_SET(val)
378 #define FIO_FLAG_S              PORTHIO_SET
379 #define bfin_read_FIO_FLAG_T() bfin_read_PORTHIO_TOGGLE()
380 #define bfin_write_FIO_FLAG_T(val) bfin_write_PORTHIO_TOGGLE(val)
381 #define FIO_FLAG_T              PORTHIO_TOGGLE
382 #define bfin_read_FIO_MASKA_D() bfin_read_PORTHIO_MASKA()
383 #define bfin_write_FIO_MASKA_D(val) bfin_write_PORTHIO_MASKA(val)
384 #define FIO_MASKA_D         PORTHIO_MASKA
385 #define bfin_read_FIO_MASKA_C() bfin_read_PORTHIO_MASKA_CLEAR()
386 #define bfin_write_FIO_MASKA_C(val) bfin_write_PORTHIO_MASKA_CLEAR(val)
387 #define FIO_MASKA_C         PORTHIO_MASKA_CLEAR
388 #define bfin_read_FIO_MASKA_S() bfin_read_PORTHIO_MASKA_SET()
389 #define bfin_write_FIO_MASKA_S(val) bfin_write_PORTHIO_MASKA_SET(val)
390 #define FIO_MASKA_S         PORTHIO_MASKA_SET
391 #define bfin_read_FIO_MASKA_T() bfin_read_PORTHIO_MASKA_TOGGLE()
392 #define bfin_write_FIO_MASKA_T(val) bfin_write_PORTHIO_MASKA_TOGGLE(val)
393 #define FIO_MASKA_T         PORTHIO_MASKA_TOGGLE
394 #define bfin_read_FIO_MASKB_D() bfin_read_PORTHIO_MASKB()
395 #define bfin_write_FIO_MASKB_D(val) bfin_write_PORTHIO_MASKB(val)
396 #define FIO_MASKB_D         PORTHIO_MASKB
397 #define bfin_read_FIO_MASKB_C() bfin_read_PORTHIO_MASKB_CLEAR()
398 #define bfin_write_FIO_MASKB_C(val) bfin_write_PORTHIO_MASKB_CLEAR(val)
399 #define FIO_MASKB_C         PORTHIO_MASKB_CLEAR
400 #define bfin_read_FIO_MASKB_S() bfin_read_PORTHIO_MASKB_SET()
401 #define bfin_write_FIO_MASKB_S(val) bfin_write_PORTHIO_MASKB_SET(val)
402 #define FIO_MASKB_S         PORTHIO_MASKB_SET
403 #define bfin_read_FIO_MASKB_T() bfin_read_PORTHIO_MASKB_TOGGLE()
404 #define bfin_write_FIO_MASKB_T(val) bfin_write_PORTHIO_MASKB_TOGGLE(val)
405 #define FIO_MASKB_T         PORTHIO_MASKB_TOGGLE
406 #define bfin_read_FIO_DIR() bfin_read_PORTHIO_DIR()
407 #define bfin_write_FIO_DIR(val) bfin_write_PORTHIO_DIR(val)
408 #define FIO_DIR             PORTHIO_DIR
409 #define bfin_read_FIO_POLAR() bfin_read_PORTHIO_POLAR()
410 #define bfin_write_FIO_POLAR(val) bfin_write_PORTHIO_POLAR(val)
411 #define FIO_POLAR               PORTHIO_POLAR
412 #define bfin_read_FIO_EDGE() bfin_read_PORTHIO_EDGE()
413 #define bfin_write_FIO_EDGE(val) bfin_write_PORTHIO_EDGE(val)
414 #define FIO_EDGE                PORTHIO_EDGE
415 #define bfin_read_FIO_BOTH() bfin_read_PORTHIO_BOTH()
416 #define bfin_write_FIO_BOTH(val) bfin_write_PORTHIO_BOTH(val)
417 #define FIO_BOTH                PORTHIO_BOTH
418 #define bfin_read_FIO_INEN() bfin_read_PORTHIO_INEN()
419 #define bfin_write_FIO_INEN(val) bfin_write_PORTHIO_INEN(val)
420 #define FIO_INEN                PORTHIO_INEN
421
422 #endif
423
424 /* PLL_DIV Masks                                                                                                        */
425 #define CCLK_DIV1 CSEL_DIV1     /*          CCLK = VCO / 1                                  */
426 #define CCLK_DIV2 CSEL_DIV2     /*          CCLK = VCO / 2                                  */
427 #define CCLK_DIV4 CSEL_DIV4     /*          CCLK = VCO / 4                                  */
428 #define CCLK_DIV8 CSEL_DIV8     /*          CCLK = VCO / 8                                  */
429
430 #endif