diff options
author | Wei6 Xu <wei6.xu@intel.com> | 2019-06-24 14:49:24 +0800 |
---|---|---|
committer | Zhang, Chao B <chao.b.zhang@intel.com> | 2019-06-26 15:10:41 +0800 |
commit | 4ef0b0ac8e89633b8ad0475fa153c97a1dbe5905 (patch) | |
tree | 00861b49f2d367a87a2fd2ddeaf2a7662dacc89b | |
parent | 43311062a148666f9f8090dc134ae55197f8e41c (diff) | |
download | edk2-4ef0b0ac8e89633b8ad0475fa153c97a1dbe5905.zip edk2-4ef0b0ac8e89633b8ad0475fa153c97a1dbe5905.tar.gz edk2-4ef0b0ac8e89633b8ad0475fa153c97a1dbe5905.tar.bz2 |
MdeModulePkg/CapsuleRuntimeDxe: Introduce PCD to control this feature.
REF: https://github.com/tianocore/tianocore.github.io/wiki/
UEFI-Capsule-on-Disk-Introducation
Introduce PcdCapsuleInRamSupport to turn on/off Capsule In Ram feature.
Platform could choose to drop CapsulePei/CapsuleX64 and not to support
Capsule In Ram.
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>
-rw-r--r-- | MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf | 1 | ||||
-rw-r--r-- | MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c | 12 |
2 files changed, 12 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf index 338577e..9da4507 100644 --- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf +++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf @@ -90,6 +90,7 @@ [Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizeNonPopulateCapsule ## SOMETIMES_CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule ## SOMETIMES_CONSUMES # Populate Image requires reset support.
+ gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleInRamSupport ## CONSUMES
[Pcd.X64]
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsulePeiLongModeStackSize ## SOMETIMES_CONSUMES
diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c index aaf819c..77b8f00 100644 --- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c +++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c @@ -4,7 +4,7 @@ It installs the Capsule Architectural Protocol defined in PI1.0a to signify
the capsule runtime services are ready.
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -72,6 +72,14 @@ UpdateCapsule ( CHAR16 *TempVarName;
//
+ // Check if platform support Capsule In RAM or not.
+ // Platform could choose to drop CapsulePei/CapsuleX64 and do not support Capsule In RAM.
+ //
+ if (!PcdGetBool(PcdCapsuleInRamSupport)) {
+ return EFI_UNSUPPORTED;
+ }
+
+ //
// Capsule Count can't be less than one.
//
if (CapsuleCount < 1) {
@@ -218,6 +226,8 @@ UpdateCapsule ( /**
Returns if the capsule can be supported via UpdateCapsule().
+ Notice: When PcdCapsuleInRamSupport is unsupported, even this routine returns a valid answer,
+ the capsule still is unsupported via UpdateCapsule().
@param CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules
being passed into update capsule.
|