diff options
Diffstat (limited to 'firmware/target/arm/as3525')
-rw-r--r-- | firmware/target/arm/as3525/lcd-as-e200v2-fuze.S | 62 | ||||
-rw-r--r-- | firmware/target/arm/as3525/sansa-clip/lcd-as-clip.S | 16 |
2 files changed, 39 insertions, 39 deletions
diff --git a/firmware/target/arm/as3525/lcd-as-e200v2-fuze.S b/firmware/target/arm/as3525/lcd-as-e200v2-fuze.S index 254816cd0e..71d997d044 100644 --- a/firmware/target/arm/as3525/lcd-as-e200v2-fuze.S +++ b/firmware/target/arm/as3525/lcd-as-e200v2-fuze.S | |||
@@ -51,7 +51,7 @@ lcd_write_yuv420_lines: | |||
51 | @ r0 = yuv_src | 51 | @ r0 = yuv_src |
52 | @ r1 = width | 52 | @ r1 = width |
53 | @ r2 = stride | 53 | @ r2 = stride |
54 | stmfd sp!, { r4-r12 } @ save non-scratch | 54 | stmfd sp!, { r4-r10, lr } @ save non-scratch |
55 | ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p | 55 | ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p |
56 | @ r5 = yuv_src[1] = Cb_p | 56 | @ r5 = yuv_src[1] = Cb_p |
57 | @ r6 = yuv_src[2] = Cr_p | 57 | @ r6 = yuv_src[2] = Cr_p |
@@ -76,9 +76,9 @@ lcd_write_yuv420_lines: | |||
76 | add r10, r10, r8, asl #3 @ | 76 | add r10, r10, r8, asl #3 @ |
77 | add r10, r10, r8, asl #4 @ | 77 | add r10, r10, r8, asl #4 @ |
78 | @ | 78 | @ |
79 | add r11, r9, r9, asl #2 @ r9 = Cr*101 | 79 | add lr, r9, r9, asl #2 @ r9 = Cr*101 |
80 | add r11, r11, r9, asl #5 @ | 80 | add lr, lr, r9, asl #5 @ |
81 | add r9, r11, r9, asl #6 @ | 81 | add r9, lr, r9, asl #6 @ |
82 | @ | 82 | @ |
83 | add r8, r8, #2 @ r8 = bu = (Cb*128 + 128) >> 8 | 83 | add r8, r8, #2 @ r8 = bu = (Cb*128 + 128) >> 8 |
84 | mov r8, r8, asr #2 @ | 84 | mov r8, r8, asr #2 @ |
@@ -88,19 +88,19 @@ lcd_write_yuv420_lines: | |||
88 | mov r10, r10, asr #8 @ | 88 | mov r10, r10, asr #8 @ |
89 | @ compute R, G, and B | 89 | @ compute R, G, and B |
90 | add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu | 90 | add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu |
91 | add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv | 91 | add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv |
92 | add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv | 92 | add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv |
93 | @ | 93 | @ |
94 | orr r12, r0, r11 @ check if clamping is needed... | 94 | orr r12, r0, lr @ check if clamping is needed... |
95 | orr r12, r12, r7, asr #1 @ ...at all | 95 | orr r12, r12, r7, asr #1 @ ...at all |
96 | cmp r12, #31 @ | 96 | cmp r12, #31 @ |
97 | bls 15f @ no clamp @ | 97 | bls 15f @ no clamp @ |
98 | cmp r0, #31 @ clamp b | 98 | cmp r0, #31 @ clamp b |
99 | mvnhi r0, r0, asr #31 @ | 99 | mvnhi r0, r0, asr #31 @ |
100 | andhi r0, r0, #31 @ | 100 | andhi r0, r0, #31 @ |
101 | cmp r11, #31 @ clamp r | 101 | cmp lr, #31 @ clamp r |
102 | mvnhi r11, r11, asr #31 @ | 102 | mvnhi lr, lr, asr #31 @ |
103 | andhi r11, r11, #31 @ | 103 | andhi lr, lr, #31 @ |
104 | cmp r7, #63 @ clamp g | 104 | cmp r7, #63 @ clamp g |
105 | mvnhi r7, r7, asr #31 @ | 105 | mvnhi r7, r7, asr #31 @ |
106 | andhi r7, r7, #63 @ | 106 | andhi r7, r7, #63 @ |
@@ -108,7 +108,7 @@ lcd_write_yuv420_lines: | |||
108 | @ | 108 | @ |
109 | ldrb r12, [r4, r2] @ r12 = Y' = *(Y'_p + stride) | 109 | ldrb r12, [r4, r2] @ r12 = Y' = *(Y'_p + stride) |
110 | @ | 110 | @ |
111 | orr r0, r0, r11, lsl #11 @ r0 = (r << 11) | b | 111 | orr r0, r0, lr, lsl #11 @ r0 = (r << 11) | b |
112 | orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b | 112 | orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b |
113 | strh r0, [r3, #0x10] @ write pixel | 113 | strh r0, [r3, #0x10] @ write pixel |
114 | 1: @ busy @ | 114 | 1: @ busy @ |
@@ -121,19 +121,19 @@ lcd_write_yuv420_lines: | |||
121 | add r7, r12, r7, asl #5 @ | 121 | add r7, r12, r7, asl #5 @ |
122 | @ compute R, G, and B | 122 | @ compute R, G, and B |
123 | add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu | 123 | add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu |
124 | add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv | 124 | add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv |
125 | add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv | 125 | add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv |
126 | @ | 126 | @ |
127 | orr r12, r0, r11 @ check if clamping is needed... | 127 | orr r12, r0, lr @ check if clamping is needed... |
128 | orr r12, r12, r7, asr #1 @ ...at all | 128 | orr r12, r12, r7, asr #1 @ ...at all |
129 | cmp r12, #31 @ | 129 | cmp r12, #31 @ |
130 | bls 15f @ no clamp @ | 130 | bls 15f @ no clamp @ |
131 | cmp r0, #31 @ clamp b | 131 | cmp r0, #31 @ clamp b |
132 | mvnhi r0, r0, asr #31 @ | 132 | mvnhi r0, r0, asr #31 @ |
133 | andhi r0, r0, #31 @ | 133 | andhi r0, r0, #31 @ |
134 | cmp r11, #31 @ clamp r | 134 | cmp lr, #31 @ clamp r |
135 | mvnhi r11, r11, asr #31 @ | 135 | mvnhi lr, lr, asr #31 @ |
136 | andhi r11, r11, #31 @ | 136 | andhi lr, lr, #31 @ |
137 | cmp r7, #63 @ clamp g | 137 | cmp r7, #63 @ clamp g |
138 | mvnhi r7, r7, asr #31 @ | 138 | mvnhi r7, r7, asr #31 @ |
139 | andhi r7, r7, #63 @ | 139 | andhi r7, r7, #63 @ |
@@ -141,7 +141,7 @@ lcd_write_yuv420_lines: | |||
141 | @ | 141 | @ |
142 | ldrb r12, [r4], #1 @ r12 = Y' = *(Y'_p++) | 142 | ldrb r12, [r4], #1 @ r12 = Y' = *(Y'_p++) |
143 | @ | 143 | @ |
144 | orr r0, r0, r11, lsl #11 @ r0 = (r << 11) | b | 144 | orr r0, r0, lr, lsl #11 @ r0 = (r << 11) | b |
145 | orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b | 145 | orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b |
146 | strh r0, [r3, #0x10] @ write pixel | 146 | strh r0, [r3, #0x10] @ write pixel |
147 | 1: @ busy @ | 147 | 1: @ busy @ |
@@ -154,19 +154,19 @@ lcd_write_yuv420_lines: | |||
154 | add r7, r12, r7, asl #5 @ | 154 | add r7, r12, r7, asl #5 @ |
155 | @ compute R, G, and B | 155 | @ compute R, G, and B |
156 | add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu | 156 | add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu |
157 | add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv | 157 | add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv |
158 | add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv | 158 | add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv |
159 | @ | 159 | @ |
160 | orr r12, r0, r11 @ check if clamping is needed... | 160 | orr r12, r0, lr @ check if clamping is needed... |
161 | orr r12, r12, r7, asr #1 @ ...at all | 161 | orr r12, r12, r7, asr #1 @ ...at all |
162 | cmp r12, #31 @ | 162 | cmp r12, #31 @ |
163 | bls 15f @ no clamp @ | 163 | bls 15f @ no clamp @ |
164 | cmp r0, #31 @ clamp b | 164 | cmp r0, #31 @ clamp b |
165 | mvnhi r0, r0, asr #31 @ | 165 | mvnhi r0, r0, asr #31 @ |
166 | andhi r0, r0, #31 @ | 166 | andhi r0, r0, #31 @ |
167 | cmp r11, #31 @ clamp r | 167 | cmp lr, #31 @ clamp r |
168 | mvnhi r11, r11, asr #31 @ | 168 | mvnhi lr, lr, asr #31 @ |
169 | andhi r11, r11, #31 @ | 169 | andhi lr, lr, #31 @ |
170 | cmp r7, #63 @ clamp g | 170 | cmp r7, #63 @ clamp g |
171 | mvnhi r7, r7, asr #31 @ | 171 | mvnhi r7, r7, asr #31 @ |
172 | andhi r7, r7, #63 @ | 172 | andhi r7, r7, #63 @ |
@@ -175,7 +175,7 @@ lcd_write_yuv420_lines: | |||
175 | ldrb r12, [r4, r2] @ r12 = Y' = *(Y'_p + stride) | 175 | ldrb r12, [r4, r2] @ r12 = Y' = *(Y'_p + stride) |
176 | @ | 176 | @ |
177 | @ | 177 | @ |
178 | orr r0, r0, r11, lsl #11 @ r0 = (r << 11) | b | 178 | orr r0, r0, lr, lsl #11 @ r0 = (r << 11) | b |
179 | orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b | 179 | orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b |
180 | strh r0, [r3, #0x10] @ write pixel | 180 | strh r0, [r3, #0x10] @ write pixel |
181 | 1: @ busy @ | 181 | 1: @ busy @ |
@@ -188,25 +188,25 @@ lcd_write_yuv420_lines: | |||
188 | add r7, r12, r7, asl #5 @ | 188 | add r7, r12, r7, asl #5 @ |
189 | @ compute R, G, and B | 189 | @ compute R, G, and B |
190 | add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu | 190 | add r0, r8, r7, asr #8 @ r0 = b = (Y >> 9) + bu |
191 | add r11, r9, r7, asr #8 @ r11 = r = (Y >> 9) + rv | 191 | add lr, r9, r7, asr #8 @ lr = r = (Y >> 9) + rv |
192 | add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv | 192 | add r7, r10, r7, asr #7 @ r7 = g = (Y >> 8) + guv |
193 | @ | 193 | @ |
194 | orr r12, r0, r11 @ check if clamping is needed... | 194 | orr r12, r0, lr @ check if clamping is needed... |
195 | orr r12, r12, r7, asr #1 @ ...at all | 195 | orr r12, r12, r7, asr #1 @ ...at all |
196 | cmp r12, #31 @ | 196 | cmp r12, #31 @ |
197 | bls 15f @ no clamp @ | 197 | bls 15f @ no clamp @ |
198 | cmp r0, #31 @ clamp b | 198 | cmp r0, #31 @ clamp b |
199 | mvnhi r0, r0, asr #31 @ | 199 | mvnhi r0, r0, asr #31 @ |
200 | andhi r0, r0, #31 @ | 200 | andhi r0, r0, #31 @ |
201 | cmp r11, #31 @ clamp r | 201 | cmp lr, #31 @ clamp r |
202 | mvnhi r11, r11, asr #31 @ | 202 | mvnhi lr, lr, asr #31 @ |
203 | andhi r11, r11, #31 @ | 203 | andhi lr, lr, #31 @ |
204 | cmp r7, #63 @ clamp g | 204 | cmp r7, #63 @ clamp g |
205 | mvnhi r7, r7, asr #31 @ | 205 | mvnhi r7, r7, asr #31 @ |
206 | andhi r7, r7, #63 @ | 206 | andhi r7, r7, #63 @ |
207 | 15: @ no clamp @ | 207 | 15: @ no clamp @ |
208 | @ | 208 | @ |
209 | orr r0, r0, r11, lsl #11 @ r0 = (r << 11) | b | 209 | orr r0, r0, lr, lsl #11 @ r0 = (r << 11) | b |
210 | orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b | 210 | orr r0, r0, r7, lsl #5 @ r0 = (r << 11) | (g << 5) | b |
211 | strh r0, [r3, #0x10] @ write pixel | 211 | strh r0, [r3, #0x10] @ write pixel |
212 | 1: @ busy @ | 212 | 1: @ busy @ |
@@ -217,7 +217,7 @@ lcd_write_yuv420_lines: | |||
217 | subs r1, r1, #2 @ subtract block from width | 217 | subs r1, r1, #2 @ subtract block from width |
218 | bgt 10b @ loop line @ | 218 | bgt 10b @ loop line @ |
219 | @ | 219 | @ |
220 | ldmfd sp!, { r4-r12 } @ restore registers and return | 220 | ldmfd sp!, { r4-r10, pc } @ restore registers and return |
221 | bx lr @ | 221 | bx lr @ |
222 | .ltorg @ dump constant pool | 222 | .ltorg @ dump constant pool |
223 | .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines | 223 | .size lcd_write_yuv420_lines, .-lcd_write_yuv420_lines |
@@ -258,7 +258,7 @@ lcd_write_yuv420_lines_odither: | |||
258 | @ r2 = stride | 258 | @ r2 = stride |
259 | @ r3 = x_screen | 259 | @ r3 = x_screen |
260 | @ [sp] = y_screen | 260 | @ [sp] = y_screen |
261 | stmfd sp!, { r4-r12, lr } @ save non-scratch | 261 | stmfd sp!, { r4-r11, lr } @ save non-scratch |
262 | ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p | 262 | ldmia r0, { r4, r5, r6 } @ r4 = yuv_src[0] = Y'_p |
263 | @ r5 = yuv_src[1] = Cb_p | 263 | @ r5 = yuv_src[1] = Cb_p |
264 | @ r6 = yuv_src[2] = Cr_p | 264 | @ r6 = yuv_src[2] = Cr_p |
@@ -496,6 +496,6 @@ lcd_write_yuv420_lines_odither: | |||
496 | subs r1, r1, #2 @ subtract block from width | 496 | subs r1, r1, #2 @ subtract block from width |
497 | bgt 10b @ loop line @ | 497 | bgt 10b @ loop line @ |
498 | @ | 498 | @ |
499 | ldmfd sp!, { r4-r12, pc } @ restore registers and return | 499 | ldmfd sp!, { r4-r11, pc } @ restore registers and return |
500 | .ltorg @ dump constant pool | 500 | .ltorg @ dump constant pool |
501 | .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither | 501 | .size lcd_write_yuv420_lines_odither, .-lcd_write_yuv420_lines_odither |
diff --git a/firmware/target/arm/as3525/sansa-clip/lcd-as-clip.S b/firmware/target/arm/as3525/sansa-clip/lcd-as-clip.S index ed430178b9..5a52eb032c 100644 --- a/firmware/target/arm/as3525/sansa-clip/lcd-as-clip.S +++ b/firmware/target/arm/as3525/sansa-clip/lcd-as-clip.S | |||
@@ -39,15 +39,15 @@ | |||
39 | * r3/r4 - current block of phases | 39 | * r3/r4 - current block of phases |
40 | * r5/r6 - current block of values | 40 | * r5/r6 - current block of values |
41 | * r7 - lcd data accumulator | 41 | * r7 - lcd data accumulator |
42 | * r8 - phase signs mask | 42 | * r12 - phase signs mask |
43 | * lr - lcd bridge address | 43 | * lr - lcd bridge address |
44 | */ | 44 | */ |
45 | 45 | ||
46 | lcd_grey_data: | 46 | lcd_grey_data: |
47 | stmfd sp!, {r4-r8, lr} | 47 | stmfd sp!, {r4-r7, lr} |
48 | mov r8, #0x80 | 48 | mov r12, #0x80 |
49 | orr r8, r8, r8, lsl #8 | 49 | orr r12, r12, r12, lsl #8 |
50 | orr r8, r8, r8, lsl #16 | 50 | orr r12, r12, r12, lsl #16 |
51 | 51 | ||
52 | ldr lr, =GPIOA_BASE | 52 | ldr lr, =GPIOA_BASE |
53 | mov r3, #(1<<5) | 53 | mov r3, #(1<<5) |
@@ -70,7 +70,7 @@ lcd_grey_data: | |||
70 | orrne r7, r7, #0x2000 | 70 | orrne r7, r7, #0x2000 |
71 | tst r3, #0x80000000 | 71 | tst r3, #0x80000000 |
72 | orrne r7, r7, #0x1000 | 72 | orrne r7, r7, #0x1000 |
73 | bic r3, r3, r8 | 73 | bic r3, r3, r12 |
74 | add r3, r3, r5 | 74 | add r3, r3, r5 |
75 | 75 | ||
76 | /* set bits 3..0 */ | 76 | /* set bits 3..0 */ |
@@ -82,7 +82,7 @@ lcd_grey_data: | |||
82 | orrne r7, r7, #0x02 | 82 | orrne r7, r7, #0x02 |
83 | tst r4, #0x80000000 | 83 | tst r4, #0x80000000 |
84 | orrne r7, r7, #0x01 | 84 | orrne r7, r7, #0x01 |
85 | bic r4, r4, r8 | 85 | bic r4, r4, r12 |
86 | add r4, r4, r6 | 86 | add r4, r4, r6 |
87 | 87 | ||
88 | stmia r1!, {r3-r4} | 88 | stmia r1!, {r3-r4} |
@@ -102,5 +102,5 @@ lcd_grey_data: | |||
102 | ands r5, r5, #(1<<10) @ wait until push fifo empties | 102 | ands r5, r5, #(1<<10) @ wait until push fifo empties |
103 | beq 1b | 103 | beq 1b |
104 | 104 | ||
105 | ldmfd sp!, {r4-r8, pc} | 105 | ldmfd sp!, {r4-r7, pc} |
106 | .size lcd_grey_data,.-lcd_grey_data | 106 | .size lcd_grey_data,.-lcd_grey_data |