头文件不写了,主要是蓝色部分
STARTUPTEXT
DCB "CRUS"
LEAF_ENTRY StartUp
;
; Kill watch dog timer. Before any thing else.
;
ldr r0, =0x80940000
ldr r1, =0xAA55
str r1, [r0]
;
; ensure SVC32 mode with IRQ and FIQ disabled
;
mov r0, #0xd3
msr cpsr_c, r0
;set eboot run flag
ldr r0, =0x80930040
ldr r1, =EBOOT_RUN_FLAG
str r1, [r0]
; When Programming SDRAM clear clkset1 so the delay loop have proper
; delays.
;
str r1, [r0]
ldr r0, =0x80930020
ldr r1, =0x0
str r1, [r0]
;
; Configure SDRAM
;
bl SdramCfg
;
; Copy the image to RAM
;
ldr r0, =0x60000000
ldr r1, =0x40000
ldr r11, =0x60000 ;128K
;这个地方为什么是从FLASH复制到地址0x40000到0x60000处?而不是0x00处?
;我FLASH是接在;0X60000000处,SDRAM是接在0x00处
EbootCopyLoop ldmia r0!, {r2-r9} ;32byte once
stmia r1!, {r2-r9}
cmp r1, r11
bne EbootCopyLoop
ldr pc, =ExecuteFromRam;从这个地方开始的下一条代码取址是否就从ExcuteFromRam处执行呢?如果是,那么肯定不是从0x40000这个地址吧
ExecuteFromRam
ldr sp, =EbootStack
bl SysconSetup
以上两个疑问还请知道的朋友指点,感谢! |