diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/scsi/arm/acornscsi-io.S |
Linux-2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'drivers/scsi/arm/acornscsi-io.S')
-rw-r--r-- | drivers/scsi/arm/acornscsi-io.S | 145 |
1 files changed, 145 insertions, 0 deletions
diff --git a/drivers/scsi/arm/acornscsi-io.S b/drivers/scsi/arm/acornscsi-io.S new file mode 100644 index 00000000000..93467e6ac92 --- /dev/null +++ b/drivers/scsi/arm/acornscsi-io.S | |||
@@ -0,0 +1,145 @@ | |||
1 | /* | ||
2 | * linux/drivers/acorn/scsi/acornscsi-io.S: Acorn SCSI card IO | ||
3 | * | ||
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. | ||
7 | */ | ||
8 | #include <linux/linkage.h> | ||
9 | |||
10 | #include <asm/assembler.h> | ||
11 | #include <asm/hardware.h> | ||
12 | |||
13 | #if (IO_BASE == (PCIO_BASE & 0xff000000)) | ||
14 | #define ADDR(off,reg) \ | ||
15 | tst off, $0x80000000 ;\ | ||
16 | mov reg, $IO_BASE ;\ | ||
17 | orreq reg, reg, $(PCIO_BASE & 0x00ff0000) | ||
18 | #else | ||
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) | ||
24 | #endif | ||
25 | |||
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) | ||
28 | @ Returns: nothing | ||
29 | |||
30 | .align | ||
31 | ENTRY(__acornscsi_in) | ||
32 | stmfd sp!, {r4 - r7, lr} | ||
33 | bic r0, r0, #3 | ||
34 | mov lr, #0xff | ||
35 | orr lr, lr, #0xff00 | ||
36 | acornscsi_in16lp: | ||
37 | subs r2, r2, #16 | ||
38 | bmi acornscsi_in8 | ||
39 | ldmia r0!, {r3, r4, r5, r6} | ||
40 | and r3, r3, lr | ||
41 | orr r3, r3, r4, lsl #16 | ||
42 | and r4, r5, lr | ||
43 | orr r4, r4, r6, lsl #16 | ||
44 | ldmia r0!, {r5, r6, r7, ip} | ||
45 | and r5, r5, lr | ||
46 | orr r5, r5, r6, lsl #16 | ||
47 | and r6, r7, lr | ||
48 | orr r6, r6, ip, lsl #16 | ||
49 | stmia r1!, {r3 - r6} | ||
50 | bne acornscsi_in16lp | ||
51 | LOADREGS(fd, sp!, {r4 - r7, pc}) | ||
52 | |||
53 | acornscsi_in8: adds r2, r2, #8 | ||
54 | bmi acornscsi_in4 | ||
55 | ldmia r0!, {r3, r4, r5, r6} | ||
56 | and r3, r3, lr | ||
57 | orr r3, r3, r4, lsl #16 | ||
58 | and r4, r5, lr | ||
59 | orr r4, r4, r6, lsl #16 | ||
60 | stmia r1!, {r3 - r4} | ||
61 | LOADREGS(eqfd, sp!, {r4 - r7, pc}) | ||
62 | sub r2, r2, #8 | ||
63 | |||
64 | acornscsi_in4: adds r2, r2, #4 | ||
65 | bmi acornscsi_in2 | ||
66 | ldmia r0!, {r3, r4} | ||
67 | and r3, r3, lr | ||
68 | orr r3, r3, r4, lsl #16 | ||
69 | str r3, [r1], #4 | ||
70 | LOADREGS(eqfd, sp!, {r4 - r7, pc}) | ||
71 | sub r2, r2, #4 | ||
72 | |||
73 | acornscsi_in2: adds r2, r2, #2 | ||
74 | ldr r3, [r0], #4 | ||
75 | and r3, r3, lr | ||
76 | strb r3, [r1], #1 | ||
77 | mov r3, r3, lsr #8 | ||
78 | strplb r3, [r1], #1 | ||
79 | LOADREGS(fd, sp!, {r4 - r7, pc}) | ||
80 | |||
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) | ||
83 | @ Returns: nothing | ||
84 | |||
85 | ENTRY(__acornscsi_out) | ||
86 | stmfd sp!, {r4 - r6, lr} | ||
87 | bic r0, r0, #3 | ||
88 | acornscsi_out16lp: | ||
89 | subs r2, r2, #16 | ||
90 | bmi acornscsi_out8 | ||
91 | ldmia r1!, {r4, r6, ip, lr} | ||
92 | mov r3, r4, lsl #16 | ||
93 | orr r3, r3, r3, lsr #16 | ||
94 | mov r4, r4, lsr #16 | ||
95 | orr r4, r4, r4, lsl #16 | ||
96 | mov r5, r6, lsl #16 | ||
97 | orr r5, r5, r5, lsr #16 | ||
98 | mov r6, r6, lsr #16 | ||
99 | orr r6, r6, r6, lsl #16 | ||
100 | stmia r0!, {r3, r4, r5, r6} | ||
101 | mov r3, ip, lsl #16 | ||
102 | orr r3, r3, r3, lsr #16 | ||
103 | mov r4, ip, lsr #16 | ||
104 | orr r4, r4, r4, lsl #16 | ||
105 | mov ip, lr, lsl #16 | ||
106 | orr ip, ip, ip, lsr #16 | ||
107 | mov lr, lr, 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}) | ||
112 | |||
113 | acornscsi_out8: adds r2, r2, #8 | ||
114 | bmi acornscsi_out4 | ||
115 | ldmia r1!, {r4, r6} | ||
116 | mov r3, r4, lsl #16 | ||
117 | orr r3, r3, r3, lsr #16 | ||
118 | mov r4, r4, lsr #16 | ||
119 | orr r4, r4, r4, lsl #16 | ||
120 | mov r5, r6, lsl #16 | ||
121 | orr r5, r5, r5, lsr #16 | ||
122 | mov r6, r6, lsr #16 | ||
123 | orr r6, r6, r6, lsl #16 | ||
124 | stmia r0!, {r3, r4, r5, r6} | ||
125 | LOADREGS(eqfd, sp!, {r4 - r6, pc}) | ||
126 | |||
127 | sub r2, r2, #8 | ||
128 | acornscsi_out4: adds r2, r2, #4 | ||
129 | bmi acornscsi_out2 | ||
130 | ldr r4, [r1], #4 | ||
131 | mov r3, r4, lsl #16 | ||
132 | orr r3, r3, r3, lsr #16 | ||
133 | mov r4, r4, lsr #16 | ||
134 | orr r4, r4, r4, lsl #16 | ||
135 | stmia r0!, {r3, r4} | ||
136 | LOADREGS(eqfd, sp!, {r4 - r6, pc}) | ||
137 | |||
138 | sub r2, r2, #4 | ||
139 | acornscsi_out2: adds r2, r2, #2 | ||
140 | ldr r3, [r1], #2 | ||
141 | strb r3, [r0], #1 | ||
142 | mov r3, r3, lsr #8 | ||
143 | strplb r3, [r0], #1 | ||
144 | LOADREGS(fd, sp!, {r4 - r6, pc}) | ||
145 | |||