Index: umsboot/target/ipodclassic/lcd.c |
— | — | @@ -91,6 +91,8 @@ |
92 | 92 | unsigned int starty, unsigned int endy, void* data, int color)
|
93 | 93 | {
|
94 | 94 | displaylcd_sync();
|
| 95 | + while (!(LCDSTATUS & 0x2)); |
| 96 | + LCDCON = 0x80100db0; |
95 | 97 | if (lcd_detect() & 2)
|
96 | 98 | {
|
97 | 99 | lcd_send_cmd(0x210);
|
Index: umsboot/target/ipodclassic/s5l8702.h |
— | — | @@ -528,6 +528,7 @@ |
529 | 529 |
|
530 | 530 |
|
531 | 531 | /////LCD/////
|
| 532 | +#define LCDCON (*((uint32_t volatile*)(0x38300000)))
|
532 | 533 | #define LCDWCMD (*((uint32_t volatile*)(0x38300004)))
|
533 | 534 | #define LCDSTATUS (*((uint32_t volatile*)(0x3830001c)))
|
534 | 535 | #define LCDWDATA (*((uint32_t volatile*)(0x38300040)))
|
Index: emcore/trunk/target/ipodnano3g/lcd.c |
— | — | @@ -136,6 +136,8 @@ |
137 | 137 | displaylcd_sync(); |
138 | 138 | } |
139 | 139 | else while (DMAC0C4CONFIG & 1); |
| 140 | + while (!(LCDSTATUS & 0x2)); |
| 141 | + LCDCON = 0x80100db0; |
140 | 142 | if (lcd_detect() & 2) |
141 | 143 | { |
142 | 144 | lcd_send_cmd(0x210); |
— | — | @@ -265,6 +267,12 @@ |
266 | 268 | __asm__ volatile(" movne r10, #3 \n"); |
267 | 269 | __asm__ volatile(" moveq r10, #0 \n"); |
268 | 270 | __asm__ volatile(" ldr r9, =0x38300040 \n"); |
| 271 | + __asm__ volatile("displaylcd_dither_wait : \n"); |
| 272 | + __asm__ volatile(" ldr r4, [r9,#-0x24] \n"); |
| 273 | + __asm__ volatile(" tst r4, #2 \n"); |
| 274 | + __asm__ volatile(" beq displaylcd_dither_wait \n"); |
| 275 | + __asm__ volatile(" ldr r4, =0x81104eb0 \n"); |
| 276 | + __asm__ volatile(" str r4, [r9,#-0x40] \n"); |
269 | 277 | __asm__ volatile("displaylcd_dither_y: \n"); |
270 | 278 | __asm__ volatile(" ldr lr, [sp] \n"); |
271 | 279 | __asm__ volatile(" mov r4, #0 \n"); |
— | — | @@ -272,7 +280,6 @@ |
273 | 281 | __asm__ volatile(" mov r6, #0 \n"); |
274 | 282 | __asm__ volatile(" mov r7, r8 \n"); |
275 | 283 | __asm__ volatile("displaylcd_dither_x: \n"); |
276 | | - __asm__ volatile(" mov r2, #0 \n"); |
277 | 284 | __asm__ volatile(" ldrb r1, [r3], #1 \n"); |
278 | 285 | __asm__ volatile(" ldrsb r0, [r7] \n"); |
279 | 286 | __asm__ volatile(" add r1, r1, r4 \n"); |
— | — | @@ -280,10 +287,10 @@ |
281 | 288 | __asm__ volatile(" cmp r1, #0xff \n"); |
282 | 289 | __asm__ volatile(" mvnhi r1, r1,asr#31 \n"); |
283 | 290 | __asm__ volatile(" andhi r1, r1, #0xff \n"); |
284 | | - __asm__ volatile(" mov r0, r1,lsr#3 \n"); |
285 | | - __asm__ volatile(" orr r2, r0,lsl#11 \n"); |
286 | | - __asm__ volatile(" sub r1, r1, r0,lsl#3 \n"); |
287 | | - __asm__ volatile(" sub r1, r1, r0,lsr#2 \n"); |
| 291 | + __asm__ volatile(" mov r0, r1,lsr#2 \n"); |
| 292 | + __asm__ volatile(" mov r2, r0,lsl#18 \n"); |
| 293 | + __asm__ volatile(" sub r1, r1, r0,lsl#2 \n"); |
| 294 | + __asm__ volatile(" sub r1, r1, r0,lsr#4 \n"); |
288 | 295 | __asm__ volatile(" mov r4, r4,lsr#1 \n"); |
289 | 296 | __asm__ volatile(" add r4, r4, r1,lsr#2 \n"); |
290 | 297 | __asm__ volatile(" strb r4, [r7], #1 \n"); |
— | — | @@ -296,7 +303,7 @@ |
297 | 304 | __asm__ volatile(" mvnhi r1, r1,asr#31 \n"); |
298 | 305 | __asm__ volatile(" andhi r1, r1, #0xff \n"); |
299 | 306 | __asm__ volatile(" mov r0, r1,lsr#2 \n"); |
300 | | - __asm__ volatile(" orr r2, r0,lsl#5 \n"); |
| 307 | + __asm__ volatile(" orr r2, r2, r0,lsl#10 \n"); |
301 | 308 | __asm__ volatile(" sub r1, r1, r0,lsl#2 \n"); |
302 | 309 | __asm__ volatile(" sub r1, r1, r0,lsr#4 \n"); |
303 | 310 | __asm__ volatile(" mov r5, r5,lsr#1 \n"); |
— | — | @@ -310,14 +317,18 @@ |
311 | 318 | __asm__ volatile(" cmp r1, #0xff \n"); |
312 | 319 | __asm__ volatile(" mvnhi r1, r1,asr#31 \n"); |
313 | 320 | __asm__ volatile(" andhi r1, r1, #0xff \n"); |
314 | | - __asm__ volatile(" mov r0, r1,lsr#3 \n"); |
315 | | - __asm__ volatile(" orr r2, r0 \n"); |
316 | | - __asm__ volatile(" sub r1, r1, r0,lsl#3 \n"); |
317 | | - __asm__ volatile(" sub r1, r1, r0,lsr#2 \n"); |
| 321 | + __asm__ volatile(" mov r0, r1,lsr#2 \n"); |
| 322 | + __asm__ volatile(" orr r2, r2, r0,lsl#2 \n"); |
| 323 | + __asm__ volatile(" sub r1, r1, r0,lsl#2 \n"); |
| 324 | + __asm__ volatile(" sub r1, r1, r0,lsr#4 \n"); |
318 | 325 | __asm__ volatile(" mov r6, r6,lsr#1 \n"); |
319 | 326 | __asm__ volatile(" add r6, r6, r1,lsr#2 \n"); |
320 | 327 | __asm__ volatile(" strb r6, [r7], #1 \n"); |
321 | 328 | __asm__ volatile(" mov r6, r1,asr#1 \n"); |
| 329 | + __asm__ volatile("displaylcd_dither_wait2: \n"); |
| 330 | + __asm__ volatile(" ldr r0, [r9,#-0x24] \n"); |
| 331 | + __asm__ volatile(" tst r0, #0x10 \n"); |
| 332 | + __asm__ volatile(" bne displaylcd_dither_wait2 \n"); |
322 | 333 | __asm__ volatile(" str r2, [r9] \n"); |
323 | 334 | __asm__ volatile(" sub r3, r3, r10 \n"); |
324 | 335 | __asm__ volatile(" subs lr, lr, #1 \n"); |
— | — | @@ -354,6 +365,8 @@ |
355 | 366 | { |
356 | 367 | mutex_lock(&lcd_mutex, TIMEOUT_BLOCK); |
357 | 368 | displaylcd_sync(); |
| 369 | + while (!(LCDSTATUS & 0x2)); |
| 370 | + LCDCON = 0x80100db0; |
358 | 371 | uint32_t type = lcd_detect(); |
359 | 372 | if (type & 2) |
360 | 373 | { |
Index: emcore/trunk/target/ipodnano3g/s5l8702.h |
— | — | @@ -768,14 +768,14 @@ |
769 | 769 | |
770 | 770 | |
771 | 771 | /////UART///// |
772 | | -#define ULCON (*((uint32_t volatile*)0x3cc00000))
|
773 | | -#define UCON (*((uint32_t volatile*)0x3cc00004))
|
774 | | -#define UFCON (*((uint32_t volatile*)0x3cc00008))
|
775 | | -#define UMCON (*((uint32_t volatile*)0x3cc0000c))
|
776 | | -#define UFSTAT (*((uint32_t volatile*)0x3cc00018))
|
777 | | -#define UTXH (*((uint8_t volatile*)0x3cc00020))
|
778 | | -#define URXH (*((uint8_t volatile*)0x3cc00024))
|
779 | | -#define UBRDIV (*((uint32_t volatile*)0x3cc00028))
|
| 772 | +#define ULCON (*((uint32_t volatile*)0x3cc00000)) |
| 773 | +#define UCON (*((uint32_t volatile*)0x3cc00004)) |
| 774 | +#define UFCON (*((uint32_t volatile*)0x3cc00008)) |
| 775 | +#define UMCON (*((uint32_t volatile*)0x3cc0000c)) |
| 776 | +#define UFSTAT (*((uint32_t volatile*)0x3cc00018)) |
| 777 | +#define UTXH (*((uint8_t volatile*)0x3cc00020)) |
| 778 | +#define URXH (*((uint8_t volatile*)0x3cc00024)) |
| 779 | +#define UBRDIV (*((uint32_t volatile*)0x3cc00028)) |
780 | 780 | |
781 | 781 | |
782 | 782 | /////CLOCK GATES///// |