The TX_PULSE interrupt is a pulse interrupt selected from the GMAC_SW 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 CPDMA_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 WR_C0_TX_EN .The masked interrupt status can be read in the address location of TX_STAT bit in the WR_C0_TX_STAT register.
When the GMAC_SW completes the transmission of a packet, the GMAC_SW subsystem issues an interrupt to the host processor by writing the packet's last buffer descriptor address to the appropriate channel queue's transmit 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 reception of an interrupt, software should perform the following:
- Read the TX_STAT bit address location to determine which channel(s) caused the interrupt
- Process received packets for the interrupting channel(s).
- Write the GMAC_SW completion pointer(s) (TX n_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 GMAC_SW (address of last buffer descriptor used by the GMAC_SW). If the two values are not equal (which means that the GMAC_SW has transmitted more packets than the software has processed), the transmit packet completion interrupt signal remains asserted. If the two values are equal (which means that the host has processed all packets that the subsystem has transferred), the pending interrupt is cleared. The value that the GMAC_SW is expecting is found by reading the transmit channel ncompletion pointer register (TX n_CP).
-
Write the 2h 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 CPDMA_TX_INTMASK_CLEAR register.
- The receive completion pulse interrupt could be disabled by clearing to 0 all the bits in the WR_C0_TX_EN register.
The software could still poll for the CPDMA_TX_INTSTAT_RAW and CPDMA_TX_INTSTAT_MASKED registers, if the corresponding interrupts are enabled.