LSI Logic Confidential
15-14
Serial I/O Port
Copyright © 2001, 2002 by LSI Logic Corporation. All rights reserved.
5.
Set the SPI ENAB bit to start the SPI cycle. Software may poll this
bit to check for cycle completion.
Note:
The ENAB bit is set-only, as it can not be cleared by the
host/DMA engine. It is cleared by the SPI module at cycle
completion.
6.
When the HAEN bit in the SPI_CONTROL register is high, the SPI
has finished shifting out the last piece of transmit data or shifting in
the newest piece of receive data. In non-DMA mode, SPI_TEMP can
now be read, if desired, to obtain the data just shifted in from
SIO_SPI_MISO. In DMA mode, SPI_TEMP is automatically read and
stored in a FIFO for transfer to SDRAM, since both transmit and
receive must be active.
7.
At this point, the SPI_TEMP register must be written with the next
chunk of data. After this data is written, this sequence of events
repeats after HAEN goes active.
If non-DMA mode is used, the host must poll HAEN and explicitly
update the SPI_TEMP register with new data (and thus clear the
HAEN bit) BSIZ[10:2] + 2 times. These two extra 32-bit writes are
the equivalent of the eight “dummy data” bytes described in step 3a,
and must be done before ENAB goes low and the spi_cycle_done
interrupt signals.
If DMA mode is used, these updates are handled automatically by
the DMA engine, and no polling needs to be done.
For a 16-byte example, in non-DMA mode, the user must explicitly
write SPI_TEMP six times: first, the initial 4-byte write in step 3 (data
1-4), then three subsequent 4-byte writes (data 5-8, 9-12, 13-16)
then two additional times with dummy data. If DMA mode is used,
the user only needs to write SPI_TEMP explicitly once, with the initial
data. The first byte read back during the cycle is not valid data and
should be discarded.
Note:
If the last “data word” to be transferred has < 32 bits—that
is, bit granularity is used or only 1-3 bytes of the final
SPI_TEMP write need to be transferred, then the
corresponding “word” received from SIO_SPI_MISO needs
special consideration. Software must mask the value read
from SPI_TEMP to get the real data bytes that are valid,
since reading this register (either explicitly, or having the