TianoCore EDK2 master
Loading...
Searching...
No Matches
Nvme.h
Go to the documentation of this file.
1
18#ifndef __NVM_E_H__
19#define __NVM_E_H__
20
21#pragma pack(1)
22
23//
24// controller register offsets
25//
26#define NVME_CAP_OFFSET 0x0000 // Controller Capabilities
27#define NVME_VER_OFFSET 0x0008 // Version
28#define NVME_INTMS_OFFSET 0x000c // Interrupt Mask Set
29#define NVME_INTMC_OFFSET 0x0010 // Interrupt Mask Clear
30#define NVME_CC_OFFSET 0x0014 // Controller Configuration
31#define NVME_CSTS_OFFSET 0x001c // Controller Status
32#define NVME_NSSR_OFFSET 0x0020 // NVM Subsystem Reset (Optional)
33#define NVME_AQA_OFFSET 0x0024 // Admin Queue Attributes
34#define NVME_ASQ_OFFSET 0x0028 // Admin Submission Queue Base Address
35#define NVME_ACQ_OFFSET 0x0030 // Admin Completion Queue Base Address
36#define NVME_CMBLOC_OFFSET 0x0038 // Control Memory Buffer Location (Optional)
37#define NVME_CMBSZ_OFFSET 0x003C // Control Memory Buffer Size (Optional)
38#define NVME_BPINFO_OFFSET 0x0040 // Boot Partition Information
39#define NVME_BPRSEL_OFFSET 0x0044 // Boot Partition Read Select
40#define NVME_BPMBL_OFFSET 0x0048 // Boot Partition Memory Buffer Location
41#define NVME_SQ0_OFFSET 0x1000 // Submission Queue 0 (admin) Tail Doorbell
42#define NVME_CQ0_OFFSET 0x1004 // Completion Queue 0 (admin) Head Doorbell
43
44//
45// These register offsets are defined as 0x1000 + (N * (4 << CAP.DSTRD))
46// Get the doorbell stride bit shift value from the controller capabilities.
47//
48#define NVME_SQTDBL_OFFSET(QID, DSTRD) 0x1000 + ((2 * (QID)) * (4 << (DSTRD))) // Submission Queue y (NVM) Tail Doorbell
49#define NVME_CQHDBL_OFFSET(QID, DSTRD) 0x1000 + (((2 * (QID)) + 1) * (4 << (DSTRD))) // Completion Queue y (NVM) Head Doorbell
50
51#pragma pack(1)
52
53//
54// 3.1.1 Offset 00h: CAP - Controller Capabilities
55//
56typedef struct {
57 UINT16 Mqes; // Maximum Queue Entries Supported
58 UINT8 Cqr : 1; // Contiguous Queues Required
59 UINT8 Ams : 2; // Arbitration Mechanism Supported
60 UINT8 Rsvd1 : 5;
61 UINT8 To; // Timeout
62 UINT16 Dstrd : 4; // Doorbell Stride
63 UINT16 Nssrs : 1; // NVM Subsystem Reset Supported NSSRS
64 UINT16 Css : 8; // Command Sets Supported - Bit 37
65 UINT16 Bps : 1; // Boot Partition Support - Bit 45 in NVMe1.4
66 UINT16 Rsvd3 : 2;
67 UINT8 Mpsmin : 4; // Memory Page Size Minimum
68 UINT8 Mpsmax : 4; // Memory Page Size Maximum
69 UINT8 Pmrs : 1; // Persistent Memory Region Supported
70 UINT8 Cmbs : 1; // Controller Memory Buffer Supported
71 UINT8 Rsvd4 : 6;
72} NVME_CAP;
73
74//
75// 3.1.2 Offset 08h: VS - Version
76//
77typedef struct {
78 UINT16 Mnr; // Minor version number
79 UINT16 Mjr; // Major version number
80} NVME_VER;
81
82//
83// 3.1.5 Offset 14h: CC - Controller Configuration
84//
85typedef struct {
86 UINT16 En : 1; // Enable
87 UINT16 Rsvd1 : 3;
88 UINT16 Css : 3; // I/O Command Set Selected
89 UINT16 Mps : 4; // Memory Page Size
90 UINT16 Ams : 3; // Arbitration Mechanism Selected
91 UINT16 Shn : 2; // Shutdown Notification
92 UINT8 Iosqes : 4; // I/O Submission Queue Entry Size
93 UINT8 Iocqes : 4; // I/O Completion Queue Entry Size
94 UINT8 Rsvd2;
95} NVME_CC;
96#define NVME_CC_SHN_NORMAL_SHUTDOWN 1
97#define NVME_CC_SHN_ABRUPT_SHUTDOWN 2
98
99//
100// 3.1.6 Offset 1Ch: CSTS - Controller Status
101//
102typedef struct {
103 UINT32 Rdy : 1; // Ready
104 UINT32 Cfs : 1; // Controller Fatal Status
105 UINT32 Shst : 2; // Shutdown Status
106 UINT32 Nssro : 1; // NVM Subsystem Reset Occurred
107 UINT32 Rsvd1 : 27;
108} NVME_CSTS;
109#define NVME_CSTS_SHST_SHUTDOWN_OCCURRING 1
110#define NVME_CSTS_SHST_SHUTDOWN_COMPLETED 2
111//
112// 3.1.8 Offset 24h: AQA - Admin Queue Attributes
113//
114typedef struct {
115 UINT16 Asqs : 12; // Submission Queue Size
116 UINT16 Rsvd1 : 4;
117 UINT16 Acqs : 12; // Completion Queue Size
118 UINT16 Rsvd2 : 4;
119} NVME_AQA;
120
121//
122// 3.1.9 Offset 28h: ASQ - Admin Submission Queue Base Address
123//
124#define NVME_ASQ UINT64
125//
126// 3.1.10 Offset 30h: ACQ - Admin Completion Queue Base Address
127//
128#define NVME_ACQ UINT64
129
130//
131// 3.1.13 Offset 40h: BPINFO - Boot Partition Information
132//
133typedef struct {
134 UINT32 Bpsz : 15; // Boot Partition Size
135 UINT32 Rsvd1 : 9;
136 UINT32 Brs : 2; // Boot Read Status
137 UINT32 Rsvd2 : 5;
138 UINT32 Abpid : 1; // Active Boot Partition ID
140
141//
142// 3.1.14 Offset 44h: BPRSEL - Boot Partition Read Select
143//
144typedef struct {
145 UINT32 Bprsz : 10; // Boot Partition Read Size
146 UINT32 Bprof : 20; // Boot Partition Read Offset
147 UINT32 Rsvd1 : 1;
148 UINT32 Bpid : 1; // Boot Partition Identifier
150
151//
152// 3.1.15 Offset 48h: BPMBL - Boot Partition Memory Buffer Location (Optional)
153//
154typedef struct {
155 UINT64 Rsvd1 : 12;
156 UINT64 Bmbba : 52; // Boot Partition Memory Buffer Base Address
157} NVME_BPMBL;
158
159//
160// 3.1.25 Offset (1000h + ((2y) * (4 << CAP.DSTRD))): SQyTDBL - Submission Queue y Tail Doorbell
161//
162typedef struct {
163 UINT16 Sqt;
164 UINT16 Rsvd1;
166
167//
168// 3.1.12 Offset (1000h + ((2y + 1) * (4 << CAP.DSTRD))): CQyHDBL - Completion Queue y Head Doorbell
169//
170typedef struct {
171 UINT16 Cqh;
172 UINT16 Rsvd1;
174
175//
176// NVM command set structures
177//
178// Read Command
179//
180typedef struct {
181 //
182 // CDW 10, 11
183 //
184 UINT64 Slba; /* Starting Sector Address */
185 //
186 // CDW 12
187 //
188 UINT16 Nlb; /* Number of Sectors */
189 UINT16 Rsvd1 : 10;
190 UINT16 Prinfo : 4; /* Protection Info Check */
191 UINT16 Fua : 1; /* Force Unit Access */
192 UINT16 Lr : 1; /* Limited Retry */
193 //
194 // CDW 13
195 //
196 UINT32 Af : 4; /* Access Frequency */
197 UINT32 Al : 2; /* Access Latency */
198 UINT32 Sr : 1; /* Sequential Request */
199 UINT32 In : 1; /* Incompressible */
200 UINT32 Rsvd2 : 24;
201 //
202 // CDW 14
203 //
204 UINT32 Eilbrt; /* Expected Initial Logical Block Reference Tag */
205 //
206 // CDW 15
207 //
208 UINT16 Elbat; /* Expected Logical Block Application Tag */
209 UINT16 Elbatm; /* Expected Logical Block Application Tag Mask */
210} NVME_READ;
211
212//
213// Write Command
214//
215typedef struct {
216 //
217 // CDW 10, 11
218 //
219 UINT64 Slba; /* Starting Sector Address */
220 //
221 // CDW 12
222 //
223 UINT16 Nlb; /* Number of Sectors */
224 UINT16 Rsvd1 : 10;
225 UINT16 Prinfo : 4; /* Protection Info Check */
226 UINT16 Fua : 1; /* Force Unit Access */
227 UINT16 Lr : 1; /* Limited Retry */
228 //
229 // CDW 13
230 //
231 UINT32 Af : 4; /* Access Frequency */
232 UINT32 Al : 2; /* Access Latency */
233 UINT32 Sr : 1; /* Sequential Request */
234 UINT32 In : 1; /* Incompressible */
235 UINT32 Rsvd2 : 24;
236 //
237 // CDW 14
238 //
239 UINT32 Ilbrt; /* Initial Logical Block Reference Tag */
240 //
241 // CDW 15
242 //
243 UINT16 Lbat; /* Logical Block Application Tag */
244 UINT16 Lbatm; /* Logical Block Application Tag Mask */
245} NVME_WRITE;
246
247//
248// Flush
249//
250typedef struct {
251 //
252 // CDW 10
253 //
254 UINT32 Flush; /* Flush */
255} NVME_FLUSH;
256
257//
258// Write Uncorrectable command
259//
260typedef struct {
261 //
262 // CDW 10, 11
263 //
264 UINT64 Slba; /* Starting LBA */
265 //
266 // CDW 12
267 //
268 UINT32 Nlb : 16; /* Number of Logical Blocks */
269 UINT32 Rsvd1 : 16;
271
272//
273// Write Zeroes command
274//
275typedef struct {
276 //
277 // CDW 10, 11
278 //
279 UINT64 Slba; /* Starting LBA */
280 //
281 // CDW 12
282 //
283 UINT16 Nlb; /* Number of Logical Blocks */
284 UINT16 Rsvd1 : 10;
285 UINT16 Prinfo : 4; /* Protection Info Check */
286 UINT16 Fua : 1; /* Force Unit Access */
287 UINT16 Lr : 1; /* Limited Retry */
288 //
289 // CDW 13
290 //
291 UINT32 Rsvd2;
292 //
293 // CDW 14
294 //
295 UINT32 Ilbrt; /* Initial Logical Block Reference Tag */
296 //
297 // CDW 15
298 //
299 UINT16 Lbat; /* Logical Block Application Tag */
300 UINT16 Lbatm; /* Logical Block Application Tag Mask */
302
303//
304// Compare command
305//
306typedef struct {
307 //
308 // CDW 10, 11
309 //
310 UINT64 Slba; /* Starting LBA */
311 //
312 // CDW 12
313 //
314 UINT16 Nlb; /* Number of Logical Blocks */
315 UINT16 Rsvd1 : 10;
316 UINT16 Prinfo : 4; /* Protection Info Check */
317 UINT16 Fua : 1; /* Force Unit Access */
318 UINT16 Lr : 1; /* Limited Retry */
319 //
320 // CDW 13
321 //
322 UINT32 Rsvd2;
323 //
324 // CDW 14
325 //
326 UINT32 Eilbrt; /* Expected Initial Logical Block Reference Tag */
327 //
328 // CDW 15
329 //
330 UINT16 Elbat; /* Expected Logical Block Application Tag */
331 UINT16 Elbatm; /* Expected Logical Block Application Tag Mask */
333
334typedef union {
335 NVME_READ Read;
336 NVME_WRITE Write;
337 NVME_FLUSH Flush;
338 NVME_WRITE_UNCORRECTABLE WriteUncorrectable;
339 NVME_WRITE_ZEROES WriteZeros;
340 NVME_COMPARE Compare;
341} NVME_CMD;
342
343typedef struct {
344 UINT16 Mp; /* Maximum Power */
345 UINT8 Rsvd1; /* Reserved as of Nvm Express 1.1 Spec */
346 UINT8 Mps : 1; /* Max Power Scale */
347 UINT8 Nops : 1; /* Non-Operational State */
348 UINT8 Rsvd2 : 6; /* Reserved as of Nvm Express 1.1 Spec */
349 UINT32 Enlat; /* Entry Latency */
350 UINT32 Exlat; /* Exit Latency */
351 UINT8 Rrt : 5; /* Relative Read Throughput */
352 UINT8 Rsvd3 : 3; /* Reserved as of Nvm Express 1.1 Spec */
353 UINT8 Rrl : 5; /* Relative Read Latency */
354 UINT8 Rsvd4 : 3; /* Reserved as of Nvm Express 1.1 Spec */
355 UINT8 Rwt : 5; /* Relative Write Throughput */
356 UINT8 Rsvd5 : 3; /* Reserved as of Nvm Express 1.1 Spec */
357 UINT8 Rwl : 5; /* Relative Write Latency */
358 UINT8 Rsvd6 : 3; /* Reserved as of Nvm Express 1.1 Spec */
359 UINT8 Rsvd7[16]; /* Reserved as of Nvm Express 1.1 Spec */
361
362typedef struct {
363 UINT32 Ces : 1; /* Crypto Erase Supported */
364 UINT32 Bes : 1; /* Block Erase Supported */
365 UINT32 Ows : 1; /* Overwrite Supported */
366 UINT32 Rsvd1 : 26; /* Reserved as of NVM Express 2.0c Spec */
367 UINT32 Ndi : 1; /* No-Deallocate Inhibited */
368 UINT32 Nodmmas : 2; /* No-Deallocate Modifies Media After Sanitize */
370
371//
372// Power Loss Signaling Information
373// (ref. spec. v2.1 Figure 312).
374//
375#define PLS_EMERGENCY_POWER_FAIL BIT0
376#define PLS_FORCED_QUIESCENCE BIT1
377
378//
379// Identify Controller Data
380//
381typedef struct {
382 //
383 // Controller Capabilities and Features 0-255
384 //
385 UINT16 Vid; /* PCI Vendor ID */
386 UINT16 Ssvid; /* PCI sub-system vendor ID */
387 UINT8 Sn[20]; /* Product serial number */
388
389 UINT8 Mn[40]; /* Product model number */
390 UINT8 Fr[8]; /* Firmware Revision */
391 UINT8 Rab; /* Recommended Arbitration Burst */
392 UINT8 Ieee_oui[3]; /* Organization Unique Identifier */
393 UINT8 Cmic; /* Multi-interface Capabilities */
394 UINT8 Mdts; /* Maximum Data Transfer Size */
395 UINT8 Cntlid[2]; /* Controller ID */
396 UINT32 Ver; /* Version */
397 UINT32 Rtd3r; /* RTD3 Resume Latency */
398 UINT32 Rtd3e; /* RTD3 Entry Latency */
399 UINT32 Oaes; /* Optional Async Events Supported */
400 UINT32 Ctratt; /* Controller Attributes */
401 UINT16 Rrls; /* Read Recovery Levels Supported */
402 UINT8 Rsvd1[8]; /* Reserved as of NVM Express 1.4c Spec */
403 UINT8 Plsi; /* Power Loss Signaling Information */
404 UINT8 Cntrltype; /* Controller Type */
405 UINT8 Fguid[16]; /* FRU Globally Unique Identifier */
406 UINT16 Crdt1; /* Command Retry Delay Time 1 */
407 UINT16 Crdt2; /* Command Retry Delay Time 2 */
408 UINT16 Crdt3; /* Command Retry Delay Time 3 */
409 UINT8 Rsvd2[106]; /* Reserved as of NVM Express 1.4c Spec */
410 UINT8 Rsvd3[16]; /* Reserved for NVMe MI Spec */
411
412 //
413 // Admin Command Set Attributes
414 //
415 UINT16 Oacs; /* Optional Admin Command Support */
416 #define NAMESPACE_MANAGEMENT_SUPPORTED BIT3
417 #define FW_DOWNLOAD_ACTIVATE_SUPPORTED BIT2
418 #define FORMAT_NVM_SUPPORTED BIT1
419 #define SECURITY_SEND_RECEIVE_SUPPORTED BIT0
420 UINT8 Acl; /* Abort Command Limit */
421 UINT8 Aerl; /* Async Event Request Limit */
422 UINT8 Frmw; /* Firmware updates */
423 UINT8 Lpa; /* Log Page Attributes */
424 UINT8 Elpe; /* Error Log Page Entries */
425 UINT8 Npss; /* Number of Power States Support */
426 UINT8 Avscc; /* Admin Vendor Specific Command Configuration */
427 UINT8 Apsta; /* Autonomous Power State Transition Attributes */
428 //
429 // Below fields before Rsvd2 are defined in NVM Express 1.4 Spec
430 //
431 UINT16 Wctemp; /* Warning Composite Temperature Threshold */
432 UINT16 Cctemp; /* Critical Composite Temperature Threshold */
433 UINT16 Mtfa; /* Maximum Time for Firmware Activation */
434 UINT32 Hmpre; /* Host Memory Buffer Preferred Size */
435 UINT32 Hmmin; /* Host Memory Buffer Minimum Size */
436 UINT8 Tnvmcap[16]; /* Total NVM Capacity */
437 UINT8 Unvmcap[16]; /* Unallocated NVM Capacity */
438 UINT32 Rpmbs; /* Replay Protected Memory Block Support */
439 UINT16 Edstt; /* Extended Device Self-test Time */
440 UINT8 Dsto; /* Device Self-test Options */
441 UINT8 Fwug; /* Firmware Update Granularity */
442 UINT16 Kas; /* Keep Alive Support */
443 UINT16 Hctma; /* Host Controlled Thermal Management Attributes */
444 UINT16 Mntmt; /* Minimum Thermal Management Temperature */
445 UINT16 Mxtmt; /* Maximum Thermal Management Temperature */
446 NVME_SANICAP Sanicap; /* Sanitize Capabilities */
447 UINT32 Hmminds; /* Host Memory Buffer Minimum Descriptor Entry Size */
448 UINT16 Hmmaxd; /* Host Memory Maximum Descriptors Entries */
449 UINT16 Nsetidmax; /* NVM Set Identifier Maximum */
450 UINT16 Endgidmax; /* Endurance Group Identifier Maximum */
451 UINT8 Anatt; /* ANA Transition Time */
452 UINT8 Anacap; /* Asymmetric Namespace Access Capabilities */
453 UINT32 Anagrpmax; /* ANA Group Identifier Maximum */
454 UINT32 Nanagrpid; /* Number of ANA Group Identifiers */
455 UINT32 Pels; /* Persistent Event Log Size */
456 UINT8 Rsvd4[156]; /* Reserved as of NVM Express 1.4c Spec */
457 //
458 // NVM Command Set Attributes
459 //
460 UINT8 Sqes; /* Submission Queue Entry Size */
461 UINT8 Cqes; /* Completion Queue Entry Size */
462 UINT16 Maxcmd; /* Maximum Outstanding Commands */
463 UINT32 Nn; /* Number of Namespaces */
464 UINT16 Oncs; /* Optional NVM Command Support */
465 UINT16 Fuses; /* Fused Operation Support */
466 UINT8 Fna; /* Format NVM Attributes */
467 UINT8 Vwc; /* Volatile Write Cache */
468 UINT16 Awun; /* Atomic Write Unit Normal */
469 UINT16 Awupf; /* Atomic Write Unit Power Fail */
470 UINT8 Nvscc; /* NVM Vendor Specific Command Configuration */
471 UINT8 Nwpc; /* Namespace Write Protection Capabilities */
472 UINT16 Acwu; /* Atomic Compare & Write Unit */
473 UINT16 Rsvd5; /* Reserved as of NVM Express 1.4c Spec */
474 UINT32 Sgls; /* SGL Support */
475 UINT32 Mnan; /* Maximum Number of Allowed Namespace */
476 UINT8 Rsvd6[224]; /* Reserved as of NVM Express 1.4c Spec */
477 UINT8 Subnqn[256]; /* NVM Subsystem NVMe Qualified Name */
478 UINT8 Rsvd7[768]; /* Reserved as of NVM Express 1.4c Spec */
479 UINT8 Rsvd8[256]; /* Reserved for NVMe over Fabrics Spec */
480 //
481 // Power State Descriptors
482 //
483 NVME_PSDESCRIPTOR PsDescriptor[32];
484
485 UINT8 VendorData[1024]; /* Vendor specific data */
487
488typedef struct {
489 UINT16 Ms; /* Metadata Size */
490 UINT8 Lbads; /* LBA Data Size */
491 UINT8 Rp : 2; /* Relative Performance */
492 #define LBAF_RP_BEST 00b
493 #define LBAF_RP_BETTER 01b
494 #define LBAF_RP_GOOD 10b
495 #define LBAF_RP_DEGRADED 11b
496 UINT8 Rsvd1 : 6; /* Reserved as of Nvm Express 1.1 Spec */
498
499//
500// Identify Namespace Data
501//
502typedef struct {
503 //
504 // NVM Command Set Specific
505 //
506 UINT64 Nsze; /* Namespace Size (total number of blocks in formatted namespace) */
507 UINT64 Ncap; /* Namespace Capacity (max number of logical blocks) */
508 UINT64 Nuse; /* Namespace Utilization */
509 UINT8 Nsfeat; /* Namespace Features */
510 UINT8 Nlbaf; /* Number of LBA Formats */
511 UINT8 Flbas; /* Formatted LBA size */
512 UINT8 Mc; /* Metadata Capabilities */
513 UINT8 Dpc; /* End-to-end Data Protection capabilities */
514 UINT8 Dps; /* End-to-end Data Protection Type Settings */
515 UINT8 Nmic; /* Namespace Multi-path I/O and Namespace Sharing Capabilities */
516 UINT8 Rescap; /* Reservation Capabilities */
517 UINT8 Rsvd1[88]; /* Reserved as of Nvm Express 1.1 Spec */
518 UINT64 Eui64; /* IEEE Extended Unique Identifier */
519 //
520 // LBA Format
521 //
522 NVME_LBAFORMAT LbaFormat[16];
523
524 UINT8 Rsvd2[192]; /* Reserved as of Nvm Express 1.1 Spec */
525 UINT8 VendorData[3712]; /* Vendor specific data */
527
528//
529// RPMB Device Configuration Block Data Structure as of Nvm Express 1.4 Spec
530//
531typedef struct {
532 UINT8 Bppe; /* Boot Partition Protection Enable */
533 UINT8 Bpl; /* Boot Partition Lock */
534 UINT8 Nwpac; /* Namespace Write Protection Authentication Control */
535 UINT8 Rsvd1[509]; /* Reserved as of Nvm Express 1.4 Spec */
537
538#define RPMB_FRAME_STUFF_BYTES 223
539
540//
541// RPMB Data Frame as of Nvm Express 1.4 Spec
542//
543typedef struct {
544 UINT8 Sbakamc[RPMB_FRAME_STUFF_BYTES]; /* [222-N:00] Stuff Bytes */
545 /* [222:222-(N-1)] Authentication Key or Message Authentication Code (MAC) */
546 UINT8 Rpmbt; /* RPMB Target */
547 UINT64 Nonce[2];
548 UINT32 Wcounter; /* Write Counter */
549 UINT32 Address; /* Starting address of data to be programmed to or read from the RPMB. */
550 UINT32 Scount; /* Sector Count */
551 UINT16 Result;
552 UINT16 Rpmessage; /* Request/Response Message */
553 // UINT8 *Data; /* Data to be written or read by signed access where M = 512 * Sector Count. */
555
556//
557// RPMB Device Configuration Block Data Structure.
558// (ref. NVMe Base spec. v2.0 Figure 460).
559//
560typedef struct {
561 UINT8 BPPEnable; /* Boot Partition Protection Enabled */
562 UINT8 BPLock; /* Boot Partition Lock */
563 UINT8 NameSpaceWrP; /* Namespace Write Protection */
564 UINT8 Rsvd1[509]; /* Reserved as of Nvm Express 2.0 Spec */
566
567//
568// RPMB Request and Response Message Types.
569// (ref. NVMe Base spec. v2.0 Figure 461).
570//
571#define NVME_RPMB_AUTHKEY_PROGRAM 0x0001
572#define NVME_RPMB_COUNTER_READ 0x0002
573#define NVME_RPMB_AUTHDATA_WRITE 0x0003
574#define NVME_RPMB_AUTHDATA_READ 0x0004
575#define NVME_RPMB_RESULT_READ 0x0005
576#define NVME_RPMB_DCB_WRITE 0x0006
577#define NVME_RPMB_DCB_READ 0x0007
578#define NVME_RPMB_AUTHKEY_PROGRAM_RESPONSE 0x0100
579#define NVME_RPMB_COUNTER_READ_RESPONSE 0x0200
580#define NVME_RPMB_AUTHDATA_WRITE_RESPONSE 0x0300
581#define NVME_RPMB_AUTHDATA_READ_RESPONSE 0x0400
582#define NVME_RPMB_DCB_WRITE_RESPONSE 0x0600
583#define NVME_RPMB_DCB_READ_RESPONSE 0x0700
584
585//
586// RPMB Operation Result.
587// (ref. NVMe Base spec. v2.0 Figure 462).
588//
589#define NVME_RPMB_RESULT_SUCCESS 0x00
590#define NVME_RPMB_RESULT_GENERAL_FAILURE 0x01
591#define NVME_RPMB_RESULT_AHTHENTICATION_FAILURE 0x02
592#define NVME_RPMB_RESULT_COUNTER_FAILURE 0x03
593#define NVME_RPMB_RESULT_ADDRESS_FAILURE 0x04
594#define NVME_RPMB_RESULT_WRITE_FAILURE 0x05
595#define NVME_RPMB_RESULT_READ_FAILURE 0x06
596#define NVME_RPMB_RESULT_AUTHKEY_NOT_PROGRAMMED 0x07
597#define NVME_RPMB_RESULT_INVALID_DCB 0x08
598
599//
600// Get Log Page - Boot Partition Log Header.
601// (ref. NVMe Base spec. v2.0 Figure 262).
602//
603typedef struct {
604 UINT8 LogIdentifier; /* Log Identifier, shall be set to 15h */
605 UINT8 Rsvd1[3];
606 UINT32 Bpsz : 15; /* Boot Partition Size */
607 UINT32 Rsvd2 : 16;
608 UINT32 Abpid : 1; /* Active Boot Partition ID */
609 UINT8 Rsvd3[8];
611
612//
613// NvmExpress Admin Identify Cmd
614//
615typedef struct {
616 //
617 // CDW 10
618 //
619 UINT32 Cns : 2;
620 UINT32 Rsvd1 : 30;
622
623//
624// NvmExpress Admin Create I/O Completion Queue
625//
626typedef struct {
627 //
628 // CDW 10
629 //
630 UINT32 Qid : 16; /* Queue Identifier */
631 UINT32 Qsize : 16; /* Queue Size */
632
633 //
634 // CDW 11
635 //
636 UINT32 Pc : 1; /* Physically Contiguous */
637 UINT32 Ien : 1; /* Interrupts Enabled */
638 UINT32 Rsvd1 : 14; /* reserved as of Nvm Express 1.1 Spec */
639 UINT32 Iv : 16; /* Interrupt Vector for MSI-X or MSI*/
641
642//
643// NvmExpress Admin Create I/O Submission Queue
644//
645typedef struct {
646 //
647 // CDW 10
648 //
649 UINT32 Qid : 16; /* Queue Identifier */
650 UINT32 Qsize : 16; /* Queue Size */
651
652 //
653 // CDW 11
654 //
655 UINT32 Pc : 1; /* Physically Contiguous */
656 UINT32 Qprio : 2; /* Queue Priority */
657 UINT32 Rsvd1 : 13; /* Reserved as of Nvm Express 1.1 Spec */
658 UINT32 Cqid : 16; /* Completion Queue ID */
660
661//
662// NvmExpress Admin Delete I/O Completion Queue
663//
664typedef struct {
665 //
666 // CDW 10
667 //
668 UINT16 Qid;
669 UINT16 Rsvd1;
671
672//
673// NvmExpress Admin Delete I/O Submission Queue
674//
675typedef struct {
676 //
677 // CDW 10
678 //
679 UINT16 Qid;
680 UINT16 Rsvd1;
682
683//
684// NvmExpress Admin Abort Command
685//
686typedef struct {
687 //
688 // CDW 10
689 //
690 UINT32 Sqid : 16; /* Submission Queue identifier */
691 UINT32 Cid : 16; /* Command Identifier */
693
694//
695// NvmExpress Admin Firmware Activate Command
696//
697typedef struct {
698 //
699 // CDW 10
700 //
701 UINT32 Fs : 3; /* Submission Queue identifier */
702 UINT32 Aa : 2; /* Command Identifier */
703 UINT32 Rsvd1 : 27;
705
706//
707// NvmExpress Admin Firmware Image Download Command
708//
709typedef struct {
710 //
711 // CDW 10
712 //
713 UINT32 Numd; /* Number of Dwords */
714 //
715 // CDW 11
716 //
717 UINT32 Ofst; /* Offset */
719
720//
721// NvmExpress Admin Get Features Command
722//
723typedef struct {
724 //
725 // CDW 10
726 //
727 UINT32 Fid : 8; /* Feature Identifier */
728 UINT32 Sel : 3; /* Select */
729 UINT32 Rsvd1 : 21;
731
732//
733// NvmExpress Admin Get Log Page Command
734//
735typedef struct {
736 //
737 // CDW 10
738 //
739 UINT32 Lid : 8; /* Log Page Identifier */
740 #define LID_ERROR_INFO 0x1
741 #define LID_SMART_INFO 0x2
742 #define LID_FW_SLOT_INFO 0x3
743 #define LID_BP_INFO 0x15
744 #define LID_SANITIZE_STATUS_INFO 0x81
745 UINT32 Rsvd1 : 8;
746 UINT32 Numd : 12; /* Number of Dwords */
747 UINT32 Rsvd2 : 4; /* Reserved as of Nvm Express 1.1 Spec */
749
750//
751// NvmExpress Admin Set Features Command
752//
753typedef struct {
754 //
755 // CDW 10
756 //
757 UINT32 Fid : 8; /* Feature Identifier */
758 UINT32 Rsvd1 : 23;
759 UINT32 Sv : 1; /* Save */
761
762//
763// Feature Identifier
764// (ref. spec. v2.1 Figure 32).
765//
766#define POWER_LOSS_SIGNALING_CONFIG_FID 0x1B // Power Loss Signaling Config
767
768//
769// NvmExpress Admin Sanitize Command
770//
771typedef struct {
772 //
773 // CDW 10
774 //
775 UINT32 Sanact : 3; /* Sanitize Action */
776 UINT32 Ause : 1; /* Allow Unrestricted Sanitize Exit */
777 UINT32 Owpass : 4; /* Overwrite Pass Count */
778 UINT32 Oipbp : 1; /* Overwrite Invert Pattern Between Passes */
779 UINT32 Nodas : 1; /* No-Deallocate After Sanitize */
780 UINT32 Rsvd1 : 22;
781 //
782 // CDW 11
783 //
784 UINT32 Ovrpat; /* Overwrite Pattern */
786
787#define SANITIZE_ACTION_NO_ACTION 0x0
788#define SANITIZE_ACTION_EXIT_FAILURE_MODE 0x1
789#define SANITIZE_ACTION_BLOCK_ERASE 0x2
790#define SANITIZE_ACTION_OVERWRITE 0x3
791#define SANITIZE_ACTION_CRYPTO_ERASE 0x4
792
793//
794// NvmExpress Admin Format NVM Command
795//
796typedef struct {
797 //
798 // CDW 10
799 //
800 UINT32 Lbaf : 4; /* LBA Format */
801 UINT32 Ms : 1; /* Metadata Settings */
802 UINT32 Pi : 3; /* Protection Information */
803 UINT32 Pil : 1; /* Protection Information Location */
804 UINT32 Ses : 3; /* Secure Erase Settings */
805 UINT32 Rsvd1 : 20;
807
808#define SES_NO_SECURE_ERASE 0x0
809#define SES_USER_DATA_ERASE 0x1
810#define SES_CRYPTO_ERASE 0x2
811
812//
813// NvmExpress Admin Security Receive Command
814//
815typedef struct {
816 //
817 // CDW 10
818 //
819 UINT32 Rsvd1 : 8;
820 UINT32 Spsp : 16; /* SP Specific */
821 UINT32 Secp : 8; /* Security Protocol */
822 //
823 // CDW 11
824 //
825 UINT32 Al; /* Allocation Length */
827
828//
829// NvmExpress Admin Security Send Command
830//
831typedef struct {
832 //
833 // CDW 10
834 //
835 UINT32 Rsvd1 : 8;
836 UINT32 Spsp : 16; /* SP Specific */
837 UINT32 Secp : 8; /* Security Protocol */
838 //
839 // CDW 11
840 //
841 UINT32 Tl; /* Transfer Length */
843
844typedef union {
845 NVME_ADMIN_IDENTIFY Identify;
846 NVME_ADMIN_CRIOCQ CrIoCq;
847 NVME_ADMIN_CRIOSQ CrIoSq;
848 NVME_ADMIN_DEIOCQ DeIoCq;
849 NVME_ADMIN_DEIOSQ DeIoSq;
850 NVME_ADMIN_ABORT Abort;
852 NVME_ADMIN_FIRMWARE_IMAGE_DOWNLOAD FirmwareImageDownload;
853 NVME_ADMIN_GET_FEATURES GetFeatures;
854 NVME_ADMIN_GET_LOG_PAGE GetLogPage;
855 NVME_ADMIN_SET_FEATURES SetFeatures;
856 NVME_ADMIN_FORMAT_NVM FormatNvm;
857 NVME_ADMIN_SECURITY_RECEIVE SecurityReceive;
858 NVME_ADMIN_SECURITY_SEND SecuritySend;
859 NVME_ADMIN_SANITIZE Sanitize;
861
862typedef struct {
863 UINT32 Cdw10;
864 UINT32 Cdw11;
865 UINT32 Cdw12;
866 UINT32 Cdw13;
867 UINT32 Cdw14;
868 UINT32 Cdw15;
869} NVME_RAW;
870
871typedef union {
872 NVME_ADMIN_CMD Admin; // Union of Admin commands
873 NVME_CMD Nvm; // Union of Nvm commands
874 NVME_RAW Raw;
876
877//
878// Submission Queue
879//
880typedef struct {
881 //
882 // CDW 0, Common to all commands
883 //
884 UINT8 Opc; // Opcode
885 UINT8 Fuse : 2; // Fused Operation
886 UINT8 Rsvd1 : 5;
887 UINT8 Psdt : 1; // PRP or SGL for Data Transfer
888 UINT16 Cid; // Command Identifier
889
890 //
891 // CDW 1
892 //
893 UINT32 Nsid; // Namespace Identifier
894
895 //
896 // CDW 2,3
897 //
898 UINT64 Rsvd2;
899
900 //
901 // CDW 4,5
902 //
903 UINT64 Mptr; // Metadata Pointer
904
905 //
906 // CDW 6-9
907 //
908 UINT64 Prp[2]; // First and second PRP entries
909
910 NVME_PAYLOAD Payload;
911} NVME_SQ;
912
913//
914// Completion Queue
915//
916typedef struct {
917 //
918 // CDW 0
919 //
920 UINT32 Dword0;
921 //
922 // CDW 1
923 //
924 UINT32 Rsvd1;
925 //
926 // CDW 2
927 //
928 UINT16 Sqhd; // Submission Queue Head Pointer
929 UINT16 Sqid; // Submission Queue Identifier
930 //
931 // CDW 3
932 //
933 UINT16 Cid; // Command Identifier
934 UINT16 Pt : 1; // Phase Tag
935 UINT16 Sc : 8; // Status Code
936 UINT16 Sct : 3; // Status Code Type
937 UINT16 Rsvd2 : 2;
938 UINT16 Mo : 1; // More
939 UINT16 Dnr : 1; // Do Not Retry
940} NVME_CQ;
941
942//
943// Nvm Express Admin cmd opcodes
944//
945#define NVME_ADMIN_DEIOSQ_CMD 0x00
946#define NVME_ADMIN_CRIOSQ_CMD 0x01
947#define NVME_ADMIN_GET_LOG_PAGE_CMD 0x02
948#define NVME_ADMIN_DEIOCQ_CMD 0x04
949#define NVME_ADMIN_CRIOCQ_CMD 0x05
950#define NVME_ADMIN_IDENTIFY_CMD 0x06
951#define NVME_ADMIN_ABORT_CMD 0x08
952#define NVME_ADMIN_SET_FEATURES_CMD 0x09
953#define NVME_ADMIN_GET_FEATURES_CMD 0x0A
954#define NVME_ADMIN_ASYNC_EVENT_REQUEST_CMD 0x0C
955#define NVME_ADMIN_NAMESACE_MANAGEMENT_CMD 0x0D
956#define NVME_ADMIN_FW_COMMIT_CMD 0x10
957#define NVME_ADMIN_FW_IAMGE_DOWNLOAD_CMD 0x11
958#define NVME_ADMIN_NAMESACE_ATTACHMENT_CMD 0x15
959#define NVME_ADMIN_FORMAT_NVM_CMD 0x80
960#define NVME_ADMIN_SECURITY_SEND_CMD 0x81
961#define NVME_ADMIN_SECURITY_RECEIVE_CMD 0x82
962#define NVME_ADMIN_SANITIZE_CMD 0x84
963
964#define NVME_IO_FLUSH_OPC 0
965#define NVME_IO_WRITE_OPC 1
966#define NVME_IO_READ_OPC 2
967
968typedef enum {
969 DeleteIOSubmissionQueueOpcode = NVME_ADMIN_DEIOSQ_CMD,
970 CreateIOSubmissionQueueOpcode = NVME_ADMIN_CRIOSQ_CMD,
971 GetLogPageOpcode = NVME_ADMIN_GET_LOG_PAGE_CMD,
972 DeleteIOCompletionQueueOpcode = NVME_ADMIN_DEIOCQ_CMD,
973 CreateIOCompletionQueueOpcode = NVME_ADMIN_CRIOCQ_CMD,
974 IdentifyOpcode = NVME_ADMIN_IDENTIFY_CMD,
975 AbortOpcode = NVME_ADMIN_ABORT_CMD,
976 SetFeaturesOpcode = NVME_ADMIN_SET_FEATURES_CMD,
977 GetFeaturesOpcode = NVME_ADMIN_GET_FEATURES_CMD,
978 AsyncEventRequestOpcode = NVME_ADMIN_ASYNC_EVENT_REQUEST_CMD,
979 NamespaceManagementOpcode = NVME_ADMIN_NAMESACE_MANAGEMENT_CMD,
980 FirmwareCommitOpcode = NVME_ADMIN_FW_COMMIT_CMD,
981 FirmwareImageDownloadOpcode = NVME_ADMIN_FW_IAMGE_DOWNLOAD_CMD,
982 NamespaceAttachmentOpcode = NVME_ADMIN_NAMESACE_ATTACHMENT_CMD,
983 FormatNvmOpcode = NVME_ADMIN_FORMAT_NVM_CMD,
984 SecuritySendOpcode = NVME_ADMIN_SECURITY_SEND_CMD,
985 SecurityReceiveOpcode = NVME_ADMIN_SECURITY_RECEIVE_CMD,
986 SanitizeOpcode = NVME_ADMIN_SANITIZE_CMD
987} NVME_ADMIN_COMMAND_OPCODE;
988
989//
990// Controller or Namespace Structure (CNS) field
991// (ref. spec. v1.1 figure 82).
992//
993typedef enum {
994 IdentifyNamespaceCns = 0x0,
995 IdentifyControllerCns = 0x1,
996 IdentifyActiveNsListCns = 0x2
997} NVME_ADMIN_IDENTIFY_CNS;
998
999//
1000// Commit Action
1001// (ref. spec. 1.1 figure 60).
1002//
1003typedef enum {
1004 ActivateActionReplace = 0x0,
1005 ActivateActionReplaceActivate = 0x1,
1006 ActivateActionActivate = 0x2
1007} NVME_FW_ACTIVATE_ACTION;
1008
1009//
1010// Firmware Slot
1011// (ref. spec. 1.1 Figure 60).
1012//
1013typedef enum {
1014 FirmwareSlotCtrlChooses = 0x0,
1015 FirmwareSlot1 = 0x1,
1016 FirmwareSlot2 = 0x2,
1017 FirmwareSlot3 = 0x3,
1018 FirmwareSlot4 = 0x4,
1019 FirmwareSlot5 = 0x5,
1020 FirmwareSlot6 = 0x6,
1021 FirmwareSlot7 = 0x7
1022} NVME_FW_ACTIVATE_SLOT;
1023
1024//
1025// Get Log Page ? Log Page Identifiers
1026// (ref. spec. v2.0c Figure 202).
1027//
1028typedef enum {
1029 ErrorInfoLogID = LID_ERROR_INFO,
1030 SmartHealthInfoLogID = LID_SMART_INFO,
1031 FirmwareSlotInfoLogID = LID_FW_SLOT_INFO,
1032 BootPartitionInfoLogID = LID_BP_INFO,
1033 SanitizeStatusInfoLogID = LID_SANITIZE_STATUS_INFO
1034} NVME_LOG_ID;
1035
1036//
1037// Get Log Page ? Firmware Slot Information Log
1038// (ref. spec. v1.1 Figure 77).
1039//
1040typedef struct {
1041 //
1042 // Indicates the firmware slot from which the actively running firmware revision was loaded.
1043 //
1044 UINT8 ActivelyRunningFwSlot : 3;
1045 UINT8 : 1;
1046 //
1047 // Indicates the firmware slot that is going to be activated at the next controller reset. If this field is 0h, then the controller does not indicate the firmware slot that is going to be activated at the next controller reset.
1048 //
1049 UINT8 NextActiveFwSlot : 3;
1050 UINT8 : 1;
1052
1053//
1054// Get Log Page ? Firmware Slot Information Log
1055// (ref. spec. v1.1 Figure 77).
1056//
1057typedef struct {
1058 //
1059 // Specifies information about the active firmware revision.
1060 // s
1061 NVME_ACTIVE_FW_INFO ActiveFwInfo;
1062 UINT8 Reserved1[7];
1063 //
1064 // Contains the revision of the firmware downloaded to firmware slot 1/7. If no valid firmware revision is present or if this slot is unsupported, all zeros shall be returned.
1065 //
1066 CHAR8 FwRevisionSlot[7][8];
1067 UINT8 Reserved2[448];
1069
1070//
1071// SMART / Health Information (Log Identifier 02h)
1072// (ref. spec. v1.1 5.10.1.2)
1073//
1074typedef struct {
1075 //
1076 // This field indicates critical warnings for the state of the controller.
1077 //
1078 UINT8 CriticalWarningAvailableSpare : 1;
1079 UINT8 CriticalWarningTemperature : 1;
1080 UINT8 CriticalWarningReliability : 1;
1081 UINT8 CriticalWarningMediaReadOnly : 1;
1082 UINT8 CriticalWarningVolatileBackup : 1;
1083 UINT8 CriticalWarningReserved : 3;
1084 //
1085 // Contains a value corresponding to a temperature in degrees Kelvin that represents the current composite temperature of the controller and namespace(s) associated with that controller. The manner in which this value is computed is implementation specific and may not represent the actual temperature of any physical point in the NVM subsystem.
1086 //
1087 UINT16 CompositeTemp;
1088 //
1089 // Contains a normalized percentage (0 to 100%) of the remaining spare capacity available.
1090 //
1091 UINT8 AvailableSpare;
1092 //
1093 // When the Available Spare falls below the threshold indicated in this field, an asynchronous event completion may occur. The value is indicated as a normalized percentage (0 to 100%).
1094 //
1095 UINT8 AvailableSpareThreshold;
1096 //
1097 // Contains a vendor specific estimate of the percentage of NVM subsystem life used based on the actual usage and the manufacturer's prediction of NVM life. A value of 100 indicates that the estimated endurance of the NVM in the NVM subsystem has been consumed, but may not indicate an NVM subsystem failure. The value is allowed to exceed 100. Percentages greater than 254 shall be represented as 255. This value shall be updated once per power-on hour (when the controller is not in a sleep state).
1098 //
1099 UINT8 PercentageUsed;
1100 UINT8 Reserved1[26];
1101 //
1102 // Contains the number of 512 byte data units the host has read from the controller; this value does not include metadata.
1103 //
1104 UINT8 DataUnitsRead[16];
1105 //
1106 // Contains the number of 512 byte data units the host has written to the controller; this value does not include metadata.
1107 //
1108 UINT8 DataUnitsWritten[16];
1109 //
1110 // Contains the number of read commands completed by the controller.
1111 //
1112 UINT8 HostReadCommands[16];
1113 //
1114 // Contains the number of write commands completed by the controller.
1115 //
1116 UINT8 HostWriteCommands[16];
1117 //
1118 // Contains the amount of time the controller is busy with I/O commands. This value is reported in minutes.
1119 //
1120 UINT8 ControllerBusyTime[16];
1121 //
1122 // Contains the number of power cycles.
1123 //
1124 UINT8 PowerCycles[16];
1125 //
1126 // Contains the number of power-on hours.
1127 //
1128 UINT8 PowerOnHours[16];
1129 //
1130 // Contains the number of unsafe shutdowns.
1131 //
1132 UINT8 UnsafeShutdowns[16];
1133 //
1134 // Contains the number of occurrences where the controller detected an unrecovered data integrity error.
1135 //
1136 UINT8 MediaAndDataIntegrityErrors[16];
1137 //
1138 // Contains the number of Error Information log entries over the life of the controller.
1139 //
1140 UINT8 NumberErrorInformationLogEntries[16];
1141 //
1142 // Contains the amount of time in minutes that the controller is operational and the Composite Temperature is greater than or equal to the Warning Composite Temperature Threshold (WCTEMP) field and less than the Critical Composite Temperature Threshold (CCTEMP) field in the Identify Controller data structure in Figure 90.
1143 //
1144 UINT32 WarningCompositeTemperatureTime;
1145 //
1146 // Contains the amount of time in minutes that the controller is operational and the Composite Temperature is greater the Critical Composite Temperature Threshold (CCTEMP) field in the Identify Controller data structure in Figure 90.
1147 //
1148 UINT32 CriticalCompositeTemperatureTime;
1149 //
1150 // Contains the current temperature in degrees Kelvin reported by the temperature sensor. An implementation that does not implement the temperature sensor reports a temperature of zero degrees Kelvin.
1151 //
1152 UINT16 TemperatureSensor[8];
1153 UINT8 Reserved2[296];
1155
1156//
1157// Sanitize Status (Log Identifier 81h)
1158// (ref. spec. v2.0c 5.16.1.25).
1159//
1160typedef struct {
1161 //
1162 // Indicates the fraction complete of the sanitize operation. (SPROG)
1163 //
1164 UINT16 SanitizeProgress;
1165 //
1166 // Indicates the status associated with the most recent sanitize operation. (SSTAT)
1167 //
1168 UINT16 SanitizeStatus : 3;
1169 UINT16 OverwriteSanitizeCompletedNumber : 5;
1170 UINT16 GlobalDataErased : 1;
1171 UINT16 SanitizeStatusRsvd : 7;
1172 //
1173 // Contains the value of the Command Dword 10 field of the Sanitize command that started the sanitize operation whose status is reported in the SSTAT field. (SCDW10)
1174 //
1175 UINT32 SanitizeCmdDw10Info;
1176 //
1177 // Indicates the number of seconds required to complete an Overwrite sanitize operation with 16 passes in the background when the No-Deallocate Modifies Media After Sanitize field is not set to 10b.
1178 //
1179 UINT32 OverwriteEstimatedTime;
1180 //
1181 // Indicates the number of seconds required to complete a Block Erase sanitize operation in the background when the No-Deallocate Modifies Media After Sanitize field is not set to 10b.
1182 //
1183 UINT32 BlockEraseEstimatedTime;
1184 //
1185 // Indicates the number of seconds required to complete a Crypto Erase sanitize operation in the background when the No-Deallocate Modifies Media After Sanitize field is not set to 10b.
1186 //
1187 UINT32 CryptoEraseEstimatedTime;
1188 //
1189 // Indicates the number of seconds required to complete an Overwrite sanitize operation and the associated additional media modification after the Overwrite sanitize operation in the background.
1190 // The No-Deallocate After Sanitize bit was set to ?1? in the Sanitize command that requested the Overwrite sanitize operation.
1191 // The No-Deallocate Modifies Media After Sanitize field is set to 10b.
1192 //
1193 UINT32 OverwriteEstimatedTimeWithNodmm;
1194 //
1195 // Indicates the number of seconds required to complete a Block Erase sanitize operation and the associated additional media modification after the Block Erase sanitize operation in the background.
1196 // The No-Deallocate After Sanitize bit was set to ?1? in the Sanitize command that requested the Block Erase sanitize operation.
1197 // The No-Deallocate Modifies Media After Sanitize field is set to 10b.
1198 //
1199 UINT32 BlockEraseEstimatedTimeWithNodmm;
1200 //
1201 // Indicates the number of seconds required to complete a Crypto Erase sanitize operation and the associated additional media modification after the Crypto Erase sanitize operation in the background.
1202 // The No-Deallocate After Sanitize bit was set to ?1? in the Sanitize command that requested the Crypto Erase sanitize operation.
1203 // The No-Deallocate Modifies Media After Sanitize field is set to 10b.
1204 //
1205 UINT32 CryptoEraseEstimatedTimeWithNodmm;
1206 UINT8 Reserved[480];
1208
1209//
1210// Power Loss Signaling Config
1211// (ref. spec. v2.1 Figure 414).
1212//
1213#define PLS_NOT_ENABLED 0x0 // Power Loss Signaling Not Enabled
1214#define PLS_EMERGENCY_POWER_FAIL_ENABLED 0x1 // Power Loss Signaling with Emergency Power Fail Enabled
1215#define PLS_FORCED_QUIESCENCE_ENABLED 0x2 // Power Loss Signaling with Forced Quiescence Enabled
1216
1217typedef struct {
1218 //
1219 // Indicates the Power Loss Signaling mode of operation
1220 //
1221 UINT32 Plsm : 2; /* Power Loss Signaling Mode */
1222 UINT32 Reserved : 30;
1224
1225#pragma pack()
1226
1227#endif
EFI_STATUS EFIAPI Activate(IN CONST EFI_SMM_CONTROL2_PROTOCOL *This, IN OUT UINT8 *CommandPort OPTIONAL, IN OUT UINT8 *DataPort OPTIONAL, IN BOOLEAN Periodic OPTIONAL, IN EFI_SMM_PERIOD ActivationInterval OPTIONAL)
Definition: Nvme.h:114
Definition: Nvme.h:56
Definition: Nvme.h:85
Definition: Nvme.h:916
Definition: Nvme.h:862
Definition: Nvme.h:880
Definition: Nvme.h:77
Definition: Nvme.h:334