]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Add Capsule On Disk related definition.
authorWei6 Xu <wei6.xu@intel.com>
Mon, 24 Jun 2019 06:46:02 +0000 (14:46 +0800)
committerZhang, Chao B <chao.b.zhang@intel.com>
Wed, 26 Jun 2019 07:10:40 +0000 (15:10 +0800)
REF: https://github.com/tianocore/tianocore.github.io/wiki/
UEFI-Capsule-on-Disk-Introducation

This patch will add Capsule On Disk related definition, including
GUID, PPI and PCDs:
The Capsule On Disk Name GUID indicates the capsule is to store
Capsule On Disk file names.
The Pei Capsule On Disk PPI provides service to retrieve capsules
from Capsule On Disk temp relocation file on mass storage devices
and create capsule hob for these capsules.
Pei Boot In CapsuleOnDisk Mode Ppi indicates current boot mode is
capsule on disk mode.
PcdCapsuleOnDiskSupport is used to enable/disable Capsule On Disk.
PcdCapsuleInRamSupport is used to enable/disable Capsule In Ram.
PcdCoDRelocationFileName specifies the Capsule On Disk temp
relocation file name.
PcdCodRelocationDevPath specifies platform specific device to store
Capsule On Disk temp relocation file.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Chao B Zhang <chao.b.zhang@intel.com>
Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
Acked-by: Hao A Wu <hao.a.wu@intel.com>
MdeModulePkg/Include/Ppi/CapsuleOnDisk.h [new file with mode: 0644]
MdeModulePkg/MdeModulePkg.dec
MdeModulePkg/MdeModulePkg.uni

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