MPC562/MPC564 Compression Features
MPC561/MPC563 Reference Manual, Rev. 1.2
A-14
Freescale Semiconductor
A.2.14
Compression/Non-Compression Mode Switch
The MPC562/MPC564 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 A.2.14.1, “Compression
Definition for Exception Handlers
,” and
Section A.2.14.2, “Running Mixed Code
A.2.14.1
Compression Definition for Exception Handlers
The MPC562/MPC564 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.
A.2.14.2
Running Mixed Code
If the compression mode is enabled on the MPC562/MPC564, 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. 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. Following is 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
ori
r31,r31,turn_on_compression_bit_mask
# or alternative to go to uncompressed code:
andi.
r31,r31,turn_off_compression_bit_mask
mtspr
NRI,r0 # Disable external interrupts
mtspr
SRR1,r31
mtspr
SRR0,r30 # destination address load
rfi
# branch and modify MSR
NOTE
When BBCMCR[EN_COMP] (bit 21) is set, modification of
MSR[DCMPEN] (bit 29) by mtmsr instruction is strictly forbidden. It may
cause the machine to hang until reset.
A.3
Operation Modes
A.3.1
Instruction Fetch
The MPC562/MPC564 provides two instruction fetch modes: decompression off and decompression on.
The operational modes are defined by RCPU MSR[DCMPEN] bit. If the bit is set, the mode is
decompression on. Otherwise, it is in decompression off.
Summary of Contents for MPC561
Page 84: ...MPC561 MPC563 Reference Manual Rev 1 2 lxxxiv Freescale Semiconductor...
Page 144: ...Signal Descriptions MPC561 MPC563 Reference Manual Rev 1 2 2 46 Freescale Semiconductor...
Page 206: ...Central Processing Unit MPC561 MPC563 Reference Manual Rev 1 2 3 62 Freescale Semiconductor...
Page 302: ...Reset MPC561 MPC563 Reference Manual Rev 1 2 7 14 Freescale Semiconductor...
Page 854: ...Time Processor Unit 3 MPC561 MPC563 Reference Manual Rev 1 2 19 24 Freescale Semiconductor...
Page 968: ...Development Support MPC561 MPC563 Reference Manual Rev 1 2 23 54 Freescale Semiconductor...
Page 1144: ...Internal Memory Map MPC561 MPC563 Reference Manual Rev 1 2 B 34 Freescale Semiconductor...
Page 1212: ...TPU3 ROM Functions MPC561 MPC563 Reference Manual Rev 1 2 D 60 Freescale Semiconductor...
Page 1216: ...Memory Access Timing MPC561 MPC563 Reference Manual Rev 1 2 E 4 Freescale Semiconductor...