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/arch/hardware.h>
13 #if defined(__APCS_32__)
14 #define LOADREGS(t,r,l...) ldm##t r, l
15 #elif defined(__APCS_26__)
16 #define LOADREGS(t,r,l...) ldm##t r, l##^
19 @ Purpose: transfer a block of data from the acorn scsi card to memory
20 @ Proto : void acornscsi_in(unsigned int addr_start, char *buffer, int length)
25 stmfd sp!, {r4 - r7, lr}
32 ldmia r0!, {r3, r4, r5, r6}
34 orr r3, r3, r4, lsl #16
36 orr r4, r4, r6, lsl #16
37 ldmia r0!, {r5, r6, r7, ip}
39 orr r5, r5, r6, lsl #16
41 orr r6, r6, ip, lsl #16
44 LOADREGS(fd, sp!, {r4 - r7, pc})
46 acornscsi_in8: adds r2, r2, #8
48 ldmia r0!, {r3, r4, r5, r6}
50 orr r3, r3, r4, lsl #16
52 orr r4, r4, r6, lsl #16
54 LOADREGS(eqfd, sp!, {r4 - r7, pc})
57 acornscsi_in4: adds r2, r2, #4
61 orr r3, r3, r4, lsl #16
63 LOADREGS(eqfd, sp!, {r4 - r7, pc})
66 acornscsi_in2: adds r2, r2, #2
72 LOADREGS(fd, sp!, {r4 - r7, pc})
74 @ Purpose: transfer a block of data from memory to the acorn scsi card
75 @ Proto : void acornscsi_in(unsigned int addr_start, char *buffer, int length)
78 ENTRY(__acornscsi_out)
79 stmfd sp!, {r4 - r6, lr}
84 ldmia r1!, {r4, r6, ip, lr}
86 orr r3, r3, r3, lsr #16
88 orr r4, r4, r4, lsl #16
90 orr r5, r5, r5, lsr #16
92 orr r6, r6, r6, lsl #16
93 stmia r0!, {r3, r4, r5, r6}
95 orr r3, r3, r3, lsr #16
97 orr r4, r4, r4, lsl #16
99 orr ip, ip, ip, lsr #16
101 orr lr, lr, lr, lsl #16
102 stmia r0!, {r3, r4, ip, lr}
103 bne acornscsi_out16lp
104 LOADREGS(fd, sp!, {r4 - r6, pc})
106 acornscsi_out8: adds r2, r2, #8
110 orr r3, r3, r3, lsr #16
112 orr r4, r4, r4, lsl #16
114 orr r5, r5, r5, lsr #16
116 orr r6, r6, r6, lsl #16
117 stmia r0!, {r3, r4, r5, r6}
118 LOADREGS(eqfd, sp!, {r4 - r6, pc})
121 acornscsi_out4: adds r2, r2, #4
125 orr r3, r3, r3, lsr #16
127 orr r4, r4, r4, lsl #16
129 LOADREGS(eqfd, sp!, {r4 - r6, pc})
132 acornscsi_out2: adds r2, r2, #2
137 LOADREGS(fd, sp!, {r4 - r6, pc})