![]() |
qspips
Vitis Drivers API Documentation
|
This file contains a design example using the QSPI driver (XQspiPs) in Linear QSPI mode with a serial FLASH device.
The example writes to the flash in QSPI mode and reads it back in Linear QSPI mode. This examples performs some transfers in Auto mode and Manual start mode, to illustrate the modes available. It is recommended to use Manual CS + Auto start for best performance. The hardware which this example runs on, must have a serial FLASH (Numonyx N25Q, Winbond W25Q, Spansion S25FL, ISSI IS25WP) for it to run. This example has been tested with the Numonyx Serial Flash (N25Q128) and IS25WP series flash parts.
None.
MODIFICATION HISTORY:
Ver Who Date Changes
1.00 sdm 11/25/10 First release 2.00a kka 22/08/12 Updated the example as XQspiPs_PolledTransfer API has changed. Changed the prescalar to use divide by 8. The user can change the prescalar to a maximum of divide by 2 based on the reference clock in the system. Set the Holdb_dr bit in the configuration register using XQSPIPS_HOLD_B_DRIVE_OPTION. Setting this bit drives the HOLD bit of the QSPI controller. This is required for QSPI to be used in Non QSPI boot mode else there needs to be an external pullup on this line. See http://www.xilinx.com/support/answers/47596.htm 2.01a sg 02/03/13 Created a function FlashReadID. ms 04/05/17 Modified Comment lines in functions to recognize it as documentation block for doxygen generation. 3.5 tjs 07/16/18 Added support for low density ISSI flash parts. Added FlashQuadEnable API to enable quad mode in flash. 3.6 akm 04/15/19 Modified FlashQuadEnable, FlashWrie and FlashErase APIs, to wait for the on going operation to complete before performing the next operation. 3.10 akm 08/17/22 Fix logical error in NumSect calculation. 3.11 akm 07/10/23 Add support for system device-tree flow for example.
Functions | |
void | FlashErase (XQspiPs *QspiPtr, u32 Address, u32 ByteCount) |
This function erases the sectors in the serial FLASH connected to the QSPI interface. More... | |
void | FlashWrite (XQspiPs *QspiPtr, u32 Address, u32 ByteCount, u8 Command) |
This function writes to the serial FLASH connected to the QSPI interface. More... | |
int | FlashReadID (void) |
This function reads serial FLASH ID connected to the SPI interface. More... | |
void | FlashQuadEnable (XQspiPs *QspiPtr) |
This function enables quad mode in the serial flash connected to the SPI interface. More... | |
int | LinearQspiFlashExample (XQspiPs *QspiInstancePtr, u16 QspiDeviceId) |
The purpose of this function is to illustrate how to use the XQspiPs device driver in Linear mode. More... | |
int | main (void) |
Main function to call the QSPI Flash example. More... | |
void FlashErase | ( | XQspiPs * | QspiPtr, |
u32 | Address, | ||
u32 | ByteCount | ||
) |
This function erases the sectors in the serial FLASH connected to the QSPI interface.
QspiPtr | is a pointer to the QSPI driver component to use. |
Address | contains the address of the first sector which needs to be erased. |
ByteCount | contains the total size to be erased. |
void FlashQuadEnable | ( | XQspiPs * | QspiPtr | ) |
This function enables quad mode in the serial flash connected to the SPI interface.
QspiPtr | is a pointer to the QSPI driver component to use. |
int FlashReadID | ( | void | ) |
This function reads serial FLASH ID connected to the SPI interface.
void FlashWrite | ( | XQspiPs * | QspiPtr, |
u32 | Address, | ||
u32 | ByteCount, | ||
u8 | Command | ||
) |
This function writes to the serial FLASH connected to the QSPI interface.
All the data put into the buffer must be in the same page of the device with page boundaries being on 256 byte boundaries.
QspiPtr | is a pointer to the QSPI driver component to use. |
Address | contains the address to write data to in the FLASH. |
ByteCount | contains the number of bytes to write. |
Command | is the command used to write data to the flash. QSPI device supports only Page Program command to write data to the flash. |
int LinearQspiFlashExample | ( | XQspiPs * | QspiInstancePtr, |
u16 | QspiDeviceId | ||
) |
The purpose of this function is to illustrate how to use the XQspiPs device driver in Linear mode.
This function writes data to the serial FLASH in QSPI mode and reads data in Linear QSPI mode.
QspiInstancePtr | is a pointer to the QSPIPS driver to use. |
QspiDeviceId | is the XPAR_<QSPIPS_instance>_DEVICE_ID value from xparameters.h. |
int main | ( | void | ) |
Main function to call the QSPI Flash example.
References LinearQspiFlashExample().