26#if !defined(_ZYNQ_QSPI_FLASH_H_)
27#define _ZYNQ_QSPI_FLASH_H_
35#define ZQSPI_FLASH_4BYTE_ADDRESSING 1
36#define ZQSPI_FLASH_FAST_READ 1
38#define ZQSPI_FLASH_COMMAND_OFFSET (0)
39#define ZQSPI_FLASH_ADDRESS_1_OFFSET (1)
40#define ZQSPI_FLASH_ADDRESS_2_OFFSET (2)
41#define ZQSPI_FLASH_ADDRESS_3_OFFSET (3)
42#if ZQSPI_FLASH_4BYTE_ADDRESSING
43 #define ZQSPI_FLASH_ADDRESS_4_OFFSET (4)
44 #define ZQSPI_FLASH_DATA_OFFSET (5)
46 #define ZQSPI_FLASH_DATA_OFFSET (4)
48#define ZQSPI_FLASH_SPI_MAX_PADDING (4)
50#define ZQSPI_FLASH_TX_TRANS 0
51#define ZQSPI_FLASH_RX_TRANS 1
53#define ZQSPI_FLASH_BUFFER_SIZE 0x1008
55#define ZQPSI_ZYNQ_QSPI_IRQ 51
57#define ZQSPI_TIMEOUT_US 5000000U
58#define ZQSPI_TIMEOUT_TICKS (ZQSPI_TIMEOUT_US \
59 / rtems_configuration_get_microseconds_per_tick())
67 ZQSPI_FLASH_NO_ERROR = 0,
69 ZQSPI_FLASH_ALREADY_OPEN,
70 ZQSPI_FLASH_NO_MEMORY,
71 ZQSPI_FLASH_4BYTE_ADDR_NOT_SUPPORTED,
72 ZQSPI_FLASH_BUFFER_OVERFLOW,
73 ZQSPI_FLASH_BUFFER_UNDERFLOW,
74 ZQSPI_FLASH_BAD_ADDRESS,
75 ZQSPI_FLASH_NOT_BLANK,
76 ZQSPI_FLASH_ERASE_FAILURE,
77 ZQSPI_FLASH_READ_ONLY,
78 ZQSPI_FLASH_WRITE_LATCH_CLEAR_FAIL,
79 ZQSPI_FLASH_WRITE_LOCK_FAIL,
80 ZQSPI_FLASH_WRITE_ACROSS_SECTION,
81 ZQSPI_FLASH_WRITE_ERASE_CMD_FAIL,
82 ZQSPI_FLASH_LOCK_FAIL,
83 ZQSPI_FLASH_INVALID_DEVICE,
84 ZQPSI_FLASH_TRANSFER_FAILED,
85 ZQSPI_FLASH_RTEMS_INTR
118 uint32_t flash_read_dummies;
119 uint32_t flash_erase_sector_size;
120 uint32_t flash_page_size;
149zqspi_error zqspi_read(
166zqspi_error zqspi_write(
182zqspi_error zqspi_erase(
197zqspi_error zqspi_blank(
211zqspi_error zqspi_erase_sector(
225zqspi_error zqspi_write_sector(
239zqspi_error zqspi_erase_device(
zqspiflash *driver);
250zqspi_error zqspi_readid(
zqspiflash *driver, uint32_t *jedec_id);
268size_t zqspi_device_sector_erase_size(
zqspiflash *driver);
276void zqspi_transfer_trace(
287void qspi_reg_write(uint32_t reg, uint32_t value);
296uint32_t qspi_reg_read(uint32_t reg);
306zqspi_error zqspi_transfer_buffer_skip(
Definition: media-server.c:46
Definition: zynq-qspi-flash.h:92
Definition: zynq-qspi-flash.h:113