From 121c981bb4256045aa8fd7c17a754e1057ae1b65 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Mon, 7 Dec 2020 03:20:01 -0800 Subject: [PATCH] sept: be more forgiving about entrypoint --- sept/sept-primary/src/start.s | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/sept/sept-primary/src/start.s b/sept/sept-primary/src/start.s index 3a525a9de..b5cb1c1e8 100644 --- a/sept/sept-primary/src/start.s +++ b/sept/sept-primary/src/start.s @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - + .section .text.start, "ax", %progbits .arm .align 5 @@ -24,34 +24,34 @@ _start: mov r0, #0x0 ldr r1, =0x7000E400 str r0, [r1, #0x50] - + /* Tell pk1ldr normal reboot, no error */ str r0, [r1, #0x1B4] str r0, [r1, #0x840] - + /* Cleanup SVC handler address. */ ldr r0, =0x40004C30 ldr r1, =0x6000F208 str r0, [r1] - + /* Disable RCM forcefully */ mov r0, #0x4 ldr r1, =0x15DC ldr r2, =0xE020 bl ipatch_word - + /* Patch BCT signature check */ mov r0, #0x5 ldr r1, =0x4AEE ldr r2, =0xE05B bl ipatch_word - + /* Patch bootloader read */ mov r0, #0x6 ldr r1, =0x4E88 ldr r2, =0xE018 bl ipatch_word - + ldr r0, =__main_phys_start__ ldr r1, =__main_start__ mov r2, #0x0 @@ -62,17 +62,17 @@ _start: add r2, r2, #0x4 cmp r2, r3 bne copy_panic_payload - - + + /* Jump back to bootrom start. */ ldr r0, =0x101010 bx r0 - + /* Unused, but forces inclusion in binary. */ b main - - + + .section .text.ipatch_word, "ax", %progbits .arm .align 5 @@ -86,15 +86,15 @@ ipatch_word: orr r1, r1, r2 str r1, [r3, r0] bx lr - + .section .text.jump_to_main, "ax", %progbits .arm .align 5 .global jump_to_main .type jump_to_main, %function jump_to_main: - /* Insert 0x40 of NOPs, for version compatibility. */ -.rept 16 + /* Insert 0x240 of NOPs, for version compatibility. */ +.rept (0x240/4) nop .endr /* Just jump to main */