![](http://datasheet.mmic.net.cn/290000/XPC801ZP25_datasheet_16187868/XPC801ZP25_207.png)
Memory Management Unit
11-32
MPC801 USER’S MANUAL
MOTOROLA
11
11.8.2 Controlling the TLB Replacement Counter
The TLB replacement counter can be controlled to only select among the first 6 entries in
each TLB by setting the RSVI bit in the MI_CTR register or the RSVD bit in the MD_CTR
register. These control bits also affect the
tlbia
instruction. Replacement counters are
cleared to zero after the
tlbia
instruction is executed and the counters decrement after an
appropriate TLB reload.
11.8.3 Invalidating the TLB
The MPC801 implements the
tlbie
instruction to invalidate the TLB entries. This instruction
invalidates TLB entries in the TLB that hits, including the reserved entries. The 22
most-significant bits of the effective address are used in comparison since no segment
registers are implemented. Although, for entries with page sizes greater than 4K, some of
the lower bits of the effective page number are ignored. The ASID value in the entry is
ignored for the purpose of matching an invalid address, thus multiple entries may be
invalidated if they have the same effective address and different ASID values. The MPC801
supports the
tlbia
instruction to invalidate all entries in both TLBs. If the RSVD or RSVI bit
is set for a TLB, the two reserved entries will not be invalidated when
tlbia
is executed.
However, the software can explicitly invalidate one or more of these entries by setting the
index field in MD_CTR (DTLB_INDX) or MI_CTR (ITLB_INDX), negating the EV bit in
MD_EPN or MI_EPN, and performing a write to the appropriate MD_RPN or MI_RPN. The
TLBs are not automatically invalidated on reset, although they are disabled. However, they
must be invalidated under program control.
11.8.4 Loading the Reserved TLB Entries
To load a single reserved entry in the TLB, follow these steps:
1. Disable the TLB by clearing MSR
IR
or MSR
DR
as needed.
2. Clear the RSVI (RSVD) bit in the MI_CTR (MD_CTR) register.
3. Invalidate the effective address of the reserved page by using the
tlbia
or
tlbie
instruction.
4. Set the ITLB_INDX (DTLB_INDX) fields of the MI_CTR (MD_CTR) register to the
appropriate value between 27 and 31.
5. Load the MI_EPN (MD_EPN) register with the effective page number, the ASID of the
reserved page, and 1 as the EV bit.
6. Run software tablewalk code to load the appropriate entry into the TLB.
7. If needed, repeat the three previous steps to load other TLB entries.
8. Set the RSVI (RSVD) bit in the MI_CTR (MD_CTR) register.
11.9 REQUIREMENTS FOR ACCESSING THE MEMORY MANAGEMENT
UNIT CONTROL REGISTERS
All instruction and data memory management unit control registers should be accessed
when both instruction and data address translation is turned off (MSR
IR
=0 and MSR
DR
=0).
Prior to an
mtspr
MD_DCAM Rx instruction, an
eieio
instruction should be placed.