]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: Add ESRT Interface Definitions
authorHao Wu <hao.a.wu@intel.com>
Tue, 28 Apr 2015 07:28:27 +0000 (07:28 +0000)
committerhwu1225 <hwu1225@Edk2>
Tue, 28 Apr 2015 07:28:27 +0000 (07:28 +0000)
Add EFI System Resource Table (ESRT) interface (API only).

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17235 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/Guid/FmpCapsule.h
MdePkg/Include/Guid/SystemResourceTable.h [new file with mode: 0644]
MdePkg/Include/Protocol/FirmwareManagement.h
MdePkg/MdePkg.dec

index 4c358b82bb6d08891baad1887c3f21b2166a1b8b..8c9ae6b8d9456ebbfb2ebd922d5ad98722906658 100644 (file)
@@ -2,7 +2,7 @@
   Guid & data structure used for Delivering Capsules Containing Updates to Firmware\r
   Management Protocol\r
 \r
   Guid & data structure used for Delivering Capsules Containing Updates to Firmware\r
   Management Protocol\r
 \r
-  Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials                          \r
   are licensed and made available under the terms and conditions of the BSD License         \r
   which accompanies this distribution.  The full text of the license may be found at        \r
   This program and the accompanying materials                          \r
   are licensed and made available under the terms and conditions of the BSD License         \r
   which accompanies this distribution.  The full text of the license may be found at        \r
@@ -56,7 +56,7 @@ typedef struct {
   UINT32   Version;\r
 \r
   ///\r
   UINT32   Version;\r
 \r
   ///\r
-  /// Used to identifiy device firmware targeted by this update. This guid is matched by\r
+  /// Used to identify device firmware targeted by this update. This guid is matched by\r
   /// system firmware against ImageTypeId field within a EFI_FIRMWARE_IMAGE_DESCRIPTOR\r
   ///\r
   EFI_GUID UpdateImageTypeId;\r
   /// system firmware against ImageTypeId field within a EFI_FIRMWARE_IMAGE_DESCRIPTOR\r
   ///\r
   EFI_GUID UpdateImageTypeId;\r
@@ -73,16 +73,25 @@ typedef struct {
   UINT32   UpdateImageSize;\r
 \r
   ///\r
   UINT32   UpdateImageSize;\r
 \r
   ///\r
-  ///Size of the VendorCode bytes which optionally immediately follow binary update image in the capsule\r
+  /// Size of the VendorCode bytes which optionally immediately follow binary update image in the capsule\r
   ///\r
   UINT32   UpdateVendorCodeSize;\r
   ///\r
   UINT32   UpdateVendorCodeSize;\r
+\r
+  ///\r
+  /// The HardwareInstance to target with this update. If value is zero it means match all\r
+  /// HardwareInstances. This field allows update software to target only a single device in\r
+  /// cases where there are more than one device with the same ImageTypeId GUID.\r
+  /// This header is outside the signed data of the Authentication Info structure and\r
+  /// therefore can be modified without changing the Auth data.\r
+  ///\r
+  UINT64   UpdateHardwareInstance;\r
 } EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER;\r
 \r
 #pragma pack()\r
 \r
 \r
 } EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER;\r
 \r
 #pragma pack()\r
 \r
 \r
-#define EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER_INIT_VERSION       0x00000001  \r
-#define EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER_INIT_VERSION 0x00000001\r
+#define EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER_INIT_VERSION       0x00000001\r
+#define EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER_INIT_VERSION 0x00000002\r
 \r
 extern EFI_GUID gEfiFmpCapsuleGuid;\r
 \r
 \r
 extern EFI_GUID gEfiFmpCapsuleGuid;\r
 \r
diff --git a/MdePkg/Include/Guid/SystemResourceTable.h b/MdePkg/Include/Guid/SystemResourceTable.h
new file mode 100644 (file)
index 0000000..a77cb92
--- /dev/null
@@ -0,0 +1,125 @@
+/** @file\r
+  Guid & data structure used for EFI System Resource Table (ESRT)\r
+\r
+  Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution. The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  @par Revision Reference:\r
+  GUIDs defined in UEFI 2.5 spec.\r
+\r
+**/\r
+\r
+\r
+#ifndef _SYSTEM_RESOURCE_TABLE_H__\r
+#define _SYSTEM_RESOURCE_TABLE_H__\r
+\r
+#define EFI_SYSTEM_RESOURCE_TABLE_GUID \\r
+  { \\r
+    0xb122a263, 0x3661, 0x4f68, {0x99, 0x29, 0x78, 0xf8, 0xb0, 0xd6, 0x21, 0x80 } \\r
+  }\r
+\r
+///\r
+/// Current Entry Version\r
+///\r
+#define EFI_SYSTEM_RESOURCE_TABLE_FIRMWARE_RESOURCE_VERSION  1\r
+\r
+///\r
+/// Firmware Type Definitions\r
+///\r
+#define ESRT_FW_TYPE_UNKNOWN         0x00000000\r
+#define ESRT_FW_TYPE_SYSTEMFIRMWARE  0x00000001\r
+#define ESRT_FW_TYPE_DEVICEFIRMWARE  0x00000002\r
+#define ESRT_FW_TYPE_UEFIDRIVER      0x00000003\r
+\r
+///\r
+/// Last Attempt Status Values\r
+///\r
+#define LAST_ATTEMPT_STATUS_SUCCESS                       0x00000000\r
+#define LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL            0x00000001\r
+#define LAST_ATTEMPT_STATUS_ERROR_INSUFFICIENT_RESOURCES  0x00000002\r
+#define LAST_ATTEMPT_STATUS_ERROR_INCORRECT_VERSION       0x00000003\r
+#define LAST_ATTEMPT_STATUS_ERROR_INVALID_FORMAT          0x00000004\r
+#define LAST_ATTEMPT_STATUS_ERROR_AUTH_ERROR              0x00000005\r
+#define LAST_ATTEMPT_STATUS_ERROR_PWR_EVT_AC              0x00000006\r
+#define LAST_ATTEMPT_STATUS_ERROR_PWR_EVT_BATT            0x00000007\r
+\r
+typedef struct {\r
+  ///\r
+  /// The firmware class field contains a GUID that identifies a firmware component\r
+  /// that can be updated via UpdateCapsule(). This GUID must be unique within all\r
+  /// entries of the ESRT.\r
+  ///\r
+  EFI_GUID                   FwClass;\r
+  ///\r
+  /// Identifies the type of firmware resource.\r
+  ///\r
+  UINT32                     FwType;\r
+  ///\r
+  /// The firmware version field represents the current version of the firmware\r
+  /// resource, value must always increase as a larger number represents a newer\r
+  /// version.\r
+  ///\r
+  UINT32                     FwVersion;\r
+  ///\r
+  /// The lowest firmware resource version to which a firmware resource can be\r
+  /// rolled back for the given system/device. Generally this is used to protect\r
+  /// against known and fixed security issues.\r
+  ///\r
+  UINT32                     LowestSupportedFwVersion;\r
+  ///\r
+  /// The capsule flags field contains the CapsuleGuid flags (bits 0- 15) as defined\r
+  /// in the EFI_CAPSULE_HEADER that will be set in the capsule header.\r
+  ///\r
+  UINT32                     CapsuleFlags;\r
+  ///\r
+  /// The last attempt version field describes the last firmware version for which\r
+  /// an update was attempted (uses the same format as Firmware Version).\r
+  /// Last Attempt Version is updated each time an UpdateCapsule() is attempted for\r
+  /// an ESRT entry and is preserved across reboots (non-volatile). However, in\r
+  /// cases where the attempt version is not recorded due to limitations in the\r
+  /// update process, the field shall set to zero after a failed update. Similarly,\r
+  /// in the case of a removable device, this value is set to 0 in cases where the\r
+  /// device has not been updated since being added to the system.\r
+  ///\r
+  UINT32                     LastAttemptVersion;\r
+  ///\r
+  /// The last attempt status field describes the result of the last firmware update\r
+  /// attempt for the firmware resource entry.\r
+  /// LastAttemptStatus is updated each time an UpdateCapsule() is attempted for an\r
+  /// ESRT entry and is preserved across reboots (non-volatile).\r
+  /// If a firmware update has never been attempted or is unknown, for example after\r
+  /// fresh insertion of a removable device, LastAttemptStatus must be set to Success.\r
+  ///\r
+  UINT32                     LastAttemptStatus;\r
+} EFI_SYSTEM_RESOURCE_ENTRY;\r
+\r
+typedef struct {\r
+  ///\r
+  /// The number of firmware resources in the table, must not be zero.\r
+  ///\r
+  UINT32                     FwResourceCount;\r
+  ///\r
+  /// The maximum number of resource array entries that can be within the table\r
+  /// without reallocating the table, must not be zero.\r
+  ///\r
+  UINT32                     FwResourceCountMax;\r
+  ///\r
+  /// The version of the EFI_SYSTEM_RESOURCE_ENTRY entities used in this table.\r
+  /// This field should be set to 1.\r
+  ///\r
+  UINT64                     FwResourceVersion;\r
+  ///\r
+  /// Array of EFI_SYSTEM_RESOURCE_ENTRY\r
+  ///\r
+  //EFI_SYSTEM_RESOURCE_ENTRY  Entries[];\r
+} EFI_SYSTEM_RESOURCE_TABLE;\r
+\r
+extern EFI_GUID gEfiSystemResourceTableGuid;\r
+\r
+#endif\r
index 7ba6a7aa16c2c9f9e0fb8090f9438dd7540096b4..c4191a9fe27acc284d0586dafb10ffffe374f2b2 100644 (file)
@@ -8,7 +8,7 @@
   CheckImage(), GetPackageInfo(), and SetPackageInfo() shall return \r
   EFI_UNSUPPORTED if not supported by the driver.\r
     \r
   CheckImage(), GetPackageInfo(), and SetPackageInfo() shall return \r
   EFI_UNSUPPORTED if not supported by the driver.\r
     \r
-  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
   Copyright (c) 2013 - 2014, Hewlett-Packard Development Company, L.P.<BR>  \r
   This program and the accompanying materials                          \r
   are licensed and made available under the terms and conditions of the BSD License         \r
   Copyright (c) 2013 - 2014, Hewlett-Packard Development Company, L.P.<BR>  \r
   This program and the accompanying materials                          \r
   are licensed and made available under the terms and conditions of the BSD License         \r
@@ -44,8 +44,8 @@ typedef struct {
   /// \r
   UINT8                            ImageIndex;\r
   ///\r
   /// \r
   UINT8                            ImageIndex;\r
   ///\r
-  /// A unique number identifying the firmware image type.  \r
-  /// \r
+  /// A unique GUID identifying the firmware image type.\r
+  ///\r
   EFI_GUID                         ImageTypeId;\r
   /// \r
   /// A unique number identifying the firmware image. \r
   EFI_GUID                         ImageTypeId;\r
   /// \r
   /// A unique number identifying the firmware image. \r
@@ -91,6 +91,32 @@ typedef struct {
   /// present in version 2 or higher.\r
   ///\r
   UINT32                           LowestSupportedImageVersion;\r
   /// present in version 2 or higher.\r
   ///\r
   UINT32                           LowestSupportedImageVersion;\r
+  ///\r
+  /// Describes the version that was last attempted to update. If no update attempted the\r
+  /// value will be 0. If the update attempted was improperly formatted and no version\r
+  /// number was available then the value will be zero. Only present in version 3 or higher.\r
+  UINT32                           LastAttemptVersion;\r
+  ///\r
+  /// Describes the status that was last attempted to update. If no update has been attempted\r
+  /// the value will be LAST_ATTEMPT_STATUS_SUCCESS. Only present in version 3 or higher.\r
+  ///\r
+  UINT32                           LastAttemptStatus;\r
+  ///\r
+  /// An optional number to identify the unique hardware instance within the system for\r
+  /// devices that may have multiple instances (Example: a plug in pci network card). This\r
+  /// number must be unique within the namespace of the ImageTypeId GUID and\r
+  /// ImageIndex. For FMP instances that have multiple descriptors for a single\r
+  /// hardware instance, all descriptors must have the same HardwareInstance value.\r
+  /// This number must be consistent between boots and should be based on some sort of\r
+  /// hardware identified unique id (serial number, etc) whenever possible. If a hardware\r
+  /// based number is not available the FMP provider may use some other characteristic\r
+  /// such as device path, bus/dev/function, slot num, etc for generating the\r
+  /// HardwareInstance. For implementations that will never have more than one\r
+  /// instance a zero can be used. A zero means the FMP provider is not able to determine a\r
+  /// unique hardware instance number or a hardware instance number is not needed. Only\r
+  /// present in version 3 or higher.\r
+  ///\r
+  UINT64                           HardwareInstance;\r
 } EFI_FIRMWARE_IMAGE_DESCRIPTOR;\r
 \r
 \r
 } EFI_FIRMWARE_IMAGE_DESCRIPTOR;\r
 \r
 \r
@@ -137,7 +163,7 @@ typedef struct {
 ///\r
 /// Descriptor Version exposed by GetImageInfo() function\r
 ///\r
 ///\r
 /// Descriptor Version exposed by GetImageInfo() function\r
 ///\r
-#define   EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION   2\r
+#define   EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION   3\r
 \r
 \r
 ///\r
 \r
 \r
 ///\r
index c36d4f5d052ec4a257e1b5e52cf3942ede27c828..04c285b6109b51441504d263bbda7b2da1c3fd45 100644 (file)
   gEfiAdapterInfoNetworkBootGuid      = { 0x1FBD2960, 0x4130, 0x41E5, {0x94, 0xAC, 0xD2, 0xCF, 0x03, 0x7F, 0xB3, 0x7C }}\r
   gEfiAdapterInfoSanMacAddressGuid    = { 0x114da5ef, 0x2cf1, 0x4e12, {0x9b, 0xbb, 0xc4, 0x70, 0xb5, 0x52, 0x5, 0xd9 }}\r
 \r
   gEfiAdapterInfoNetworkBootGuid      = { 0x1FBD2960, 0x4130, 0x41E5, {0x94, 0xAC, 0xD2, 0xCF, 0x03, 0x7F, 0xB3, 0x7C }}\r
   gEfiAdapterInfoSanMacAddressGuid    = { 0x114da5ef, 0x2cf1, 0x4e12, {0x9b, 0xbb, 0xc4, 0x70, 0xb5, 0x52, 0x5, 0xd9 }}\r
 \r
+  #\r
+  # GUIDs defined in UEFI2.5\r
+  #\r
+  ## Include/Guid/SystemResourceTable.h\r
+  gEfiSystemResourceTableGuid    = { 0xb122a263, 0x3661, 0x4f68, {0x99, 0x29, 0x78, 0xf8, 0xb0, 0xd6, 0x21, 0x80 }}\r
+\r
   #\r
   # GUID defined in PI1.0\r
   #\r
   #\r
   # GUID defined in PI1.0\r
   #\r