
4-32
G2 PowerPC Core Reference Manual
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA
Cache Locking
4.12.1 Cache Locking Terminology
Cache locking refers to the ability to prevent some or all of a processor’s instruction or data
cache from being overwritten. Cache locking can be set for either an entire cache or for
individual ways within the cache as follows:
Entire cache locking—When an entire cache is locked, data for read hits within the
cache are supplied to the requesting unit in the same manner as hits from an
unlocked cache. Similarly, writes that hit in the data cache are written to the cache
in the same way as write hits to an unlocked cache. However, any access that misses
in the cache is treated as a cache-inhibited access. Cache entries that are invalid at
the time of locking remain invalid and inaccessible until the cache is unlocked.
When the cache has been unlocked, all entries (including invalid entries) are
available. Entire cache locking is inefficient if the number of instructions or the size
of data to be locked is small compared to the cache size.
Way-Locking—Locking only a portion of the cache is accomplished by locking
ways within the cache. Locking always begins with the first way (way 0) and is
sequential, that is, locking ways 0, 1, and 2 is possible, but it is not possible to lock
only way 0 and way 2. When using way-locking, at least two ways must be left
unlocked. The maximum number of lockable ways is six on the G2 core
(way 0–way 5).
Unlike entire cache locking, invalid entries in a locked way are accessible and
available for data replacement. As hits to the cache fill invalid entries within a
locked way, the entries become valid and locked. This behavior differs from entire
cache locking in which invalid entries cannot be allocated. Unlocked ways of the
cache behave normally.
Table 4-9 summaries the G2 core cache organization.
4.12.2 Cache Locking Register Summary
Table 4-10 through Table 4-12 outline the registers and bits used to perform cache locking
on the G2 core. Refer to Section 2.1.2.1, “Hardware Implementation Register 0 (HID0)
,”
for a complete description of the HID0 and MSR registers. Refer to Section 2.1.2.3,
“Hardware Implementation Register 2 (HID2),” for a complete description of the HID2
register.
Table 4-9. Cache Organization
Instruction Cache Size
Data Cache Size
Associativity
Block Size
Way Size
16 Kbytes
16 Kbytes
4-way
8 words
4 Kbytes
F
Freescale Semiconductor, Inc.
n
.