Software Operation
•
Overwrite the packet’s SOP buffer descriptor buffer length with the number of valid data bytes in the
buffer. If the buffer is filled up, the buffer length will be the buffer size minus buffer offset.
•
Set the SOP bit in the packet’s SOP buffer descriptor.
•
Write the SOP buffer descriptor Packet Length field.
•
Clear the Ownership bit in the packet’s SOP buffer descriptor.
•
Issue an Rx host interrupt by writing the address of the packet’s last buffer descriptor to the queue’s
Rx DMA State Completion Pointer. The interrupt is generated by the write to the Rx DMA State
Completion Pointer address location, regardless of the value written.
On interrupt the host processes the Rx buffer queue detecting received packets by the status of the
Ownership bit in each packet’s SOP buffer descriptor. If the Ownership bit is cleared then the packet has
been completely received and is available to be processed by the host.
The host may continue Rx queue processing until the end of the queue or until a buffer descriptor is read
that contains a set Ownership bit indicating that the next packet’s reception is not complete. The host
determines that the Rx queue is empty when the last packet in the queue has a cleared Ownership bit in
the SOP buffer descriptor, a set End of Queue bit in the EOP buffer descriptor, and the Next Descriptor
Pointer in the EOP buffer descriptor is zero.
A misqueued buffer may occur when the host adds buffers to a queue as the port finishes the reception of
the previous last packet in the queue. The misqueued buffer is detected by the host when queue
processing detects a cleared Ownership bit in the SOP buffer descriptor, a set End of Queue bit in the
EOP buffer descriptor, and a nonzero Next Descriptor Pointer in the EOP buffer descriptor.
A misqueued buffer means that the port read the last EOP buffer descriptor before the host added buffer
descriptor(s) to the queue, so the port determined queue empty just before the host added more buffer
descriptor(s). In the transmit case, the packet transmission is delayed by the time required for the host to
determine the condition and reinitiate the transaction, but the packet is not actually lost. In the receive
case, receive overrun condition may occur in the misqueued buffer case.
If a new packet reception is begun during the time that the port has determined the end of queue
condition, then the received packet will overrun (start of packet overrun). If the misqueued buffer occurs
during the middle of a packet reception then middle of packet overrun may occur. If the misqueued buffer
occurs after the last packet has completed, and is corrected before the next packet reception begins, then
overrun will not occur. The host acts on the misqueued buffer condition by writing the added buffer
descriptor address to the appropriate Rx DMA State Head Descriptor Pointer.
14.4.3 Initializing the MDIO Module
The following steps are performed by the application software or device driver to initialize the MDIO
device:
1. 1. Configure the PREAMBLE and CLKDIV bits in the MDIO control register (MDIOCONTROL).
2. Enable the MDIO module by setting the ENABLE bit in MDIOCONTROL.
3. The MDIO PHY alive status register (MDIOALIVE) can be read in polling fashion until a PHY
connected to the system responded, and the MDIO PHY link status register (MDIOLINK) can
determine whether this PHY already has a link.
4. Setup the appropriate PHY addresses in the MDIO user PHY select register (MDIOUSERPHYSELn),
and set the LINKINTENB bit to enable a link change event interrupt if desirable.
•
If an interrupt on general MDIO register access is desired, set the corresponding bit in the MDIO user
command complete interrupt mask set register (MDIOUSERINTMASKSET) to use the MDIO user
access register (MDIOUSERACCESSn). Since only one PHY is used in this device, the application
software can use one MDIOUSERACCESSn to trigger a completion interrupt; the other
MDIOUSERACCESSn is not setup.
14.4.4 Writing Data to a PHY Register
The MDIO module includes a user access register (MDIOUSERACCESSn) to directly access a specified
PHY device.To write a PHY register, perform the following:
1. Check to ensure that the GO bit in the MDIO user access register (MDIOUSERACCESSn) is cleared.
1238
Ethernet Subsystem
SPRUH73H – October 2011 – Revised April 2013
Copyright © 2011–2013, Texas Instruments Incorporated