From af5902b48f2d3c5d0e81de0afb5be061d689b544 Mon Sep 17 00:00:00 2001 From: Sergii Dmytruk Date: Sun, 30 Jun 2024 18:51:35 +0300 Subject: [PATCH] MdeModulePkg: Add PcdCapsuleFmpSupport to set EFI_OS_INDICATIONS_FMP_CAPSULE_SUPPORTED Don't know why EDK never sets this bit (there is only definition with no uses), maybe nothing actually checks its value. Whatever the reason is, it seems like a good idea to make setting it possible. Signed-off-by: Sergii Dmytruk --- MdeModulePkg/MdeModulePkg.dec | 8 ++++++++ MdeModulePkg/Universal/BdsDxe/BdsDxe.inf | 1 + MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 2dd524fda9..f69068683c 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -1598,6 +1598,14 @@ # @Prompt Maximum Number of PEI Reset Filters, Reset Notifications or Reset Handlers. gEfiMdeModulePkgTokenSpaceGuid.PcdMaximumPeiResetNotifies|0x10|UINT32|0x0000010A + ## Whether to report support of FMP capsules in OsIndicationSupport.

+ # This PCD indicates if support of FMP capsules should be advertised.
+ # TRUE - support of FMP capsules is advertised.
+ # FALSE - support of FMP capsules is not advertised.
+ # If platform does not use this feature, this PCD should be set to FALSE.

+ # @Prompt Enable advertising support of FMP capsules. + gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleFmpSupport|FALSE|BOOLEAN|0x00000028 + ## Capsule On Disk is to deliver capsules via files on Mass Storage device.

# This PCD indicates if the Capsule On Disk is supported.
# TRUE - Capsule On Disk is supported.
diff --git a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf index 5bac635def..95d2607b8d 100644 --- a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf +++ b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf @@ -97,6 +97,7 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdErrorCodeSetVariable ## SOMETIMES_CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdTestKeyUsed ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleOnDiskSupport ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleFmpSupport ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdPlatformRecoverySupport ## CONSUMES [Depex] diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c index 3670ae6f28..5b0d8c681e 100644 --- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c +++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c @@ -595,6 +595,10 @@ BdsFormalizeOSIndicationVariable ( OsIndicationSupport |= EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED; } + if (PcdGetBool (PcdCapsuleFmpSupport)) { + OsIndicationSupport |= EFI_OS_INDICATIONS_FMP_CAPSULE_SUPPORTED; + } + Status = gRT->SetVariable ( EFI_OS_INDICATIONS_SUPPORT_VARIABLE_NAME, &gEfiGlobalVariableGuid,