summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
d2a1603)
The previous ESRT driver unconditionally treat FMP to be
ESRT_FW_TYPE_DEVICEFIRMWARE.
EDKII System Capsule reuses FMP, but it is ESRT_FW_TYPE_SYSTEMFIRMWARE.
Add check to ImageTypeId check to see if it is ESRT_FW_TYPE_SYSTEMFIRMWARE.
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
# This driver produces EsrtManagement protocol to manage cache ESRT repository for FMP/Non-FMP instances.\r
# ESRT table based on repository is published on gEfiEventReadyToBootGuid.\r
#\r
# This driver produces EsrtManagement protocol to manage cache ESRT repository for FMP/Non-FMP instances.\r
# ESRT table based on repository is published on gEfiEventReadyToBootGuid.\r
#\r
-# Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxFmpEsrtCacheNum ## CONSUMES\r
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxNonFmpEsrtCacheNum ## CONSUMES\r
gEfiMdeModulePkgTokenSpaceGuid.PcdSystemRebootAfterCapsuleProcessFlag ## CONSUMES\r
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxFmpEsrtCacheNum ## CONSUMES\r
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxNonFmpEsrtCacheNum ## CONSUMES\r
gEfiMdeModulePkgTokenSpaceGuid.PcdSystemRebootAfterCapsuleProcessFlag ## CONSUMES\r
+ gEfiMdeModulePkgTokenSpaceGuid.PcdSystemFmpCapsuleImageTypeIdGuid ## CONSUMES\r
\r
[Depex]\r
gEfiVariableArchProtocolGuid AND gEfiVariableWriteArchProtocolGuid\r
\r
[Depex]\r
gEfiVariableArchProtocolGuid AND gEfiVariableWriteArchProtocolGuid\r
/** @file\r
Esrt management implementation.\r
\r
/** @file\r
Esrt management implementation.\r
\r
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
+/**\r
+ Return if this FMP is a system FMP or a device FMP, based upon FmpImageInfo.\r
+\r
+ @param[in] FmpImageInfo A pointer to EFI_FIRMWARE_IMAGE_DESCRIPTOR\r
+\r
+ @return TRUE It is a system FMP.\r
+ @return FALSE It is a device FMP.\r
+**/\r
+BOOLEAN\r
+IsSystemFmp (\r
+ IN EFI_FIRMWARE_IMAGE_DESCRIPTOR *FmpImageInfo\r
+ )\r
+{\r
+ GUID *Guid;\r
+ UINTN Count;\r
+ UINTN Index;\r
+\r
+ Guid = PcdGetPtr(PcdSystemFmpCapsuleImageTypeIdGuid);\r
+ Count = PcdGetSize(PcdSystemFmpCapsuleImageTypeIdGuid)/sizeof(GUID);\r
+\r
+ for (Index = 0; Index < Count; Index++, Guid++) {\r
+ if (CompareGuid(&FmpImageInfo->ImageTypeId, Guid)) {\r
+ return TRUE;\r
+ }\r
+ }\r
+\r
+ return FALSE;\r
+}\r
+\r
/**\r
Init one ESRT entry according to input FmpImageInfo (V1, V2, V3) .\r
\r
/**\r
Init one ESRT entry according to input FmpImageInfo (V1, V2, V3) .\r
\r
{\r
EsrtEntry->FwVersion = FmpImageInfo->Version;\r
EsrtEntry->FwClass = FmpImageInfo->ImageTypeId;\r
{\r
EsrtEntry->FwVersion = FmpImageInfo->Version;\r
EsrtEntry->FwClass = FmpImageInfo->ImageTypeId;\r
- EsrtEntry->FwType = ESRT_FW_TYPE_DEVICEFIRMWARE;\r
+ if (IsSystemFmp(FmpImageInfo)) {\r
+ EsrtEntry->FwType = ESRT_FW_TYPE_SYSTEMFIRMWARE;\r
+ } else {\r
+ EsrtEntry->FwType = ESRT_FW_TYPE_DEVICEFIRMWARE;\r
+ }\r
EsrtEntry->LowestSupportedFwVersion = 0;\r
EsrtEntry->CapsuleFlags = 0;\r
EsrtEntry->LastAttemptVersion = 0;\r
EsrtEntry->LowestSupportedFwVersion = 0;\r
EsrtEntry->CapsuleFlags = 0;\r
EsrtEntry->LastAttemptVersion = 0;\r