5#ifndef __SPIFLASH_SFDP_H
6#define __SPIFLASH_SFDP_H
21#include <basictypes.h>
22#include <bit_overlay.h>
24#define SFDP_PROTO_XSPI_NAND_1 0xF0
25#define SFDP_PROTO_XSPI_NAND_2 0xF1
26#define SFDP_PROTO_XSPI_NAND_3_1 0xF2
27#define SFDP_PROTO_XSPI_NAND_3_2 0xF3
28#define SFDP_PROTO_SPI_NAND_1 0xF4
29#define SFDP_PROTO_SPI_NAND_2 0xF5
30#define SFDP_PROTO_SPI_NAND_3_1 0xF6
31#define SFDP_PROTO_SPI_NAND_3_2 0xF7
32#define SFDP_PROTO_XSPI_NOR_2_5BA_8W 0xFA
33#define SFDP_PROTO_XSPI_NOR_1_3BA_8W_DTR 0xFC
34#define SFDP_PROTO_XSPI_NOR_1_4BA_20W 0xFD
35#define SFDP_PROTO_XSPI_NOR_1_4BA_8W 0xFE
36#define SFDP_PROTO_XSPI_NOR_1_3BA_8W 0xFF
38#define SFDP_PARAM_BASIC_PROTO 0xFF00
39#define SFDP_PARAM_SECTOR_MAP 0xFF81
40#define SFDP_PARAM_REP_PROT_MONO_CTRS 0xFF03
41#define SFDP_PARAM_4B_ADDR_INSTR_TBL 0xFF84
42#define SFDP_PARAM_XSPI_PROFILE_1_0 0xFF05
43#define SFDP_PARAM_XSPI_PROFILE_2_0 0xFF06
44#define SFDP_PARAM_STAT_CTRL_CFG_MAP 0xFF87
45#define SFDP_PARAM_STAT_CTRL_CFG_MAP_OFFSETS 0xFF88
46#define SFDP_PARAM_STAT_CTRL_CFG_MAP_XSPI_2_0 0xFF09
47#define SFDP_PARAM_CMD_SEQ_OCTAL_DDR 0xFF0A
48#define SFDP_PARAM_LONG_LAT_NVM_MSPT 0xFF8B
49#define SFDP_PARAM_X4_QUAD_IO_WITH_DS 0xFF0C
50#define SFDP_PARAM_CMD_SEQ_QUAD_DDR 0xFF8D
52#define SFDP_PARAM_BASIC_TBL_1_0 0xFF00
54#define SFDP_SIGNATURE HTONL(0x53464450)
70}__attribute__((packed));
84 bit_overlay<23, 0,32> tblAddr;
85 bit_overlay<31,24,32> paramID_msb;
87 }__attribute__((packed));
89 inline uint16_t id() {
return (((uint32_t)paramID_msb) << 8) | (uint16_t)paramID_lsb; }
90}__attribute__((packed));
92#define BEGIN_FIELD(n, sz) union { \
93 uint##sz##_t __val_##n;
94#define END_FIELD() }__attribute__((packed));
95#define BITS(e, s, w, name) __BITS(e, s, w, name, #name)
96#define BIT(e, w, name) __BITS(e, e, w, name, #name)
97#define BITS_PRETTY(e, s, w, name, lbl) __BITS(e, s, w, name, lbl)
98#define BIT_PRETTY(e, w, name, lbl) __BITS(e, e, w, name, lbl)
100struct sfdpBasicFlashTbl_1_0
104#define BEGIN_FIELD(n, sz) union { \
105 uint##sz##_t __val_##n;
106#define END_FIELD() }__attribute__((packed));
107#define __BITS(e, s, w, name, lbl) bit_overlay<e,s,w> name;
108#include "sfdp_basic_tbl_1_0.inc"
112 }__attribute__((packed));
116 }__attribute__((packed));
117}__attribute__((packed));
119struct sfdpBasicFlashTbl_1_5
123#define BEGIN_FIELD(n, sz) union { \
124 uint##sz##_t __val_##n;
125#define END_FIELD() }__attribute__((packed));
126#define __BITS(e, s, w, name, lbl) bit_overlay<e,s,w> name;
127#include "sfdp_basic_tbl_1_5.inc"
131 }__attribute__((packed));
136}__attribute__((packed));