The RX_PULSE interrupt is a pulse interrupt selected from the GMAC_SW 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 CPDMA_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 (WR_C0_RX_EN) . The masked interrupt status can be read in the address location of RX_STAT bit in the WR_C0_RX_STAT register.
When the GMAC_SW completes a packet reception, the subsystem issues an interrupt to the host processor 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 software 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 (RX n_CP) in the receive DMA state RAM.
Upon reception of an interrupt, software should perform the following:
- Read the WR_C0_RX_STAT[7:0] RX_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) (RX 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 subsystem (address of last buffer descriptor used by the subsystem). If the two values are not equal (which means that the GMAC_SW has received more packets than the software 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 GMAC_SW is expecting is found by reading the receive channel n completion pointer register (RX n_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 CPDMA_RX_INTMASK_CLEAR register.
- The receive completion pulse interrupt could be disabled by clearing to 0 all the bits in the WR_C0_RX_EN register.
The software could still poll for the CPDMA_RX_INTSTAT_RAW and CPDMA_RX_INTSTAT_MASKED registers if the corresponding interrupts are enabled.