GR740-UM-DS, Nov 2017, Version 1.7
414
www.cobham.com/gaisler
GR740
35.5.6 Setting up the DMA control register
The final step to receive packets is to set the control register in the following steps: The receiver must
be enabled by setting the rxen bit in the DMA control register. This can be done anytime and before
this bit is set nothing will happen. The rxdescav bit in the DMA control register is then set to indicate
that there are new active descriptors. This must always be done after the descriptors have been
enabled or the core might not notice the new descriptors. More descriptors can be activated when
reception has already started by enabling the descriptors and writing the rxdescav bit. When these bits
are set reception will start immediately when data is arriving.
35.5.7 The effect to the control bits during reception
When the receiver is disabled all packets going to the DMA-channel are discarded if the packet’s
address does not fall into the range of another DMA channel. If the receiver is enabled and the address
falls into the accepted address range, the next state is entered where the rxdescav bit is checked. This
bit indicates whether there are active descriptors or not and should be set by the external application
using the DMA channel each time descriptors are enabled as mentioned above. If the rxdescav bit is
‘0’ and the nospill bit is ‘0’ the packets will be discarded. If nospill is ’1’ the core waits until rxdescav
is set and the characters are kept in the N-Char fifo during this time. If the fifo becomes full further N-
char transmissions are inhibited by stopping the transmission of FCTs.
When rxdescav is set the next descriptor is read and if enabled the packet is received to the buffer. If
the read descriptor is not enabled, rxdescav is set to ‘0’ and the packet is spilled depending on the
value of nospill.
The receiver can be disabled at any time and will stop packets from being received to this channel. If
a packet is currently received when the receiver is disabled the reception will still be finished. The
rxdescav bit can also be cleared at any time. It will not affect any ongoing receptions but no more
descriptors will be read until it is set again. Rxdescav is also cleared by the core when it reads a dis-
abled descriptor.
35.5.8 Status bits
When the reception of a packet is finished the enable bit in the current descriptor is set to zero. When
enable is zero, the status bits are also valid and the number of received bytes is indicated in the length
field. The DMA control register contains a status bit which is set each time a packet has been
received. The controller can also be made to generate an interrupt for this event.
The RMAP CRC calculation is always active for all received packets and all bytes except the EOP/
EEP are included. The packet is always assumed to be an RMAP packet and the length of the header
is determined by checking byte 3 which should be the command field. The calculated CRC value is
then checked when the header has been received (according to the calculated number of bytes) and if
it is non-zero the HC bit is set indicating a header CRC error.
The CRC value is not set to zero after the header has been received, instead the calculation continues
in the same way until the complete packet has been received. Then if the CRC value is non-zero the
DC bit is set indicating a data CRC error. This means that the controller can indicate a data CRC error
even if the data field was correct when the header CRC was incorrect. However, the data should not
be used when the header is corrupt and therefore the DC bit is unimportant in this case. When the
header is not corrupted the CRC value will always be zero when the calculation continues with the
data field and the behaviour will be as if the CRC calculation was restarted
Table 545.
GRSPW receive descriptor word 1 (address offset 0x4)
31
0
PACKETADDRESS
31: 0
Packet address (PACKETADDRESS) - The address pointing at the buffer which will be used to store
the received packet.