Endian Control (Byte and Word Swapping)
BCM5718 Programmer’s Guide
Broadcom
®
January 29, 2016 • 5718-PG108-R
Page 200
Word Swap Non-Frame Data and Byte Swap Non-Frame Data Bits
The Word Swap Non-Frame Data, and Byte Swap Non-Frame Data bits affect the byte ordering of certain
shared memory data structures (buffer descriptors, statistics block, etc.) when those structures are transferred
across PCI.
The following table shows as example of how a Send Buffer Descriptor is stored internally in the Ethernet
controller.
Since the Ethernet controller uses a 64-bit memory subsystem, the above diagram is shown in 64-bit format.
Furthermore, the table shows both the internal byte offset for each field and the bit position for each byte.
To provide flexibility for different host processor/memory architectures, the Ethernet controller can order the data
in memory in four different ways depending on the settings of the Word Swap Non-Frame Data and Byte Swap
Non-Frame Data bits. The following tables show how data will appear depending on the settings of those swap
bits:
Table 68: Send Buffer Descriptor (Big-Endian 64-Bit format)
Byte #
0
1
2
3
4
5
6
7
Bit #
63
47
31
15
MSB
Host Address
0x00
MSB Length
Flags
Reserved
VLAN
0x08
Note:
This may seem confusing because big-endian notation normally has the bit positions
incrementing from left to right. However, in this case, the bit positions are relevant because they
correspond to the bit positions on PCI (AD[63:0]) if neither of the non-frame data swap bits are set. For
clarification, the following table shows the same structure in 32-bit format.
Table 69: Send Buffer Descriptor (Big-Endian 32-Bit format)
Byte #
0
1
2
3
Bit #
31
15
MSB
Host Address
0x00
0x04
MSB
Length
Flags
0x08
Reserved
VLAN
0x0C