非常感谢各位的关注,下面是这段代码:
××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
_reset:
/*
* set the cpu to SVC32 mode
*/
mrs r0,cpsr
bic r0,r0,#0x1f
orr r0,r0,#0xd3
msr cpsr,r0
/*
* we do sys-critical inits only at reboot,
* not when booting from ram!
*/
bl cpu_init_crit
/* Set up the stack which is in Internal RAM - Temporary */
ldr r0, ISRAM_SRC_ADDR
sub sp, r0, #12 /* leave 3 words for abort-stack */
bic sp, r0, #7 /* 8-byte align stack for ABI compliance */
/*
* Go setup Memory and board specific bits prior to relocation.
*/
adr r0, CGU_FDIV_REG_VALS
adr r1, CGU_FDIV_CLKS
bl init_clocks /* go setup pll,mux,memory */ //就是这个时钟初始化函数
#ifdef CONFIG_EA3152
/*
* For LPC3152 board, set IO valtage for
* SDRAM to work properly
*/
bl setup_sdram_voltage
#endif
/*
* Setup Memory Controller & SDRAM Timing.
*/
bl mpmc_sdram_init /* go setup pll,mux,memory */
/*
* Write a code to copy initial boot code from
* ISRAM (0x11029000) to SDRAM
*/
ldr r0, ISRAM_SRC_ADDR /* r0 <- ISRAM source address */
add r1, r0, #0x00000020 /* r1 <- point to Image Size in Image Headr, 0x11029020 */
ldr r2, [r1] /* r2 <- length to copy */
add r2, r0, r2 /* r2 <- source end address */
ldr r1, _TEXT_BASE
copy_data:
ldmia r0!, {r7-r10} /* copy from source address [r0] */
stmia r1!, {r7-r10} /* copy to target address [r1] */
cmp r0, r2 /* until source end addreee [r2] */
ble copy_data
/* Set up the stack which is in SDRAM - Parmenant */
stack_setup:
××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××