summaryrefslogtreecommitdiffstats
path: root/FmpDevicePkg/FmpDxe
diff options
context:
space:
mode:
authorEric Jin <eric.jin@intel.com>2019-07-26 15:45:19 +0800
committerLiming Gao <liming.gao@intel.com>2019-08-15 17:22:24 +0800
commit11d354945c204588c98f74cfd8b6d18433d621c4 (patch)
tree1ceb27f607301ff51a11f64bbd7a5e0438ba6f7c /FmpDevicePkg/FmpDxe
parent278c3d48a7535a2c4aee01f8381ee56b13258c51 (diff)
downloadedk2-11d354945c204588c98f74cfd8b6d18433d621c4.tar.gz
FmpDevicePkg/FmpDxe: Add PcdFmpDeviceStorageAccessEnable
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1525 Add PCD PcdFmpDeviceStorageAccessEnable. If this PCD is TRUE, then the Firmware Management Protocol supports access to the firmware storage device. This is the default setting. If FALSE, then Firmware Management Protocol services that access the firmware storage device return EFI_UNSUPPORTED except GetImageInfo(). Setting this value to FALSE produces the smallest possible FmpDxe driver that still advertises the updatable firmware component in the ESRT. Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Eric Jin <eric.jin@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'FmpDevicePkg/FmpDxe')
-rw-r--r--FmpDevicePkg/FmpDxe/FmpDxe.c12
-rw-r--r--FmpDevicePkg/FmpDxe/FmpDxe.inf1
-rw-r--r--FmpDevicePkg/FmpDxe/FmpDxeLib.inf1
3 files changed, 14 insertions, 0 deletions
diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c b/FmpDevicePkg/FmpDxe/FmpDxe.c
index a53ded7380..3ca9d3526a 100644
--- a/FmpDevicePkg/FmpDxe/FmpDxe.c
+++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
@@ -541,6 +541,10 @@ GetTheImage (
FIRMWARE_MANAGEMENT_PRIVATE_DATA *Private;
UINTN Size;
+ if (!FeaturePcdGet (PcdFmpDeviceStorageAccessEnable)) {
+ return EFI_UNSUPPORTED;
+ }
+
Status = EFI_SUCCESS;
//
@@ -715,6 +719,10 @@ CheckTheImage (
FmpHeaderSize = 0;
AllHeaderSize = 0;
+ if (!FeaturePcdGet (PcdFmpDeviceStorageAccessEnable)) {
+ return EFI_UNSUPPORTED;
+ }
+
//
// Retrieve the private context structure
//
@@ -970,6 +978,10 @@ SetTheImage (
IncommingFwVersion = 0;
LastAttemptStatus = LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL;
+ if (!FeaturePcdGet (PcdFmpDeviceStorageAccessEnable)) {
+ return EFI_UNSUPPORTED;
+ }
+
//
// Retrieve the private context structure
//
diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.inf b/FmpDevicePkg/FmpDxe/FmpDxe.inf
index 65535a7f43..5487123935 100644
--- a/FmpDevicePkg/FmpDxe/FmpDxe.inf
+++ b/FmpDevicePkg/FmpDxe/FmpDxe.inf
@@ -61,6 +61,7 @@
gEdkiiFirmwareManagementProgressProtocolGuid ## PRODUCES
[Pcd]
+ gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceStorageAccessEnable ## CONSUMES
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName ## CONSUMES
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceBuildTimeLowestSupportedVersion ## CONSUMES
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceLockEventGuid ## CONSUMES
diff --git a/FmpDevicePkg/FmpDxe/FmpDxeLib.inf b/FmpDevicePkg/FmpDxe/FmpDxeLib.inf
index 3b10b57377..ba762b0b77 100644
--- a/FmpDevicePkg/FmpDxe/FmpDxeLib.inf
+++ b/FmpDevicePkg/FmpDxe/FmpDxeLib.inf
@@ -61,6 +61,7 @@
gEdkiiFirmwareManagementProgressProtocolGuid ## PRODUCES
[Pcd]
+ gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceStorageAccessEnable ## CONSUMES
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName ## CONSUMES
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceBuildTimeLowestSupportedVersion ## CONSUMES
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceLockEventGuid ## CONSUMES