NO:
W90P710 Programming Guide
VERSION:
2.1
PAGE:
33
The above information is the exclusive intellectual property of Winbond Electronics and shall not be disclosed,
distributed or reproduced without permission from Winbond.
Table No.: 1200-0003-07-A
; ------------------------------------------------------------------
; UNMAPROM
; --------
; Provide code to deal with mapping the reset ROM away from zero
MACRO
$label UNMAPROM $w1,$w2
; This macro needs to test if the system has already been initialized
; The reset value of SDCONF0 is used to check if the system has been initialized
LDR $w1, =SDCONF0
;SDCONF0=0xFFF01008
LDR $w1, [$w1]
LDR
$w2,
=0x800
CMP $w1, $w2
BNE %FT0
; Set mode to SVC, interrupts disabled (just paranoid)
MRS $w1, cpsr
BIC $w1, $w1, #0x1F
ORR $w1, $w1, #0xD3
MSR cpsr_fc, $w1
; Configure the EBI controller to remap the flash
; The EBI Control Registers must be set using store multiples
; Set up a stack in internal SRAM to preserve the original register contents
; Disable Cache and use the on-chip SRAM to be stack
LDR
$w1,
=CAHCNF
;
CAHCNF=0xFFF02000
LDR
$w2, =0x0
; SetValue = 0x0
STR
$w2, [$w1]
; Cache,WB disable
; W90P710 _SRAM_BASE = 0x7FE00000
; W90P710 _SRAM_SIZe = 10 Kbytes
MOV
$w1,
sp
LDR
sp, =(W90P710 _SRW90P710 _SRAM_SIZE)
STR
$w1, [sp, #-4]!
; preserve previous sp on new stack
STMFD sp!, {r0 - r12,lr}
; The labels “$label.temp” and “$label.EndSysMapJump are absolute addresses
; calculated by linker according to the RO base.
LDR
r2,
=$label.temp
; The value of current pc is the run-time address of “$label.temp”
MOV
r1,
pc
LDR
r3,
=$label.EndSysMapJump