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
This commit is contained in:
czhang46
2013-10-15 01:31:49 +00:00
committed by czhang46
parent 0127372430
commit 566771b0a7
12 changed files with 563 additions and 25 deletions

View File

@@ -36,6 +36,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Guid/BdsHii.h>
#include <Guid/ConnectConInEvent.h>
#include <Guid/Performance.h>
#include <Guid/FmpCapsule.h>
#include <Protocol/GenericMemoryTest.h>
#include <Protocol/FormBrowser2.h>
#include <Protocol/HiiConfigAccess.h>

View File

@@ -141,6 +141,7 @@
gDeviceManagerFormSetGuid ## SOMETIMES_PRODUCES ## DeviceManager HII Package
gDriverHealthFormSetGuid ## SOMETIMES_PRODUCES ## DriverHealth HII Package
gConnectConInEventGuid ## CONSUMES ## GUID (Connect ConIn Event)
gEfiFmpCapsuleGuid ## CONSUMES ## GUID (FMP Capsule)
[Protocols]
gEfiSimpleFileSystemProtocolGuid ## PROTOCOL CONSUMES

View File

@@ -403,7 +403,9 @@ BdsFormalizeEfiGlobalVariable (
//
// OS indicater support variable
//
OsIndicationSupport = EFI_OS_INDICATIONS_BOOT_TO_FW_UI;
OsIndicationSupport = EFI_OS_INDICATIONS_BOOT_TO_FW_UI \
| EFI_OS_INDICATIONS_FMP_CAPSULE_SUPPORTED;
Status = gRT->SetVariable (
L"OsIndicationsSupported",
&gEfiGlobalVariableGuid,

View File

@@ -1,7 +1,7 @@
/** @file
BDS routines to handle capsules.
Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2004 - 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
@@ -52,14 +52,16 @@ BdsProcessCapsules (
VOID **CapsulePtr;
VOID **CapsulePtrCache;
EFI_GUID *CapsuleGuidCache;
BOOLEAN NeedReset;
CapsuleNumber = 0;
CapsuleNumber = 0;
CapsuleTotalNumber = 0;
CacheIndex = 0;
CacheNumber = 0;
CapsulePtr = NULL;
CapsulePtrCache = NULL;
CapsuleGuidCache = NULL;
CacheIndex = 0;
CacheNumber = 0;
CapsulePtr = NULL;
CapsulePtrCache = NULL;
CapsuleGuidCache = NULL;
NeedReset = FALSE;
//
// We don't do anything else if the boot mode is not flash-update
@@ -190,6 +192,13 @@ BdsProcessCapsules (
for (Index = 0; Index < CapsuleTotalNumber; Index++) {
CapsuleHeader = (EFI_CAPSULE_HEADER*) CapsulePtr [Index];
if ((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) == 0) {
//
// Always reset system after all capsule processed if FMP capsule exist
//
if (CompareGuid (&gEfiFmpCapsuleGuid, &CapsuleHeader->CapsuleGuid)){
NeedReset = TRUE;
}
//
// Call capsule library to process capsule image.
//
@@ -197,6 +206,19 @@ BdsProcessCapsules (
}
}
if (NeedReset) {
Print(L"Capsule Request Cold Reboot.\n");
for (Index = 5; Index > 0; Index--) {
Print(L"\rResetting system in %d seconds ...", Index);
gBS->Stall (1000000);
}
gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
CpuDeadLoop ();
}
PlatformBdsLockNonUpdatableFlash ();
//