
Using CP15 Control Register
Copyright 2000–2001 by LSI Logic Corporation. All rights reserved.
6-5
The D-SRAM load mode allows you to initialize the D-SRAM more
efficiently. With load mode, you can copy into the D-SRAM directly from
the corresponding address in the data cache or external memory.
When the D-SRAM Load Mode bit of CP15 Register 1 is set to 1, it
inhibits reads from the D-SRAM. This action forces reads to access
either main memory or the data cache. The Load Mode bit does not
affect writes to the D-SRAM address range.
The procedure for initializing the D-SRAM using the load mode is as
follows:
1.
Enable the D-SRAM and data load mode.
2.
Load ARM registers from main memory or data cache.
3.
Store ARM registers into D-SRAM.
4.
Increment address pointers and repeat load/store steps until the data
image is copied.
A suggested assembler code sequence for this procedure is shown
below:
LDR R0, #ImageStart
LDR R1, =ImageTop
MRC p15, 0, R2, c1, c0, 0 ; Read Control Register
ORR R2, R2, #&30000
MCR p15, 0, R2, c1, c0, 0 ; Enable Data RAM and Load Mode
CopyLoop
LDMIA R0, {R2 - R9}
; Load 8 registers from main memory
STMIA R0!, {R2 - R9}
; Store 8 regs into instruction SRAM
CMP R1, R0
; Check if limit reached
BGT CopyLoop
; Repeat if more to do
; Initialized pointer
; Define end of data space
The read (LDMIA) accesses external memory or the data cache, and the
write (STMIA) updates the tightly coupled D-SRAM.
Do not use SWP or SWPB to access D-SRAM addresses while in load
mode. Doing this produces unpredictable results.
SWP and SWPB operations to the D-SRAM while it is in load mode
produce unpredictable results. The read accesses external memory or
the data cache, and the write updates the D-SRAM.
Do not perform SWP or SWPB operations to locations in the I-SRAM
address space while the I-SRAM is in load mode.