Use DTCM for ctrNandWrite's buffer, crt0 changes, reboot patch changes

This commit is contained in:
TuxSH
2017-05-24 19:52:09 +02:00
parent 10f555b6fb
commit d57d8aaae7
5 changed files with 47 additions and 40 deletions

View File

@@ -2,15 +2,17 @@
.arm.little
argv_addr equ 0x27FFDF00
fname_addr equ 0x27FFDF80
low_tid_addr equ 0x27FFDFE0
copy_launch_stub_addr equ 0x27FFE000
copy_launch_stub_stack_top equ 0x01FFB800
copy_launch_stub_stack_bottom equ 0x01FFA800
copy_launch_stub_addr equ 0x01FF9000
firm_addr equ 0x20001000
firm_maxsize equ (copy_launch_stub_addr - 0x1000 - firm_addr)
argv_addr equ (copy_launch_stub_stack_bottom - 0x100)
fname_addr equ (copy_launch_stub_stack_bottom - 0x200)
low_tid_addr equ (copy_launch_stub_stack_bottom - 0x300)
firm_addr equ 0x20001000
firm_maxsize equ 0x07FFF000
arm11_entrypoint_addr equ 0x1FFFFFFC
.create "build/reboot.bin", 0
.arm
; Interesting registers and locations to keep in mind, set just before this code is ran:
@@ -154,17 +156,13 @@ fname: .ascii "FILE"
cmp r5, #3
blo load_section_loop
ldr r0, =arm11_entrypoint_addr
ldr r1, [r4, #0x08]
str r1, [r0]
mov r0, #2 ; argc
ldr r1, =argv_addr ; argv
ldr r2, =0xBABE ; magic word
ldr r5, =arm11_entrypoint_addr
mov r5, #0x20000000
ldr r6, [r4, #0x08]
str r6, [r5]
str r6, [r5, #-4] ; store arm11 entrypoint
ldr lr, [r4, #0x0c]
bx lr