summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg
diff options
context:
space:
mode:
Diffstat (limited to 'IntelFrameworkModulePkg')
-rw-r--r--IntelFrameworkModulePkg/Library/DxeCapsuleLib/DxeCapsuleLib.c383
-rw-r--r--IntelFrameworkModulePkg/Library/DxeCapsuleLib/DxeCapsuleLib.inf13
-rw-r--r--IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c11
-rw-r--r--IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf3
-rw-r--r--IntelFrameworkModulePkg/Universal/Acpi/AcpiSupportDxe/AcpiSupport.h11
-rw-r--r--IntelFrameworkModulePkg/Universal/Acpi/AcpiSupportDxe/AcpiSupportAcpiSupportProtocol.c36
-rw-r--r--IntelFrameworkModulePkg/Universal/Acpi/AcpiSupportDxe/AcpiSupportDxe.inf9
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/Bds.h1
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf1
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c4
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c244
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/Capsules.c36
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c33
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.h17
14 files changed, 608 insertions, 194 deletions
diff --git a/IntelFrameworkModulePkg/Library/DxeCapsuleLib/DxeCapsuleLib.c b/IntelFrameworkModulePkg/Library/DxeCapsuleLib/DxeCapsuleLib.c
index 6f5ab5b0f..04db1a4f6 100644
--- a/IntelFrameworkModulePkg/Library/DxeCapsuleLib/DxeCapsuleLib.c
+++ b/IntelFrameworkModulePkg/Library/DxeCapsuleLib/DxeCapsuleLib.c
@@ -1,7 +1,7 @@
/** @file
- Capsule Library instance to update capsule image to flash.
+ Capsule Library instance to process capsule images.
- Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2007 - 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
@@ -13,12 +13,368 @@
**/
#include <PiDxe.h>
+
#include <Guid/Capsule.h>
+#include <Guid/FmpCapsule.h>
+
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DxeServicesTableLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/CapsuleLib.h>
+#include <Library/GenericBdsLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/BaseLib.h>
+#include <Library/DevicePathLib.h>
+
+#include <Protocol/FirmwareManagement.h>
+#include <Protocol/DevicePath.h>
+
+
+/**
+ Function indicate the current completion progress of the firmware
+ update. Platform may override with own specific progress function.
+
+ @param Completion A value between 1 and 100 indicating the current completion progress of the firmware update
+
+ @retval EFI_SUCESS Input capsule is a correct FMP capsule.
+**/
+EFI_STATUS
+EFIAPI
+Update_Image_Progress (
+ IN UINTN Completion
+)
+{
+ return EFI_SUCCESS;
+}
+
+
+/**
+ Validate Fmp capsules layout.
+
+ @param CapsuleHeader Points to a capsule header.
+
+ @retval EFI_SUCESS Input capsule is a correct FMP capsule.
+ @retval EFI_INVALID_PARAMETER Input capsule is not a correct FMP capsule.
+**/
+EFI_STATUS
+ValidateFmpCapsule (
+ IN EFI_CAPSULE_HEADER *CapsuleHeader
+ )
+{
+ EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER *FmpCapsuleHeader;
+ UINT8 *EndOfCapsule;
+ EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER *ImageHeader;
+ UINT8 *EndOfPayload;
+ UINT64 *ItemOffsetList;
+ UINT32 ItemNum;
+ UINTN Index;
+
+ FmpCapsuleHeader = (EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER *) ((UINT8 *) CapsuleHeader + CapsuleHeader->HeaderSize);
+ EndOfCapsule = (UINT8 *) CapsuleHeader + CapsuleHeader->CapsuleImageSize;
+
+ if (FmpCapsuleHeader->Version > EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER_INIT_VERSION) {
+ return EFI_INVALID_PARAMETER;
+ }
+ ItemOffsetList = (UINT64 *)(FmpCapsuleHeader + 1);
+
+ ItemNum = FmpCapsuleHeader->EmbeddedDriverCount + FmpCapsuleHeader->PayloadItemCount;
+
+ if (ItemNum == FmpCapsuleHeader->EmbeddedDriverCount) {
+ //
+ // No payload element
+ //
+ if (((UINT8 *)FmpCapsuleHeader + ItemOffsetList[ItemNum - 1]) < EndOfCapsule) {
+ return EFI_SUCCESS;
+ } else {
+ return EFI_INVALID_PARAMETER;
+ }
+ }
+
+ if (FmpCapsuleHeader->PayloadItemCount != 0) {
+ //
+ // Check if the last payload is within capsule image range
+ //
+ ImageHeader = (EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER *)((UINT8 *)FmpCapsuleHeader + ItemOffsetList[ItemNum - 1]);
+ EndOfPayload = (UINT8 *)(ImageHeader + 1) + ImageHeader->UpdateImageSize + ImageHeader->UpdateVendorCodeSize;
+ } else {
+ //
+ // No driver & payload element in FMP
+ //
+ EndOfPayload = (UINT8 *)(FmpCapsuleHeader + 1);
+ }
+
+ if (EndOfPayload != EndOfCapsule) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ //
+ // All the address in ItemOffsetList must be stored in ascending order
+ //
+ if (ItemNum >= 2) {
+ for (Index = 0; Index < ItemNum - 1; Index++) {
+ if (ItemOffsetList[Index] >= ItemOffsetList[Index + 1]) {
+ return EFI_INVALID_PARAMETER;
+ }
+ }
+ }
+
+ return EFI_SUCCESS;
+}
+
+/**
+ Process Firmware management protocol data capsule.
+
+ @param CapsuleHeader Points to a capsule header.
+
+ @retval EFI_SUCESS Process Capsule Image successfully.
+ @retval EFI_UNSUPPORTED Capsule image is not supported by the firmware.
+ @retval EFI_VOLUME_CORRUPTED FV volume in the capsule is corrupted.
+ @retval EFI_OUT_OF_RESOURCES Not enough memory.
+**/
+EFI_STATUS
+ProcessFmpCapsuleImage (
+ IN EFI_CAPSULE_HEADER *CapsuleHeader
+ )
+{
+ EFI_STATUS Status;
+ EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER *FmpCapsuleHeader;
+ UINT8 *EndOfCapsule;
+ EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER *ImageHeader;
+ EFI_HANDLE ImageHandle;
+ UINT64 *ItemOffsetList;
+ UINT32 ItemNum;
+ UINTN Index;
+ UINTN ExitDataSize;
+ EFI_HANDLE *HandleBuffer;
+ EFI_FIRMWARE_MANAGEMENT_PROTOCOL *Fmp;
+ UINTN NumberOfHandles;
+ UINTN DescriptorSize;
+ UINT8 FmpImageInfoCount;
+ UINT32 FmpImageInfoDescriptorVer;
+ UINTN ImageInfoSize;
+ UINT32 PackageVersion;
+ CHAR16 *PackageVersionName;
+ CHAR16 *AbortReason;
+ EFI_FIRMWARE_IMAGE_DESCRIPTOR *FmpImageInfoBuf;
+ EFI_FIRMWARE_IMAGE_DESCRIPTOR *TempFmpImageInfo;
+ UINTN DriverLen;
+ UINTN Index1;
+ UINTN Index2;
+ MEMMAP_DEVICE_PATH MemMapNode;
+ EFI_DEVICE_PATH_PROTOCOL *DriverDevicePath;
+
+ Status = EFI_SUCCESS;
+ HandleBuffer = NULL;
+ ExitDataSize = 0;
+ DriverDevicePath = NULL;
+
+ FmpCapsuleHeader = (EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER *) ((UINT8 *) CapsuleHeader + CapsuleHeader->HeaderSize);
+ EndOfCapsule = (UINT8 *) CapsuleHeader + CapsuleHeader->CapsuleImageSize;
+
+ if (FmpCapsuleHeader->Version > EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER_INIT_VERSION) {
+ return EFI_INVALID_PARAMETER;
+ }
+ ItemOffsetList = (UINT64 *)(FmpCapsuleHeader + 1);
+
+ ItemNum = FmpCapsuleHeader->EmbeddedDriverCount + FmpCapsuleHeader->PayloadItemCount;
+
+ //
+ // capsule in which driver count and payload count are both zero is not processed.
+ //
+ if (ItemNum == 0) {
+ return EFI_SUCCESS;
+ }
+
+ //
+ // 1. ConnectAll to ensure
+ // All the communication protocol required by driver in capsule installed
+ // All FMP protocols are installed
+ //
+ BdsLibConnectAll();
+
+
+ //
+ // 2. Try to load & start all the drivers within capsule
+ //
+ SetDevicePathNodeLength (&MemMapNode.Header, sizeof (MemMapNode));
+ MemMapNode.Header.Type = HARDWARE_DEVICE_PATH;
+ MemMapNode.Header.SubType = HW_MEMMAP_DP;
+ MemMapNode.MemoryType = EfiBootServicesCode;
+ MemMapNode.StartingAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)CapsuleHeader;
+ MemMapNode.EndingAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)((UINT8 *)CapsuleHeader + CapsuleHeader->CapsuleImageSize - 1);
+
+ DriverDevicePath = AppendDevicePathNode (NULL, &MemMapNode.Header);
+ if (DriverDevicePath == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
+
+ for (Index = 0; Index < FmpCapsuleHeader->EmbeddedDriverCount; Index++) {
+ if (FmpCapsuleHeader->PayloadItemCount == 0 && Index == (UINTN)FmpCapsuleHeader->EmbeddedDriverCount - 1) {
+ //
+ // When driver is last element in the ItemOffsetList array, the driver size is calculated by reference CapsuleImageSize in EFI_CAPSULE_HEADER
+ //
+ DriverLen = CapsuleHeader->CapsuleImageSize - CapsuleHeader->HeaderSize - (UINTN)ItemOffsetList[Index];
+ } else {
+ DriverLen = (UINTN)ItemOffsetList[Index + 1] - (UINTN)ItemOffsetList[Index];
+ }
+
+ Status = gBS->LoadImage(
+ FALSE,
+ gImageHandle,
+ DriverDevicePath,
+ (UINT8 *)FmpCapsuleHeader + ItemOffsetList[Index],
+ DriverLen,
+ &ImageHandle
+ );
+ if (EFI_ERROR(Status)) {
+ goto EXIT;
+ }
+
+ Status = gBS->StartImage(
+ ImageHandle,
+ &ExitDataSize,
+ NULL
+ );
+ if (EFI_ERROR(Status)) {
+ DEBUG ((DEBUG_ERROR, "Driver Return Status = %r\n", Status));
+ goto EXIT;
+ }
+ }
+
+ //
+ // Connnect all again to connect drivers within capsule
+ //
+ if (FmpCapsuleHeader->EmbeddedDriverCount > 0) {
+ BdsLibConnectAll();
+ }
+
+ //
+ // 3. Route payload to right FMP instance
+ //
+ Status = gBS->LocateHandleBuffer (
+ ByProtocol,
+ &gEfiFirmwareManagementProtocolGuid,
+ NULL,
+ &NumberOfHandles,
+ &HandleBuffer
+ );
+
+ if (!EFI_ERROR(Status)) {
+ for(Index1 = 0; Index1 < NumberOfHandles; Index1++) {
+ Status = gBS->HandleProtocol(
+ HandleBuffer[Index1],
+ &gEfiFirmwareManagementProtocolGuid,
+ (VOID **)&Fmp
+ );
+ if (EFI_ERROR(Status)) {
+ continue;
+ }
+
+ ImageInfoSize = 0;
+ Status = Fmp->GetImageInfo (
+ Fmp,
+ &ImageInfoSize,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ );
+ if (Status != EFI_BUFFER_TOO_SMALL) {
+ continue;
+ }
+
+ FmpImageInfoBuf = NULL;
+ FmpImageInfoBuf = AllocateZeroPool (ImageInfoSize);
+ if (FmpImageInfoBuf == NULL) {
+ Status = EFI_OUT_OF_RESOURCES;
+ goto EXIT;
+ }
+
+ PackageVersionName = NULL;
+ Status = Fmp->GetImageInfo (
+ Fmp,
+ &ImageInfoSize, // ImageInfoSize
+ FmpImageInfoBuf, // ImageInfo
+ &FmpImageInfoDescriptorVer, // DescriptorVersion
+ &FmpImageInfoCount, // DescriptorCount
+ &DescriptorSize, // DescriptorSize
+ &PackageVersion, // PackageVersion
+ &PackageVersionName // PackageVersionName
+ );
+
+ //
+ // If FMP GetInformation interface failed, skip this resource
+ //
+ if (EFI_ERROR(Status)) {
+ FreePool(FmpImageInfoBuf);
+ continue;
+ }
+
+ if (PackageVersionName != NULL) {
+ FreePool(PackageVersionName);
+ }
+
+ TempFmpImageInfo = FmpImageInfoBuf;
+ for (Index2 = 0; Index2 < FmpImageInfoCount; Index2++) {
+ //
+ // Check all the payload entry in capsule payload list
+ //
+ for (Index = FmpCapsuleHeader->EmbeddedDriverCount; Index < ItemNum; Index++) {
+ ImageHeader = (EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER *)((UINT8 *)FmpCapsuleHeader + ItemOffsetList[Index]);
+ if (CompareGuid(&ImageHeader->UpdateImageTypeId, &TempFmpImageInfo->ImageTypeId) &&
+ ImageHeader->UpdateImageIndex == TempFmpImageInfo->ImageIndex) {
+ AbortReason = NULL;
+ if (ImageHeader->UpdateVendorCodeSize == 0) {
+ Status = Fmp->SetImage(
+ Fmp,
+ TempFmpImageInfo->ImageIndex, // ImageIndex
+ (UINT8 *)(ImageHeader + 1), // Image
+ ImageHeader->UpdateImageSize, // ImageSize
+ NULL, // VendorCode
+ Update_Image_Progress, // Progress
+ &AbortReason // AbortReason
+ );
+ } else {
+ Status = Fmp->SetImage(
+ Fmp,
+ TempFmpImageInfo->ImageIndex, // ImageIndex
+ (UINT8 *)(ImageHeader + 1), // Image
+ ImageHeader->UpdateImageSize, // ImageSize
+ (UINT8 *)((UINT8 *) (ImageHeader + 1) + ImageHeader->UpdateImageSize), // VendorCode
+ Update_Image_Progress, // Progress
+ &AbortReason // AbortReason
+ );
+ }
+ if (AbortReason != NULL) {
+ DEBUG ((EFI_D_ERROR, "%s\n", AbortReason));
+ FreePool(AbortReason);
+ }
+ }
+ }
+ //
+ // Use DescriptorSize to move ImageInfo Pointer to stay compatible with different ImageInfo version
+ //
+ TempFmpImageInfo = (EFI_FIRMWARE_IMAGE_DESCRIPTOR *)((UINT8 *)TempFmpImageInfo + DescriptorSize);
+ }
+ FreePool(FmpImageInfoBuf);
+ }
+ }
+
+EXIT:
+
+ if (HandleBuffer != NULL) {
+ FreePool(HandleBuffer);
+ }
+
+ if (DriverDevicePath != NULL) {
+ FreePool(DriverDevicePath);
+ }
+
+ return Status;
+}
/**
Those capsules supported by the firmwares.
@@ -27,6 +383,7 @@
@retval EFI_SUCESS Input capsule is supported by firmware.
@retval EFI_UNSUPPORTED Input capsule is not supported by the firmware.
+ @retval EFI_INVALID_PARAMETER Input capsule layout is not correct
**/
EFI_STATUS
EFIAPI
@@ -38,6 +395,13 @@ SupportCapsuleImage (
return EFI_SUCCESS;
}
+ if (CompareGuid (&gEfiFmpCapsuleGuid, &CapsuleHeader->CapsuleGuid)) {
+ //
+ // Check layout of FMP capsule
+ //
+ return ValidateFmpCapsule(CapsuleHeader);
+ }
+
return EFI_UNSUPPORTED;
}
@@ -73,6 +437,21 @@ ProcessCapsuleImage (
}
//
+ // Check FMP capsule layout
+ //
+ if (CompareGuid (&gEfiFmpCapsuleGuid, &CapsuleHeader->CapsuleGuid)){
+ Status = ValidateFmpCapsule(CapsuleHeader);
+ if (EFI_ERROR(Status)) {
+ return Status;
+ }
+
+ //
+ // Press EFI FMP Capsule
+ //
+ return ProcessFmpCapsuleImage(CapsuleHeader);
+ }
+
+ //
// Skip the capsule header, move to the Firware Volume
//
FvImage = (EFI_FIRMWARE_VOLUME_HEADER *) ((UINT8 *) CapsuleHeader + CapsuleHeader->HeaderSize);
diff --git a/IntelFrameworkModulePkg/Library/DxeCapsuleLib/DxeCapsuleLib.inf b/IntelFrameworkModulePkg/Library/DxeCapsuleLib/DxeCapsuleLib.inf
index c11d8f762..ab66a6814 100644
--- a/IntelFrameworkModulePkg/Library/DxeCapsuleLib/DxeCapsuleLib.inf
+++ b/IntelFrameworkModulePkg/Library/DxeCapsuleLib/DxeCapsuleLib.inf
@@ -1,7 +1,7 @@
## @file
# Capsule library instance for DXE_DRIVER, DXE_RUNTIME_DRIVER
#
-# Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 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
@@ -33,15 +33,22 @@
[Packages]
MdePkg/MdePkg.dec
- IntelFrameworkPkg/IntelFrameworkPkg.dec
MdeModulePkg/MdeModulePkg.dec
+ IntelFrameworkPkg/IntelFrameworkPkg.dec
+ IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
[LibraryClasses]
BaseMemoryLib
DebugLib
MemoryAllocationLib
DxeServicesTableLib
+ GenericBdsLib
+ UefiBootServicesTableLib
+ DevicePathLib
+
+[Protocols]
+ gEfiFirmwareManagementProtocolGuid # CONSUMES
[Guids]
gEfiCapsuleGuid # SOMETIMES_CONSUMED
- \ No newline at end of file
+ gEfiFmpCapsuleGuid # SOMETIMES_CONSUMED
diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
index 06ba0fcf7..29afe45f3 100644
--- a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
+++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
@@ -2637,17 +2637,16 @@ BdsExpandPartitionPartialDevicePathToFull (
TempNewDevicePath = CachedDevicePath;
CachedDevicePath = BdsLibDelPartMatchInstance (CachedDevicePath, BlockIoDevicePath);
FreePool(TempNewDevicePath);
+ }
- TempNewDevicePath = CachedDevicePath;
- CachedDevicePath = AppendDevicePathInstance (BlockIoDevicePath, CachedDevicePath);
- if (TempNewDevicePath != NULL) {
- FreePool(TempNewDevicePath);
- }
- } else {
+ if (CachedDevicePath != NULL) {
TempNewDevicePath = CachedDevicePath;
CachedDevicePath = AppendDevicePathInstance (BlockIoDevicePath, CachedDevicePath);
FreePool(TempNewDevicePath);
+ } else {
+ CachedDevicePath = DuplicateDevicePath (BlockIoDevicePath);
}
+
//
// Here limit the device path instance number to 12, which is max number for a system support 3 IDE controller
// If the user try to boot many OS in different HDs or partitions, in theory,
diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf b/IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
index 545709c6e..2fb9916aa 100644
--- a/IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
+++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
@@ -22,7 +22,7 @@
FILE_GUID = e405ec31-ccaa-4dd4-83e8-0aec01703f7e
MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0
- LIBRARY_CLASS = GenericBdsLib|DXE_DRIVER UEFI_APPLICATION
+ LIBRARY_CLASS = GenericBdsLib|DXE_DRIVER DXE_RUNTIME_DRIVER UEFI_APPLICATION
CONSTRUCTOR = GenericBdsLibConstructor
#
@@ -78,6 +78,7 @@
gLastEnumLangGuid ## SOMETIMES_PRODUCES ## Variable:L"LastEnumLang" (Platform language at last time enumeration.)
gHdBootDevicePathVariablGuid ## SOMETIMES_PRODUCES ## Variable:L"HDDP" (The device path of Boot file on Hard device.)
gBdsLibStringPackageGuid ## PRODUCES ## GUID (HII String PackageList Guid)
+ gEfiLegacyDevOrderVariableGuid ## CONSUMES ## GUID
[Protocols]
gEfiSimpleFileSystemProtocolGuid # PROTOCOL CONSUMES
diff --git a/IntelFrameworkModulePkg/Universal/Acpi/AcpiSupportDxe/AcpiSupport.h b/IntelFrameworkModulePkg/Universal/Acpi/AcpiSupportDxe/AcpiSupport.h
index b28f1cd19..1bcf1e6ee 100644
--- a/IntelFrameworkModulePkg/Universal/Acpi/AcpiSupportDxe/AcpiSupport.h
+++ b/IntelFrameworkModulePkg/Universal/Acpi/AcpiSupportDxe/AcpiSupport.h
@@ -2,7 +2,7 @@
This is an implementation of the ACPI Support protocol.
It is in compliance with the 0.9 definition of the protocol.
-Copyright (c) 2006 - 2010, 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
@@ -80,15 +80,6 @@ typedef struct {
#define EFI_ACPI_MAX_NUM_TABLES 20
//
-// ACPI table information used to initialize tables.
-//
-#define EFI_ACPI_OEM_ID "INTEL "
-#define EFI_ACPI_OEM_TABLE_ID 0x2020204F4E414954ULL // "TIANO "
-#define EFI_ACPI_OEM_REVISION 0x00000002
-#define EFI_ACPI_CREATOR_ID 0x20202020
-#define EFI_ACPI_CREATOR_REVISION 0x01000013
-
-//
// Protocol private structure definition
//
//
diff --git a/IntelFrameworkModulePkg/Universal/Acpi/AcpiSupportDxe/AcpiSupportAcpiSupportProtocol.c b/IntelFrameworkModulePkg/Universal/Acpi/AcpiSupportDxe/AcpiSupportAcpiSupportProtocol.c
index 107db88ed..3bcff22dc 100644
--- a/IntelFrameworkModulePkg/Universal/Acpi/AcpiSupportDxe/AcpiSupportAcpiSupportProtocol.c
+++ b/IntelFrameworkModulePkg/Universal/Acpi/AcpiSupportDxe/AcpiSupportAcpiSupportProtocol.c
@@ -1,7 +1,7 @@
/** @file
ACPI Support Protocol implementation
-Copyright (c) 2006 - 2012, 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
@@ -1839,13 +1839,13 @@ AcpiSupportAcpiSupportConstructor (
//
CurrentData = EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE;
CopyMem (&AcpiSupportInstance->Rsdp1->Signature, &CurrentData, sizeof (UINT64));
- CopyMem (AcpiSupportInstance->Rsdp1->OemId, EFI_ACPI_OEM_ID, 6);
+ CopyMem (AcpiSupportInstance->Rsdp1->OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (AcpiSupportInstance->Rsdp1->OemId));
AcpiSupportInstance->Rsdp1->Reserved = EFI_ACPI_RESERVED_BYTE;
AcpiSupportInstance->Rsdp1->RsdtAddress = (UINT32) (UINTN) AcpiSupportInstance->Rsdt1;
CurrentData = EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE;
CopyMem (&AcpiSupportInstance->Rsdp3->Signature, &CurrentData, sizeof (UINT64));
- CopyMem (AcpiSupportInstance->Rsdp3->OemId, EFI_ACPI_OEM_ID, 6);
+ CopyMem (AcpiSupportInstance->Rsdp3->OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (AcpiSupportInstance->Rsdp3->OemId));
AcpiSupportInstance->Rsdp3->Revision = EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION;
AcpiSupportInstance->Rsdp3->RsdtAddress = (UINT32) (UINTN) AcpiSupportInstance->Rsdt3;
AcpiSupportInstance->Rsdp3->Length = sizeof (EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER);
@@ -1863,12 +1863,12 @@ AcpiSupportAcpiSupportConstructor (
AcpiSupportInstance->Rsdt1->Signature = EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE;
AcpiSupportInstance->Rsdt1->Length = sizeof (EFI_ACPI_DESCRIPTION_HEADER);
AcpiSupportInstance->Rsdt1->Revision = EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION;
- CopyMem (AcpiSupportInstance->Rsdt1->OemId, EFI_ACPI_OEM_ID, 6);
- CurrentData = EFI_ACPI_OEM_TABLE_ID;
+ CopyMem (AcpiSupportInstance->Rsdt1->OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (AcpiSupportInstance->Rsdt1->OemId));
+ CurrentData = PcdGet64 (PcdAcpiDefaultOemTableId);
CopyMem (&AcpiSupportInstance->Rsdt1->OemTableId, &CurrentData, sizeof (UINT64));
- AcpiSupportInstance->Rsdt1->OemRevision = EFI_ACPI_OEM_REVISION;
- AcpiSupportInstance->Rsdt1->CreatorId = EFI_ACPI_CREATOR_ID;
- AcpiSupportInstance->Rsdt1->CreatorRevision = EFI_ACPI_CREATOR_REVISION;
+ AcpiSupportInstance->Rsdt1->OemRevision = PcdGet32 (PcdAcpiDefaultOemRevision);
+ AcpiSupportInstance->Rsdt1->CreatorId = PcdGet32 (PcdAcpiDefaultCreatorId);
+ AcpiSupportInstance->Rsdt1->CreatorRevision = PcdGet32 (PcdAcpiDefaultCreatorRevision);
//
// We always reserve first one for FADT
//
@@ -1878,12 +1878,12 @@ AcpiSupportAcpiSupportConstructor (
AcpiSupportInstance->Rsdt3->Signature = EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE;
AcpiSupportInstance->Rsdt3->Length = sizeof (EFI_ACPI_DESCRIPTION_HEADER);
AcpiSupportInstance->Rsdt3->Revision = EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION;
- CopyMem (AcpiSupportInstance->Rsdt3->OemId, EFI_ACPI_OEM_ID, 6);
- CurrentData = EFI_ACPI_OEM_TABLE_ID;
+ CopyMem (AcpiSupportInstance->Rsdt3->OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (AcpiSupportInstance->Rsdt3->OemId));
+ CurrentData = PcdGet64 (PcdAcpiDefaultOemTableId);
CopyMem (&AcpiSupportInstance->Rsdt3->OemTableId, &CurrentData, sizeof (UINT64));
- AcpiSupportInstance->Rsdt3->OemRevision = EFI_ACPI_OEM_REVISION;
- AcpiSupportInstance->Rsdt3->CreatorId = EFI_ACPI_CREATOR_ID;
- AcpiSupportInstance->Rsdt3->CreatorRevision = EFI_ACPI_CREATOR_REVISION;
+ AcpiSupportInstance->Rsdt3->OemRevision = PcdGet32 (PcdAcpiDefaultOemRevision);
+ AcpiSupportInstance->Rsdt3->CreatorId = PcdGet32 (PcdAcpiDefaultCreatorId);
+ AcpiSupportInstance->Rsdt3->CreatorRevision = PcdGet32 (PcdAcpiDefaultCreatorRevision);
//
// We always reserve first one for FADT
//
@@ -1896,12 +1896,12 @@ AcpiSupportAcpiSupportConstructor (
AcpiSupportInstance->Xsdt->Signature = EFI_ACPI_3_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE;
AcpiSupportInstance->Xsdt->Length = sizeof (EFI_ACPI_DESCRIPTION_HEADER);
AcpiSupportInstance->Xsdt->Revision = EFI_ACPI_3_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION;
- CopyMem (AcpiSupportInstance->Xsdt->OemId, EFI_ACPI_OEM_ID, 6);
- CurrentData = EFI_ACPI_OEM_TABLE_ID;
+ CopyMem (AcpiSupportInstance->Xsdt->OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (AcpiSupportInstance->Xsdt->OemId));
+ CurrentData = PcdGet64 (PcdAcpiDefaultOemTableId);
CopyMem (&AcpiSupportInstance->Xsdt->OemTableId, &CurrentData, sizeof (UINT64));
- AcpiSupportInstance->Xsdt->OemRevision = EFI_ACPI_OEM_REVISION;
- AcpiSupportInstance->Xsdt->CreatorId = EFI_ACPI_CREATOR_ID;
- AcpiSupportInstance->Xsdt->CreatorRevision = EFI_ACPI_CREATOR_REVISION;
+ AcpiSupportInstance->Xsdt->OemRevision = PcdGet32 (PcdAcpiDefaultOemRevision);
+ AcpiSupportInstance->Xsdt->CreatorId = PcdGet32 (PcdAcpiDefaultCreatorId);
+ AcpiSupportInstance->Xsdt->CreatorRevision = PcdGet32 (PcdAcpiDefaultCreatorRevision);
//
// We always reserve first one for FADT
//
diff --git a/IntelFrameworkModulePkg/Universal/Acpi/AcpiSupportDxe/AcpiSupportDxe.inf b/IntelFrameworkModulePkg/Universal/Acpi/AcpiSupportDxe/AcpiSupportDxe.inf
index 422856d75..19818064f 100644
--- a/IntelFrameworkModulePkg/Universal/Acpi/AcpiSupportDxe/AcpiSupportDxe.inf
+++ b/IntelFrameworkModulePkg/Universal/Acpi/AcpiSupportDxe/AcpiSupportDxe.inf
@@ -4,7 +4,7 @@
# This driver initializes ACPI support protocol instance data structure and intstall
# ACPI support protocol to provide Get, Set and Publish Table services.
#
-# Copyright (c) 2006 - 2010, 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
@@ -62,6 +62,13 @@
[FeaturePcd]
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdInstallAcpiSupportProtocol
+[Pcd]
+ gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId
+ gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId
+ gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision
+ gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId
+ gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision
+
[Protocols]
gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_PRODUCED
gEfiAcpiSupportProtocolGuid # PROTOCOL ALWAYS_PRODUCED
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/Bds.h b/IntelFrameworkModulePkg/Universal/BdsDxe/Bds.h
index 0aba09c1b..e535bc21d 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/Bds.h
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/Bds.h
@@ -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>
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf b/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf
index 2424a8a84..b10056491 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf
@@ -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
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c
index 77c88b0d2..33b3cc2dc 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c
@@ -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,
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c
index 44d9b71c4..5f200e2e1 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c
@@ -316,6 +316,106 @@ BootMaintCallback (
UpdatePageId (Private, QuestionId);
+ if (QuestionId < FILE_OPTION_OFFSET) {
+ if (QuestionId < CONFIG_OPTION_OFFSET) {
+ switch (QuestionId) {
+ case KEY_VALUE_BOOT_FROM_FILE:
+ Private->FeCurrentState = FileExplorerStateBootFromFile;
+ break;
+
+ case FORM_BOOT_ADD_ID:
+ Private->FeCurrentState = FileExplorerStateAddBootOption;
+ break;
+
+ case FORM_DRV_ADD_FILE_ID:
+ Private->FeCurrentState = FileExplorerStateAddDriverOptionState;
+ break;
+
+ case FORM_DRV_ADD_HANDLE_ID:
+ CleanUpPage (FORM_DRV_ADD_HANDLE_ID, Private);
+ UpdateDrvAddHandlePage (Private);
+ break;
+
+ case FORM_BOOT_DEL_ID:
+ CleanUpPage (FORM_BOOT_DEL_ID, Private);
+ UpdateBootDelPage (Private);
+ break;
+
+ case FORM_BOOT_CHG_ID:
+ case FORM_DRV_CHG_ID:
+ UpdatePageBody (QuestionId, Private);
+ break;
+
+ case FORM_DRV_DEL_ID:
+ CleanUpPage (FORM_DRV_DEL_ID, Private);
+ UpdateDrvDelPage (Private);
+ break;
+
+ case FORM_BOOT_NEXT_ID:
+ CleanUpPage (FORM_BOOT_NEXT_ID, Private);
+ UpdateBootNextPage (Private);
+ break;
+
+ case FORM_TIME_OUT_ID:
+ CleanUpPage (FORM_TIME_OUT_ID, Private);
+ UpdateTimeOutPage (Private);
+ break;
+
+ case FORM_CON_IN_ID:
+ case FORM_CON_OUT_ID:
+ case FORM_CON_ERR_ID:
+ UpdatePageBody (QuestionId, Private);
+ break;
+
+ case FORM_CON_MODE_ID:
+ CleanUpPage (FORM_CON_MODE_ID, Private);
+ UpdateConModePage (Private);
+ break;
+
+ case FORM_CON_COM_ID:
+ CleanUpPage (FORM_CON_COM_ID, Private);
+ UpdateConCOMPage (Private);
+ break;
+
+ case FORM_SET_FD_ORDER_ID:
+ case FORM_SET_HD_ORDER_ID:
+ case FORM_SET_CD_ORDER_ID:
+ case FORM_SET_NET_ORDER_ID:
+ case FORM_SET_BEV_ORDER_ID:
+ CleanUpPage (QuestionId, Private);
+ UpdateSetLegacyDeviceOrderPage (QuestionId, Private);
+ break;
+
+ default:
+ break;
+ }
+ } else if ((QuestionId >= TERMINAL_OPTION_OFFSET) && (QuestionId < CONSOLE_OPTION_OFFSET)) {
+ Index2 = (UINT16) (QuestionId - TERMINAL_OPTION_OFFSET);
+ Private->CurrentTerminal = Index2;
+
+ CleanUpPage (FORM_CON_COM_SETUP_ID, Private);
+ UpdateTerminalPage (Private);
+
+ } else if (QuestionId >= HANDLE_OPTION_OFFSET) {
+ Index2 = (UINT16) (QuestionId - HANDLE_OPTION_OFFSET);
+
+ NewMenuEntry = BOpt_GetMenuEntry (&DriverMenu, Index2);
+ ASSERT (NewMenuEntry != NULL);
+ Private->HandleContext = (BM_HANDLE_CONTEXT *) NewMenuEntry->VariableContext;
+
+ CleanUpPage (FORM_DRV_ADD_HANDLE_DESC_ID, Private);
+
+ Private->MenuEntry = NewMenuEntry;
+ Private->LoadContext->FilePathList = Private->HandleContext->DevicePath;
+
+ UpdateDriverAddHandleDescPage (Private);
+ }
+ }
+ } else if (Action == EFI_BROWSER_ACTION_CHANGED) {
+ if ((Value == NULL) || (ActionRequest == NULL)) {
+ return EFI_INVALID_PARAMETER;
+ }
+
//
// need to be subtituded.
//
@@ -466,133 +566,33 @@ BootMaintCallback (
//
Value->u8 = NewLegacyDev[Index3];
}
- }
-
- if (QuestionId < FILE_OPTION_OFFSET) {
- if (QuestionId < CONFIG_OPTION_OFFSET) {
- switch (QuestionId) {
- case KEY_VALUE_BOOT_FROM_FILE:
- Private->FeCurrentState = FileExplorerStateBootFromFile;
- break;
-
- case FORM_BOOT_ADD_ID:
- Private->FeCurrentState = FileExplorerStateAddBootOption;
- break;
-
- case FORM_DRV_ADD_FILE_ID:
- Private->FeCurrentState = FileExplorerStateAddDriverOptionState;
- break;
-
- case FORM_DRV_ADD_HANDLE_ID:
- CleanUpPage (FORM_DRV_ADD_HANDLE_ID, Private);
- UpdateDrvAddHandlePage (Private);
- break;
-
- case FORM_BOOT_DEL_ID:
- CleanUpPage (FORM_BOOT_DEL_ID, Private);
- UpdateBootDelPage (Private);
- break;
-
- case FORM_BOOT_CHG_ID:
- case FORM_DRV_CHG_ID:
- UpdatePageBody (QuestionId, Private);
- break;
-
- case FORM_DRV_DEL_ID:
- CleanUpPage (FORM_DRV_DEL_ID, Private);
- UpdateDrvDelPage (Private);
- break;
-
- case FORM_BOOT_NEXT_ID:
- CleanUpPage (FORM_BOOT_NEXT_ID, Private);
- UpdateBootNextPage (Private);
- break;
-
- case FORM_TIME_OUT_ID:
- CleanUpPage (FORM_TIME_OUT_ID, Private);
- UpdateTimeOutPage (Private);
- break;
-
- case FORM_CON_IN_ID:
- case FORM_CON_OUT_ID:
- case FORM_CON_ERR_ID:
- UpdatePageBody (QuestionId, Private);
- break;
-
- case FORM_CON_MODE_ID:
- CleanUpPage (FORM_CON_MODE_ID, Private);
- UpdateConModePage (Private);
- break;
-
- case FORM_CON_COM_ID:
- CleanUpPage (FORM_CON_COM_ID, Private);
- UpdateConCOMPage (Private);
- break;
-
- case FORM_SET_FD_ORDER_ID:
- case FORM_SET_HD_ORDER_ID:
- case FORM_SET_CD_ORDER_ID:
- case FORM_SET_NET_ORDER_ID:
- case FORM_SET_BEV_ORDER_ID:
- CleanUpPage (QuestionId, Private);
- UpdateSetLegacyDeviceOrderPage (QuestionId, Private);
- break;
-
- default:
- break;
+ } else {
+ switch (QuestionId) {
+ case KEY_VALUE_SAVE_AND_EXIT:
+ case KEY_VALUE_NO_SAVE_AND_EXIT:
+ if (QuestionId == KEY_VALUE_SAVE_AND_EXIT) {
+ Status = ApplyChangeHandler (Private, CurrentFakeNVMap, Private->BmmPreviousPageId);
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+ } else if (QuestionId == KEY_VALUE_NO_SAVE_AND_EXIT) {
+ DiscardChangeHandler (Private, CurrentFakeNVMap);
}
- } else if ((QuestionId >= TERMINAL_OPTION_OFFSET) && (QuestionId < CONSOLE_OPTION_OFFSET)) {
- Index2 = (UINT16) (QuestionId - TERMINAL_OPTION_OFFSET);
- Private->CurrentTerminal = Index2;
-
- CleanUpPage (FORM_CON_COM_SETUP_ID, Private);
- UpdateTerminalPage (Private);
-
- } else if (QuestionId >= HANDLE_OPTION_OFFSET) {
- Index2 = (UINT16) (QuestionId - HANDLE_OPTION_OFFSET);
- NewMenuEntry = BOpt_GetMenuEntry (&DriverMenu, Index2);
- ASSERT (NewMenuEntry != NULL);
- Private->HandleContext = (BM_HANDLE_CONTEXT *) NewMenuEntry->VariableContext;
-
- CleanUpPage (FORM_DRV_ADD_HANDLE_DESC_ID, Private);
+ //
+ // Tell browser not to ask for confirmation of changes,
+ // since we have already applied or discarded.
+ //
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;
+ break;
- Private->MenuEntry = NewMenuEntry;
- Private->LoadContext->FilePathList = Private->HandleContext->DevicePath;
+ case FORM_RESET:
+ gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
+ return EFI_UNSUPPORTED;
- UpdateDriverAddHandleDescPage (Private);
- }
- }
- } else if (Action == EFI_BROWSER_ACTION_CHANGED) {
- if ((Value == NULL) || (ActionRequest == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
-
- switch (QuestionId) {
- case KEY_VALUE_SAVE_AND_EXIT:
- case KEY_VALUE_NO_SAVE_AND_EXIT:
- if (QuestionId == KEY_VALUE_SAVE_AND_EXIT) {
- Status = ApplyChangeHandler (Private, CurrentFakeNVMap, Private->BmmPreviousPageId);
- if (EFI_ERROR (Status)) {
- return Status;
- }
- } else if (QuestionId == KEY_VALUE_NO_SAVE_AND_EXIT) {
- DiscardChangeHandler (Private, CurrentFakeNVMap);
+ default:
+ break;
}
-
- //
- // Tell browser not to ask for confirmation of changes,
- // since we have already applied or discarded.
- //
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;
- break;
-
- case FORM_RESET:
- gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
- return EFI_UNSUPPORTED;
-
- default:
- break;
}
}
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/Capsules.c b/IntelFrameworkModulePkg/Universal/BdsDxe/Capsules.c
index 07c12195f..6c7fc7ced 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/Capsules.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/Capsules.c
@@ -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
@@ -191,12 +193,32 @@ BdsProcessCapsules (
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.
//
ProcessCapsuleImage (CapsuleHeader);
}
}
+ 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 ();
//
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c b/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c
index d9ec1f2f1..14e71e3e5 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c
@@ -1,7 +1,7 @@
/** @file
The platform device manager reference implementation
-Copyright (c) 2004 - 2012, 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
@@ -1943,7 +1943,7 @@ ProcessSingleControllerHealth (
DriverHealth,
ControllerHandle,
ChildHandle,
- (EFI_DRIVER_HEALTH_REPAIR_PROGRESS_NOTIFY) RepairNotify
+ RepairNotify
);
}
//
@@ -2019,24 +2019,20 @@ ProcessSingleControllerHealth (
/**
- Platform specific notification function for controller repair operations.
-
- If the driver for a controller support the Driver Health Protocol and the
- current state of the controller is EfiDriverHealthStatusRepairRequired then
- when the Repair() service of the Driver Health Protocol is called, this
- platform specific notification function can display the progress of the repair
- operation. Some platforms may choose to not display anything, other may choose
- to show the percentage complete on text consoles, and other may choose to render
- a progress bar on text and graphical consoles.
-
- This function displays the percentage of the repair operation that has been
- completed on text consoles. The percentage is Value / Limit * 100%.
-
- @param Value Value in the range 0..Limit the the repair has completed..
- @param Limit The maximum value of Value
+ Reports the progress of a repair operation.
+
+ @param[in] Value A value between 0 and Limit that identifies the current
+ progress of the repair operation.
+
+ @param[in] Limit The maximum value of Value for the current repair operation.
+ For example, a driver that wants to specify progress in
+ percent would use a Limit value of 100.
+
+ @retval EFI_SUCCESS The progress of a repair operation is reported successfully.
**/
-VOID
+EFI_STATUS
+EFIAPI
RepairNotify (
IN UINTN Value,
IN UINTN Limit
@@ -2050,6 +2046,7 @@ RepairNotify (
Percent = Value * 100 / Limit;
Print(L"Repair Progress = %3d%%\n\r", Percent);
}
+ return EFI_SUCCESS;
}
/**
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.h b/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.h
index ae01b3f60..95bde8de5 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.h
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.h
@@ -1,7 +1,7 @@
/** @file
The platform device manager reference implement
-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
@@ -313,13 +313,20 @@ ProcessSingleControllerHealth (
);
/**
- Repair notification function, simply print the repair progress.
+ Reports the progress of a repair operation.
- @param Value The value of part has been repaired.
- @param Limit Total value need to be repaired.
+ @param[in] Value A value between 0 and Limit that identifies the current
+ progress of the repair operation.
+
+ @param[in] Limit The maximum value of Value for the current repair operation.
+ For example, a driver that wants to specify progress in
+ percent would use a Limit value of 100.
+
+ @retval EFI_SUCCESS The progress of a repair operation is reported successfully.
**/
-VOID
+EFI_STATUS
+EFIAPI
RepairNotify (
IN UINTN Value,
IN UINTN Limit