User manual

Table Of Contents
Zynq-7000 AP SoC Technical Reference Manual www.xilinx.com 513
UG585 (v1.11) September 27, 2016
Chapter 16: Gigabit Ethernet Controller
The Transmit Buffer Queue Pointer register (gem.tx_qbar) register points to this data structure.
To create this list of buffer descriptors with N entries:
1. Each buffer descriptor is 8 bytes in length. Hence allocate an area of 8N bytes for the transmit
buffer descriptor list in system memory which creates N entries in this list. It is advisable to use
un-cached memory for allocating the complete buffer descriptor list for the reasons already
described for the Receive Buffer Descriptor List.
2. Mark all entries in this list as owned by the controller. Set bit[31] of word 1 to 0.
3. Mark the last descriptor in the list with the wrap bit. Set bit[30] in word 1 to 1.
4. Write the base address of transmit buffer descriptor list to Controller register gem.tx_qbar.
16.3.6 Configure Interrupts
There are 26 interrupt conditions that are detected within the controller which are OR-ed to generate
a single interrupt. Additionally there is a Wake-on-LAN interrupt driven from the Ethernet controller.
These two interrupts are then passed to the GIC pl390 interrupt controller.
Refer to the description of register, gem.intr_status in Appendix B, Register Details for more
information on the list of interrupt conditions identified by the controller.
An appropriate handler for the interrupt should be registered with the CPU for processing an
interrupt condition. The CPU suspends its normal activity, moves to interrupt processing mode and
executes the corresponding handler for an interrupt condition.
Example: Configuring Interrupts
1. Register a handler. There are two interrupts generated by the controller - Wake-on-LAN and
another interrupt for all other functions. Register the handler for each of these interrupt types
with the CPU.
Note: In a typical case, a single handler is used for both transmission and reception of packets.
Once the control reaches the handler, the software should read the gem.intr_status register to
determine the source and perform the relevant function.
2. Enable the necessary interrupt conditions. The relevant bits in the gem.intr_en register must
be set. The interrupt conditions necessary are determined by the system architecture.
Note: Read the read-only register gem.intr_mask for current the mask state of each interrupt.
16.3.7 Enable the Controller
The receiver and transmitter must be enabled after configuration:
1. Enable the Transmitter. Write a 1 to gem.net_ctrl[tx_en].
2. Enable the Receiver. Write a 1 to gem.net_ctrl[rx_en].