From: "Kinney, Michael D" <michael.d.kinney@intel.com>
To: edk2-devel@lists.01.org
Cc: Star Zeng <star.zeng@intel.com>,
Michael D Kinney <michael.d.kinney@intel.com>
Subject: [Patch v6 15/23] FmpDevicePkg FmpDxe: Use Attributes to know whether reset is required
Date: Wed, 1 Aug 2018 16:29:15 -0700 [thread overview]
Message-ID: <20180801232923.18720-16-michael.d.kinney@intel.com> (raw)
In-Reply-To: <20180801232923.18720-1-michael.d.kinney@intel.com>
From: Star Zeng <star.zeng@intel.com>
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1040
Use Attributes to know whether reset is required and remove
PcdFmpDeviceSystemResetRequired.
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
---
FmpDevicePkg/FmpDevicePkg.dec | 7 -------
FmpDevicePkg/FmpDevicePkg.uni | 5 -----
FmpDevicePkg/FmpDxe/FmpDxe.c | 13 ++++++++++---
FmpDevicePkg/FmpDxe/FmpDxe.inf | 1 -
FmpDevicePkg/FmpDxe/FmpDxeLib.inf | 1 -
5 files changed, 10 insertions(+), 17 deletions(-)
diff --git a/FmpDevicePkg/FmpDevicePkg.dec b/FmpDevicePkg/FmpDevicePkg.dec
index 9ea0d73359..ad0730a532 100644
--- a/FmpDevicePkg/FmpDevicePkg.dec
+++ b/FmpDevicePkg/FmpDevicePkg.dec
@@ -62,13 +62,6 @@ [Guids]
gFmpDevicePkgTokenSpaceGuid = { 0x40b2d964, 0xfe11, 0x40dc, { 0x82, 0x83, 0x2e, 0xfb, 0xda, 0x29, 0x53, 0x56 } }
[PcdsFixedAtBuild]
- ## Indicates if a full system reset is required before a firmware update to a
- # firmware devices takes effect.<BR><BR>
- # TRUE - System reset is required.<BR>
- # FALSE - System reset is not required.<BR>
- # @Prompt FMP Device System Reset Required.
- gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceSystemResetRequired|TRUE|BOOLEAN|0x40000008
-
## The SHA-256 hash of a PKCS7 test key that is used to detect if a test key
# is being used to authenticate capsules. Test key detection is disabled by
# setting the value to {0}.
diff --git a/FmpDevicePkg/FmpDevicePkg.uni b/FmpDevicePkg/FmpDevicePkg.uni
index da31d0ac81..fed1da4802 100644
--- a/FmpDevicePkg/FmpDevicePkg.uni
+++ b/FmpDevicePkg/FmpDevicePkg.uni
@@ -22,11 +22,6 @@
#string STR_PACKAGE_DESCRIPTION #language en-US "This package provides libraries that support the implementation of a module that produces the Firmware Management Protocol to support the update of a system firmware component."
-#string STR_gFmpDevicePkgTokenSpaceGuid_PcdFmpDeviceSystemResetRequired_PROMPT #language en-US "FMP Device System Reset Required."
-#string STR_gFmpDevicePkgTokenSpaceGuid_PcdFmpDeviceSystemResetRequired_HELP #language en-US "Indicates if a full system reset is required before a firmware update to a firmware device takes effect.<BR><BR>\n"
- "TRUE - System reset is required.<BR>\n"
- "FALSE - System reset is not required.<BR>"
-
#string STR_gFmpDevicePkgTokenSpaceGuid_PcdFmpDeviceTestKeySha256Digest_PROMPT #language en-US "SHA-256 hash of PKCS7 test key."
#string STR_gFmpDevicePkgTokenSpaceGuid_PcdFmpDeviceTestKeySha256Digest_HELP #language en-US "The SHA-256 hash of a PKCS7 test key that is used to detect if a test key"
"is being used to authenticate capsules. Test key detection can be disabled"
diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c b/FmpDevicePkg/FmpDxe/FmpDxe.c
index 94fdf56085..3544afd3de 100644
--- a/FmpDevicePkg/FmpDxe/FmpDxe.c
+++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
@@ -898,6 +898,9 @@ SetTheImage (
UINT32 AllHeaderSize;
UINT32 IncommingFwVersion;
UINT32 LastAttemptStatus;
+ EFI_STATUS GetAttributesStatus;
+ UINT64 AttributesSupported;
+ UINT64 AttributesSetting;
Status = EFI_SUCCESS;
Updateable = 0;
@@ -1110,10 +1113,14 @@ SetTheImage (
//
// Set flag so the descriptor is repopulated
- // This only applied to devices that do not require system reboot
+ // This is only applied to devices that do not require reset
//
- if (!PcdGetBool (PcdFmpDeviceSystemResetRequired)) {
- mDescriptorPopulated = FALSE;
+ GetAttributesStatus = FmpDeviceGetAttributes (&AttributesSupported, &AttributesSetting);
+ if (!EFI_ERROR (GetAttributesStatus)) {
+ if (((AttributesSupported & IMAGE_ATTRIBUTE_RESET_REQUIRED) == 0) ||
+ ((AttributesSetting & IMAGE_ATTRIBUTE_RESET_REQUIRED) == 0)) {
+ mDescriptorPopulated = FALSE;
+ }
}
cleanup:
diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.inf b/FmpDevicePkg/FmpDxe/FmpDxe.inf
index ec2bb2d052..228e53658a 100644
--- a/FmpDevicePkg/FmpDxe/FmpDxe.inf
+++ b/FmpDevicePkg/FmpDxe/FmpDxe.inf
@@ -76,7 +76,6 @@ [Protocols]
gEdkiiFirmwareManagementProgressProtocolGuid ## PRODUCES
[Pcd]
- gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceSystemResetRequired ## CONSUMES
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName ## CONSUMES
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceBuildTimeLowestSupportedVersion ## CONSUMES
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceLockEventGuid ## CONSUMES
diff --git a/FmpDevicePkg/FmpDxe/FmpDxeLib.inf b/FmpDevicePkg/FmpDxe/FmpDxeLib.inf
index 41acf45fcf..5484531155 100644
--- a/FmpDevicePkg/FmpDxe/FmpDxeLib.inf
+++ b/FmpDevicePkg/FmpDxe/FmpDxeLib.inf
@@ -76,7 +76,6 @@ [Protocols]
gEdkiiFirmwareManagementProgressProtocolGuid ## PRODUCES
[Pcd]
- gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceSystemResetRequired ## CONSUMES
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName ## CONSUMES
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceBuildTimeLowestSupportedVersion ## CONSUMES
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceLockEventGuid ## CONSUMES
--
2.14.2.windows.3
next prev parent reply other threads:[~2018-08-01 23:29 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-01 23:29 [Patch v6 00/23] Add FmpDevicePkg Kinney, Michael D
2018-08-01 23:29 ` [Patch v6 01/23] FmpDevicePkg: Add package, library classes, and PCDs Kinney, Michael D
2018-08-01 23:29 ` [Patch v6 02/23] FmpDevicePkg: Add library instances Kinney, Michael D
2018-08-01 23:29 ` [Patch v6 03/23] FmpDevicePkg: Add FmpDxe module Kinney, Michael D
2018-08-01 23:29 ` [Patch v6 04/23] FmpDevicePkg: Add DSC file to build all package components Kinney, Michael D
2018-08-01 23:29 ` [Patch v6 05/23] FmpDevicePkg FmpDxe: Update function comment for FmpDxeEntryPoint Kinney, Michael D
2018-08-01 23:29 ` [Patch v6 06/23] FmpDevicePkg FmpDxe: Return 0 when LSV check is not required Kinney, Michael D
2018-08-01 23:29 ` [Patch v6 07/23] FmpDevicePkg: Remove IPF Kinney, Michael D
2018-08-01 23:29 ` [Patch v6 08/23] FmpDevicePkg: Add DISABLE_NEW_DEPRECATED_INTERFACES build options Kinney, Michael D
2018-08-01 23:29 ` [Patch v6 09/23] FmpDevicePkg FmpDxe: Check Progress!= NULL before calling Progress(100) Kinney, Michael D
2018-08-01 23:29 ` [Patch v6 10/23] FmpDevicePkg FmpDxe: Add EFI_ABORTED in retval of CheckTheImage() Kinney, Michael D
2018-08-01 23:29 ` [Patch v6 11/23] FmpDevicePkg FmpDxe: Fix typo "EFI_SECURITY_VIOLATIO" Kinney, Michael D
2018-08-01 23:29 ` [Patch v6 12/23] FmpDevicePkg: Remove DisplayUpdateProgressLib mapping for FmpDxe Kinney, Michael D
2018-08-01 23:29 ` [Patch v6 13/23] FmpDevicePkg FmpDxe: Add NULL check to return Value from GetVariable2 Kinney, Michael D
2018-08-01 23:29 ` [Patch v6 14/23] FmpDevicePkg FmpDxe: Check ImageIndex first before Image/ImageSize Kinney, Michael D
2018-08-01 23:29 ` Kinney, Michael D [this message]
2018-08-01 23:29 ` [Patch v6 16/23] FmpDevicePkg FmpDxe: Add comment in mFmpDeviceLocked's declaration Kinney, Michael D
2018-08-01 23:29 ` [Patch v6 17/23] FmpDevicePkg FmpDxe: Return UNSUPPORTED if device has been locked Kinney, Michael D
2018-08-01 23:29 ` [Patch v6 18/23] FmpDevicePkg FmpDxe: Initialize DeviceLibLowestSupportedVersion Kinney, Michael D
2018-08-01 23:29 ` [Patch v6 19/23] FmpDevicePkg: Fix code style issue Kinney, Michael D
2018-08-01 23:29 ` [Patch v6 20/23] FmpDevicePkg FmpDxe: Use local variable to store test key digest size Kinney, Michael D
2018-08-01 23:29 ` [Patch v6 21/23] FmpDevicePkg/FmpDxe: Fix XCODE build failure Kinney, Michael D
2018-08-01 23:29 ` [Patch v6 22/23] FmpDevicePkg: Remove useless lib mapping in dsc Kinney, Michael D
2018-08-01 23:29 ` [Patch v6 23/23] MdeModulePkg/BdsDxe: Move display of test key usage into BDS module Kinney, Michael D
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=20180801232923.18720-16-michael.d.kinney@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