summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYunhao Tian <[email protected]>2021-12-08 13:39:27 +0800
committerYunhao Tian <[email protected]>2021-12-08 13:39:27 +0800
commit527036b1f5a3f0aa3994f62e3ab18fa990a40cf8 (patch)
treed6f466bc9a93f81a0a6bce40bebf23a39aa9c858
parent43621ab9edda8765a555585e11fee2a9867c4140 (diff)
Initialize MMU if we are executing from DDR
-rw-r--r--hw/mcu/allwinner/f1c100s/machine/start.S27
1 files changed, 14 insertions, 13 deletions
diff --git a/hw/mcu/allwinner/f1c100s/machine/start.S b/hw/mcu/allwinner/f1c100s/machine/start.S
index 1fd7cb1f9..befb22148 100644
--- a/hw/mcu/allwinner/f1c100s/machine/start.S
+++ b/hw/mcu/allwinner/f1c100s/machine/start.S
@@ -111,37 +111,38 @@ reset:
ldmia r0!, {r2-r8, r10}
stmia r1!, {r2-r8, r10}
- /* Initial system clock, ddr add uart */
+ /* Initial system clock, ddr and uart */
bl sys_clock_init
- bl sys_dram_init
bl sys_uart_init
- /* Boot speed up, leave slower sram */
+ /* Check if we are already running from dram */
adr r0, _start
ldr r1, =_start
cmp r0, r1
- beq _speedup
+ beq _init_mmu
+
+ /* Init dram if not running from dram */
+ bl sys_dram_init
+
+ /* Copy bootloader to faster dram (sram is slower) */
ldr r0, =0x81f80000
adr r1, _start
mov r2, #0x4000
bl memcpy
- ldr r0, =_speedup
+ ldr r0, =_copy_self
ldr r1, =_start
sub r0, r0, r1
ldr r1, =0x81f80000
add r0, r0, r1
mov pc, r0
-_speedup:
- nop
-
+_init_mmu:
+ bl sys_mmu_init
+ b 1f
+_copy_self:
/* Copyself to link address */
- adr r0, _start
- ldr r1, =_start
- cmp r0, r1
- beq 1f
bl sys_copyself
-1: nop
+1: nop
/* Initialize stacks */
mrs r0, cpsr
bic r0, r0, #0x1f