sept: be more forgiving about entrypoint

This commit is contained in:
Michael Scire 2020-12-07 03:20:01 -08:00
parent 15396dbbc2
commit 121c981bb4

View file

@ -13,7 +13,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
.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 */