
4-16
MPC565/MPC566 Reference Manual
MOTOROLA
Class-Based Compression Model Main Principles
supplied by the compressor tool and the vocabulary generator. There are two initialization
scenarios:
1. Wake up in “Decompression OFF” mode — If the chip wakes up with
decompression disabled, the initialization routine can be executed at any time before
entering “Decompression ON” mode. After the compression environment is
initialized, the operational mode would be changed to “Decompression ON”.
2. Wake up in “Decompression ON” mode — If the chip wakes up in
“Decompression ON” mode, it has to perform compressed instructions without the
vocabularies and class parameters. Thus, all instructions executed until the end of
the initialization routine will be compressed in the global bypass format. Perform
the routine as close as possible to the wake up.
4.2.11 Compression/Non-Compression Mode Switch
(MPC566 Only)
The MPC566 allows the option to switch between compressed and non-compressed code
on the fly. There are two ways to switch between the modes, as shown in
Section 4.2.11.1,4.2.11.1 Compression Definition for Exception Handlers
The MPC566 can wake up upon reset with all the exception handlers defined to be
compressed (or not), so when any exception occurs or completes, the hardware switches to
the appropriate mode without software intervention.
4.2.11.2 Running Mixed Code
If the compression mode is enabled on the MPC566, the software can switch between
compressed and non-compressed code by setting (or clearing) the compression mode bit in
the RCPU MSR register. This is done by setting/clearing bit [29] in the RCPU SRR1
register (SRR1 gets loaded into the MSR register when the RFI instruction is executed and
bit [29] is the DCMPEN bit of the MSR). The next step is to load SRR0 with a target
address in compressed/non-compressed format and then executing an RFI instruction.
Figure 4-13 shows a suggested routine to execute the switch in both directions (must be run
in supervisor mode when RCPU MSR[PR] bit is cleared).
# R30 contains destination address in appropriate format
.set turn_on_compression_bit_mask, 4
.set turn_off_compression_bit_mask, 0xfffb
mfmsr
r31
# to go to compressed code