; Configure the System Manger to remap the flash
; The Memory Bank Control Registers must be set using store multpiles ; Set up a stack in internal sram to preserve the original register contents
LDR r2, =remap_temp MOV r1, pc LDR r3, =remap_EndSysMapJump remap_temp MOV lr, #0 CMP r2, r1 LDRGT lr, =ROM_Start;ROM_Start=0x7F000000,remap后,ROM的地址
SUB r3, r3, r2 ADD r1, r1, r3 ADD lr, lr, r1 ; Load in the target values into the control registers ADRL r0, remap_SystemInitData LDMIA r0, {r1-r6} LDR r0, =EBI_Ctrl ; Now run critical jump code STMIA r0, {r1-r6} MOV pc, lr remap_EndSysMapJump
remap_SystemInitData ; Default sdram configuration DCD 0x000530C0 ; EBICON : not need to change. DCD 0xFE040080 ; ROMCON(Flash) -Unknown type:0xFE000FF0, A29LV800: 0xFE020080, W28J160: 0xFE030080 DCD 0x000090E4 ; SDCONF0(SDRAM) - 8M(2Mx32): 0x000090E3, 4M(1Mx16x2):0x00009062, 16M(4Mx16x2):0x000090E4 DCD 0x020090E4 ; SDCONF1 - The same as SDCONF0 with proper base address DCD 0x0000014B ; SDTIME0 - not need to change DCD 0x0000014B ; SDTIME1 - not need to change DCB "@SYSTEM_INIT_CFG" ; A key word for future useage ALIGN |