3-58
MPC7400 RISC Microprocessor Users Manual
L2 Cache Interface
4. Monitor the L2CR[L2P] bit to determine when the global invalidation operation is
completed (indicated by the clearing of L2CR[L2IP]). The global invalidation
requires approximately 16K core clock cycles to complete.
5. After detecting the clearing of L2CR[L2IP], clear L2CR[L2I] and re-enable the L2
cache for normal operation by setting L2CR[L2E].
3.7.3.8 L2 Cache Flushing
In the MPC7400, the L2 cache is a victim cache for the L1 data cache. As such, the L2 cache
ush routines used for MPC750-based systems will not work on the MPC7400. The
MPC7400 provides a hardware ush mechanism through L2CR[HWF]. This hardware
ush method is the recommended method for ushing the L2 cache. Although the hardware
ush mechanism is the preferred method of ushing the cache, if for some reason a
software ush is desired, the MPC7400 provides a software ush assist bit L2CR[L2FA] to
facilitate software ushing of the L2 cache. The following sections describe ushing the L2
cache using the hardware and software methods.
3.7.3.8.1 L2 Cache Hardware Flush
The hardware ush mechanism is controlled by L2CR[L2HWF]. When the processor
detects a state transistion from 0 to 1 in L2HWF, the MPC7400 initiates a hardware ush
of the L2 cache.
The ush is performed by starting with low cache indices and increments through way 0 of
the cache one index at a time until the maximum index value is obtained. Then, the index
is reset to zero and the same process is repeated for way 1 of the L2 cache. For each index
and way of the cache, the processor generates a castout operation to the system bus for all
modiTed cache blocks. At the end of the hardware ush, all lines in the L2 cache tags are
in the invalid state.
During the ush, all memory activity from the L1 intruction and L1 data cache are blocked
from accessing the L2 until the ush is complete. Snoops, however, are fully serviced by
the L2 cache during the ush.
When the L2 cache tags have been fully ushed of all valid entries, the L2CR[L2HWF] bit
is cleared by hardware. Note that when L2HWF is cleared, it does not guarantee that all
lines from the L2 have been written completely to the system interface. L2 copybacks may
still be queued up in the bus interface unit. A Tnal
sync
instruction is required to guarantee
that all data from the L2 cache has been written to the system address bus.
The recommended sequence to ush the L2 cache follows:
1. disable interrupts
2.
dssall
3.
sync
4. set L2CR[L2HWF] = 1
5.
sync