]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
MdeModulePkg/CapsuleRuntimeDxe: Introduce PCD to control this feature.
[mirror_edk2.git] / MdeModulePkg / Universal / CapsuleRuntimeDxe / CapsuleService.c
index aaf819c4c615e7f2903b77139120c829055bb8e3..77b8f00062a65c833b1724ccc59ac86bd2517773 100644 (file)
@@ -4,7 +4,7 @@
   It installs the Capsule Architectural Protocol defined in PI1.0a to signify\r
   the capsule runtime services are ready.\r
 \r
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -71,6 +71,14 @@ UpdateCapsule (
   CHAR16                    CapsuleVarName[30];\r
   CHAR16                    *TempVarName;\r
 \r
+  //\r
+  // Check if platform support Capsule In RAM or not.\r
+  // Platform could choose to drop CapsulePei/CapsuleX64 and do not support Capsule In RAM.\r
+  //\r
+  if (!PcdGetBool(PcdCapsuleInRamSupport)) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
   //\r
   // Capsule Count can't be less than one.\r
   //\r
@@ -218,6 +226,8 @@ UpdateCapsule (
 \r
 /**\r
   Returns if the capsule can be supported via UpdateCapsule().\r
+  Notice: When PcdCapsuleInRamSupport is unsupported, even this routine returns a valid answer,\r
+  the capsule still is unsupported via UpdateCapsule().\r
 \r
   @param  CapsuleHeaderArray    Virtual pointer to an array of virtual pointers to the capsules\r
                                 being passed into update capsule.\r