]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: Add definition for Fmp Capsule Dependency.
authorXu, Wei6 <wei6.xu@intel.com>
Fri, 10 Jan 2020 05:34:52 +0000 (13:34 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sun, 19 Jan 2020 02:47:47 +0000 (02:47 +0000)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2421

Add new definitions for Fmp Capsule dependency in UEFI Spec 2.8.
1. Extend the Last Attempt Status with a value to indicate the firmware
update fails with unsatisfied dependencies.
2. Add the definition of dependency expression op-codes.
3. Add the definition of EFI_FIRMWARE_IMAGE_DEP which is an array of FMP
dependency expression op-codes.
4. Extend the EFI_FIRMWARE_IMAGE_DESCRIPTOR with a pointer to the array of
FMP dependency expression op-codes.
5. Extend the Image Attribute Definitions with IMAGE_ATTRIBUTE_DEPENDENCY
to indicate that there is and EFI_FIRMWARE_IMAGE_DEP section associated
with the image.
6. Update EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION to 4.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdePkg/Include/Guid/SystemResourceTable.h
MdePkg/Include/Protocol/FirmwareManagement.h

index 57c42bf9f3da57185397d0a48503caae117d4868..418b8c8d055a7db90907a06c1bc1b853f145f28f 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Guid & data structure used for EFI System Resource Table (ESRT)\r
 \r
-  Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.<BR>\r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
   @par Revision Reference:\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
+#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
+#define LAST_ATTEMPT_STATUS_ERROR_UNSATISFIED_DEPENDENCIES  0x00000008\r
 \r
 typedef struct {\r
   ///\r
index 0a0bf4c84a51cff586fdb61bd594cd369e02518f..297bb5ff0397c859eedbfca173dffc0ee4090df9 100644 (file)
@@ -8,7 +8,7 @@
   CheckImage(), GetPackageInfo(), and SetPackageInfo() shall return\r
   EFI_UNSUPPORTED if not supported by the driver.\r
 \r
-  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.<BR>\r
   Copyright (c) 2013 - 2014, Hewlett-Packard Development Company, L.P.<BR>\r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 \r
 typedef struct _EFI_FIRMWARE_MANAGEMENT_PROTOCOL EFI_FIRMWARE_MANAGEMENT_PROTOCOL;\r
 \r
+///\r
+/// Dependency Expression Opcode\r
+///\r
+#define EFI_FMP_DEP_PUSH_GUID        0x00\r
+#define EFI_FMP_DEP_PUSH_VERSION     0x01\r
+#define EFI_FMP_DEP_VERSION_STR      0x02\r
+#define EFI_FMP_DEP_AND              0x03\r
+#define EFI_FMP_DEP_OR               0x04\r
+#define EFI_FMP_DEP_NOT              0x05\r
+#define EFI_FMP_DEP_TRUE             0x06\r
+#define EFI_FMP_DEP_FALSE            0x07\r
+#define EFI_FMP_DEP_EQ               0x08\r
+#define EFI_FMP_DEP_GT               0x09\r
+#define EFI_FMP_DEP_GTE              0x0A\r
+#define EFI_FMP_DEP_LT               0x0B\r
+#define EFI_FMP_DEP_LTE              0x0C\r
+#define EFI_FMP_DEP_END              0x0D\r
+\r
+///\r
+/// Image Attribute - Dependency\r
+///\r
+typedef struct {\r
+  UINT8 Dependencies[1];\r
+} EFI_FIRMWARE_IMAGE_DEP;\r
+\r
 ///\r
 /// EFI_FIRMWARE_IMAGE_DESCRIPTOR\r
 ///\r
@@ -111,6 +136,7 @@ typedef struct {
   /// present in version 3 or higher.\r
   ///\r
   UINT64                           HardwareInstance;\r
+  EFI_FIRMWARE_IMAGE_DEP           *Dependencies;\r
 } EFI_FIRMWARE_IMAGE_DESCRIPTOR;\r
 \r
 \r
@@ -143,6 +169,11 @@ typedef struct {
 /// The attribute IMAGE_ATTRIBUTE_UEFI_IMAGE indicates that this image is an EFI compatible image.\r
 ///\r
 #define    IMAGE_ATTRIBUTE_UEFI_IMAGE              0x0000000000000010\r
+///\r
+/// The attribute IMAGE_ATTRIBUTE_DEPENDENCY indicates that there is an EFI_FIRMWARE_IMAGE_DEP\r
+/// section associated with the image.\r
+///\r
+#define    IMAGE_ATTRIBUTE_DEPENDENCY              0x0000000000000020\r
 \r
 \r
 //\r
@@ -158,7 +189,7 @@ typedef struct {
 ///\r
 /// Descriptor Version exposed by GetImageInfo() function\r
 ///\r
-#define   EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION   3\r
+#define   EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION   4\r
 \r
 \r
 ///\r