diff options
author | Igniculus Fu <Igniculus.Fu@amd.com> | 2024-01-08 11:51:13 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-03-13 10:53:30 +0000 |
commit | 5572b43c6767f7cc46b074ae1fc288f6eccdc65d (patch) | |
tree | 4de26af74210c65bddfe0b08c027eb4bdce5488f /BaseTools/Source/Python | |
parent | 308e6e0936c43063551babb4a71c46775b1dc01c (diff) | |
download | edk2-5572b43c6767f7cc46b074ae1fc288f6eccdc65d.tar.gz edk2-5572b43c6767f7cc46b074ae1fc288f6eccdc65d.tar.bz2 edk2-5572b43c6767f7cc46b074ae1fc288f6eccdc65d.zip |
BaseTools/GenFds: Apply OEM_CAPSULE_FLAGS during Capsule generation.
Bugzilla ticket 4633
FdfParser.py has defined a key named OEM_CAPSULE_FLAGS to set the
lower 16 bits of EFI_CAPSULE_HEADER.Flags. However, this key is totally
"forgotten" in Capsule.py, making it impossible to set lower 16 bits of
this field, and leading to an always FALSE when comparing to
gEfiMdeModulePkgTokenSpaceGuid.PcdSystemRebootAfterCapsuleProcessFlag
in MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleProcessLib.c:
ProcessTheseCapsules().
This patch ORs the value of OEM_CAPSULE_FLAGS with previously calculated
CAPSULE_FLAGS value, making the lower 16 bits of value being correctly set.
Signed-off-by: Igniculus Fu <igniculus.fu@amd.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Eric Xing <eric.xing@amd.com>
Cc: Abdul Lateef Attar <abdattar@amd.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Diffstat (limited to 'BaseTools/Source/Python')
-rw-r--r-- | BaseTools/Source/Python/GenFds/Capsule.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/GenFds/Capsule.py b/BaseTools/Source/Python/GenFds/Capsule.py index f4bfc74e55..42788b43ce 100644 --- a/BaseTools/Source/Python/GenFds/Capsule.py +++ b/BaseTools/Source/Python/GenFds/Capsule.py @@ -1,6 +1,7 @@ ## @file
# generate capsule
#
+# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -78,6 +79,8 @@ class Capsule (CapsuleClassObject): Flags |= 0x00010000
elif flag == 'InitiateReset':
Flags |= 0x00040000
+ if 'OEM_CAPSULE_FLAGS' in self.TokensDict:
+ Flags |= int(self.TokensDict['OEM_CAPSULE_FLAGS'],16)
Header.write(pack('=I', Flags))
#
# typedef struct {
|