2 * linux/drivers/acorn/scsi/acornscsi-io.S: Acorn SCSI card IO
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
8 #include <linux/linkage.h>
10 #include <asm/assembler.h>
11 #include <asm/hardware.h>
13 #if (IO_BASE == (PCIO_BASE & 0xff000000))
14 #define ADDR(off,reg) \
15 tst off, $0x80000000 ;\
17 orreq reg, reg, $(PCIO_BASE & 0x00ff0000)
19 #define ADDR(off,reg) \
20 tst off, $0x80000000 ;\
21 movne reg, $IO_BASE ;\
22 moveq reg, $(PCIO_BASE & 0xff000000) ;\
23 orreq reg, reg, $(PCIO_BASE & 0x00ff0000)
26 @ Purpose: transfer a block of data from the acorn scsi card to memory
27 @ Proto : void acornscsi_in(unsigned int addr_start, char *buffer, int length)
32 stmfd sp!, {r4 - r7, lr}
39 ldmia r0!, {r3, r4, r5, r6}
41 orr r3, r3, r4, lsl #16
43 orr r4, r4, r6, lsl #16
44 ldmia r0!, {r5, r6, r7, ip}
46 orr r5, r5, r6, lsl #16
48 orr r6, r6, ip, lsl #16
51 LOADREGS(fd, sp!, {r4 - r7, pc})
53 acornscsi_in8: adds r2, r2, #8
55 ldmia r0!, {r3, r4, r5, r6}
57 orr r3, r3, r4, lsl #16
59 orr r4, r4, r6, lsl #16
61 LOADREGS(eqfd, sp!, {r4 - r7, pc})
64 acornscsi_in4: adds r2, r2, #4
68 orr r3, r3, r4, lsl #16
70 LOADREGS(eqfd, sp!, {r4 - r7, pc})
73 acornscsi_in2: adds r2, r2, #2
79 LOADREGS(fd, sp!, {r4 - r7, pc})
81 @ Purpose: transfer a block of data from memory to the acorn scsi card
82 @ Proto : void acornscsi_in(unsigned int addr_start, char *buffer, int length)
85 ENTRY(__acornscsi_out)
86 stmfd sp!, {r4 - r6, lr}
91 ldmia r1!, {r4, r6, ip, lr}
93 orr r3, r3, r3, lsr #16
95 orr r4, r4, r4, lsl #16
97 orr r5, r5, r5, lsr #16
99 orr r6, r6, r6, lsl #16
100 stmia r0!, {r3, r4, r5, r6}
102 orr r3, r3, r3, lsr #16
104 orr r4, r4, r4, lsl #16
106 orr ip, ip, ip, lsr #16
108 orr lr, lr, lr, lsl #16
109 stmia r0!, {r3, r4, ip, lr}
110 bne acornscsi_out16lp
111 LOADREGS(fd, sp!, {r4 - r6, pc})
113 acornscsi_out8: adds r2, r2, #8
117 orr r3, r3, r3, lsr #16
119 orr r4, r4, r4, lsl #16
121 orr r5, r5, r5, lsr #16
123 orr r6, r6, r6, lsl #16
124 stmia r0!, {r3, r4, r5, r6}
125 LOADREGS(eqfd, sp!, {r4 - r6, pc})
128 acornscsi_out4: adds r2, r2, #4
132 orr r3, r3, r3, lsr #16
134 orr r4, r4, r4, lsl #16
136 LOADREGS(eqfd, sp!, {r4 - r6, pc})
139 acornscsi_out2: adds r2, r2, #2
144 LOADREGS(fd, sp!, {r4 - r6, pc})