
4-12
Caches
Copyright 2000–2001 by LSI Logic Corporation. All rights reserved.
You can carry out lockdown in the D-cache using CP15 register 9.
I-cache lockdown uses both CP15 registers 7 and 9.
As described in
Section 4.1, “Cache Architecture,” page 4-1
, the
ARM946E-S I-cache and D-cache each consist of from one to four sets.
You can perform lockdown with a granularity of one set. The smallest
space that you can lockdown is one set (one quarter of cache size).
Lockdown starts at set zero, and can continue until only one set is left
unlocked. At least one set must always be unlocked, so lockdown is not
available for direct-mapped caches.
4.4.1 Locking Down the Caches
The procedures for locking down a set in the I-cache and D-cache are
slightly different. In both cases you must:
1.
Put the cache into lockdown mode by programming register 9.
2.
Force a line fill.
3.
Lock the corresponding data in the cache.
4.4.1.1 D-Cache Lockdown
For the D-cache, the lockdown procedure is as follows:
1.
Write to CP15 register 9, setting LD = 1 (LD is bit 31, the load bit)
and IDX[1:0] = 0 (IDX bits specify the cache set).
2.
Initialize the pointer to the first of the words to be locked into the
cache.
3.
Execute an LDR from that location. This forces a line fill from that
location, and the resulting eight words are captured in the cache.
4.
Increment the pointer by 32 (number of bytes in a cache line).
5.
Execute an LDR from that location. The resulting line fill is captured
in the cache.
6.
Repeat steps 4 and 5 until all words are loaded in the cache or one
quarter of the cache has been loaded.
7.
Write to CP15 register 9, setting LD = 0 and IDX[1:0] = 1.
If there is more data to lockdown, at the final step, the LD bit must remain
set and the process repeated. The LD bit must only be cleared when all