summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MdeModulePkg/Include/Ppi/CapsuleOnDisk.h55
-rw-r--r--MdeModulePkg/MdeModulePkg.dec48
-rw-r--r--MdeModulePkg/MdeModulePkg.uni34
3 files changed, 137 insertions, 0 deletions
diff --git a/MdeModulePkg/Include/Ppi/CapsuleOnDisk.h b/MdeModulePkg/Include/Ppi/CapsuleOnDisk.h
new file mode 100644
index 0000000000..c83e68fcd0
--- /dev/null
+++ b/MdeModulePkg/Include/Ppi/CapsuleOnDisk.h
@@ -0,0 +1,55 @@
+/** @file
+ This file declares Capsule On Disk PPI. This PPI is used to find and load the
+ capsule on files that are relocated into a temp file under rootdir.
+
+ Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef __PEI_CAPSULE_ON_DISK_PPI_H__
+#define __PEI_CAPSULE_ON_DISK_PPI_H__
+
+#define EFI_PEI_CAPSULE_ON_DISK_PPI_GUID \
+ { \
+ 0x71a9ea61, 0x5a35, 0x4a5d, {0xac, 0xef, 0x9c, 0xf8, 0x6d, 0x6d, 0x67, 0xe0 } \
+ }
+
+typedef struct _EFI_PEI_CAPSULE_ON_DISK_PPI EFI_PEI_CAPSULE_ON_DISK_PPI;
+
+/**
+ Loads a DXE capsule from some media into memory and updates the HOB table
+ with the DXE firmware volume information.
+
+ @param PeiServices General-purpose services that are available to every PEIM.
+ @param This Indicates the EFI_PEI_RECOVERY_MODULE_PPI instance.
+
+ @retval EFI_SUCCESS The capsule was loaded correctly.
+ @retval EFI_DEVICE_ERROR A device error occurred.
+ @retval EFI_NOT_FOUND A recovery DXE capsule cannot be found.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_LOAD_CAPSULE_ON_DISK)(
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_CAPSULE_ON_DISK_PPI *This
+ );
+
+///
+/// Finds and loads the recovery files.
+///
+struct _EFI_PEI_CAPSULE_ON_DISK_PPI {
+ EFI_PEI_LOAD_CAPSULE_ON_DISK LoadCapsuleOnDisk; ///< Loads a DXE binary capsule into memory.
+};
+
+extern EFI_GUID gEdkiiPeiCapsuleOnDiskPpiGuid;
+
+#define EFI_PEI_BOOT_IN_CAPSULE_ON_DISK_MODE_PPI \
+ { \
+ 0xb08a11e4, 0xe2b7, 0x4b75, { 0xb5, 0x15, 0xaf, 0x61, 0x6, 0x68, 0xbf, 0xd1 } \
+ }
+
+extern EFI_GUID gEfiPeiBootInCapsuleOnDiskModePpiGuid;
+
+#endif
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 2dee139ba3..08b3cbd7f2 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -399,6 +399,9 @@
## Include/Guid/SerialPortLibVendor.h
gEdkiiSerialPortLibVendorGuid = { 0xD3987D4B, 0x971A, 0x435F, { 0x8C, 0xAF, 0x49, 0x67, 0xEB, 0x62, 0x72, 0x41 } }
+ ## GUID indicates the capsule is to store Capsule On Disk file names.
+ gEdkiiCapsuleOnDiskNameGuid = { 0x98c80a4f, 0xe16b, 0x4d11, { 0x93, 0x9a, 0xab, 0xe5, 0x61, 0x26, 0x3, 0x30 } }
+
[Ppis]
## Include/Ppi/AtaController.h
gPeiAtaControllerPpiGuid = { 0xa45e60d1, 0xc719, 0x44aa, { 0xb0, 0x7a, 0xaa, 0x77, 0x7f, 0x85, 0x90, 0x6d }}
@@ -469,6 +472,10 @@
## Include/Ppi/Debug.h
gEdkiiDebugPpiGuid = { 0x999e699c, 0xb013, 0x475e, { 0xb1, 0x7b, 0xf3, 0xa8, 0xae, 0x5c, 0x48, 0x75 } }
+ ## Include/Ppi/CapsuleOnDisk.h
+ gEdkiiPeiCapsuleOnDiskPpiGuid = { 0x71a9ea61, 0x5a35, 0x4a5d, { 0xac, 0xef, 0x9c, 0xf8, 0x6d, 0x6d, 0x67, 0xe0 } }
+ gEdkiiPeiBootInCapsuleOnDiskModePpiGuid = { 0xb08a11e4, 0xe2b7, 0x4b75, { 0xb5, 0x15, 0xaf, 0x61, 0x6, 0x68, 0xbf, 0xd1 } }
+
[Protocols]
## Load File protocol provides capability to load and unload EFI image into memory and execute it.
# Include/Protocol/LoadPe32Image.h
@@ -1478,6 +1485,22 @@
# @Prompt Maximum Number of PEI Reset Filters, Reset Notifications or Reset Handlers.
gEfiMdeModulePkgTokenSpaceGuid.PcdMaximumPeiResetNotifies|0x10|UINT32|0x0000010A
+ ## Capsule On Disk is to deliver capsules via files on Mass Storage device.<BR><BR>
+ # This PCD indicates if the Capsule On Disk is supported.<BR>
+ # TRUE - Capsule On Disk is supported.<BR>
+ # FALSE - Capsule On Disk is not supported.<BR>
+ # If platform does not use this feature, this PCD should be set to FALSE.<BR><BR>
+ # Two sulotions to deliver Capsule On Disk:<BR>
+ # a) If PcdCapsuleInRamSupport = TRUE, Load Capsule On Disk image out of TCB, and reuse
+ # Capsule In Ram to deliver capsule.<BR>
+ # b) If PcdCapsuleInRamSupport = FALSE, Relocate Capsule On Disk image to RootDir out
+ # of TCB, and reuse FatPei to load capsules from external storage.<BR>
+ # Note:<BR>
+ # If Both Capsule In Ram and Capsule On Disk are provisioned at the same time, the Capsule
+ # On Disk will be bypassed.
+ # @Prompt Enable Capsule On Disk support.
+ gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleOnDiskSupport|FALSE|BOOLEAN|0x0000002d
+
[PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
## This PCD defines the Console output row. The default value is 25 according to UEFI spec.
# This PCD could be set to 0 then console output would be at max column and max row.
@@ -1937,6 +1960,17 @@
# @Prompt Recover file name in PEI phase
gEfiMdeModulePkgTokenSpaceGuid.PcdRecoveryFileName|L"FVMAIN.FV"|VOID*|0x30001045
+ ## This is Capsule Temp Relocation file name in PEI phase.
+ # The file must be in the root directory.
+ # The file name must be the 8.3 format.
+ # The PCD data must be in UNICODE format.
+ # CapsuleOnDiskLoadPei PEI module will set value of this PCD to PcdRecoveryFileName, then
+ # leverage recovery to get Capsule On Disk Temp Relocation file.
+ # Note: The file name must be shorter than PcdRecoveryFileName, otherwise CapsuleOnDiskLoadPei
+ # PEI module will fail to get Capsule On Disk Temp Relocation file.
+ # @Prompt Capsule On Disk Temp Relocation file name in PEI phase
+ gEfiMdeModulePkgTokenSpaceGuid.PcdCoDRelocationFileName|L"TempCod.tmp"|VOID*|0x30001048
+
## This PCD hold a list GUIDs for the ImageTypeId to indicate the
# FMP capsule is a system FMP.
# @Prompt A list of system FMP ImageTypeId GUIDs
@@ -1948,6 +1982,20 @@
# @Prompt The address mask when memory encryption is enabled.
gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask|0x0|UINT64|0x30001047
+ ## Capsule In Ram is to use memory to deliver the capsules that will be processed after system
+ # reset.<BR><BR>
+ # This PCD indicates if the Capsule In Ram is supported.<BR>
+ # TRUE - Capsule In Ram is supported.<BR>
+ # FALSE - Capsule In Ram is not supported.
+ # @Prompt Enable Capsule In Ram support.
+ gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleInRamSupport|TRUE|BOOLEAN|0x0000002e
+
+ ## Full device path of plaform specific device to store Capsule On Disk temp relocation file.<BR>
+ # If this PCD is set, Capsule On Disk temp relocation file will be stored in the device specified
+ # by this PCD, instead of the EFI System Partition that stores capsule image file.
+ # @Prompt Capsule On Disk relocation device path.
+ gEfiMdeModulePkgTokenSpaceGuid.PcdCodRelocationDevPath|{0xFF}|VOID*|0x0000002f
+
[PcdsPatchableInModule]
## Specify memory size with page number for PEI code when
# Loading Module at Fixed Address feature is enabled.
diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.uni
index ed8ac9eadc..06356407fb 100644
--- a/MdeModulePkg/MdeModulePkg.uni
+++ b/MdeModulePkg/MdeModulePkg.uni
@@ -1066,6 +1066,15 @@
"The file name must be the 8.3 format.\n"
"The PCD data must be in UNICODE format."
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdCoDRelocationFileName_PROMPT #language en-US "Capsule On Disk Temp Relocation file name in PEI phase"
+
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdCoDRelocationFileName_HELP #language en-US "This is Capsule Temp Relocation file name in PEI phase.<BR>"
+ "The file must be in the root directory.<BR>"
+ "The file name must be the 8.3 format.<BR>"
+ "The PCD data must be in UNICODE format.<BR>"
+ "CapsuleOnDiskLoadPei PEI module will set value of this PCD to PcdRecoveryFileName, then leverage recovery to get Capsule On Disk Temp Relocation file.<BR>"
+ "Note: The file name must be shorter than PcdRecoveryFileName, otherwise CapsuleOnDiskLoadPei PEI module will fail to get Capsule On Disk Temp Relocation file.<BR>"
+
#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSystemFmpCapsuleImageTypeIdGuid_PROMPT #language en-US "A list of system FMP ImageTypeId GUIDs"
#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdSystemFmpCapsuleImageTypeIdGuid_HELP #language en-US "This PCD hold a list GUIDs for the ImageTypeId to indicate the\n"
@@ -1131,6 +1140,31 @@
"enabled on AMD processors supporting the Secure Encrypted Virtualization (SEV) feature.\n"
"This mask should be applied when creating 1:1 virtual to physical mapping tables."
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdCapsuleOnDiskSupport_PROMPT #language en-US "Enable Capsule On Disk support"
+
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdCapsuleOnDiskSupport_HELP #language en-US "Capsule On Disk is to deliver capsules via files on Mass Storage device.<BR><BR>"
+ "This PCD indicates if the Capsule On Disk is supported.<BR>"
+ " TRUE - Capsule On Disk is supported.<BR>"
+ " FALSE - Capsule On Disk is not supported.<BR>"
+ "If platform does not use this feature, this PCD should be set to FALSE.<BR><BR>"
+ "Two sulotions to deliver Capsule On Disk:<BR>"
+ " a) If PcdCapsuleInRamSupport = TRUE, Load Capsule On Disk image out of TCB, and reuse Capsule In Ram to deliver capsule.<BR>"
+ " b) If PcdCapsuleInRamSupport = FALSE, Relocate Capsule On Disk image to RootDir out of TCB, and reuse FatPei to load capsules from external storage.<BR>"
+ "Note:<BR>"
+ "If Both Capsule In Ram and Capsule On Disk are provisioned at the same time, the Capsule On Disk will be bypassed."
+
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdCapsuleInRamSupport_PROMPT #language en-US "Enable Capsule In Ram support"
+
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdCapsuleInRamSupport_HELP #language en-US "Capsule In Ram is to use memory to deliver the capsules that will be processed after system reset.<BR><BR>"
+ "This PCD indicates if the Capsule In Ram is supported.<BR>"
+ " TRUE - Capsule In Ram is supported.<BR>"
+ " FALSE - Capsule In Ram is not supported."
+
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdCodRelocationDevPath_PROMPT #language en-US "Capsule On Disk relacation device path."
+
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdCodRelocationDevPath_HELP #language en-US "Full device path of plaform specific device to store Capsule On Disk temp relocation file.<BR>"
+ "If this PCD is set, Capsule On Disk temp relocation file will be stored in the device specified by this PCD, instead of the EFI System Partition that stores capsule image file."
+
#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdNullPointerDetectionPropertyMask_PROMPT #language en-US "Enable NULL pointer detection"
#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdNullPointerDetectionPropertyMask_HELP #language en-US "Mask to control the NULL address detection in code for different phases.\n"