Thursday, September 13, 2007

ARM_init.s

修改FMI module, 修改
開機區、非開機區的Flash size, 起啟位置, 終止位置
系統若有Bootloader則不需執行這些initial code.


; --- Remap Flash Bank 0 at address 0x0 and Bank 1 at address 0x80000,
; when the bank 0 is the boot bank, then enable the Bank 1.

LDR R6, =0x54000000 ; BOOT BANK Size = 512KB
LDR R7, =0x4 ; (2^4) * 32 = 512KB
STR R7, [R6]

LDR R6, =0x54000004 ; NON BOOT BANK Size = 32KB
LDR R7, =0x2 ; (2^2) * 8 = 32KB
STR R7, [R6]

LDR R6, =0x5400000C ; BOOT BANK Address = 0x0
LDR R7, =0x0
STR R7, [R6]

LDR R6, =0x54000010 ; NON BOOT BANK Address = 0x80000
LDR R7, =0x20000 ; need to put 0x20000 because FMI bus on A[25:2] of CPU bus
STR R7, [R6]

LDR R6, =0x54000018 ; Enable CS on both banks
LDR R7, =0x18
STR R7, [R6]

No comments: