12 #define SERIAL_FLASH_READ_SFDP (0x5AU)
13 #define SERIAL_FLASH_READ_MANUFACTURE_ID (0x9FU)
16 #define SFDP_SIGNATURE (0x50444653UL)
17 #define SFDP_VERSION_MAJOR_1_0 (1U)
18 #define SFDP_VERSION_MINOR_0 (0U)
19 #define SFDP_VERSION_MINOR_A (5U)
20 #define SFDP_VERSION_MINOR_B (6U)
21 #define SFDP_VERSION_MINOR_C (7U)
22 #define SFDP_VERSION_MINOR_D (8U)
23 #define SFDP_BASIC_PROTOCOL_TABLE_SIZE_REV0 (36U)
24 #define SFDP_BASIC_PROTOCOL_TABLE_SIZE_REVA (64U)
25 #define SFDP_BASIC_PROTOCOL_TABLE_SIZE_REVB SFDP_BASIC_PROTOCOL_TABLE_SIZE_REVA
26 #define SFDP_BASIC_PROTOCOL_TABLE_SIZE_REVC (80U)
27 #define SFDP_BASIC_PROTOCOL_TABLE_SIZE_REVD SFDP_BASIC_PROTOCOL_TABLE_SIZE_REVC
29 typedef union _sfdp_header {
35 uint8_t param_hdr_num;
36 uint8_t sfdp_access_protocol;
42 #define PARAMETER_ID_BASIC_SPIPROTOCOL (0xFF00U)
44 #define PARAMETER_ID_SECTOR_MAP (0xFF81U)
45 #define PARAMETER_ID_4BYTEADDRESS_INSTRUCTION_TABLE (0xFF84U)
47 #define PARAMETER_ID_XSPIPROFILE1_0 (0xFF05U)
48 #define PARAMETER_ID_XSPIOROFILE2_0 (0xFF06U)
49 #define PARAMETER_ID_STACTRLCFGREGMAP (0xFF87U)
50 #define PARAMETER_ID_OPIENABLESEQ (0xFF09U)
51 #define PARAMETER_ID_CMDSEQ_CHANGE_TO_OCTAL_DDR (0xFF0AU)
53 #define NORFLASH_ADDRESSBITS_3B (0U)
54 #define NORFLASH_ADDRESSBITS_3B_4B (1U)
55 #define NORFLASH_ADDRESSBITS_4B (2U)
57 #define COMMAND_EXTENSION_SAME_AS_COMMAND (0U)
58 #define COMMAND_EXTENSION_INVERSE_OF_COMMAND (1U)
59 #define COMMAND_AND_COMMANDEXTENSION_16BITWORD (2U)
62 #define ENTER_OCTAL_MODE_OPTION0 HPM_BITSMASK(1U, 1)
63 #define ENTER_OCTAL_MODE_OPTION1 HPM_BITSMASK(1U, 2)
66 typedef union _sfdp_parameter_header {
69 uint8_t parameter_id_lsb;
72 uint8_t table_length_in_32bit;
73 uint8_t parameter_table_pointer[3];
74 uint8_t parameter_id_msb;
80 typedef union _jedec_flash_param_table {
84 uint32_t erase_size : 2;
85 uint32_t write_granularity : 1;
86 uint32_t reserved0 : 2;
88 uint32_t erase4k_inst : 8;
89 uint32_t support_1_1_2_fast_read : 1;
90 uint32_t address_bits : 2;
91 uint32_t support_ddr_clocking : 1;
92 uint32_t support_1_2_2_fast_read : 1;
93 uint32_t supports_1_4_4_fast_read : 1;
94 uint32_t support_1_1_4_fast_read : 1;
97 uint32_t flash_density;
99 uint32_t dummy_clocks_1_4_4_read : 5;
100 uint32_t mode_clocks_1_4_4_read : 3;
101 uint32_t inst_1_4_4_read : 8;
102 uint32_t dummy_clocks_1_1_4_read : 5;
103 uint32_t mode_clocks_1_1_4_read : 3;
104 uint32_t inst_1_1_4_read : 8;
107 uint32_t dummy_clocks_1_1_2_read : 5;
108 uint32_t mode_clocks_1_1_2_read : 3;
109 uint32_t inst_1_1_2_read : 8;
110 uint32_t dummy_clocks_1_2_2_read : 5;
111 uint32_t mode_clocks_1_2_2_read : 3;
112 uint32_t inst_1_2_2_read : 8;
116 uint32_t support_2_2_2_fast_read : 1;
117 uint32_t reserved0 : 3;
118 uint32_t support_4_4_4_fast_read : 1;
119 uint32_t reserved1 : 27;
123 uint32_t reserved0 : 16;
124 uint32_t dummy_clocks_2_2_2_read : 5;
125 uint32_t mode_clocks_2_2_2_read : 3;
126 uint32_t inst_2_2_2_read : 8;
129 uint32_t reserved0 : 16;
130 uint32_t dummy_clocks_4_4_4_read : 5;
131 uint32_t mode_clocks_4_4_4_read : 3;
132 uint32_t inst_4_4_4_read : 8;
140 uint32_t erase_timing;
142 uint32_t reserved0 : 4;
143 uint32_t page_size : 4;
144 uint32_t reserved1 : 24;
145 } chip_erase_progrm_info;
148 uint32_t suspend_resume_spec;
149 uint32_t suspend_resume_inst;
150 } suspend_resume_info;
153 uint32_t reserved0 : 2;
154 uint32_t busy_status_polling : 6;
155 uint32_t reserved1 : 24;
159 uint32_t mode_4_4_4_disable_seq : 4;
160 uint32_t mode_4_4_4_enable_seq : 5;
161 uint32_t support_mode_0_4_4 : 1;
162 uint32_t mode_0_4_4_exit_method : 6;
163 uint32_t mode_0_4_4_entry_method : 4;
164 uint32_t quad_enable_requirement : 3;
165 uint32_t hold_reset_disable : 1;
166 uint32_t reserved0 : 8;
170 uint32_t status_reg_write_enable : 7;
171 uint32_t reserved0 : 1;
172 uint32_t soft_reset_rescue_support : 6;
173 uint32_t exit_4_byte_addressing : 10;
174 uint32_t enter_4_byte_addrssing : 8;
178 uint32_t dummy_clocks_1_8_8_read : 5;
179 uint32_t mode_clocks_1_8_8_read : 3;
180 uint32_t inst_1_8_8_read : 8;
181 uint32_t dummy_clocks_1_1_8_read : 5;
182 uint32_t mode_clocks_1_1_8_read : 3;
183 uint32_t inst_1_1_8_read : 8;
187 uint32_t reserved : 18;
188 uint32_t output_driver_strength : 5;
189 uint32_t jedec_spi_protocol_reset : 1;
190 uint32_t dqs_waveform_type_sdr : 2;
191 uint32_t dqs_support_in_qpi_sdr : 1;
192 uint32_t dqs_support_in_qpi_ddr : 1;
193 uint32_t dqs_support_in_opi_str : 1;
194 uint32_t cmd_and_extension_in_opi_ddr : 2;
195 uint32_t byte_order_in_opi_ddr : 1;
199 uint32_t opi_sdr_disable_seq : 4;
200 uint32_t opi_sdr_enable_seq : 5;
201 uint32_t support_mode_0_8_8 : 1;
202 uint32_t mode_0_8_8_exit_method : 6;
203 uint32_t mode_0_8_8_entry_method : 4;
204 uint32_t octal_enable_requirement : 3;
205 uint32_t reserved : 9;
209 uint32_t qpi_sdr_no_dqs : 4;
210 uint32_t qpi_sdr_with_dqs : 4;
211 uint32_t qpi_ddr_no_dqs : 4;
212 uint32_t qpi_ddr_with_dqs : 4;
213 uint32_t opi_sdr_no_dqs : 4;
214 uint32_t opi_sdr_with_dqs : 4;
215 uint32_t opi_ddr_no_dqs : 4;
216 uint32_t opi_ddr_with_dqs : 4;
217 } max_speed_info_xpi;
223 typedef union _jedec_4byte_addressing_inst_table {
227 uint32_t support_1_1_1_read : 1;
228 uint32_t support_1_1_1_fast_read : 1;
229 uint32_t support_1_1_2_fast_read : 1;
230 uint32_t support_1_2_2_fast_read : 1;
231 uint32_t support_1_1_4_fast_read : 1;
232 uint32_t support_1_4_4_fast_read : 1;
233 uint32_t support_1_1_1_page_program : 1;
234 uint32_t support_1_1_4_page_program : 1;
235 uint32_t support_1_4_4_page_program : 1;
236 uint32_t support_erase_type1_size : 1;
237 uint32_t support_erase_type2_size : 1;
238 uint32_t support_erase_type3_size : 1;
239 uint32_t support_erase_type4_size : 1;
240 uint32_t support_1_1_1_dtr_read : 1;
241 uint32_t support_1_2_2_dtr_read : 1;
242 uint32_t support_1_4_4_dtr_read : 1;
243 uint32_t support_volatile_sector_lock_read_cmd : 1;
244 uint32_t support_volatile_sector_lock_write_cmd : 1;
245 uint32_t support_nonvolatile_sector_lock_read_cmd : 1;
246 uint32_t support_nonvolatile_sector_lock_write_cmd : 1;
247 uint32_t reserved : 12;
248 } cmd_4byte_support_info;
251 uint8_t erase_inst[4];
256 typedef union _jedec_cmd_sequence_change_to_octal_mode {
261 uint32_t byte3_of_1st_command_seq : 8;
262 uint32_t byte2_of_1st_command_seq : 8;
263 uint32_t byte1_of_1st_command_seq : 8;
264 uint32_t length_of_1st_command_seq : 8;
265 } first_command_sequence_low;
268 uint32_t byte7_of_first_command_seq : 8;
269 uint32_t byte6_of_first_command_seq : 8;
270 uint32_t byte5_of_first_command_seq : 8;
271 uint32_t byte4_of_first_command_seq : 8;
272 } first_command_sequence_high;
275 uint32_t byte3_of_2nd_command_seq : 8;
276 uint32_t byte2_of_2nd_command_seq : 8;
277 uint32_t byte1_of_2nd_command_seq : 8;
278 uint32_t length_of_2nd_command_seq : 8;
279 } second_command_sequence_low;
282 uint32_t byte7_of_2nd_command_seq : 8;
283 uint32_t byte6_of_2nd_command_seq : 8;
284 uint32_t byte5_of_2nd_command_seq : 8;
285 uint32_t byte4_of_2md_command_seq : 8;
286 } second_command_sequence_high;
289 uint32_t byte3_of_3rd_command_seq : 8;
290 uint32_t byte2_of_3rd_command_seq : 8;
291 uint32_t byte1_of_3rd_command_seq : 8;
292 uint32_t length_of_3rd_command_seq : 8;
293 } third_command_sequence_low;
296 uint32_t byte7_of_3rd_command_seq : 8;
297 uint32_t byte6_of_3rd_command_seq : 8;
298 uint32_t byte5_of_3rd_command_seq : 8;
299 uint32_t byte4_of_3rd_command_seq : 8;
300 } third_command_sequence_high;
303 uint32_t byte3_of_4th_command_seq : 8;
304 uint32_t byte2_of_4th_command_seq : 8;
305 uint32_t byte1_of_4th_command_seq : 8;
306 uint32_t length_of_4th_command_seq : 8;
307 } fourth_command_sequence_low;
310 uint32_t byte7_of_4th_command_seq : 8;
311 uint32_t byte6_of_4th_command_seq : 8;
312 uint32_t byte5_of_4th_command_seq : 8;
313 uint32_t byte4_of_4th_command_seq : 8;
314 } fourth_command_sequence_high;
319 typedef union _jedec_x_spi_profile1_0_table_t {
324 uint32_t fast_read_wrapped_cmd : 8;
325 uint32_t fast_read_cmd : 8;
326 uint32_t reserved : 16;
330 uint32_t write_nv_register_cmd : 8;
331 uint32_t write_v_register_cmd : 8;
332 uint32_t reserved : 16;
335 uint32_t unused_tables[3];
340 typedef union _jedec_status_control_configuration_reg_map {
343 uint32_t unused_table[2];
345 uint32_t dummy_cycles_1s_1s_1s : 4;
346 uint32_t reserved0 : 2;
347 uint32_t dummy_cycles_8d_8d_8d : 4;
348 uint32_t dummy_cycles_8s_8s_8s : 4;
349 uint32_t dummy_cycles_4s_4d_4d : 4;
350 uint32_t dummy_cycles_4s_4s_4s : 4;
351 uint32_t dummy_cycles_2s_2s_2s : 4;
352 uint32_t dummy_cycles_1s_1s_1s_select : 2;
353 uint32_t addr_bytes_address_status_register : 2;
354 uint32_t unused0 : 2;
356 uint32_t unused_table1[25];
360 typedef struct _jdec_query_table {
361 uint32_t standard_version;
362 uint32_t flash_param_tbl_size;
364 bool has_4b_addressing_inst_table;
366 bool has_otcal_ddr_mode_enable_sequence_table;
369 bool has_spi_profile1_0_table;
376 #define SERIALNOR_CMD_BASICREAD_3B (0x03U)
377 #define SERIALNOR_CMD_BASICREAD_4B (0x13U)
378 #define SERIALNOR_CMD_PAGEPROGRAM_1_1_1_3B (0x02U)
379 #define SERIALNOR_CMD_PAGEPROGRAM_1_1_1_4B (0x12U)
380 #define SERIALNOR_CMD_PAGEPROGRAM_1_4_4_4B (0x3EU)
381 #define SERIALNOR_CMD_PAGEPROGRAM_1_1_4_4B (0x34U)
382 #define SERIALNOR_CMD_READ_SDR_1_4_4_3B (0xEBU)
383 #define SERIALNOR_CMD_READ_DDR_1_4_4_3B (0xEDU)
384 #define SERIALNOR_CMD_READ_SDR_1_4_4_4B (0xECU)
385 #define SERIALNOR_CMD_READ_SDR_1_1_4_4B (0x6CU)
386 #define SERIALNOR_CMD_READ_DDR_1_4_4_4B (0xEEU)
387 #define SERIALNOR_CMD_CHIPERASE (0x60U)
388 #define SERIALNOR_CMD_WRITEENABLE (0x06U)
389 #define SERIALNOR_CMD_WRITE_STATUS_REG1 (0x01U)
390 #define SERIALNOR_CMD_READ_STATUS_REG1 (0x05U)
391 #define SERIALNOR_CMD_WRITE_STATUS_REG2 (0x3EU)
392 #define SERIALNOR_CMD_READ_STATUS_REG2 (0x3FU)
393 #define SERIALNOR_CMD_READ_FLAGREG (0x70U)
394 #define SERIALNOR_CMD_READID (0x9FU)
395 #define SERIALNOR_CMD_READ_DDR_4B (0x0CU)
396 #define SERIALNOR_CMD_READ_DDR_3B (0x0BU)
397 #define SERIALNOR_CMD_SE4K_3B (0x20U)
398 #define SERIALNOR_CMD_SE4K_4B (0x21U)
399 #define SERIALNOR_CMD_SE64K_3B (0xD8U)
400 #define SERIALNOR_CMD_SE64K_4B (0xDCU)
static void size
Definition: hpm_math.h:6938
union _sfdp_header sfdp_header_t
union _jedec_4byte_addressing_inst_table jedec_4byte_addressing_inst_table_t
struct _jdec_query_table jedec_info_table_t
union _jedec_flash_param_table jedec_flash_param_table_t
union _jedec_status_control_configuration_reg_map jedec_status_control_configuration_reg_map_t
union _jedec_x_spi_profile1_0_table_t jedec_x_spi_profile1_0_table_t
union _jedec_cmd_sequence_change_to_octal_mode jedec_cmd_sequence_change_to_octal_mode_t
union _sfdp_parameter_header sfdp_parameter_header_t