MOTOROLA
Appendix B. Bit and Byte Ordering
B-1
Appendix B
Bit and Byte Ordering
B0
B0
The MPC106 supports both big-endian and little-endian formatted data on the PCI bus.
This appendix provides examples of the big- and little-endian modes of operation.
PICR1[LE_MODE] controls the endian mode of the MPC106. LE_MODE is also
accessible from the external configuration register at port 0x092. Note that the 60x
processor and the MPC106 should be set for the same endian mode before accessing the
devices on PCI bus.
When designing little-endian or big-endian systems using the MPC106, system designers
and programmers must consider the following:
The PCI bus uses a little-endian bit format (the most-significant bit (msb) is 31),
while the 60x bus uses a big-endian bit format (the most-significant bit is 0). Thus,
PCI address bit AD31 equates to the 60x address bit A0, while PCI address bit AD0
equates to the 60x address bit A31.
For data comprised of more than 1 byte, the endian mode affects the byte ordering.
For little-endian data, the least-significant byte (LSB) is stored at the lowest (or
starting) address while the most-significant byte is stored at the highest (or ending)
address. For big-endian data, the most-significant byte is stored at the lowest (or
starting) address while the least-significant byte is stored at the highest (or ending)
address.
For 60x processors, the conversion to little-endian mode does not occur on the data
bus. The bus interface unit (BIU) of the 60x processor uses a technique called
munging to reverse the address order of every 8 bytes stored to memory. See Chapter
3, “Operand Conventions” in
PowerPC Microprocessor Family: The Programming
Environments
, for more information. External to the processor, all the byte lanes
must be reversed (MSB to LSB, etc.) and the addresses must be unmunged. The
unmunging/byte lane reversing mechanism can either be between the processor and
system memory or between the PCI bus and system memory. The MPC106
unmunges the address and reverses the byte lanes between the PCI bus and system
memory.