User manual

Table Of Contents
Zynq-7000 AP SoC Technical Reference Manual www.xilinx.com 515
UG585 (v1.11) September 27, 2016
Chapter 16: Gigabit Ethernet Controller
The received frame's type/length field matches one of the four type ID registers. The available
type id registers are gem.type_id_match{1:4}. This is applicable for cases where Ethernet
type/length field based filtering is required.
Unicast or Multicast hash is enabled through gem.net_cfg[uni_hash_en] or
gem.net_cfg[multi_hash_en] register bits, then the received frame is accepted only if the hash is
matched.
The destination address is a broadcast address (0xFFFFFFFFFFFF) and broadcasts are allowed.
This option is set using the gem.net_cfg[no_broadcast] register bit.
The controller is configured for promiscuous mode with the gem.net_cfg[copy_all] register bit
set.
The register gem.rx_qbar points to the next entry in the receive buffer descriptor list and the
controller uses this as the address in system memory to write the frame. When the frame has been
completely received and written to system memory, the controller then updates the receive buffer
descriptor entry with the reason for the address match, marks the area as being owned by software,
and sets the receive complete interrupt (gem.intr_status[rx_complete] = 1). Software is then
responsible for copying the data to the application area and releasing the buffer.
If the controller is unable to write the data at a rate to match the incoming frame, then the receiver
overrun interrupt is set (gem.intr_status[rx_overrun] = 1). If there is no receive buffer available, i.e.,
the next buffer is still owned by software, a receive-buffer not available interrupt is set. If the frame
is not successfully received, a Statistic register is incremented and the frame is discarded without
informing software.
Example: Handling a Received Frame
1. Wait for the controller to receive a frame. The receive complete interrupt,
gem.intr_status[rx_complete], is generated when a frame is received.
2. Service the interrupt. Read and clear the gem.intr_status[rx_complete] register bit writing a 1 to
the bit in the interrupt handler. Also read and clear the gem.rx_status register by writing a 1 to
gem.rx_status[frame_recd] bit.
3. Process the data in the buffer. Scan the buffer descriptor list for the buffer descriptors with the
ownership bit (bit 0, Word 0) set. When the DMA receive buffer size programmed to 1,600 bytes
(gem.dma_cfg[ahb_mem_rx_buf_size] = 0x19), the packets on the receive side are not scattered
and always go into a single buffer. For a buffer descriptor with the ownership bit set, process the
buffer allocated in the corresponding buffer descriptor and set the ownership bit to 0. Read
other bit fields in the relevant buffer descriptor word 1, take necessary action, and clear them.
16.3.10 Debug Guide
The GigE can encounter different kinds of errors while receiving or transmitting Ethernet frames.
Refer to Appendix B, Register Details for more information on the transmit and receive error
conditions listed in the description for gem.tx_status and gem.rx_status registers, respectively.
Some common errors and the action necessary is described in Table 16-6 and Table 16-7.