26#if !defined(_ZYNQ_QSPI_FLASH_DEFS_H_)
27#define _ZYNQ_QSPI_FLASH_DEFS_H_
29#include <dev/spi/zynq-qspi-flash.h>
31#define ZQSPI_QSPI_BASE 0xE000D000
37#define ZQSPI_FLASH_COMMAND_SIZE 1
38#if ZQSPI_FLASH_4BYTE_ADDRESSING
39 #define ZQSPI_FLASH_ADDRESS_SIZE 4
40 #define ZQSPI_FLASH_WRITE_CMD 0x12
41 #if ZQSPI_FLASH_FAST_READ
42 #define ZQSPI_FLASH_READ_CMD 0x0c
44 #define ZQSPI_FLASH_READ_CMD 0x13
46 #define ZQSPI_FLASH_SEC_ERASE_CMD 0xDC
48 #define ZQSPI_FLASH_ADDRESS_SIZE 3
49 #define ZQSPI_FLASH_WRITE_CMD 0x02
50 #if ZQSPI_FLASH_FAST_READ
51 #define ZQSPI_FLASH_READ_CMD 0x0b
53 #define ZQSPI_FLASH_READ_CMD 0x03
55 #define ZQSPI_FLASH_SEC_ERASE_CMD 0xD8
58#define ZQSPI_FLASH_READ_CONFIG_CMD 0x35
59#define ZQSPI_FLASH_WRITE_STATUS_CMD 0x01
60#define ZQSPI_FLASH_WRITE_DISABLE_CMD 0x04
61#define ZQSPI_FLASH_READ_STATUS_CMD 0x05
62#define ZQSPI_FLASH_WRITE_DISABLE_CMD 0x04
63#define ZQSPI_FLASH_WRITE_ENABLE_CMD 0x06
64#define ZQSPI_FLASH_BULK_ERASE_CMD 0xC7
65#define ZQSPI_FLASH_READ_ID 0x9F
67#define ZQSPI_FLASH_READ_STATUS_FLAG_CMD 0x05
72#define ZQSPI_QSPI_REG_CONFIG 0x00000000
73#define ZQSPI_QSPI_REG_INTR_STATUS 0x00000004
74#define ZQSPI_QSPI_REG_INTR_ENABLE 0x00000008
75#define ZQSPI_QSPI_REG_INTR_DISABLE 0x0000000c
76#define ZQSPI_QSPI_REG_INTR_MASK 0x00000010
77#define ZQSPI_QSPI_REG_EN 0x00000014
78#define ZQSPI_QSPI_REG_DELAY 0x00000018
79#define ZQSPI_QSPI_REG_TXD0 0x0000001c
80#define ZQSPI_QSPI_REG_RX_DATA 0x00000020
81#define ZQSPI_QSPI_REG_SLAVE_IDLE_COUNT 0x00000024
82#define ZQSPI_QSPI_REG_TX_THRES 0x00000028
83#define ZQSPI_QSPI_REG_RX_THRES 0x0000002c
84#define ZQSPI_QSPI_REG_GPIO 0x00000030
85#define ZQSPI_QSPI_REG_LPBK_DLY_ADJ 0x00000038
86#define ZQSPI_QSPI_REG_TXD1 0x00000080
87#define ZQSPI_QSPI_REG_TXD2 0x00000084
88#define ZQSPI_QSPI_REG_TXD3 0x00000088
89#define ZQSPI_QSPI_REG_LSPI_CFG 0x000000a0
90#define ZQSPI_QSPI_REG_LSPI_STS 0x000000a4
91#define ZQSPI_QSPI_REG_MOD_ID 0x000000fc
96#define ZQSPI_QSPI_FIFO_DEPTH (63)
101#define ZQSPI_QSPI_CR_HOLDB_DR (1 << 19)
102#define ZQSPI_QSPI_CR_MANSTRT (1 << 16)
103#define ZQSPI_QSPI_CR_MANSTRTEN (1 << 15)
104#define ZQSPI_QSPI_CR_SSFORCE (1 << 14)
105#define ZQSPI_QSPI_CR_PCS (1 << 10)
106#define ZQSPI_QSPI_CR_BAUD_RATE_DIV_2 (0 << 3)
107#define ZQSPI_QSPI_CR_BAUD_RATE_DIV_4 (1 << 3)
108#define ZQSPI_QSPI_CR_BAUD_RATE_DIV_8 (2 << 3)
109#define ZQSPI_QSPI_CR_MODE_SEL (1 << 0)
114#define ZQSPI_QSPI_CR_BAUD_RATE_FAST ZQSPI_QSPI_CR_BAUD_RATE_DIV_2
119#define ZQSPI_QSPI_IXR_TXUF (1 << 6)
120#define ZQSPI_QSPI_IXR_RXFULL (1 << 5)
121#define ZQSPI_QSPI_IXR_RXNEMPTY (1 << 4)
122#define ZQSPI_QSPI_IXR_TXFULL (1 << 3)
123#define ZQSPI_QSPI_IXR_TXOW (1 << 2)
124#define ZQSPI_QSPI_INTR_RXOVR (1 << 0)
129#define ZQSPI_QSPI_EN_SPI_ENABLE (1 << 0)
135 #define ZQSPI_QSPI_CR_BAUD_RATE ZQSPI_QSPI_CR_BAUD_RATE_DIV_2
137 #define ZQSPI_QSPI_CR_BAUD_RATE ZQSPI_QSPI_CR_BAUD_RATE_DIV_4
143#define ZQSPI_FLASH_SR_WIP (1 << 0)
144#define ZQSPI_FLASH_SR_WEL (1 << 1)
145#define ZQSPI_FLASH_SR_BP0 (1 << 2)
146#define ZQSPI_FLASH_SR_BP1 (1 << 3)
147#define ZQSPI_FLASH_SR_BP2 (1 << 4)
148#define ZQSPI_FLASH_SR_E_ERR (1 << 5)
149#define ZQSPI_FLASH_SR_P_ERR (1 << 6)
150#define ZQSPI_FLASH_SR_SRWD (1 << 7)
Definition: zynq-qspi-flash.h:92
Definition: zynq-qspi-flash.h:113