35#ifndef XQSPIPSU_FLASH_CONFIG_H_
36#define XQSPIPSU_FLASH_CONFIG_H_
45#include "xparameters.h"
47#include <bsp/xil-compat.h>
57#define WRITE_STATUS_CMD 0x01
60#define WRITE_DISABLE_CMD 0x04
61#define READ_STATUS_CMD 0x05
62#define WRITE_ENABLE_CMD 0x06
63#define VOLATILE_WRITE_ENABLE_CMD 0x50
64#define QUAD_MODE_ENABLE_BIT 0x06
65#define FAST_READ_CMD 0x0B
66#define DUAL_READ_CMD 0x3B
67#define QUAD_READ_CMD 0x6B
68#define BULK_ERASE_CMD 0xC7
69#define SEC_ERASE_CMD 0xD8
72#define READ_CONFIG_CMD 0x35
73#define WRITE_CONFIG_CMD 0x01
74#define ENTER_4B_ADDR_MODE 0xB7
75#define EXIT_4B_ADDR_MODE 0xE9
76#define EXIT_4B_ADDR_MODE_ISSI 0x29
78#define READ_CMD_4B 0x13
79#define FAST_READ_CMD_4B 0x0C
80#define DUAL_READ_CMD_4B 0x3C
81#define QUAD_READ_CMD_4B 0x6C
82#define WRITE_CMD_4B 0x12
83#define SEC_ERASE_CMD_4B 0xDC
85#define BANK_REG_RD 0x16
86#define BANK_REG_WR 0x17
87#define READ_ECCSR 0x18
89#define EXTADD_REG_RD 0xC8
90#define EXTADD_REG_WR 0xC5
91#define DIE_ERASE_CMD 0xC4
92#define READ_FLAG_STATUS_CMD 0x70
94#define WRITE_STATUS_REG_2_CMD 0x31
95#define READ_STATUS_REG_2_CMD 0x35
96#define WB_QUAD_MODE_ENABLE_BIT 0x01
105#define COMMAND_OFFSET 0
106#define ADDRESS_1_OFFSET 1
107#define ADDRESS_2_OFFSET 2
108#define ADDRESS_3_OFFSET 3
109#define ADDRESS_4_OFFSET 4
113#define DUMMY_OFFSET 4
119#define DUMMY_CLOCKS 8
123#define BULK_ERASE_SIZE 1
124#define SEC_ERASE_SIZE 4
125#define BANK_SEL_SIZE 2
134#define DIE_ERASE_SIZE 4
141#define OVERHEAD_SIZE 4
146#define FLASH1BASE 0x0000000
151#define SIXTEENMB 0x1000000
157#define FLASH_QUAD_EN_MASK 0x02
159#define FLASH_SRWD_MASK 0x80
164#define BANKMASK 0xF000000
169#define BUSWIDTH_SINGLE 0
170#define BUSWIDTH_DOUBLE 1
185#define MICRON_ID_BYTE0 0x20
186#define SPANSION_ID_BYTE0 0x01
187#define WINBOND_ID_BYTE0 0xEF
188#define MACRONIX_ID_BYTE0 0xC2
189#define ISSI_ID_BYTE0 0x9D
222 0x8000, 0x800000, 0xFFFF0000, 1},
225 0x10000, 0x1000000, 0xFFFF0000, 1},
228 0x20000, 0x2000000, 0xFFFF0000, 1},
231 0x20000, 0x4000000, 0xFFFC0000, 1},
236 0x10000, 0x1000000, 0xFFFF0000, 1},
239 0x10000, 0x1000000, 0xFFFF0000, 1},
242 0x20000, 0x2000000, 0xFFFF0000, 1},
245 0x20000, 0x2000000, 0xFFFF0000, 1},
248 0x40000, 0x4000000, 0xFFFF0000, 2},
251 0x40000, 0x4000000, 0xFFFF0000, 2},
254 0x80000, 0x8000000, 0xFFFF0000, 4},
257 0x80000, 0x8000000, 0xFFFF0000, 4},
260 0x100000, 0x10000000, 0xFFFF0000, 4},
263 0x100000, 0x10000000, 0xFFFF0000, 4},
267 0x10000, 0x1000000, 0xFFFF0000, 1},
270 0x10000, 0x1000000, 0xFFFF0000, 1},
273 0x100000, 0x10000000, 0xFFFF0000, 4},
277 0x80000, 0x8000000, 0xFFFF0000, 4},
280 0x80000, 0x8000000, 0xFFFF0000, 4},
283 0x80000, 0x8000000, 0xFFFF0000, 4},
286 0x100000, 0x10000000, 0xFFFF0000, 1},
289 0x100000, 0x10000000, 0xFFFF0000, 1},
293 0x1000, 0x100000, 0xFFFF0000, 1},
296 0x1000, 0x100000, 0xFFFF0000, 1},
299 0x2000, 0x200000, 0xFFFF0000, 1},
302 0x2000, 0x200000, 0xFFFF0000, 1},
305 0x4000, 0x400000, 0xFFFF0000, 1},
308 0x4000, 0x400000, 0xFFFF0000, 1},
311 0x8000, 0x800000, 0xFFFF0000, 1},
314 0x8000, 0x800000, 0xFFFF0000, 1},
317 0x10000, 0x1000000, 0xFFFF0000, 1},
320 0x10000, 0x1000000, 0xFFFF0000, 1},
323 0x20000, 0x2000000, 0xFFFF0000, 1},
326 0x20000, 0x2000000, 0xFFFF0000, 1},
329 0x40000, 0x4000000, 0xFFFF0000, 2},
332 0x40000, 0x4000000, 0xFFFF0000, 2},
335 0x80000, 0x8000000, 0xFFFF0000, 1},
338 0x80000, 0x8000000, 0xFFFF0000, 1}
341static INLINE u32 CalculateFCTIndex(u32 ReadId, u32 *FCTIndex)
345 for (Index = 0; Index <
sizeof(Flash_Config_Table)/
sizeof(Flash_Config_Table[0]);
347 if (ReadId == Flash_Config_Table[Index].jedec_id) {
#define NUM_OF_SECTORS512
Definition: xqspipsu.h:306
#define NUM_OF_SECTORS16
Definition: xqspipsu.h:301
#define SECTOR_SIZE_256K
Definition: xqspipsu.h:313
#define NUM_OF_SECTORS1024
Definition: xqspipsu.h:307
#define NUM_OF_SECTORS256
Definition: xqspipsu.h:305
#define NUM_OF_SECTORS64
Definition: xqspipsu.h:303
#define NUM_OF_SECTORS2048
Definition: xqspipsu.h:308
#define NUM_OF_SECTORS32
Definition: xqspipsu.h:302
#define NUM_OF_SECTORS4096
Definition: xqspipsu.h:309
#define BYTES256_PER_PAGE
Definition: xqspipsu.h:290
#define NUM_OF_SECTORS128
Definition: xqspipsu.h:304
#define SECTOR_SIZE_64K
Definition: xqspipsu.h:311
#define BYTES512_PER_PAGE
Definition: xqspipsu.h:291
Definition: xqspipsu_flash_config.h:179