From: "Xu, Wei6" <wei6.xu@intel.com>
To: devel@edk2.groups.io
Cc: Michael D Kinney <michael.d.kinney@intel.com>,
Liming Gao <liming.gao@intel.com>
Subject: [edk2-devel][PATCH 1/3] MdePkg: Add definition for Fmp Capsule Dependency.
Date: Fri, 10 Jan 2020 13:34:52 +0800 [thread overview]
Message-ID: <20200110053454.15376-2-wei6.xu@intel.com> (raw)
In-Reply-To: <20200110053454.15376-1-wei6.xu@intel.com>
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>
---
MdePkg/Include/Guid/SystemResourceTable.h | 19 ++++++++-------
MdePkg/Include/Protocol/FirmwareManagement.h | 35 ++++++++++++++++++++++++++--
2 files changed, 43 insertions(+), 11 deletions(-)
diff --git a/MdePkg/Include/Guid/SystemResourceTable.h b/MdePkg/Include/Guid/SystemResourceTable.h
index 57c42bf9f3..418b8c8d05 100644
--- a/MdePkg/Include/Guid/SystemResourceTable.h
+++ b/MdePkg/Include/Guid/SystemResourceTable.h
@@ -1,9 +1,9 @@
/** @file
Guid & data structure used for EFI System Resource Table (ESRT)
- Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@par Revision Reference:
GUIDs defined in UEFI 2.5 spec.
@@ -32,18 +32,19 @@
#define ESRT_FW_TYPE_UEFIDRIVER 0x00000003
///
/// Last Attempt Status Values
///
-#define LAST_ATTEMPT_STATUS_SUCCESS 0x00000000
-#define LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL 0x00000001
-#define LAST_ATTEMPT_STATUS_ERROR_INSUFFICIENT_RESOURCES 0x00000002
-#define LAST_ATTEMPT_STATUS_ERROR_INCORRECT_VERSION 0x00000003
-#define LAST_ATTEMPT_STATUS_ERROR_INVALID_FORMAT 0x00000004
-#define LAST_ATTEMPT_STATUS_ERROR_AUTH_ERROR 0x00000005
-#define LAST_ATTEMPT_STATUS_ERROR_PWR_EVT_AC 0x00000006
-#define LAST_ATTEMPT_STATUS_ERROR_PWR_EVT_BATT 0x00000007
+#define LAST_ATTEMPT_STATUS_SUCCESS 0x00000000
+#define LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL 0x00000001
+#define LAST_ATTEMPT_STATUS_ERROR_INSUFFICIENT_RESOURCES 0x00000002
+#define LAST_ATTEMPT_STATUS_ERROR_INCORRECT_VERSION 0x00000003
+#define LAST_ATTEMPT_STATUS_ERROR_INVALID_FORMAT 0x00000004
+#define LAST_ATTEMPT_STATUS_ERROR_AUTH_ERROR 0x00000005
+#define LAST_ATTEMPT_STATUS_ERROR_PWR_EVT_AC 0x00000006
+#define LAST_ATTEMPT_STATUS_ERROR_PWR_EVT_BATT 0x00000007
+#define LAST_ATTEMPT_STATUS_ERROR_UNSATISFIED_DEPENDENCIES 0x00000008
typedef struct {
///
/// The firmware class field contains a GUID that identifies a firmware component
/// that can be updated via UpdateCapsule(). This GUID must be unique within all
diff --git a/MdePkg/Include/Protocol/FirmwareManagement.h b/MdePkg/Include/Protocol/FirmwareManagement.h
index 0a0bf4c84a..297bb5ff03 100644
--- a/MdePkg/Include/Protocol/FirmwareManagement.h
+++ b/MdePkg/Include/Protocol/FirmwareManagement.h
@@ -6,11 +6,11 @@
GetImageInfo() is the only required function. GetImage(), SetImage(),
CheckImage(), GetPackageInfo(), and SetPackageInfo() shall return
EFI_UNSUPPORTED if not supported by the driver.
- Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2013 - 2014, Hewlett-Packard Development Company, L.P.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@par Revision Reference:
This Protocol is introduced in UEFI Specification 2.3
@@ -26,10 +26,35 @@
0x86c77a67, 0xb97, 0x4633, {0xa1, 0x87, 0x49, 0x10, 0x4d, 0x6, 0x85, 0xc7 } \
}
typedef struct _EFI_FIRMWARE_MANAGEMENT_PROTOCOL EFI_FIRMWARE_MANAGEMENT_PROTOCOL;
+///
+/// Dependency Expression Opcode
+///
+#define EFI_FMP_DEP_PUSH_GUID 0x00
+#define EFI_FMP_DEP_PUSH_VERSION 0x01
+#define EFI_FMP_DEP_VERSION_STR 0x02
+#define EFI_FMP_DEP_AND 0x03
+#define EFI_FMP_DEP_OR 0x04
+#define EFI_FMP_DEP_NOT 0x05
+#define EFI_FMP_DEP_TRUE 0x06
+#define EFI_FMP_DEP_FALSE 0x07
+#define EFI_FMP_DEP_EQ 0x08
+#define EFI_FMP_DEP_GT 0x09
+#define EFI_FMP_DEP_GTE 0x0A
+#define EFI_FMP_DEP_LT 0x0B
+#define EFI_FMP_DEP_LTE 0x0C
+#define EFI_FMP_DEP_END 0x0D
+
+///
+/// Image Attribute - Dependency
+///
+typedef struct {
+ UINT8 Dependencies[1];
+} EFI_FIRMWARE_IMAGE_DEP;
+
///
/// EFI_FIRMWARE_IMAGE_DESCRIPTOR
///
typedef struct {
///
@@ -109,10 +134,11 @@ typedef struct {
/// instance a zero can be used. A zero means the FMP provider is not able to determine a
/// unique hardware instance number or a hardware instance number is not needed. Only
/// present in version 3 or higher.
///
UINT64 HardwareInstance;
+ EFI_FIRMWARE_IMAGE_DEP *Dependencies;
} EFI_FIRMWARE_IMAGE_DESCRIPTOR;
//
// Image Attribute Definitions
@@ -141,10 +167,15 @@ typedef struct {
#define IMAGE_ATTRIBUTE_IN_USE 0x0000000000000008
///
/// The attribute IMAGE_ATTRIBUTE_UEFI_IMAGE indicates that this image is an EFI compatible image.
///
#define IMAGE_ATTRIBUTE_UEFI_IMAGE 0x0000000000000010
+///
+/// The attribute IMAGE_ATTRIBUTE_DEPENDENCY indicates that there is an EFI_FIRMWARE_IMAGE_DEP
+/// section associated with the image.
+///
+#define IMAGE_ATTRIBUTE_DEPENDENCY 0x0000000000000020
//
// Image Compatibility Definitions
//
@@ -156,11 +187,11 @@ typedef struct {
#define IMAGE_COMPATIBILITY_CHECK_SUPPORTED 0x0000000000000001
///
/// Descriptor Version exposed by GetImageInfo() function
///
-#define EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION 3
+#define EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION 4
///
/// Image Attribute - Authentication Required
///
--
2.16.2.windows.1
next prev parent reply other threads:[~2020-01-10 5:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-10 5:34 [edk2-devel][PATCH 0/3] Fmp Capsule Dependency implementation Xu, Wei6
2020-01-10 5:34 ` Xu, Wei6 [this message]
2020-01-10 5:34 ` [edk2-devel][PATCH 2/3] MdeModulePkg/CapsuleApp: Enhance CapsuleApp for Fmp Capsule Dependency Xu, Wei6
2020-01-10 5:34 ` [edk2-devel][PATCH 3/3] FmdDevicePkg/FmpDxe: Support " Xu, Wei6
2020-01-16 12:25 ` [edk2-devel][PATCH 0/3] Fmp Capsule Dependency implementation Liming Gao
2020-01-16 13:31 ` Xu, Wei6
2020-01-16 13:54 ` Liming Gao
[not found] ` <15EA627A19795932.4264@groups.io>
2020-01-17 0:32 ` Liming Gao
2020-01-17 0:49 ` Xu, Wei6
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200110053454.15376-2-wei6.xu@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox