]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/DxeIpl: Support Capsule On Disk.
authorWei6 Xu <wei6.xu@intel.com>
Wed, 19 Jun 2019 16:32:05 +0000 (00:32 +0800)
committerZhang, Chao B <chao.b.zhang@intel.com>
Thu, 20 Jun 2019 08:50:42 +0000 (16:50 +0800)
https://github.com/tianocore/tianocore.github.io/wiki/UEFI-Capsule-
on-Disk-Introducation

If Capsule On Disk mode, call Capsule On Disk Load PPI to load
capsules. When it fails, still goes to Firmware Update boot path.
BDS will clear corresponding indicator and reboot later on.

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: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
MdeModulePkg/Core/DxeIplPeim/DxeIpl.h
MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
MdeModulePkg/Core/DxeIplPeim/DxeLoad.c

index 063fefb414b051b936cabce0fec20155788567f6..90b5b5b211997d9f2b23da4585c2ebcb106a3693 100644 (file)
@@ -2,7 +2,7 @@
   Master header file for DxeIpl PEIM. All source files in this module should\r
   include this file for common definitions.\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
@@ -21,6 +21,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <Ppi/LoadFile.h>\r
 #include <Ppi/S3Resume2.h>\r
 #include <Ppi/RecoveryModule.h>\r
+#include <Ppi/CapsuleOnDisk.h>\r
 #include <Ppi/VectorHandoffInfo.h>\r
 \r
 #include <Guid/MemoryTypeInformation.h>\r
index 62bb3f3077011af6c5204b956589f3dc3eca001c..abc3217b0179b7bf43808659c968ecfdd654f560 100644 (file)
@@ -5,7 +5,7 @@
 #  PPI to discover and dispatch the DXE Foundation and components that are\r
 #  needed to run the DXE Foundation.\r
 #\r
-#  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r
 #  Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>\r
 #\r
 #  SPDX-License-Identifier: BSD-2-Clause-Patent\r
   ArmMmuLib\r
 \r
 [Ppis]\r
-  gEfiDxeIplPpiGuid                 ## PRODUCES\r
-  gEfiPeiDecompressPpiGuid          ## PRODUCES\r
-  gEfiEndOfPeiSignalPpiGuid         ## SOMETIMES_PRODUCES # Not produced on S3 boot path\r
-  gEfiPeiReadOnlyVariable2PpiGuid   ## SOMETIMES_CONSUMES\r
-  gEfiPeiLoadFilePpiGuid            ## SOMETIMES_CONSUMES\r
-  gEfiPeiS3Resume2PpiGuid           ## SOMETIMES_CONSUMES # Consumed on S3 boot path\r
-  gEfiPeiRecoveryModulePpiGuid      ## SOMETIMES_CONSUMES # Consumed on recovery boot path\r
+  gEfiDxeIplPpiGuid                      ## PRODUCES\r
+  gEfiPeiDecompressPpiGuid               ## PRODUCES\r
+  gEfiEndOfPeiSignalPpiGuid              ## SOMETIMES_PRODUCES # Not produced on S3 boot path\r
+  gEfiPeiReadOnlyVariable2PpiGuid        ## SOMETIMES_CONSUMES\r
+  gEfiPeiLoadFilePpiGuid                 ## SOMETIMES_CONSUMES\r
+  gEfiPeiS3Resume2PpiGuid                ## SOMETIMES_CONSUMES # Consumed on S3 boot path\r
+  gEfiPeiRecoveryModulePpiGuid           ## SOMETIMES_CONSUMES # Consumed on recovery boot path\r
   ## SOMETIMES_CONSUMES\r
   ## UNDEFINED # HOB\r
   gEfiVectorHandoffInfoPpiGuid\r
-  gEfiPeiMemoryDiscoveredPpiGuid    ## SOMETIMES_CONSUMES\r
+  gEfiPeiMemoryDiscoveredPpiGuid         ## SOMETIMES_CONSUMES\r
+  gEdkiiPeiBootInCapsuleOnDiskModePpiGuid  ## SOMETIMES_CONSUMES\r
+  gEdkiiPeiCapsuleOnDiskPpiGuid            ## SOMETIMES_CONSUMES # Consumed on firmware update boot path\r
 \r
 [Guids]\r
   ## SOMETIMES_CONSUMES ## Variable:L"MemoryTypeInformation"\r
index c6e5b8330927ed093cac6222b1591160cbf0b989..859184e0d10968802eea1e24e75ad0f3471c7b28 100644 (file)
@@ -3,7 +3,7 @@
   Responsibility of this module is to load the DXE Core from a Firmware Volume.\r
 \r
 Copyright (c) 2016 HP Development Company, L.P.\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
@@ -265,7 +265,9 @@ DxeLoadCore (
   UINTN                                     DataSize;\r
   EFI_PEI_S3_RESUME2_PPI                    *S3Resume;\r
   EFI_PEI_RECOVERY_MODULE_PPI               *PeiRecovery;\r
+  EFI_PEI_CAPSULE_ON_DISK_PPI               *PeiCapsuleOnDisk;\r
   EFI_MEMORY_TYPE_INFORMATION               MemoryData[EfiMaxMemoryType + 1];\r
+  VOID                                      *CapsuleOnDiskModePpi;\r
 \r
   //\r
   // if in S3 Resume, restore configure\r
@@ -330,6 +332,32 @@ DxeLoadCore (
     //\r
     // Now should have a HOB with the DXE core\r
     //\r
+  } else if (BootMode == BOOT_ON_FLASH_UPDATE) {\r
+    //\r
+    // If Capsule On Disk mode, call storage stack to read Capsule Relocation file\r
+    // IoMmmu is highly recommmended to enable before reading\r
+    //\r
+    Status = PeiServicesLocatePpi (\r
+               &gEdkiiPeiBootInCapsuleOnDiskModePpiGuid,\r
+               0,\r
+               NULL,\r
+               &CapsuleOnDiskModePpi\r
+               );\r
+    if (!EFI_ERROR(Status)) {\r
+      Status = PeiServicesLocatePpi (\r
+                 &gEdkiiPeiCapsuleOnDiskPpiGuid,\r
+                 0,\r
+                 NULL,\r
+                 (VOID **) &PeiCapsuleOnDisk\r
+                 );\r
+\r
+      //\r
+      // Whether failed, still goes to Firmware Update boot path. BDS will clear corresponding indicator and reboot later on\r
+      //\r
+      if (!EFI_ERROR (Status)) {\r
+        Status = PeiCapsuleOnDisk->LoadCapsuleOnDisk (PeiServices, PeiCapsuleOnDisk);\r
+      }\r
+    }\r
   }\r
 \r
   if (GetFirstGuidHob ((CONST EFI_GUID *)&gEfiMemoryTypeInformationGuid) == NULL) {\r