freemyipod r797 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r796‎ | r797 | r798 >
Date:15:26, 19 November 2011
Author:theseven
Status:new
Tags:
Comment:
iPod Classic boot stub: Make this position independent to allow booting from the firmware partition
Modified paths:
  • /apps/installer-ipodclassic/bootstub/bootstub.S (modified) (history)
  • /apps/installer-ipodclassic/bootstub/ls.x (modified) (history)

Diff [purge]

Index: apps/installer-ipodclassic/bootstub/bootstub.S
@@ -33,7 +33,11 @@
3434 mcr p15, 0, r0,c7,c5
3535 mcr p15, 0, r0,c8,c7
3636 mcr p15, 0, r0,c13,c0
37 - adr lr, cacheflush_done
 37+ adr r5, flushcache
 38+ mov r2, #0x22000000
 39+ add r1, r2, #0x50 + flushcache - _start
 40+ adr r4, _stubend + 4
 41+ adr lr, copyloop
3842
3943 flushcache:
4044 mrc p15, 0, r15,c7,c14,3
@@ -40,9 +44,24 @@
4145 bne flushcache
4246 mov r0, #0
4347 mcr p15, 0, r0,c7,c10,4
 48+ mcr p15, 0, r0,c7,c5
4449 bx lr
4550
46 -cacheflush_done:
 51+copyloop:
 52+ cmp r1, r2
 53+ ldrhi r3, [r5], #4
 54+ strhi r3, [r2], #4
 55+ bhi copyloop
 56+ add lr, r1, #_start - flushcache - 0x50 + sramstart - flushcache
 57+ b flushcache
 58+sramstart:
 59+ cmp r4, r5
 60+ ldrhi r3, [r5], #4
 61+ strhi r3, [r2], #4
 62+ bhi sramstart
 63+ bl flushcache
 64+ str r4, [r2]
 65+
4766 adr sp, values1
4867 ldmia sp!, {r10-r12}
4968 mcr p15, 0, r11,c2,c0
@@ -227,7 +246,6 @@
228247 .byte 0x26, 9
229248 .byte 0x27, 1
230249 .byte 0x1a, 0x6f
231 - .byte 0x1b, 0
232250 .byte 0x1c, 0
233251 .byte 0x1d, 0x59
234252 .byte 0x33, 9
@@ -773,7 +791,7 @@
774792 bne lcdbyteseq
775793 movne r0, r0,lsl#4
776794 bne udelay
777 - adr r1, _stubend + 4
 795+ ldr r1, _stubend + 4
778796 ldr r6, val_80100db0
779797 ldr r0, _stubend
780798 str r6, [r4]
@@ -785,7 +803,6 @@
786804 strhi r3, [r2], #4
787805 bhi movepayloadloop
788806 bl flushcache
789 - mcr p15, 0, r0,c7,c5
790807 mov pc, #0x08000000
791808
792809 _stubend:
\ No newline at end of file
Index: apps/installer-ipodclassic/bootstub/ls.x
@@ -5,7 +5,7 @@
66
77 SECTIONS
88 {
9 - . = 0x22000050;
 9+ . = 0x22000000;
1010
1111 .text :
1212 {