freemyipod r322 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r321‎ | r322 | r323 >
Date:21:35, 12 December 2010
Author:theseven
Status:new
Tags:
Comment:
emBIOS: iPod Nano 2G LCD driver speedup inspired by Buschel's changes to the Rockbox driver
Modified paths:
  • /embios/trunk/target/ipodnano2g/lcd.S (modified) (history)

Diff [purge]

Index: embios/trunk/target/ipodnano2g/lcd.S
@@ -26,11 +26,14 @@
2727 .global lcd_init
2828 .type lcd_init, %function
2929 lcd_init:
30 - mov r1, #0x38000000
31 - orr r1, r1, #0x400000
 30+ mov r1, #0x38400000
3231 mov r0, #0x20000000
33 - orr r0, r0, #0x190000
 32+ orr r0, r0, #0x590000
3433 str r0, [r1,#0x104]
 34+ orr r1, r1, #0x200000
 35+ ldr r0, [r1]
 36+ orr r0, r0, #0x100
 37+ str r0, [r1]
3538 mov pc, lr
3639 .size lcd_init, .-lcd_init
3740
@@ -51,46 +54,46 @@
5255 b lcd_shutdown_done
5356 lcd_shutdown_type2:
5457 mov r0, #0x07
55 - bl displaylcd_sendlcd2c
 58+ bl displaylcd_sendlcdc
5659 mov r0, #0x200
5760 orr r0, r0, #0x32
58 - bl displaylcd_sendlcd2d
 61+ bl displaylcd_sendlcdd
5962 mov r0, #0x13
60 - bl displaylcd_sendlcd2c
 63+ bl displaylcd_sendlcdc
6164 mov r0, #0x1100
6265 orr r0, #0x37
63 - bl displaylcd_sendlcd2d
 66+ bl displaylcd_sendlcdd
6467 mov r0, #0x07
65 - bl displaylcd_sendlcd2c
 68+ bl displaylcd_sendlcdc
6669 mov r0, #0x200
6770 orr r0, r0, #0x01
68 - bl displaylcd_sendlcd2d
 71+ bl displaylcd_sendlcdd
6972 mov r0, #0x13
70 - bl displaylcd_sendlcd2c
 73+ bl displaylcd_sendlcdc
7174 mov r0, #0x100
7275 orr r0, #0x37
73 - bl displaylcd_sendlcd2d
 76+ bl displaylcd_sendlcdd
7477 mov r0, #0x07
75 - bl displaylcd_sendlcd2c
 78+ bl displaylcd_sendlcdc
7679 mov r0, #0x200
77 - bl displaylcd_sendlcd2d
 80+ bl displaylcd_sendlcdd
7881 mov r0, #0x10
79 - bl displaylcd_sendlcd2c
 82+ bl displaylcd_sendlcdc
8083 mov r0, #0x680
81 - bl displaylcd_sendlcd2d
 84+ bl displaylcd_sendlcdd
8285 mov r0, #0x12
83 - bl displaylcd_sendlcd2c
 86+ bl displaylcd_sendlcdc
8487 mov r0, #0x160
85 - bl displaylcd_sendlcd2d
 88+ bl displaylcd_sendlcdd
8689 mov r0, #0x13
87 - bl displaylcd_sendlcd2c
 90+ bl displaylcd_sendlcdc
8891 mov r0, #0x100
8992 orr r0, r0, #0x27
90 - bl displaylcd_sendlcd2d
 93+ bl displaylcd_sendlcdd
9194 mov r0, #0x10
92 - bl displaylcd_sendlcd2c
 95+ bl displaylcd_sendlcdc
9396 mov r0, #0x600
94 - bl displaylcd_sendlcd2d
 97+ bl displaylcd_sendlcdd
9598 lcd_shutdown_done:
9699 ldmfd sp!, {r4, lr}
97100 mov r0, #5120
@@ -129,7 +132,7 @@
130133 .global displaylcd
131134 .type displaylcd, %function
132135 displaylcd:
133 - stmfd sp!, {r0-r4,lr}
 136+ stmfd sp!, {r0-r5,lr}
134137 bl displaylcd_sync
135138 bl displaylcd_detectlcd
136139 sub r12, r12, #0x04900000
@@ -136,45 +139,45 @@
137140 cmp r0, #2
138141 bne displaylcd_othertypes
139142 mov r0, #0x50
140 - bl displaylcd_sendlcd2c
 143+ bl displaylcd_sendlcdc
141144 ldr r0, [sp]
142 - bl displaylcd_sendlcd2d
 145+ bl displaylcd_sendlcdd
143146 mov r0, #0x51
144 - bl displaylcd_sendlcd2c
 147+ bl displaylcd_sendlcdc
145148 ldr r0, [sp,#0x04]
146 - bl displaylcd_sendlcd2d
 149+ bl displaylcd_sendlcdd
147150 mov r0, #0x52
148 - bl displaylcd_sendlcd2c
 151+ bl displaylcd_sendlcdc
149152 ldr r0, [sp,#0x08]
150 - bl displaylcd_sendlcd2d
 153+ bl displaylcd_sendlcdd
151154 mov r0, #0x53
152 - bl displaylcd_sendlcd2c
 155+ bl displaylcd_sendlcdc
153156 ldr r0, [sp,#0x0c]
154 - bl displaylcd_sendlcd2d
 157+ bl displaylcd_sendlcdd
155158 mov r0, #0x20
156 - bl displaylcd_sendlcd2c
 159+ bl displaylcd_sendlcdc
157160 ldr r0, [sp]
158 - bl displaylcd_sendlcd2d
 161+ bl displaylcd_sendlcdd
159162 mov r0, #0x21
160 - bl displaylcd_sendlcd2c
 163+ bl displaylcd_sendlcdc
161164 ldr r0, [sp,#0x08]
162 - bl displaylcd_sendlcd2d
 165+ bl displaylcd_sendlcdd
163166 mov r0, #0x22
164 - bl displaylcd_sendlcd2c
 167+ bl displaylcd_sendlcdc
165168 b displaylcd_blit
166169 displaylcd_othertypes:
167170 mov r0, #0x2a
168171 bl displaylcd_sendlcdc
169172 ldr r0, [sp]
170 - bl displaylcd_sendlcd2d
 173+ bl displaylcd_sendlcdd
171174 ldr r0, [sp,#0x04]
172 - bl displaylcd_sendlcd2d
 175+ bl displaylcd_sendlcdd
173176 mov r0, #0x2b
174177 bl displaylcd_sendlcdc
175178 ldr r0, [sp,#0x08]
176 - bl displaylcd_sendlcd2d
 179+ bl displaylcd_sendlcdd
177180 ldr r0, [sp,#0x0c]
178 - bl displaylcd_sendlcd2d
 181+ bl displaylcd_sendlcdd
179182 mov r0, #0x2c
180183 bl displaylcd_sendlcdc
181184 displaylcd_blit:
@@ -183,56 +186,61 @@
184187 add r1, r1, #1
185188 sub r3, r2
186189 add r3, r3, #1
187 - mul r2, r1, r3
188 - ldr r1, [sp,#0x18]
 190+ mul r5, r1, r3
 191+ ldr r1, [sp,#0x1c]
 192+ add r12, r12, #0x40
 193+displaylcd_wait:
 194+ ldr r4, [r12,#-0x24]
 195+ tst r4, #8
 196+ bne displaylcd_wait
189197 cmp r1, #-1
190198 bne displaylcd_dma
 199+ ldr r0, [sp,#0x20]
 200+ movs r4, r5,lsl#31
 201+ mov r1, r0
 202+ stmcsia r12, {r0-r1}
 203+ mov r2, r0
 204+ strne r0, [r12]
 205+ mov r3, r0
191206 displaylcd_pixel:
192 - ldr r0, [sp,#0x1c]
193 - bl displaylcd_sendlcd2d
194 - subs r2, r2, #1
 207+ ldr r4, [r12,#-0x24]
 208+ tst r4, #8
195209 bne displaylcd_pixel
196 - ldmfd sp!, {r0-r4,pc}
 210+ subs r5, r5, #4
 211+ stmcsia r12, {r0-r3}
 212+ bhi displaylcd_pixel
 213+ ldmfd sp!, {r0-r5,pc}
197214 displaylcd_dma:
198 - mov r4, #0x38000000
199 - orr r4, r4, #0x400000
 215+ movs r4, r5,lsl#31
 216+ mov r4, #0x38400000
 217+ ldrcsh r2, [r1], #2
200218 mov r0, #0x20000000
201 - orr r0, r0, #0x190000
 219+ ldrcsh r3, [r1], #2
 220+ orr r0, r0, #0x590000
 221+ stmcsia r12, {r2-r3}
 222+ mov r3, r5,lsr#2
 223+ ldrneh r2, [r1], #2
 224+ sub r3, r3, #1
 225+ str r1, [r4,#0x100]
202226 str r0, [r4,#0x104]
203 - str r1, [r4,#0x100]
204 - mov r0, r2,lsr#1
205 - sub r0, r0, #1
206 - str r0, [r4,#0x108]
 227+ str r3, [r4,#0x108]
 228+ strne r2, [r12]
207229 bl clean_dcache
208230 mov r0, #4
209231 str r0, [r4,#0x114]
210 - ldmfd sp!, {r0-r4,pc}
 232+ ldmfd sp!, {r0-r5,pc}
211233
212 -displaylcd_sendlcd2c:
 234+displaylcd_sendlcdc:
213235 ldr r4, [r12,#0x1c]
214236 tst r4, #0x10
215 - bne displaylcd_sendlcd2c
216 - mov r4, r0,lsr#8
217 - str r4, [r12,#0x04]
218 - and r0, r0, #0xff
219 -displaylcd_sendlcdc:
220 - ldrh r4, [r12,#0x1c]
221 - tst r4, #0x10
222237 bne displaylcd_sendlcdc
223 - strh r0, [r12,#0x04]
 238+ str r0, [r12,#0x04]
224239 mov pc, lr
225 -displaylcd_sendlcd2d:
226 - ldrh r4, [r12,#0x1c]
227 - tst r4, #0x10
228 - bne displaylcd_sendlcd2d
229 - mov r4, r0,lsr#8
230 - strh r4, [r12,#0x40]
231 - and r0, r0, #0xff
232240 displaylcd_sendlcdd:
233 - ldrh r4, [r12,#0x1c]
 241+ ldr r4, [r12,#0x1c]
234242 tst r4, #0x10
235243 bne displaylcd_sendlcdd
236 - strh r0, [r12,#0x40]
 244+ str r0, [r12,#0x40]
237245 mov pc, lr
238246
239247 displaylcd_detectlcd:
@@ -260,8 +268,7 @@
261269 displaylcd_sync:
262270 str lr, [sp,#-4]!
263271 displaylcd_sync_wait:
264 - mov r1, #0x38000000
265 - orr r1, r1, #0x400000
 272+ mov r1, #0x38400000
266273 ldr r0, [r1,#0x184]
267274 tst r0, #0x70000
268275 ldreq pc, [sp], #4
@@ -274,8 +281,7 @@
275282 .global displaylcd_busy
276283 .type displaylcd_busy, %function
277284 displaylcd_busy:
278 - mov r1, #0x38000000
279 - orr r1, r1, #0x400000
 285+ mov r1, #0x38400000
280286 ldr r0, [r1,#0x184]
281287 and r0, r0, #0x70000
282288 mov pc, lr
@@ -286,8 +292,7 @@
287293 .global displaylcd_safe
288294 .type displaylcd_safe, %function
289295 displaylcd_safe:
290 - mov r1, #0x38000000
291 - orr r1, r1, #0x400000
 296+ mov r1, #0x38400000
292297 ldr r0, [r1,#0x184]
293298 tst r0, #0x70000
294299 moveq r0, #1
@@ -301,8 +306,7 @@
302307 .type INT_DMA8, %function
303308 INT_DMA8:
304309 str lr, [sp,#-4]!
305 - mov r1, #0x38000000
306 - orr r1, r1, #0x400000
 310+ mov r1, #0x38400000
307311 mov r0, #7
308312 str r0, [r1,#0x114]
309313 bl lcdconsole_callback