public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Add NVDIMM related spec definitions
@ 2017-11-08  6:33 Ruiyu Ni
  2017-11-08  6:33 ` [PATCH v2 1/2] MdePkg/Btt.h: Add Block Translation Table definitions Ruiyu Ni
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ruiyu Ni @ 2017-11-08  6:33 UTC (permalink / raw)
  To: edk2-devel

v2:
  1. Create Btt.h in Include/Guid directory per Liming's comments.
  2. Change the GUID C name to match macro name.

Ruiyu Ni (2):
  MdePkg/Btt.h: Add Block Translation Table definitions
  MdePkg/NvdimmLabel.h: Add NVDIMM_LABEL protocol definition

 MdePkg/Include/Guid/Btt.h             | 228 ++++++++++++++++++++++
 MdePkg/Include/Protocol/NvdimmLabel.h | 351 ++++++++++++++++++++++++++++++++++
 MdePkg/MdePkg.dec                     |   9 +
 3 files changed, 588 insertions(+)
 create mode 100644 MdePkg/Include/Guid/Btt.h
 create mode 100644 MdePkg/Include/Protocol/NvdimmLabel.h

-- 
2.12.2.windows.2



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 1/2] MdePkg/Btt.h: Add Block Translation Table definitions
  2017-11-08  6:33 [PATCH v2 0/2] Add NVDIMM related spec definitions Ruiyu Ni
@ 2017-11-08  6:33 ` Ruiyu Ni
  2017-11-08  6:33 ` [PATCH v2 2/2] MdePkg/NvdimmLabel.h: Add NVDIMM_LABEL protocol definition Ruiyu Ni
  2017-11-08  8:24 ` [PATCH v2 0/2] Add NVDIMM related spec definitions Gao, Liming
  2 siblings, 0 replies; 4+ messages in thread
From: Ruiyu Ni @ 2017-11-08  6:33 UTC (permalink / raw)
  To: edk2-devel; +Cc: Liming Gao

BTT definitions are defined in UEFI spec 2.7, to defines
a layout and set of rules for doing block I/O that provide
powerfail write atomicity of a single block in NVDIMM.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
---
 MdePkg/Include/Guid/Btt.h | 228 ++++++++++++++++++++++++++++++++++++++++++++++
 MdePkg/MdePkg.dec         |   6 ++
 2 files changed, 234 insertions(+)
 create mode 100644 MdePkg/Include/Guid/Btt.h

diff --git a/MdePkg/Include/Guid/Btt.h b/MdePkg/Include/Guid/Btt.h
new file mode 100644
index 0000000000..92977259a4
--- /dev/null
+++ b/MdePkg/Include/Guid/Btt.h
@@ -0,0 +1,228 @@
+/** @file
+  Block Translation Table (BTT) metadata layout definition.
+
+  BTT is a layout and set of rules for doing block I/O that provide powerfail
+  write atomicity of a single block.
+
+Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+  @par Revision Reference:
+  This metadata layout definition was introduced in UEFI Specification 2.7.
+
+**/
+
+#ifndef _BTT_H_
+#define _BTT_H_
+
+///
+/// The BTT layout and behavior is described by the GUID as below.
+///
+#define EFI_BTT_ABSTRACTION_GUID \
+  { \
+    0x18633bfc, 0x1735, 0x4217, { 0x8a, 0xc9, 0x17, 0x23, 0x92, 0x82, 0xd3, 0xf8 } \
+  }
+
+//
+// Alignment of all BTT structures
+//
+#define EFI_BTT_ALIGNMENT                4096
+
+#define EFI_BTT_INFO_UNUSED_LEN          3968
+
+#define EFI_BTT_INFO_BLOCK_SIG_LEN       16
+
+///
+/// Indicate inconsistent metadata or lost metadata due to unrecoverable media errors.
+///
+#define EFI_BTT_INFO_BLOCK_FLAGS_ERROR   0x00000001
+
+#define EFI_BTT_INFO_BLOCK_MAJOR_VERSION 2
+#define EFI_BTT_INFO_BLOCK_MINOR_VERSION 0
+
+///
+/// Block Translation Table (BTT) Info Block
+///
+typedef struct _EFI_BTT_INFO_BLOCK {
+  ///
+  /// Signature of the BTT Index Block data structure.
+  /// Shall be "BTT_ARENA_INFO\0\0".
+  ///
+  CHAR8    Sig[EFI_BTT_INFO_BLOCK_SIG_LEN];
+
+  ///
+  /// UUID identifying this BTT instance.
+  ///
+  GUID Uuid;
+
+  ///
+  /// UUID of containing namespace.
+  ///
+  GUID ParentUuid;
+
+  ///
+  /// Attributes of this BTT Info Block.
+  ///
+  UINT32   Flags;
+
+  ///
+  /// Major version number. Currently at version 2.
+  ///
+  UINT16   Major;
+
+  ///
+  /// Minor version number. Currently at version 0.
+  ///
+  UINT16   Minor;
+
+  ///
+  /// Advertised LBA size in bytes. I/O requests shall be in this size chunk.
+  ///
+  UINT32   ExternalLbaSize;
+
+  ///
+  /// Advertised number of LBAs in this arena.
+  ///
+  UINT32   ExternalNLba;
+
+  ///
+  /// Internal LBA size shall be greater than or equal to ExternalLbaSize and shall not be smaller than 512 bytes.
+  ///
+  UINT32   InternalLbaSize;
+
+  ///
+  /// Number of internal blocks in the arena data area.
+  ///
+  UINT32   InternalNLba;
+
+  ///
+  /// Number of free blocks maintained for writes to this arena.
+  ///
+  UINT32   NFree;
+
+  ///
+  /// The size of this info block in bytes.
+  ///
+  UINT32   InfoSize;
+
+  ///
+  /// Offset of next arena, relative to the beginning of this arena.
+  ///
+  UINT64   NextOff;
+
+  ///
+  /// Offset of the data area for this arena, relative to the beginning of this arena.
+  ///
+  UINT64   DataOff;
+
+  ///
+  /// Offset of the map for this arena, relative to the beginning of this arena.
+  ///
+  UINT64   MapOff;
+
+  ///
+  /// Offset of the flog for this arena, relative to the beginning of this arena.
+  ///
+  UINT64   FlogOff;
+
+  ///
+  /// Offset of the backup copy of this arena's info block, relative to the beginning of this arena.
+  ///
+  UINT64   InfoOff;
+
+  ///
+  /// Shall be zero.
+  ///
+  CHAR8    Unused[EFI_BTT_INFO_UNUSED_LEN];
+
+  ///
+  /// 64-bit Fletcher64 checksum of all fields.
+  ///
+  UINT64   Checksum;
+} EFI_BTT_INFO_BLOCK;
+
+///
+/// BTT Map entry maps an LBA that indexes into the arena, to its actual location.
+///
+typedef struct _EFI_BTT_MAP_ENTRY {
+  ///
+  /// Post-map LBA number (block number in this arena's data area)
+  ///
+  UINT32 PostMapLba : 30;
+
+  ///
+  /// When set and Zero is not set, reads on this block return an error.
+  /// When set and Zero is set, indicate a map entry in its normal, non-error state.
+  ///
+  UINT32 Error : 1;
+
+  ///
+  /// When set and Error is not set, reads on this block return a full block of zeros.
+  /// When set and Error is set, indicate a map entry in its normal, non-error state.
+  ///
+  UINT32 Zero : 1;
+} EFI_BTT_MAP_ENTRY;
+
+///
+/// Alignment of each flog structure
+///
+#define EFI_BTT_FLOG_ENTRY_ALIGNMENT 64
+
+///
+/// The BTT Flog is both a free list and a log.
+/// The Flog size is determined by the EFI_BTT_INFO_BLOCK.NFree which determines how many of these flog
+/// entries there are.
+/// The Flog location is the highest aligned address in the arena after space for the backup info block.
+///
+typedef struct _EFI_BTT_FLOG {
+  ///
+  /// Last pre-map LBA written using this flog entry.
+  ///
+  UINT32 Lba0;
+
+  ///
+  /// Old post-map LBA.
+  ///
+  UINT32 OldMap0;
+
+  ///
+  /// New post-map LBA.
+  ///
+  UINT32 NewMap0;
+
+  ///
+  /// The Seq0 field in each flog entry is used to determine which set of fields is newer between the two sets
+  /// (Lba0, OldMap0, NewMpa0, Seq0 vs Lba1, Oldmap1, NewMap1, Seq1).
+  ///
+  UINT32 Seq0;
+
+  ///
+  /// Alternate lba entry.
+  ///
+  UINT32 Lba1;
+
+  ///
+  /// Alternate old entry.
+  ///
+  UINT32 OldMap1;
+
+  ///
+  /// Alternate new entry.
+  ///
+  UINT32 NewMap1;
+
+  ///
+  /// Alternate Seq entry.
+  ///
+  UINT32 Seq1;
+} EFI_BTT_FLOG;
+
+extern GUID gEfiBttAbstractionGuid;
+
+#endif //_BTT_H_
diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index 1867c54c3b..c5279298e8 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -646,6 +646,12 @@ [Guids]
   gEfiHiiImageDecoderNamePngGuid            = { 0xaf060190, 0x5e3a, 0x4025, { 0xaf, 0xbd, 0xe1, 0xf9, 0x05, 0xbf, 0xaa, 0x4c }}
 
   #
+  # GUIDs defined in UEFI2.7
+  #
+  ## Include/Guid/Btt.h
+  gEfiBttAbstractionGuid         = { 0x18633bfc, 0x1735, 0x4217, { 0x8a, 0xc9, 0x17, 0x23, 0x92, 0x82, 0xd3, 0xf8 }}
+
+  #
   # GUID defined in PI1.0
   #
   ## Include/Guid/AprioriFileName.h
-- 
2.12.2.windows.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 2/2] MdePkg/NvdimmLabel.h: Add NVDIMM_LABEL protocol definition
  2017-11-08  6:33 [PATCH v2 0/2] Add NVDIMM related spec definitions Ruiyu Ni
  2017-11-08  6:33 ` [PATCH v2 1/2] MdePkg/Btt.h: Add Block Translation Table definitions Ruiyu Ni
@ 2017-11-08  6:33 ` Ruiyu Ni
  2017-11-08  8:24 ` [PATCH v2 0/2] Add NVDIMM related spec definitions Gao, Liming
  2 siblings, 0 replies; 4+ messages in thread
From: Ruiyu Ni @ 2017-11-08  6:33 UTC (permalink / raw)
  To: edk2-devel; +Cc: Liming Gao

NVDIMM_LABEL protocol is defined in UEFI 2.7 spec, to provide
services that allow management of labels contained in a Label
Storage Area in NVDIMM.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
---
 MdePkg/Include/Protocol/NvdimmLabel.h | 351 ++++++++++++++++++++++++++++++++++
 MdePkg/MdePkg.dec                     |   3 +
 2 files changed, 354 insertions(+)
 create mode 100644 MdePkg/Include/Protocol/NvdimmLabel.h

diff --git a/MdePkg/Include/Protocol/NvdimmLabel.h b/MdePkg/Include/Protocol/NvdimmLabel.h
new file mode 100644
index 0000000000..0d70bdff74
--- /dev/null
+++ b/MdePkg/Include/Protocol/NvdimmLabel.h
@@ -0,0 +1,351 @@
+/** @file
+  EFI NVDIMM Label Protocol Definition
+
+  The EFI NVDIMM Label Protocol is used to Provides services that allow management
+  of labels contained in a Label Storage Area that are associated with a specific
+  NVDIMM Device Path.
+
+Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+  @par Revision Reference:
+  This Protocol was introduced in UEFI Specification 2.7.
+
+**/
+
+#ifndef __EFI_NVDIMM_LABEL_PROTOCOL_H__
+#define __EFI_NVDIMM_LABEL_PROTOCOL_H__
+
+#define EFI_NVDIMM_LABEL_PROTOCOL_GUID \
+  { \
+    0xd40b6b80, 0x97d5, 0x4282, {0xbb, 0x1d, 0x22, 0x3a, 0x16, 0x91, 0x80, 0x58 } \
+  }
+
+typedef struct _EFI_NVDIMM_LABEL_PROTOCOL EFI_NVDIMM_LABEL_PROTOCOL;
+
+#define EFI_NVDIMM_LABEL_INDEX_SIG_LEN 16
+#define EFI_NVDIMM_LABEL_INDEX_ALIGN   256
+typedef struct {
+  ///
+  /// Signature of the Index Block data structure. Must be "NAMESPACE_INDEX\0".
+  ///
+  CHAR8  Sig[EFI_NVDIMM_LABEL_INDEX_SIG_LEN];
+
+  ///
+  /// Attributes of this Label Storage Area.
+  ///
+  UINT8  Flags[3];
+
+  ///
+  /// Size of each label in bytes, 128 bytes << LabelSize.
+  /// 1 means 256 bytes, 2 means 512 bytes, etc. Shall be 1 or greater.
+  ///
+  UINT8  LabelSize;
+
+  ///
+  /// Sequence number used to identify which of the two Index Blocks is current.
+  ///
+  UINT32 Seq;
+
+  ///
+  /// The offset of this Index Block in the Label Storage Area.
+  ///
+  UINT64 MyOff;
+
+  ///
+  /// The size of this Index Block in bytes.
+  /// This field must be a multiple of the EFI_NVDIMM_LABEL_INDEX_ALIGN.
+  ///
+  UINT64 MySize;
+
+  ///
+  /// The offset of the other Index Block paired with this one.
+  ///
+  UINT64 OtherOff;
+
+  ///
+  /// The offset of the first slot where labels are stored in this Label Storage Area.
+  ///
+  UINT64 LabelOff;
+
+  ///
+  /// The total number of slots for storing labels in this Label Storage Area.
+  ///
+  UINT32 NSlot;
+
+  ///
+  /// Major version number. Value shall be 1.
+  ///
+  UINT16 Major;
+
+  ///
+  /// Minor version number. Value shall be 2.
+  ///
+  UINT16 Minor;
+
+  ///
+  /// 64-bit Fletcher64 checksum of all fields in this Index Block.
+  ///
+  UINT64 Checksum;
+
+  ///
+  /// Array of unsigned bytes implementing a bitmask that tracks which label slots are free.
+  /// A bit value of 0 indicates in use, 1 indicates free.
+  /// The size of this field is the number of bytes required to hold the bitmask with NSlot bits,
+  /// padded with additional zero bytes to make the Index Block size a multiple of EFI_NVDIMM_LABEL_INDEX_ALIGN.
+  /// Any bits allocated beyond NSlot bits must be zero.
+  ///
+  UINT8  Free[];
+} EFI_NVDIMM_LABEL_INDEX_BLOCK;
+
+#define EFI_NVDIMM_LABEL_NAME_LEN 64
+
+///
+/// The label is read-only.
+///
+#define EFI_NVDIMM_LABEL_FLAGS_ROLABEL 0x00000001
+
+///
+/// When set, the complete label set is local to a single NVDIMM Label Storage Area.
+/// When clear, the complete label set is contained on multiple NVDIMM Label Storage Areas.
+///
+#define EFI_NVDIMM_LABEL_FLAGS_LOCAL 0x00000002
+
+///
+/// This reserved flag is utilized on older implementations and has been deprecated.
+/// Do not use.
+//
+#define EFI_NVDIMM_LABEL_FLAGS_RESERVED 0x00000004
+
+///
+/// When set, the label set is being updated.
+///
+#define EFI_NVDIMM_LABEL_FLAGS_UPDATING 0x00000008
+
+typedef struct {
+  ///
+  /// Unique Label Identifier UUID per RFC 4122.
+  ///
+  EFI_GUID Uuid;
+
+  ///
+  /// NULL-terminated string using UTF-8 character formatting.
+  ///
+  CHAR8    Name[EFI_NVDIMM_LABEL_NAME_LEN];
+
+  ///
+  /// Attributes of this namespace.
+  ///
+  UINT32   Flags;
+
+  ///
+  /// Total number of labels describing this namespace.
+  ///
+  UINT16   NLabel;
+
+  ///
+  /// Position of this label in list of labels for this namespace.
+  ///
+  UINT16   Position;
+
+  ///
+  /// The SetCookie is utilized by SW to perform consistency checks on the Interleave Set to verify the current
+  /// physical device configuration matches the original physical configuration when the labels were created
+  /// for the set.The label is considered invalid if the actual label set cookie doesn't match the cookie stored here.
+  ///
+  UINT64   SetCookie;
+
+  ///
+  /// This is the default logical block size in bytes and may be superseded by a block size that is specified
+  /// in the AbstractionGuid.
+  ///
+  UINT64   LbaSize;
+
+  ///
+  /// The DPA is the DIMM Physical address where the NVM contributing to this namespace begins on this NVDIMM.
+  ///
+  UINT64   Dpa;
+
+  ///
+  /// The extent of the DPA contributed by this label.
+  ///
+  UINT64   RawSize;
+
+  ///
+  /// Current slot in the Label Storage Area where this label is stored.
+  ///
+  UINT32   Slot;
+
+  ///
+  /// Alignment hint used to advertise the preferred alignment of the data from within the namespace defined by this label.
+  ///
+  UINT8    Alignment;
+
+  ///
+  /// Shall be 0.
+  ///
+  UINT8    Reserved[3];
+
+  ///
+  /// Range Type GUID that describes the access mechanism for the specified DPA range.
+  ///
+  EFI_GUID TypeGuid;
+
+  ///
+  /// Identifies the address abstraction mechanism for this namespace. A value of 0 indicates no mechanism used.
+  ///
+  EFI_GUID AddressAbstractionGuid;
+
+  ///
+  /// Shall be 0.
+  ///
+  UINT8    Reserved1[88];
+
+  ///
+  /// 64-bit Fletcher64 checksum of all fields in this Label.
+  /// This field is considered zero when the checksum is computed.
+  ///
+  UINT64   Checksum;
+} EFI_NVDIMM_LABEL;
+
+typedef struct  {
+  ///
+  /// The Region Offset field from the ACPI NFIT NVDIMM Region Mapping Structure for a given entry.
+  ///
+  UINT64 RegionOffset;
+
+  ///
+  /// The serial number of the NVDIMM, assigned by the module vendor.
+  ///
+  UINT32 SerialNumber;
+
+  ///
+  /// The identifier indicating the vendor of the NVDIMM.
+  ///
+  UINT16 VendorId;
+
+  ///
+  /// The manufacturing date of the NVDIMM, assigned by the module vendor.
+  ///
+  UINT16 ManufacturingDate;
+
+  ///
+  /// The manufacturing location from for the NVDIMM, assigned by the module vendor.
+  ///
+  UINT8  ManufacturingLocation;
+
+  ///
+  /// Shall be 0.
+  ///
+  UINT8  Reserved[31];
+} EFI_NVDIMM_LABEL_SET_COOKIE_MAP;
+
+typedef struct {
+  ///
+  /// Array size is 1 if EFI_NVDIMM_LABEL_FLAGS_LOCAL is set indicating a Local Namespaces.
+  ///
+  EFI_NVDIMM_LABEL_SET_COOKIE_MAP Mapping[0];
+} EFI_NVDIMM_LABEL_SET_COOKIE_INFO;
+
+/**
+  Retrieves the Label Storage Area size and the maximum transfer size for the LabelStorageRead and
+  LabelStorageWrite methods.
+
+  @param  This                   A pointer to the EFI_NVDIMM_LABEL_PROTOCOL instance.
+  @param  SizeOfLabelStorageArea The size of the Label Storage Area for the NVDIMM in bytes.
+  @param  MaxTransferLength      The maximum number of bytes that can be transferred in a single call to
+                                 LabelStorageRead or LabelStorageWrite.
+
+  @retval EFI_SUCCESS            The size of theLabel Storage Area and maximum transfer size returned are valid.
+  @retval EFI_ACCESS_DENIED      The Label Storage Area for the NVDIMM device is not currently accessible.
+  @retval EFI_DEVICE_ERROR       A physical device error occurred and the data transfer failed to complete.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_NVDIMM_LABEL_STORAGE_INFORMATION) (
+  IN  EFI_NVDIMM_LABEL_PROTOCOL *This,
+  OUT UINT32                    *SizeOfLabelStorageArea,
+  OUT UINT32                    *MaxTransferLength
+  );
+
+/**
+  Retrieves the label data for the requested offset and length from within the Label Storage Area for
+  the NVDIMM.
+
+  @param  This                   A pointer to the EFI_NVDIMM_LABEL_PROTOCOL instance.
+  @param  Offset                 The byte offset within the Label Storage Area to read from.
+  @param  TransferLength         Number of bytes to read from the Label Storage Area beginning at the byte
+                                 Offset specified. A TransferLength of 0 reads no data.
+  @param  LabelData              The return label data read at the requested offset and length from within
+                                 the Label Storage Area.
+
+  @retval EFI_SUCCESS            The label data from the Label Storage Area for the NVDIMM was read successfully
+                                 at the specified Offset and TransferLength and LabelData contains valid data.
+  @retval EFI_INVALID_PARAMETER  Any of the following are true:
+                                 - Offset > SizeOfLabelStorageArea reported in the LabelStorageInformation return data.
+                                 - Offset + TransferLength is > SizeOfLabelStorageArea reported in the
+                                   LabelStorageInformation return data.
+                                 - TransferLength is > MaxTransferLength reported in the LabelStorageInformation return
+                                   data.
+  @retval EFI_ACCESS_DENIED      The Label Storage Area for the NVDIMM device is not currently accessible and labels
+                                 cannot be read at this time.
+  @retval EFI_DEVICE_ERROR       A physical device error occurred and the data transfer failed to complete.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_NVDIMM_LABEL_STORAGE_READ) (
+  IN CONST EFI_NVDIMM_LABEL_PROTOCOL *This,
+  IN UINT32                          Offset,
+  IN UINT32                          TransferLength,
+  OUT UINT8                          *LabelData
+  );
+
+/**
+  Writes the label data for the requested offset and length in to the Label Storage Area for the NVDIMM.
+
+  @param  This                   A pointer to the EFI_NVDIMM_LABEL_PROTOCOL instance.
+  @param  Offset                 The byte offset within the Label Storage Area to write to.
+  @param  TransferLength         Number of bytes to write to the Label Storage Area beginning at the byte
+                                 Offset specified. A TransferLength of 0 writes no data.
+  @param  LabelData              The return label data write at the requested offset and length from within
+                                 the Label Storage Area.
+
+  @retval EFI_SUCCESS            The label data from the Label Storage Area for the NVDIMM written read successfully
+                                 at the specified Offset and TransferLength.
+  @retval EFI_INVALID_PARAMETER  Any of the following are true:
+                                 - Offset > SizeOfLabelStorageArea reported in the LabelStorageInformation return data.
+                                 - Offset + TransferLength is > SizeOfLabelStorageArea reported in the
+                                   LabelStorageInformation return data.
+                                 - TransferLength is > MaxTransferLength reported in the LabelStorageInformation return
+                                   data.
+  @retval EFI_ACCESS_DENIED      The Label Storage Area for the NVDIMM device is not currently accessible and labels
+                                 cannot be written at this time.
+  @retval EFI_DEVICE_ERROR       A physical device error occurred and the data transfer failed to complete.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_NVDIMM_LABEL_STORAGE_WRITE) (
+  IN CONST EFI_NVDIMM_LABEL_PROTOCOL *This,
+  IN UINT32                          Offset,
+  IN UINT32                          TransferLength,
+  IN UINT8                           *LabelData
+  );
+
+///
+/// Provides services that allow management of labels contained in a Label Storage Area.
+///
+struct _EFI_NVDIMM_LABEL_PROTOCOL {
+  EFI_NVDIMM_LABEL_STORAGE_INFORMATION LabelStorageInformation;
+  EFI_NVDIMM_LABEL_STORAGE_READ        LabelStorageRead;
+  EFI_NVDIMM_LABEL_STORAGE_WRITE       LabelStorageWrite;
+};
+
+extern EFI_GUID gEfiNvdimmLabelProtocolGuid;
+
+#endif
diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index c5279298e8..3ccd3dd5a9 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -1772,6 +1772,9 @@ [Protocols]
   ## Include/Protocol/HiiPopup.h
   gEfiHiiPopupProtocolGuid                  = { 0x4311edc0, 0x6054, 0x46d4, { 0x9e, 0x40, 0x89, 0x3e, 0xa9, 0x52, 0xfc, 0xcc }}
 
+  ## Include/Protocol/NvdimmLabel.h
+  gEfiNvdimmLabelProtocolGuid               = { 0xd40b6b80, 0x97d5, 0x4282, { 0xbb, 0x1d, 0x22, 0x3a, 0x16, 0x91, 0x80, 0x58 }}
+
   #
   # Protocols defined in Shell2.0
   #
-- 
2.12.2.windows.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 0/2] Add NVDIMM related spec definitions
  2017-11-08  6:33 [PATCH v2 0/2] Add NVDIMM related spec definitions Ruiyu Ni
  2017-11-08  6:33 ` [PATCH v2 1/2] MdePkg/Btt.h: Add Block Translation Table definitions Ruiyu Ni
  2017-11-08  6:33 ` [PATCH v2 2/2] MdePkg/NvdimmLabel.h: Add NVDIMM_LABEL protocol definition Ruiyu Ni
@ 2017-11-08  8:24 ` Gao, Liming
  2 siblings, 0 replies; 4+ messages in thread
From: Gao, Liming @ 2017-11-08  8:24 UTC (permalink / raw)
  To: Ni, Ruiyu, edk2-devel@lists.01.org

Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>Ruiyu Ni
>Sent: Wednesday, November 08, 2017 2:33 PM
>To: edk2-devel@lists.01.org
>Subject: [edk2] [PATCH v2 0/2] Add NVDIMM related spec definitions
>
>v2:
>  1. Create Btt.h in Include/Guid directory per Liming's comments.
>  2. Change the GUID C name to match macro name.
>
>Ruiyu Ni (2):
>  MdePkg/Btt.h: Add Block Translation Table definitions
>  MdePkg/NvdimmLabel.h: Add NVDIMM_LABEL protocol definition
>
> MdePkg/Include/Guid/Btt.h             | 228 ++++++++++++++++++++++
> MdePkg/Include/Protocol/NvdimmLabel.h | 351
>++++++++++++++++++++++++++++++++++
> MdePkg/MdePkg.dec                     |   9 +
> 3 files changed, 588 insertions(+)
> create mode 100644 MdePkg/Include/Guid/Btt.h
> create mode 100644 MdePkg/Include/Protocol/NvdimmLabel.h
>
>--
>2.12.2.windows.2
>
>_______________________________________________
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-08  8:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-08  6:33 [PATCH v2 0/2] Add NVDIMM related spec definitions Ruiyu Ni
2017-11-08  6:33 ` [PATCH v2 1/2] MdePkg/Btt.h: Add Block Translation Table definitions Ruiyu Ni
2017-11-08  6:33 ` [PATCH v2 2/2] MdePkg/NvdimmLabel.h: Add NVDIMM_LABEL protocol definition Ruiyu Ni
2017-11-08  8:24 ` [PATCH v2 0/2] Add NVDIMM related spec definitions Gao, Liming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox