
When there is one flash page of data in the SRAM, the quad SPI controller initiates the write operation from
SRAM to the flash memory.
Software can disable the DMA peripheral request interface with the
endma
field of the
cfg
register. If a
master other than the DMA performs the data transfer for indirect operations, the DMA peripheral request
interface must be disabled. By default, the indirect watermark registers are set to zero, which means the
DMA peripheral request controller can issue DMA request as soon as possible.
For more information about the HPS DMA controller, refer to the
DMA Controller
chapter in volume 3 of
the Cyclone
®
V Device Handbook.
Related Information
on page 16-1
STIG Operation
The STIG provides software a method to access the flash device registers directly. The
flashcmd
register
uses the following parameters to define the command to be issued to the flash device:
• Instruction opcode
• Number of address bytes
• Number of dummy bytes
• Number of write data bytes
• Write data
• Number of read data bytes
The address is specified through the flash command address register (
flashcmdaddr
). Once these settings
have been specified, software can trigger the command with the execute command field (
execcmd
) of the
flashcmd
register and wait for its completion by polling the command execution status bit (
cmdexecstat
)
of the
flashcmd
register. A maximum of eight data bytes may be read from the flash command read data
lower (
flashcmdrddatalo
) and flash command read data upper (
flashcmdrddataup
) registers or
written to the flash command write data lower (
flashcmdwrdatalo
) and flash command write data
upper (
flashcmdwrdataup
) registers per command.
Commands issued through the STIG have a higher priority than all other read accesses and therefore interrupt
any read commands being requested by the direct or indirect controllers. However, the STIG does not
interrupt a write sequence that may have been issued through the direct or indirect access controller. In
these cases, it might take a long time for the
cmdexecstat
bit of the
flashcmd
register indicates the
operation is complete.
Altera recommends using the STIG instead of the SPI legacy mode to access the flash device registers
and perform erase operations.
Note:
SPI Legacy Mode
SPI legacy mode allows software to access the internal TX FIFO and RX FIFO buffers directly, thus bypassing
the direct, indirect and STIG controllers. Software accesses the TX FIFO and RX FIFO buffers by writing
any value to any address through the data slave while legacy mode is enabled. You can enable legacy mode
with the legacy IP mode enable bit (
enlegacyip
) of the
cfg
register.
Legacy mode allows the user to issue any flash instruction to the flash device, but imposes a heavy software
overhead in order to manage the fill levels of the FIFO buffers effectively. The legacy SPI mode is bidirectional
in nature, with data continuously being transferred both directions while the chip select is enabled. If the
driver only needs to read data from the flash device, dummy data must be written to ensure the chip select
stays active, and vice versa for write transactions.
Quad SPI Flash Controller
Altera Corporation
cv_54012
STIG Operation
12-8
2013.12.30