summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal/CapsuleRuntimeDxe
diff options
context:
space:
mode:
authorczhang46 <czhang46>2013-10-15 01:31:49 +0000
committerczhang46 <czhang46@6f19259b-4bc3-4df7-8a09-765794883524>2013-10-15 01:31:49 +0000
commit566771b0a70a4ec637420c4b96a1415348bf2f12 (patch)
treee5e321ac1d2a7fba86f3942b25cbc396b9bb26fe /MdeModulePkg/Universal/CapsuleRuntimeDxe
parent012737243077fa9a843917878a5a9bdd343f611c (diff)
downloadedk2-566771b0a70a4ec637420c4b96a1415348bf2f12.tar.gz
edk2-566771b0a70a4ec637420c4b96a1415348bf2f12.tar.bz2
edk2-566771b0a70a4ec637420c4b96a1415348bf2f12.zip
Enable UEFI firmware to support FMP capsule format.
signed-off-by : Chao Zhang <chao.b.zhang@intel.com> reviewed-by : Gao Liming <liming.gao@intel.com> reviewed-by : Yao Jiewen <Jiewen.yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14773 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/CapsuleRuntimeDxe')
-rw-r--r--MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf6
-rw-r--r--MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c40
2 files changed, 36 insertions, 10 deletions
diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
index 3354fb7fc6..7767e68345 100644
--- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
+++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
@@ -5,7 +5,7 @@
# It installs the Capsule Architectural Protocol defined in PI1.0a to signify
# the capsule runtime services are ready.
#
-# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -53,7 +53,8 @@
UefiRuntimeLib
BaseLib
PrintLib
-
+ BaseMemoryLib
+
[LibraryClasses.X64]
LockBoxLib
UefiLib
@@ -62,6 +63,7 @@
[Guids]
gEfiCapsuleVendorGuid ## SOMETIMES_PRODUCED (Process across reset capsule image) ## Variable:L"CapsuleUpdateData" for capsule updated data
+ gEfiFmpCapsuleGuid ## FMP capsule GUID
[Guids.X64]
gEfiAcpiVariableGuid # ALWAYS_CONSUMED
diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
index 190127693d..0861a64778 100644
--- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
+++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
@@ -19,6 +19,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Protocol/Capsule.h>
#include <Guid/CapsuleVendor.h>
+#include <Guid/FmpCapsule.h>
#include <Library/DebugLib.h>
#include <Library/PcdLib.h>
@@ -29,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/UefiRuntimeLib.h>
#include <Library/BaseLib.h>
#include <Library/PrintLib.h>
-
+#include <Library/BaseMemoryLib.h>
//
// Handle for the installation of Capsule Architecture Protocol.
//
@@ -124,12 +125,23 @@ UpdateCapsule (
if ((CapsuleHeader->Flags & (CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_INITIATE_RESET)) == CAPSULE_FLAGS_INITIATE_RESET) {
return EFI_INVALID_PARAMETER;
}
+
+ //
+ // Check FMP capsule flag
+ //
+ if (CompareGuid(&CapsuleHeader->CapsuleGuid, &gEfiFmpCapsuleGuid)
+ && (CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) != 0 ) {
+ return EFI_INVALID_PARAMETER;
+ }
+
//
// Check Capsule image without populate flag by firmware support capsule function
//
- if (((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) == 0) &&
- (SupportCapsuleImage (CapsuleHeader) != EFI_SUCCESS)) {
- return EFI_UNSUPPORTED;
+ if ((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) == 0) {
+ Status = SupportCapsuleImage (CapsuleHeader);
+ if (EFI_ERROR(Status)) {
+ return Status;
+ }
}
}
@@ -250,6 +262,7 @@ QueryCapsuleCapabilities (
OUT EFI_RESET_TYPE *ResetType
)
{
+ EFI_STATUS Status;
UINTN ArrayNumber;
EFI_CAPSULE_HEADER *CapsuleHeader;
BOOLEAN NeedReset;
@@ -287,12 +300,23 @@ QueryCapsuleCapabilities (
if ((CapsuleHeader->Flags & (CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_INITIATE_RESET)) == CAPSULE_FLAGS_INITIATE_RESET) {
return EFI_INVALID_PARAMETER;
}
+
+ //
+ // Check FMP capsule flag
+ //
+ if (CompareGuid(&CapsuleHeader->CapsuleGuid, &gEfiFmpCapsuleGuid)
+ && (CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) != 0 ) {
+ return EFI_INVALID_PARAMETER;
+ }
+
//
// Check Capsule image without populate flag is supported by firmware
//
- if (((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) == 0) &&
- (SupportCapsuleImage (CapsuleHeader) != EFI_SUCCESS)) {
- return EFI_UNSUPPORTED;
+ if ((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) == 0) {
+ Status = SupportCapsuleImage (CapsuleHeader);
+ if (EFI_ERROR(Status)) {
+ return Status;
+ }
}
}
@@ -306,7 +330,7 @@ QueryCapsuleCapabilities (
break;
}
}
-
+
if (NeedReset) {
//
//Check if the platform supports update capsule across a system reset