Functional Description
14.3.1.3 Interrupts
The 3 Port Switch Ethernet Subsystem generates four interrupt events.
14.3.1.3.1 Receive Packet Completion Pulse Interrupt (RX_PULSE)
The RX_PULSE interrupt is a paced pulse interrupt selected from the 3PSW RX_PEND [7:0] interrupts.
The receive DMA controller has eight channels with each channel having a corresponding
(RX_PEND[7:0]).
The following steps will enable the receive packet completion interrupt.
•
Enable the required channel interrupts of the DMA engine by setting 1 to the appropriate bit in the
RX_INTMASK_SET register.
•
The receive completion interrupt(s) to be routed to RX_PULSE is selected by setting one or more bits
in the receive interrupt enable register Cn_RX_EN. The masked interrupt status can be read in the
Receive Interrupt Masked Interrupt Status (Cn_RX_STAT) register.
When the 3PSW completes a packet reception, the subsystem issues an interrupt to the CPU by writing
the packet's last buffer descriptor address to the appropriate channel queue's receive completion pointer
located in the state RAM block. The interrupt is generated by the write when enabled by the interrupt
mask, regardless of the value written.
Upon interrupt reception, the CPU processes one or more packets from the buffer chain and then
acknowledges one or more interrupt(s) by writing the address of the last buffer descriptor processed to the
queue's associated receive completion pointer (RXn_CP) in the receive DMA state RAM.
Upon reception of an interrupt, software should perform the following:
•
Read the RX_STAT register to determine which channel(s) caused the interrupt.
•
Process received packets for the interrupting channel(s).
•
Write the 3PSW completion pointer(s) (RXn_CP). The data written by the host (buffer descriptor
address of the last processed buffer) is compared to the data in the register written by the subsystem
(address of last buffer descriptor used by the subsystem). If the two values are not equal (which means
that the 3PSW has received more packets than the CPU has processed), the receive packet
completion interrupt signal remains asserted. If the two values are equal (which means that the host
has processed all packets that the system has received), the pending interrupt is de-asserted. The
value that the 3PSW is expecting is found by reading the receive channeln completion pointer register
(RXn_CP).
•
Write the value 1h to the CPDMA_EOI_VECTOR register.
To disable the interrupt:
•
The eight channel interrupts may be individually disabled by writing to 1 the appropriate bit in the
RX_INTMASK_CLEAR
•
The receive completion pulse interrupt could be disabled by clearing to 0 all the bits of the RX_EN.
The software could still poll for the RX_INTSTAT_RAW and RX_INTSTAT_MASKED registers if the
corresponding interrupts are enabled.
14.3.1.3.2 Transmit Packet Completion Pulse Interrupt (TX_PULSE)
The TX_PULSE interrupt is a paced pulse interrupt selected from the 3PSW TX_PEND [7:0] interrupts.
The transmit DMA controller has eight channels with each channel having a corresponding
(TX_PEND[7:0]).
To enable the transmit packet completion interrupt:
•
Enable the required channel interrupts of the DMA engine by setting 1 to the appropriate bit in the
TX_INTMASK_SET register.
•
The transmit completion interrupt(s) to be routed to TX_PULSE is selected by setting one or more bits
in the transmit interrupt enable register Cn_TX_EN .The masked interrupt status can be read in the
Transmit Interrupt Masked Interrupt Status (Cn_TX_STAT) register.
1178
Ethernet Subsystem
SPRUH73H – October 2011 – Revised April 2013
Copyright © 2011–2013, Texas Instruments Incorporated