1 /* $NetBSD: sm_obio_space_asm.S,v 1.1.2.3 2004/09/21 13:14:53 skrll Exp $ */
4 * Copyright (c) 2002, 2003 Genetec Corporation. All rights reserved.
5 * Written by Hiroyuki Bessho for Genetec Corporation.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. The name of Genetec Corporation may not be used to endorse or
16 * promote products derived from this software without specific prior
19 * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENETEC CORPORATION
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
33 * These are special bus space functions for Lubbock's on-board I/O.
34 * Especially for SMC91c96 chip in 8-bit mode.
37 #include <machine/asm.h>
39 RCSID("$NetBSD: sm_obio_space_asm.S,v 1.1.2.3 2004/09/21 13:14:53 skrll Exp $")
42 * bus_space I/O functions with offset*4, 8-bit access.
50 add r1, r1, r2, LSL #2
53 orr r0, r0, r2, LSL #8
61 add r1, r1, r2, LSL #2
70 ENTRY(smobio8_bs_rm_2)
71 add r0, r1, r2, LSL #2
80 subs r2, r2, #0x00000001
81 orr r1, r1, lr, LSL #8
82 strh r1, [r3], #0x0002
92 ENTRY(smobio8_bs_wm_2)
93 add r0, r1, r2, LSL #2
99 ldrh r1, [r3], #0x0002
100 subs r2, r2, #0x00000001
117 ENTRY(smobio16_bs_r_1)
118 tst r2, #1 /* Even/Odd ? */
119 ldreqb r0, [r1, r2, LSL #2]
122 /* Odd byte. read 16bits and get high byte */
124 add r1, r1, r2, LSL #2
134 ENTRY(smobio16_bs_w_1)
135 tst r2, #1 /* Even/Odd ? */
136 streqb r3, [r1, r2, LSL #2]
139 /* Odd byte. write 16bit with low byte is 0. */
142 add r1, r1, r2, LSL #2