GT-64260A Design Guide
Doc. No. MV-S300165-00, Rev. A
CONFIDENTIAL
Copyright © 2002 Marvell
Page 152
Document Classification: Proprietary Information
May 21, 2002, Preliminary
Appendix D. Big and Little Endian Support
The GT-64260A core supports two Endianess settings, each with an 8 byte width.
If the PCI Command register's (Offset: 0xc00. and 0xc80) MSwapEn bit [21] is set to '0', the swap settings are
ignored. To use any kind of data swap, it must be set to '1'.
If the PCI is being accessed from the IDMA, start the correct swapping in the Channel Control High register (Off-
set: 0x880).
If accessing the PCI from the CPU, set the correct data swap in the corresponding PCI Low Decode Address reg-
ister’s PCISwap bits [26:24]. For example, if the PCI access hits the PCI0 Memory 0 window, set the data swap at
the PCI_0 Memory 0 Low Decode Address Register (Offset: 0x058).
D.1 Internal Register
The GT-64260A internal register space is set to Little Endian. This means the byte order of significance has the
Most Significant Byte (MSB) in the leftmost ordering and the Least Significant Byte (LSB) is the rightmost. The
data written to an internal register is byte swapped by the GT-64260A CPU interface.
To write to the GT-64260A internal register, the data on the CPU bus must be driven as Big Endian (the order of
significance is that the LSB is the leftmost and the MSB is the rightmost). One way of driving the data as Big
Endian on the CPU bus is for the CPU's general register to hold the data in Big Endian and use a simple load
instruction.
A C language programer can write data in this code as Big Endian or work with Little Endian and use a SW swap
mechanism. This is the way the Low Level Drivers write to the GT-64260A internal register.
Another way to drive the data as Big Endian on the CPU bus is to use data in the code as Little Endian and only
the store/load operation to the internal register will use the load/store word with byte swap instructions. In this way,
the C programer has better code interface by using Little Endian data and better performance.
D.2 Communication Descriptors
The GT-64260A does not swap the data on CPU to SDRAM accesses (CPU data = SDRAM data). This also
applies to the SDMA engines of the communication interfaces that take the data from the SDRAM.
This means that the data to descriptors in the SDRAM must be placed on the CPU bus as Little Endian but word
swapped.
Table 34:
Big and Little Endian Bit Ordering
Little
Endian the LSB is on the right.
7
6
5
4
3
2
1
0
Big
Endian the LSB is on the left.
0
1
2
3
4
5
6
7