3-38
MPC7400 RISC Microprocessor Users Manual
Cache Control
3.5.1.4 Enabling and Disabling the Instruction Cache
The instruction cache may be enabled or disabled through the use of the instruction cache
enable bit, HID0[ICE]. HID0[ICE] is cleared on power-up, disabling the instruction cache.
The setting of the ICE bit must be preceded by an
isync
instruction to prevent the cache
from being enabled or disabled in the middle of an instruction fetch. The
icbi
instruction is
not affected by disabling the instruction cache.
When the instruction cache is in the disabled state (HID[ICE] = 0), the cache tag status bits
are ignored, and all instruction fetches are propagated to the system bus as single-beat
transactions. Note that the CI signal always reects the state of the caching-inhibited
memory/cache access attribute (the I bit) independent of the state of HID0[ICE]. Also note
that disabling the instruction cache does not affect the translation logic; translation for
instruction accesses is controlled by MSR[IR].
3.5.1.5 Instruction Cache Locking
The contents of the instruction cache can be locked by setting the instruction cache lock bit,
HID0[ILOCK]. For a locked instruction cache, there are no new tag allocations. Snoop hits
are the only operations that can cause a tag state change in a locked instruction cache. The
setting of the ILOCK bit must be preceded by an
isync
instruction to prevent the instruction
cache from being locked during an instruction fetch.
An instruction fetch that hits in a locked instruction cache is serviced by the cache. An
instruction fetch that misses in a locked instruction cache is propagated to the system bus
as a 32-byte burst read. However, the data is not loaded into the instruction cache. The data
is loaded into the L2 cache (unless L2CR[L2DO] = 1).
Note that the CI signal always reects the state of the caching-inhibited memory/cache
access attribute (the I bit) independent of the state of HID0[ILOCK].
3.5.1.6 Instruction Cache Flash Invalidation
The instruction cache ash invalidate bit, HID0[ICFI], is used to invalidate the entire
instruction cache in a single operation. Note that there is no broadcast of a ash invalidate
operation. Individual instruction cache blocks are invalidated using the
icbi
instruction. See
Section 3.5.3.8, òInstruction Cache Block Invalidate (icbi),ó for more information about the
icbi
instruction.
ICFI is set through an
mtspr
operation. Once set, the MPC7400 automatically clears ICFI
in the next clock cycle (provided that the instruction cache is enabled in the HID0 register).
Note that some PowerPC microprocessors accomplish instruction cache ash invalidation
by setting and clearing HID0[ICFI] with two consecutive
mtspr
instructions (that is, the bit
is not automatically cleared by the microprocessor). Software that has this sequence of
operations does not need to be changed to run on the MPC7400.