## Capsule Update Policy Protocol\r
gEdkiiCapuleUpdatePolicyProtocolGuid = { 0x487784c5, 0x6299, 0x4ba6, { 0xb0, 0x96, 0x5c, 0xc5, 0x27, 0x7c, 0xf7, 0x57 } }\r
\r
+[PcdsFeatureFlag]\r
+ ## Indicates if the Firmware Management Protocol supports access to\r
+ # to a firmware storage device. If set to FALSE, then only GetImageInfo()\r
+ # is supported. This is used by FMP drivers that require the samllest\r
+ # possible Firmware Management Protocol implementation that supports\r
+ # advertising the updatable firmware device in the ESRT.<BR>\r
+ # TRUE - All Firmware Management Protocol services supported.<BR>\r
+ # FALSE - Firmware Management Protocol returns EFI_UNSUPPORTED for\r
+ # all services except GetImageInfo().<BR>\r
+ # @Prompt Firmware Device Storage Access Enabled.\r
+ gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceStorageAccessEnable|TRUE|BOOLEAN|0x40000011\r
+\r
[PcdsFixedAtBuild]\r
## The SHA-256 hash of a PKCS7 test key that is used to detect if a test key\r
# is being used to authenticate capsules. Test key detection is disabled by\r
DEFINE SYSTEM_FMP_ESRT_GUID = B461B3BD-E62A-4A71-841C-50BA4E500267\r
DEFINE DEVICE_FMP_ESRT_GUID = 226034C4-8B67-4536-8653-D6EE7CE5A316\r
\r
+ #\r
+ # TRUE - Build FmpDxe module for with storage access enabled\r
+ # FALSE - Build FmpDxe module for with storage access disabled\r
+ #\r
+ DEFINE DEVICE_FMP_STORAGE_ACCESS_ENABLE = TRUE\r
+\r
[LibraryClasses]\r
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf\r
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf\r
# FILE_GUID is used as ESRT GUID\r
#\r
FILE_GUID = $(DEVICE_FMP_ESRT_GUID)\r
+ <PcdsFeatureFlag>\r
+ gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceStorageAccessEnable|$(DEVICE_FMP_STORAGE_ACCESS_ENABLE)\r
<PcdsFixedAtBuild>\r
+!if $(DEVICE_FMP_STORAGE_ACCESS_ENABLE) == FALSE\r
+ #\r
+ # Disable test key detection\r
+ #\r
+ gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceTestKeySha256Digest|{0}\r
+!endif\r
#\r
# Unicode name string that is used to populate FMP Image Descriptor for this capsule update module\r
#\r
+!if $(DEVICE_FMP_STORAGE_ACCESS_ENABLE) == TRUE\r
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName|L"Sample Firmware Device"\r
+!else\r
+ gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName|L"Sample Firmware Device No Storage Access"\r
+!endif\r
#\r
# Certificates used to authenticate capsule update image\r
#\r
\r
#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."\r
\r
+#string STR_gFmpDevicePkgTokenSpaceGuid_PcdFmpDeviceStorageAccessEnable_PROMPT #language en-US "Firmware Device Storage Access Enabled."\r
+#string STR_gFmpDevicePkgTokenSpaceGuid_PcdFmpDeviceStorageAccessEnable_HELP #language en-US "Indicates if the Firmware Management Protocol supports access to"\r
+ "to a firmware storage device. If set to FALSE, then only GetImageInfo()"\r
+ "is supported. This is used by FMP drivers that require the samllest"\r
+ "possible Firmware Management Protocol implementation that supports"\r
+ "advertising the updatable firmware device in the ESRT.<BR>"\r
+ " TRUE - All Firmware Management Protocol services supported.<BR>"\r
+ " FALSE - Firmware Management Protocol returns EFI_UNSUPPORTED for"\r
+ " all services except GetImageInfo().<BR>"\r
+\r
#string STR_gFmpDevicePkgTokenSpaceGuid_PcdFmpDeviceTestKeySha256Digest_PROMPT #language en-US "SHA-256 hash of PKCS7 test key."\r
#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"\r
"is being used to authenticate capsules. Test key detection can be disabled"\r
FIRMWARE_MANAGEMENT_PRIVATE_DATA *Private;\r
UINTN Size;\r
\r
+ if (!FeaturePcdGet (PcdFmpDeviceStorageAccessEnable)) {\r
+ return EFI_UNSUPPORTED;\r
+ }\r
+\r
Status = EFI_SUCCESS;\r
\r
//\r
FmpHeaderSize = 0;\r
AllHeaderSize = 0;\r
\r
+ if (!FeaturePcdGet (PcdFmpDeviceStorageAccessEnable)) {\r
+ return EFI_UNSUPPORTED;\r
+ }\r
+\r
//\r
// Retrieve the private context structure\r
//\r
IncommingFwVersion = 0;\r
LastAttemptStatus = LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL;\r
\r
+ if (!FeaturePcdGet (PcdFmpDeviceStorageAccessEnable)) {\r
+ return EFI_UNSUPPORTED;\r
+ }\r
+\r
//\r
// Retrieve the private context structure\r
//\r
gEdkiiFirmwareManagementProgressProtocolGuid ## PRODUCES\r
\r
[Pcd]\r
+ gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceStorageAccessEnable ## CONSUMES\r
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName ## CONSUMES\r
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceBuildTimeLowestSupportedVersion ## CONSUMES\r
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceLockEventGuid ## CONSUMES\r
gEdkiiFirmwareManagementProgressProtocolGuid ## PRODUCES\r
\r
[Pcd]\r
+ gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceStorageAccessEnable ## CONSUMES\r
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName ## CONSUMES\r
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceBuildTimeLowestSupportedVersion ## CONSUMES\r
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceLockEventGuid ## CONSUMES\r