2 * linux/drivers/sound/vidc_fill.S
4 * Copyright (C) 1997 Russell King
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * Filler routines for DMA buffers
12 #include <linux/linkage.h>
13 #include <asm/assembler.h>
14 #include <asm/hardware.h>
15 #include <asm/hardware/iomd.h>
19 ENTRY(vidc_fill_1x8_u)
25 and r4, ip, r4, lsl #8
26 orr r4, r4, r4, lsl #16
32 ENTRY(vidc_fill_2x8_u)
38 and r4, ip, r4, lsl #8
39 orr r4, r4, r5, lsl #16
40 orr r4, r4, r4, lsr #8
46 ENTRY(vidc_fill_1x8_s)
51 and r4, ip, r4, lsl #8
52 orr r4, r4, r4, lsl #16
58 ENTRY(vidc_fill_2x8_s)
64 and r4, ip, r4, lsl #8
65 orr r4, r4, r5, lsl #16
66 orr r4, r4, r4, lsr #8
72 ENTRY(vidc_fill_1x16_s)
74 orr ip, ip, ip, lsr #8
79 orr r4, r4, r4, lsl #16
83 andlt r4, r5, ip, lsl #16
84 orrlt r4, r4, r4, lsr #16
90 ENTRY(vidc_fill_2x16_s)
92 orr ip, ip, ip, lsr #8
104 ENTRY(vidc_fill_noaudio)
110 stmltia r2!, {r0, r1, r4, r5}
124 * Call filler routines with:
129 * r0 = new buffer address
130 * r2 = new buffer finish
136 ENTRY(vidc_sound_dma_irq)
137 stmfd sp!, {r4 - r8, lr}
139 ldmia r8, {r0, r1, r2, r3, r4, r5}
141 adreq r4, vidc_fill_noaudio
144 mov ip, #IOMD_BASE & 0xff000000
145 orr ip, ip, #IOMD_BASE & 0x00ff0000
146 ldrb r6, [ip, #IOMD_SD0ST]
147 tst r6, #DMA_ST_OFL @ Check for overrun
148 eorne r6, r6, #DMA_ST_AB
150 moveq r2, r3 @ DMAing A, update B
151 add r3, r2, r5 @ End of DMA buffer
152 add r1, r1, r0 @ End of virtual DMA buffer
154 mov pc, r4 @ Call fill routine (uses r4, ip)
155 sub r1, r1, r0 @ Remaining length
158 tst r2, #4 @ Round buffer up to 4 words
166 orreq r2, r2, #1 << 30 @ Set L bit
168 ldmdb r8, {r3, r4, r5}
170 mov ip, #IOMD_BASE & 0xff000000
171 orr ip, ip, #IOMD_BASE & 0x00ff0000
172 streq r4, [ip, #IOMD_SD0CURB]
173 strne r5, [ip, #IOMD_SD0CURA]
174 streq r2, [ip, #IOMD_SD0ENDB]
175 strne r2, [ip, #IOMD_SD0ENDA]
176 ldr lr, [ip, #IOMD_SD0ST]
180 strne r4, [ip, #IOMD_SD0CURB]
181 streq r5, [ip, #IOMD_SD0CURA]
182 strne r2, [ip, #IOMD_SD0ENDB]
183 streq r2, [ip, #IOMD_SD0ENDA]
186 strneb r0, [ip, #IOMD_SD0CR]
187 ldmfd sp!, {r4 - r8, lr}
188 mov r0, #1 @ IRQ_HANDLED
189 teq r1, #0 @ If we have no more
192 movne pc, r3 @ Call interrupt routine
215 .long vidc_fill_noaudio @ r4