diff options
author | Star Zeng <star.zeng@intel.com> | 2018-07-18 19:00:32 +0800 |
---|---|---|
committer | Kinney, Michael D <michael.d.kinney@intel.com> | 2018-08-02 14:46:19 -0700 |
commit | f1a921cab2b8d5ca587059795ff57d9fc92b8995 (patch) | |
tree | 1dd08b4ed4c14cb828881274120861c0a207253b /FmpDevicePkg/FmpDxe | |
parent | ebfac291bd0e57f1ef452fb2f3a402738165bf3b (diff) | |
download | edk2-f1a921cab2b8d5ca587059795ff57d9fc92b8995.tar.gz edk2-f1a921cab2b8d5ca587059795ff57d9fc92b8995.tar.bz2 edk2-f1a921cab2b8d5ca587059795ff57d9fc92b8995.zip |
FmpDevicePkg FmpDxe: Use Attributes to know whether reset is required
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>
Diffstat (limited to 'FmpDevicePkg/FmpDxe')
-rw-r--r-- | FmpDevicePkg/FmpDxe/FmpDxe.c | 13 | ||||
-rw-r--r-- | FmpDevicePkg/FmpDxe/FmpDxe.inf | 1 | ||||
-rw-r--r-- | FmpDevicePkg/FmpDxe/FmpDxeLib.inf | 1 |
3 files changed, 10 insertions, 5 deletions
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 @@ 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 @@ gEdkiiFirmwareManagementProgressProtocolGuid ## PRODUCES
[Pcd]
- gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceSystemResetRequired ## CONSUMES
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName ## CONSUMES
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceBuildTimeLowestSupportedVersion ## CONSUMES
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceLockEventGuid ## CONSUMES
|