
5-22
G2 PowerPC Core Reference Manual
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA
Exception Definitions
device enters into the big-endian mode. If MSR[ILE], MSR[LE], and HID2[LET] are
subsequently set (during or after the reset routine has completed), a subsequent soft reset
causes the system reset exception handler to be entered in true little-endian mode,
potentially resulting in illegal instruction execution (if the beginning of the handler is
written assuming big-endian code). Note that the reverse occurs for true little-endian mode.
The following assembly language code highlights register settings necessary when in
big-endian mode coming out of hard reset and subsequently changing the processor state to
true little-endian mode and setting the MSR[ILE], MSR[LE], and HID2[LET] bits. The
first eight instructions of the system reset exception handler is written in big-endian format,
in order to facilitate the mode switch. The rest of the reset handler is written in true
little-endian format for the remaining supervisor or OS code. This reset code assumes that
caching is not enabled out of reset. Due to the complexities involved with keeping the
memory system coherent, it is strongly recommended not to change endinaness at any other
time once it is determined at hard reset.
.orig 0xFFF0 0100 # default IP vector
# Begin HRESET_ handler with Big-Endian Mode
xor
xor
oris r2,r2,0x0800
mtspr HID2,r2
oris r1,r1,0x0001
ori
r1,r1,0x0001
mtmsr r1
isync
r2,r2,r2
r1,r1,r1
initialize register
# initialize register
# set bit in r2 for HID2[4]LET
# load HID2 setting LET bit
# set bit in r1 for MSR[15]ILE
# set bit in r1 for MSR[31]LE
# load MSR setting ILE and LE bits
# wait for all instructions to complete
# End Big-Endian mode, True Little-Endian enabled
# modify the 8 Big-Endian instructions into valid True Little-Endian instructions
# True Little-Endian Mode
mtspr SRR1,r1
# load the Machine State with LE enabled
xor
r0,r0,r0
# initialize register
oris r0,r0,0x0001
# set Starting address at b’0001 0000
mtspr SRR0,r0
# load the next instruction address
# whatever instructions the supervisor/OS wants.
rfi
# End HRESET_ handler in True Little-Endian Mode
# return from HRESET_ interrupt routine
See Section 3.1.2, “Endian Modes and Byte Ordering,” for more information on the endian
modes of the G2 and G2_LE cores.
5.5.2
Machine Check Exception (0x00200)
The G2 core conditionally initiates a machine check exception after detecting the assertion
of the core_tea or core_mcp signals on the 60x bus (assuming the machine check is enabled
with MSR[ME] = 1). The assertion of one of these signals indicates that a bus error
F
Freescale Semiconductor, Inc.
n
.