Architecture
1424
SPNU503C – March 2018
Copyright © 2018, Texas Instruments Incorporated
EMAC/MDIO Module
28.2.6.3 Transmit and Receive EMAC Interrupts
The EMAC processes descriptors in linked list chains as discussed in
, using the linked
list queue mechanism discussed in
.
The EMAC synchronizes descriptor list processing through the use of interrupts to the software
application. The interrupts are controlled by the application using the interrupt masks, global interrupt
enable, and the completion pointer register (CP). The CP is also called the interrupt acknowledge register.
The EMAC supports eight channels for transmit and eight channels for receive. The corresponding
completion pointer registers are:
•
TX
n
CP - Transmit Channel
n
Completion Pointer (Interrupt Acknowledge) Register
•
RX
n
CP - Receive Channel
n
Completion Pointer (Interrupt Acknowledge) Register
These registers serve two purposes. When read, they return the pointer to the last descriptor that the
EMAC has processed. When written by the software application, the value represents the last descriptor
processed by the software application. When these two values do not match, the interrupt is active.
Interrupts in the EMAC control module are routed to the Vectored Interrupt Manager (VIM) as four
separate interrupt requests. The interrupt configuration determines whether or not an active interrupt
request actually interrupts the CPU. In general the following settings are required for basic EMAC transmit
and receive interrupts:
1. EMAC transmit and receive interrupts are enabled by setting the mask registers RXINTMASKSET and
TXINTMASKSET
2. Global interrupts are set in the EMAC control module: C0RXEN and C0TXEN
3. The VIM is configured to accept C0_RX_PULSE and C0_TX_PULSE interrupts from the EMAC control
module
4. The normal mode (IRQ) interrupts are enabled in the Cortex-R4F CPU
Whether or not the interrupt is enabled, the current state of the receive or transmit channel interrupt can
be examined directly by the software application reading the EMAC receive interrupt status (unmasked)
register (RXINTSTATRAW) and transmit interrupt status (unmasked) register (TXINTSTATRAW).
After servicing transmit or receive interrupts, the application software must acknowledge both the EMAC
and EMAC control module interrupts.
EMAC interrupts are acknowledged when the application software updates the value of TX
n
CP or RX
n
CP
with a value that matches the internal value kept by the EMAC. This mechanism ensures that the
application software never misses an EMAC interrupt because the interrupt acknowledgment is tied
directly to the buffer descriptor processing.
EMAC control module interrupts are acknowledged when the application software writes the appropriate
C0TX or C0RX key to the EMAC End-Of-Interrupt Vector register (MACEOIVECTOR). The
MACEOIVECTOR behaves as an interrupt pulse interlock -- once the EMAC control module has issued an
interrupt pulse to the CPU, it will not generate further pulses of the same type until the original pulse has
been acknowledged.
28.2.6.4 Transmit Buffer Descriptor Format
A transmit (TX) buffer descriptor (
) is a contiguous block of four 32-bit data words aligned on
a 32-bit boundary that describes a packet or a packet fragment.
shows the transmit buffer
descriptor described by a C structure.