From 308d2c3ed0578ec66a173d65cc006c950fd09bfa Mon Sep 17 00:00:00 2001 From: Chiharu Shirasaka <35837918+pepepper@users.noreply.github.com> Date: Mon, 28 Jun 2021 05:42:25 +0900 Subject: [PATCH] add some feature to U-Boot --- x1/injector/disable_mmu.S | 43 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/x1/injector/disable_mmu.S b/x1/injector/disable_mmu.S index 39f6318..fa23842 100644 --- a/x1/injector/disable_mmu.S +++ b/x1/injector/disable_mmu.S @@ -3,10 +3,42 @@ .global _start _start: - ldr r0, =0x67800000 +//preload U-Boot from sd + ldr r4, .L3 + adr r1, [.LC0] + adr r0, [.LC1] + mov r3, r4 + blx r3 + add r5, r4, #0xc + mov r3, r0 + ldr r0, .L3+4 + mov r1, #1 + mov r2, r0 + blx r5 cpsid if +//copy U-Boot to head of RAM + ldr r3, =0x37500000 + ldr r1, =0x37540000 +.L2: + mov r2, r3 + sub r3, r3, #0x7500000 + ldr r0, [r2], #4 + cmp r2, r1 + str r0, [r3] + mov r3, r2 + bne .L2 + + ldr r0, =0x60000000 + +//MUB Interrupt Disable +ldr r2,=0x40220064 +ldr r3,[r2] +ldr r1,=0x0000ffff +and r3,r3,r1 +str r3,[r2] + mrc p15, 0, r8, c14, c2, 1 bic r8, r8, #1 mcr p15, 0, r8, c14, c2, 1 @@ -54,5 +86,12 @@ _start: bic r6, r6, #1 @ disable MMU mcr p15, 0, r6, c1, c0, 0 // write ctrl regs - mov pc, r0 + bx r0 +.L3: + .word 0x60006400 + .word 0x37500000 +.LC0: + .ascii "r\000" +.LC1: + .ascii "SD0:\\u-boot.bin\000"