isa_io_asm.S revision 1.1.2.2 1 1.1.2.2 nathanw /* $NetBSD: isa_io_asm.S,v 1.1.2.2 2002/02/28 04:11:52 nathanw Exp $ */
2 1.1.2.2 nathanw
3 1.1.2.2 nathanw /*-
4 1.1.2.2 nathanw * Copyright (c) 1997 The NetBSD Foundation, Inc.
5 1.1.2.2 nathanw * All rights reserved.
6 1.1.2.2 nathanw *
7 1.1.2.2 nathanw * This code is derived from software contributed to The NetBSD Foundation
8 1.1.2.2 nathanw * by Mark Brinicombe.
9 1.1.2.2 nathanw *
10 1.1.2.2 nathanw * Redistribution and use in source and binary forms, with or without
11 1.1.2.2 nathanw * modification, are permitted provided that the following conditions
12 1.1.2.2 nathanw * are met:
13 1.1.2.2 nathanw * 1. Redistributions of source code must retain the above copyright
14 1.1.2.2 nathanw * notice, this list of conditions and the following disclaimer.
15 1.1.2.2 nathanw * 2. Redistributions in binary form must reproduce the above copyright
16 1.1.2.2 nathanw * notice, this list of conditions and the following disclaimer in the
17 1.1.2.2 nathanw * documentation and/or other materials provided with the distribution.
18 1.1.2.2 nathanw * 3. All advertising materials mentioning features or use of this software
19 1.1.2.2 nathanw * must display the following acknowledgement:
20 1.1.2.2 nathanw * This product includes software developed by the NetBSD
21 1.1.2.2 nathanw * Foundation, Inc. and its contributors.
22 1.1.2.2 nathanw * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.1.2.2 nathanw * contributors may be used to endorse or promote products derived
24 1.1.2.2 nathanw * from this software without specific prior written permission.
25 1.1.2.2 nathanw *
26 1.1.2.2 nathanw * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.1.2.2 nathanw * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.1.2.2 nathanw * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.1.2.2 nathanw * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.1.2.2 nathanw * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.1.2.2 nathanw * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.1.2.2 nathanw * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.1.2.2 nathanw * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.1.2.2 nathanw * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.1.2.2 nathanw * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.1.2.2 nathanw * POSSIBILITY OF SUCH DAMAGE.
37 1.1.2.2 nathanw */
38 1.1.2.2 nathanw
39 1.1.2.2 nathanw /*
40 1.1.2.2 nathanw * Copyright 1997
41 1.1.2.2 nathanw * Digital Equipment Corporation. All rights reserved.
42 1.1.2.2 nathanw *
43 1.1.2.2 nathanw * This software is furnished under license and may be used and
44 1.1.2.2 nathanw * copied only in accordance with the following terms and conditions.
45 1.1.2.2 nathanw * Subject to these conditions, you may download, copy, install,
46 1.1.2.2 nathanw * use, modify and distribute this software in source and/or binary
47 1.1.2.2 nathanw * form. No title or ownership is transferred hereby.
48 1.1.2.2 nathanw *
49 1.1.2.2 nathanw * 1) Any source code used, modified or distributed must reproduce
50 1.1.2.2 nathanw * and retain this copyright notice and list of conditions as
51 1.1.2.2 nathanw * they appear in the source file.
52 1.1.2.2 nathanw *
53 1.1.2.2 nathanw * 2) No right is granted to use any trade name, trademark, or logo of
54 1.1.2.2 nathanw * Digital Equipment Corporation. Neither the "Digital Equipment
55 1.1.2.2 nathanw * Corporation" name nor any trademark or logo of Digital Equipment
56 1.1.2.2 nathanw * Corporation may be used to endorse or promote products derived
57 1.1.2.2 nathanw * from this software without the prior written permission of
58 1.1.2.2 nathanw * Digital Equipment Corporation.
59 1.1.2.2 nathanw *
60 1.1.2.2 nathanw * 3) This software is provided "AS-IS" and any express or implied
61 1.1.2.2 nathanw * warranties, including but not limited to, any implied warranties
62 1.1.2.2 nathanw * of merchantability, fitness for a particular purpose, or
63 1.1.2.2 nathanw * non-infringement are disclaimed. In no event shall DIGITAL be
64 1.1.2.2 nathanw * liable for any damages whatsoever, and in particular, DIGITAL
65 1.1.2.2 nathanw * shall not be liable for special, indirect, consequential, or
66 1.1.2.2 nathanw * incidental damages or damages for lost profits, loss of
67 1.1.2.2 nathanw * revenue or loss of use, whether such damages arise in contract,
68 1.1.2.2 nathanw * negligence, tort, under statute, in equity, at law or otherwise,
69 1.1.2.2 nathanw * even if advised of the possibility of such damage.
70 1.1.2.2 nathanw */
71 1.1.2.2 nathanw
72 1.1.2.2 nathanw /*
73 1.1.2.2 nathanw * bus_space I/O functions for isa
74 1.1.2.2 nathanw */
75 1.1.2.2 nathanw
76 1.1.2.2 nathanw #include <machine/asm.h>
77 1.1.2.2 nathanw
78 1.1.2.2 nathanw #ifdef GPROF
79 1.1.2.2 nathanw #define PAUSE nop ; nop ; nop ; nop ; nop
80 1.1.2.2 nathanw #else
81 1.1.2.2 nathanw #define PAUSE
82 1.1.2.2 nathanw #endif
83 1.1.2.2 nathanw
84 1.1.2.2 nathanw /*
85 1.1.2.2 nathanw * Note these functions use ARM Architecture V4 instructions as
86 1.1.2.2 nathanw * all current systems with ISA will be using processors that support
87 1.1.2.2 nathanw * V4 or later architectures (SHARK & CATS)
88 1.1.2.2 nathanw */
89 1.1.2.2 nathanw
90 1.1.2.2 nathanw /*
91 1.1.2.2 nathanw * read single
92 1.1.2.2 nathanw */
93 1.1.2.2 nathanw
94 1.1.2.2 nathanw ENTRY(isa_bs_r_1)
95 1.1.2.2 nathanw ldrb r0, [r1, r2]
96 1.1.2.2 nathanw PAUSE
97 1.1.2.2 nathanw mov pc, lr
98 1.1.2.2 nathanw
99 1.1.2.2 nathanw ENTRY(isa_bs_r_2)
100 1.1.2.2 nathanw ldrh r0, [r1, r2] /*.word 0xe19100b2*/
101 1.1.2.2 nathanw PAUSE
102 1.1.2.2 nathanw mov pc, lr
103 1.1.2.2 nathanw
104 1.1.2.2 nathanw ENTRY(isa_bs_r_4)
105 1.1.2.2 nathanw ldr r0, [r1, r2]
106 1.1.2.2 nathanw PAUSE
107 1.1.2.2 nathanw mov pc, lr
108 1.1.2.2 nathanw
109 1.1.2.2 nathanw /*
110 1.1.2.2 nathanw * read multiple.
111 1.1.2.2 nathanw */
112 1.1.2.2 nathanw
113 1.1.2.2 nathanw ENTRY(isa_bs_rm_1)
114 1.1.2.2 nathanw add r0, r1, r2
115 1.1.2.2 nathanw mov r1, r3
116 1.1.2.2 nathanw ldr r2, [sp, #0]
117 1.1.2.2 nathanw teq r2, #0
118 1.1.2.2 nathanw moveq pc, lr
119 1.1.2.2 nathanw
120 1.1.2.2 nathanw Lisa_rm_1_loop:
121 1.1.2.2 nathanw ldrb r3, [r0]
122 1.1.2.2 nathanw strb r3, [r1], #1
123 1.1.2.2 nathanw subs r2, r2, #1
124 1.1.2.2 nathanw bne Lisa_rm_1_loop
125 1.1.2.2 nathanw
126 1.1.2.2 nathanw mov pc, lr
127 1.1.2.2 nathanw
128 1.1.2.2 nathanw ENTRY(isa_bs_rm_2)
129 1.1.2.2 nathanw add r0, r1, r2
130 1.1.2.2 nathanw mov r1, r3
131 1.1.2.2 nathanw ldr r2, [sp, #0]
132 1.1.2.2 nathanw teq r2, #0
133 1.1.2.2 nathanw moveq pc, lr
134 1.1.2.2 nathanw
135 1.1.2.2 nathanw Lisa_rm_2_loop:
136 1.1.2.2 nathanw ldrh r3, [r0] /*.word 0xe1d030b0*/
137 1.1.2.2 nathanw strh r3, [r1], #2 /*.word 0xe0c130b2*/
138 1.1.2.2 nathanw subs r2, r2, #1
139 1.1.2.2 nathanw bne Lisa_rm_2_loop
140 1.1.2.2 nathanw
141 1.1.2.2 nathanw mov pc, lr
142 1.1.2.2 nathanw
143 1.1.2.2 nathanw ENTRY(isa_bs_rm_4)
144 1.1.2.2 nathanw add r0, r1, r2
145 1.1.2.2 nathanw mov r1, r3
146 1.1.2.2 nathanw ldr r2, [sp, #0]
147 1.1.2.2 nathanw teq r2, #0
148 1.1.2.2 nathanw moveq pc, lr
149 1.1.2.2 nathanw
150 1.1.2.2 nathanw Lisa_rm_4_loop:
151 1.1.2.2 nathanw ldr r3, [r0]
152 1.1.2.2 nathanw str r3, [r1], #4
153 1.1.2.2 nathanw subs r2, r2, #1
154 1.1.2.2 nathanw bne Lisa_rm_4_loop
155 1.1.2.2 nathanw
156 1.1.2.2 nathanw mov pc, lr
157 1.1.2.2 nathanw
158 1.1.2.2 nathanw /*
159 1.1.2.2 nathanw * read region.
160 1.1.2.2 nathanw */
161 1.1.2.2 nathanw
162 1.1.2.2 nathanw ENTRY(isa_bs_rr_1)
163 1.1.2.2 nathanw add r0, r1, r2
164 1.1.2.2 nathanw mov r1, r3
165 1.1.2.2 nathanw ldr r2, [sp, #0]
166 1.1.2.2 nathanw teq r2, #0
167 1.1.2.2 nathanw moveq pc, lr
168 1.1.2.2 nathanw
169 1.1.2.2 nathanw Lisa_rr_1_loop:
170 1.1.2.2 nathanw ldrb r3, [r0], #1
171 1.1.2.2 nathanw strb r3, [r1], #1
172 1.1.2.2 nathanw subs r2, r2, #1
173 1.1.2.2 nathanw bne Lisa_rr_1_loop
174 1.1.2.2 nathanw
175 1.1.2.2 nathanw mov pc, lr
176 1.1.2.2 nathanw
177 1.1.2.2 nathanw ENTRY(isa_bs_rr_2)
178 1.1.2.2 nathanw add r0, r1, r2
179 1.1.2.2 nathanw mov r1, r3
180 1.1.2.2 nathanw ldr r2, [sp, #0]
181 1.1.2.2 nathanw teq r2, #0
182 1.1.2.2 nathanw moveq pc, lr
183 1.1.2.2 nathanw
184 1.1.2.2 nathanw Lisa_rr_2_loop:
185 1.1.2.2 nathanw ldrh r3, [r0], #2
186 1.1.2.2 nathanw strh r3, [r1], #2 /*.word 0xe0c130b2*/
187 1.1.2.2 nathanw subs r2, r2, #1
188 1.1.2.2 nathanw bne Lisa_rr_2_loop
189 1.1.2.2 nathanw
190 1.1.2.2 nathanw mov pc, lr
191 1.1.2.2 nathanw
192 1.1.2.2 nathanw ENTRY(isa_bs_rr_4)
193 1.1.2.2 nathanw add r0, r1, r2
194 1.1.2.2 nathanw mov r1, r3
195 1.1.2.2 nathanw ldr r2, [sp, #0]
196 1.1.2.2 nathanw teq r2, #0
197 1.1.2.2 nathanw moveq pc, lr
198 1.1.2.2 nathanw
199 1.1.2.2 nathanw Lisa_rr_4_loop:
200 1.1.2.2 nathanw ldr r3, [r0], #4
201 1.1.2.2 nathanw str r3, [r1], #4
202 1.1.2.2 nathanw subs r2, r2, #1
203 1.1.2.2 nathanw bne Lisa_rr_4_loop
204 1.1.2.2 nathanw
205 1.1.2.2 nathanw mov pc, lr
206 1.1.2.2 nathanw
207 1.1.2.2 nathanw /*
208 1.1.2.2 nathanw * write single
209 1.1.2.2 nathanw */
210 1.1.2.2 nathanw
211 1.1.2.2 nathanw ENTRY(isa_bs_w_1)
212 1.1.2.2 nathanw strb r3, [r1, r2]
213 1.1.2.2 nathanw PAUSE
214 1.1.2.2 nathanw mov pc, lr
215 1.1.2.2 nathanw
216 1.1.2.2 nathanw ENTRY(isa_bs_w_2)
217 1.1.2.2 nathanw strh r3, [r1, r2] /*.word 0xe18130b2*/
218 1.1.2.2 nathanw PAUSE
219 1.1.2.2 nathanw mov pc, lr
220 1.1.2.2 nathanw
221 1.1.2.2 nathanw ENTRY(isa_bs_w_4)
222 1.1.2.2 nathanw str r3, [r1, r2]
223 1.1.2.2 nathanw PAUSE
224 1.1.2.2 nathanw mov pc, lr
225 1.1.2.2 nathanw
226 1.1.2.2 nathanw /*
227 1.1.2.2 nathanw * write multiple
228 1.1.2.2 nathanw */
229 1.1.2.2 nathanw
230 1.1.2.2 nathanw ENTRY(isa_bs_wm_1)
231 1.1.2.2 nathanw add r0, r1, r2
232 1.1.2.2 nathanw mov r1, r3
233 1.1.2.2 nathanw ldr r2, [sp, #0]
234 1.1.2.2 nathanw teq r2, #0
235 1.1.2.2 nathanw moveq pc, lr
236 1.1.2.2 nathanw
237 1.1.2.2 nathanw Lisa_wm_1_loop:
238 1.1.2.2 nathanw ldrb r3, [r1], #1
239 1.1.2.2 nathanw strb r3, [r0]
240 1.1.2.2 nathanw subs r2, r2, #1
241 1.1.2.2 nathanw bne Lisa_wm_1_loop
242 1.1.2.2 nathanw
243 1.1.2.2 nathanw mov pc, lr
244 1.1.2.2 nathanw
245 1.1.2.2 nathanw ENTRY(isa_bs_wm_2)
246 1.1.2.2 nathanw add r0, r1, r2
247 1.1.2.2 nathanw mov r1, r3
248 1.1.2.2 nathanw ldr r2, [sp, #0]
249 1.1.2.2 nathanw teq r2, #0
250 1.1.2.2 nathanw moveq pc, lr
251 1.1.2.2 nathanw
252 1.1.2.2 nathanw Lisa_wm_2_loop:
253 1.1.2.2 nathanw ldrh r3, [r1], #2 /*.word 0xe0d130b2*/
254 1.1.2.2 nathanw strh r3, [r0] /*.word 0xe1c030b0*/
255 1.1.2.2 nathanw subs r2, r2, #1
256 1.1.2.2 nathanw bne Lisa_wm_2_loop
257 1.1.2.2 nathanw
258 1.1.2.2 nathanw mov pc, lr
259 1.1.2.2 nathanw
260 1.1.2.2 nathanw ENTRY(isa_bs_wm_4)
261 1.1.2.2 nathanw add r0, r1, r2
262 1.1.2.2 nathanw mov r1, r3
263 1.1.2.2 nathanw ldr r2, [sp, #0]
264 1.1.2.2 nathanw teq r2, #0
265 1.1.2.2 nathanw moveq pc, lr
266 1.1.2.2 nathanw
267 1.1.2.2 nathanw Lisa_wm_4_loop:
268 1.1.2.2 nathanw ldr r3, [r1], #4
269 1.1.2.2 nathanw str r3, [r0]
270 1.1.2.2 nathanw subs r2, r2, #1
271 1.1.2.2 nathanw bne Lisa_wm_4_loop
272 1.1.2.2 nathanw
273 1.1.2.2 nathanw mov pc, lr
274 1.1.2.2 nathanw
275 1.1.2.2 nathanw
276 1.1.2.2 nathanw /*
277 1.1.2.2 nathanw * write region.
278 1.1.2.2 nathanw */
279 1.1.2.2 nathanw
280 1.1.2.2 nathanw ENTRY(isa_bs_wr_1)
281 1.1.2.2 nathanw add r0, r1, r2
282 1.1.2.2 nathanw mov r1, r3
283 1.1.2.2 nathanw ldr r2, [sp, #0]
284 1.1.2.2 nathanw teq r2, #0
285 1.1.2.2 nathanw moveq pc, lr
286 1.1.2.2 nathanw
287 1.1.2.2 nathanw Lisa_wr_1_loop:
288 1.1.2.2 nathanw ldrb r3, [r1], #1
289 1.1.2.2 nathanw strb r3, [r0], #1
290 1.1.2.2 nathanw subs r2, r2, #1
291 1.1.2.2 nathanw bne Lisa_wr_1_loop
292 1.1.2.2 nathanw
293 1.1.2.2 nathanw mov pc, lr
294 1.1.2.2 nathanw
295 1.1.2.2 nathanw ENTRY(isa_bs_wr_2)
296 1.1.2.2 nathanw add r0, r1, r2
297 1.1.2.2 nathanw mov r1, r3
298 1.1.2.2 nathanw ldr r2, [sp, #0]
299 1.1.2.2 nathanw teq r2, #0
300 1.1.2.2 nathanw moveq pc, lr
301 1.1.2.2 nathanw
302 1.1.2.2 nathanw Lisa_wr_2_loop:
303 1.1.2.2 nathanw ldrh r3, [r1], #2 /*.word 0xe0d130b2*/
304 1.1.2.2 nathanw strh r3, [r0], #2
305 1.1.2.2 nathanw subs r2, r2, #1
306 1.1.2.2 nathanw bne Lisa_wr_2_loop
307 1.1.2.2 nathanw
308 1.1.2.2 nathanw mov pc, lr
309 1.1.2.2 nathanw
310 1.1.2.2 nathanw ENTRY(isa_bs_wr_4)
311 1.1.2.2 nathanw add r0, r1, r2
312 1.1.2.2 nathanw mov r1, r3
313 1.1.2.2 nathanw ldr r2, [sp, #0]
314 1.1.2.2 nathanw teq r2, #0
315 1.1.2.2 nathanw moveq pc, lr
316 1.1.2.2 nathanw
317 1.1.2.2 nathanw Lisa_wr_4_loop:
318 1.1.2.2 nathanw ldr r3, [r1], #4
319 1.1.2.2 nathanw str r3, [r0], #4
320 1.1.2.2 nathanw subs r2, r2, #1
321 1.1.2.2 nathanw bne Lisa_wr_4_loop
322 1.1.2.2 nathanw
323 1.1.2.2 nathanw mov pc, lr
324 1.1.2.2 nathanw
325 1.1.2.2 nathanw /*
326 1.1.2.2 nathanw * Set region
327 1.1.2.2 nathanw */
328 1.1.2.2 nathanw
329 1.1.2.2 nathanw ENTRY(isa_bs_sr_2)
330 1.1.2.2 nathanw add r0, r1, r2
331 1.1.2.2 nathanw mov r1, r3
332 1.1.2.2 nathanw ldr r2, [sp, #0]
333 1.1.2.2 nathanw teq r2, #0
334 1.1.2.2 nathanw moveq pc, lr
335 1.1.2.2 nathanw
336 1.1.2.2 nathanw Lisa_bs_sr_2_loop:
337 1.1.2.2 nathanw strh r1, [r0], #2 /*.word e0c010b2*/
338 1.1.2.2 nathanw subs r2, r2, #1
339 1.1.2.2 nathanw bne Lisa_bs_sr_2_loop
340 1.1.2.2 nathanw
341 1.1.2.2 nathanw mov pc, lr
342