OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uClinux-2.0.x/] [arch/] [armnommu/] [drivers/] [scsi/] [acornscsi-io.S] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
@  linux/arch/arm/drivers/scsi/acornscsi-io.S: Acorn SCSI card IO
2
 
3
#include 
4
#include 
5
 
6
#if (IO_BASE == (PCIO_BASE & 0xff000000))
7
#define ADDR(off,reg)                                           \
8
                tst     off, $0x80000000                        ;\
9
                mov     reg, $IO_BASE                           ;\
10
                orreq   reg, reg, $(PCIO_BASE & 0x00ff0000)
11
#else
12
#define ADDR(off,reg)                                           \
13
                tst     off, $0x80000000                        ;\
14
                movne   reg, $IO_BASE                           ;\
15
                moveq   reg, $(PCIO_BASE & 0xff000000)		;\
16
                orreq   reg, reg, $(PCIO_BASE & 0x00ff0000)
17
#endif
18
 
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)
21
@ Returns: nothing
22
 
23
                .align
24
                .global ___acornscsi_in
25
___acornscsi_in:
26
                stmfd   sp!, {r4 - r7, lr}
27
                bic     r0, r0, #3
28
                mov     lr, #0xff
29
                orr     lr, lr, #0xff00
30
acornscsi_in16lp:
31
                subs    r2, r2, #16
32
                bmi     acornscsi_in8
33
                ldmia   r0!, {r3, r4, r5, r6}
34
                and     r3, r3, lr
35
                orr     r3, r3, r4, lsl #16
36
                and     r4, r5, lr
37
                orr     r4, r4, r6, lsl #16
38
                ldmia   r0!, {r5, r6, r7, ip}
39
                and     r5, r5, lr
40
                orr     r5, r5, r6, lsl #16
41
                and     r6, r7, lr
42
                orr     r6, r6, ip, lsl #16
43
                stmia   r1!, {r3 - r6}
44
                bne     acornscsi_in16lp
45
                LOADREGS(fd, sp!, {r4 - r7, pc})
46
 
47
acornscsi_in8:  adds    r2, r2, #8
48
                bmi     acornscsi_in4
49
                ldmia   r0!, {r3, r4, r5, r6}
50
                and     r3, r3, lr
51
                orr     r3, r3, r4, lsl #16
52
                and     r4, r5, lr
53
                orr     r4, r4, r6, lsl #16
54
                stmia   r1!, {r3 - r4}
55
                LOADREGS(eqfd, sp!, {r4 - r7, pc})
56
                sub     r2, r2, #8
57
 
58
acornscsi_in4:  adds    r2, r2, #4
59
                bmi     acornscsi_in2
60
                ldmia   r0!, {r3, r4}
61
                and     r3, r3, lr
62
                orr     r3, r3, r4, lsl #16
63
                str     r3, [r1], #4
64
                LOADREGS(eqfd, sp!, {r4 - r7, pc})
65
                sub     r2, r2, #4
66
 
67
acornscsi_in2:  adds    r2, r2, #2
68
                ldr     r3, [r0], #4
69
                and     r3, r3, lr
70
                strb    r3, [r1], #1
71
                mov     r3, r3, lsr #8
72
                strplb  r3, [r1], #1
73
                LOADREGS(fd, sp!, {r4 - r7, pc})
74
 
75
@ Purpose: transfer a block of data from memory to the acorn scsi card
76
@ Proto  : void acornscsi_in(unsigned int addr_start, char *buffer, int length)
77
@ Returns: nothing
78
 
79
                .global ___acornscsi_out
80
___acornscsi_out:
81
                stmfd   sp!, {r4 - r6, lr}
82
                bic     r0, r0, #3
83
acornscsi_out16lp:
84
                subs    r2, r2, #16
85
                bmi     acornscsi_out8
86
                ldmia   r1!, {r4, r6, ip, lr}
87
                mov     r3, r4, lsl #16
88
                orr     r3, r3, r3, lsr #16
89
                mov     r4, r4, lsr #16
90
                orr     r4, r4, r4, lsl #16
91
                mov     r5, r6, lsl #16
92
                orr     r5, r5, r5, lsr #16
93
                mov     r6, r6, lsr #16
94
                orr     r6, r6, r6, lsl #16
95
                stmia   r0!, {r3, r4, r5, r6}
96
                mov     r3, ip, lsl #16
97
                orr     r3, r3, r3, lsr #16
98
                mov     r4, ip, lsr #16
99
                orr     r4, r4, r4, lsl #16
100
                mov     ip, lr, lsl #16
101
                orr     ip, ip, ip, lsr #16
102
                mov     lr, lr, lsr #16
103
                orr     lr, lr, lr, lsl #16
104
                stmia   r0!, {r3, r4, ip, lr}
105
                bne     acornscsi_out16lp
106
                LOADREGS(fd, sp!, {r4 - r6, pc})
107
 
108
acornscsi_out8: adds    r2, r2, #8
109
                bmi     acornscsi_out4
110
                ldmia   r1!, {r4, r6}
111
                mov     r3, r4, lsl #16
112
                orr     r3, r3, r3, lsr #16
113
                mov     r4, r4, lsr #16
114
                orr     r4, r4, r4, lsl #16
115
                mov     r5, r6, lsl #16
116
                orr     r5, r5, r5, lsr #16
117
                mov     r6, r6, lsr #16
118
                orr     r6, r6, r6, lsl #16
119
                stmia   r0!, {r3, r4, r5, r6}
120
                LOADREGS(eqfd, sp!, {r4 - r6, pc})
121
 
122
                sub     r2, r2, #8
123
acornscsi_out4: adds    r2, r2, #4
124
                bmi     acornscsi_out2
125
                ldr     r4, [r1], #4
126
                mov     r3, r4, lsl #16
127
                orr     r3, r3, r3, lsr #16
128
                mov     r4, r4, lsr #16
129
                orr     r4, r4, r4, lsl #16
130
                stmia   r0!, {r3, r4}
131
                LOADREGS(eqfd, sp!, {r4 - r6, pc})
132
 
133
                sub     r2, r2, #4
134
acornscsi_out2: adds    r2, r2, #2
135
                ldr     r3, [r1], #2
136
                strb    r3, [r0], #1
137
                mov     r3, r3, lsr #8
138
                strplb  r3, [r0], #1
139
                LOADREGS(fd, sp!, {r4 - r6, pc})
140
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.