* [edk2-devel] [PATCH] BaseTools/GenFds: Apply OEM_CAPSULE_FLAGS during Capsule generation.
@ 2024-01-02 6:27 Igniculus.Fu via groups.io
2024-01-08 1:06 ` 回复: " gaoliming via groups.io
0 siblings, 1 reply; 2+ messages in thread
From: Igniculus.Fu via groups.io @ 2024-01-02 6:27 UTC (permalink / raw)
To: devel
Cc: Bob Feng, Liming Gao, Yuwei Chen, Abner Chang, Eric Xing,
Abdul Lateef Attar
From: Igniculus Fu <Igniculus.Fu@amd.com>
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>
---
BaseTools/Source/Python/GenFds/Capsule.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/BaseTools/Source/Python/GenFds/Capsule.py b/BaseTools/Source/Python/GenFds/Capsule.py
index f4bfc74e55..d274d8f03e 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 {
--
2.38.1.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113052): https://edk2.groups.io/g/devel/message/113052
Mute This Topic: https://groups.io/mt/103494173/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply related [flat|nested] 2+ messages in thread
* 回复: [edk2-devel] [PATCH] BaseTools/GenFds: Apply OEM_CAPSULE_FLAGS during Capsule generation.
2024-01-02 6:27 [edk2-devel] [PATCH] BaseTools/GenFds: Apply OEM_CAPSULE_FLAGS during Capsule generation Igniculus.Fu via groups.io
@ 2024-01-08 1:06 ` gaoliming via groups.io
0 siblings, 0 replies; 2+ messages in thread
From: gaoliming via groups.io @ 2024-01-08 1:06 UTC (permalink / raw)
To: devel, Igniculus.Fu
Cc: 'Bob Feng', 'Yuwei Chen', 'Abner Chang',
'Eric Xing', 'Abdul Lateef Attar'
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Igniculus.Fu
> via groups.io
> 发送时间: 2024年1月2日 14:27
> 收件人: devel@edk2.groups.io
> 抄送: Bob Feng <bob.c.feng@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Yuwei Chen <yuwei.chen@intel.com>; Abner
> Chang <abner.chang@amd.com>; Eric Xing <eric.xing@amd.com>; Abdul
> Lateef Attar <abdattar@amd.com>
> 主题: [edk2-devel] [PATCH] BaseTools/GenFds: Apply OEM_CAPSULE_FLAGS
> during Capsule generation.
>
> From: Igniculus Fu <Igniculus.Fu@amd.com>
>
> 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.PcdSystemRebootAfterCapsuleProcessFla
> g
> 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>
>
> ---
> BaseTools/Source/Python/GenFds/Capsule.py | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/BaseTools/Source/Python/GenFds/Capsule.py
> b/BaseTools/Source/Python/GenFds/Capsule.py
> index f4bfc74e55..d274d8f03e 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 {
> --
> 2.38.1.windows.1
>
>
>
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113336): https://edk2.groups.io/g/devel/message/113336
Mute This Topic: https://groups.io/mt/103589200/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-01-08 1:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-02 6:27 [edk2-devel] [PATCH] BaseTools/GenFds: Apply OEM_CAPSULE_FLAGS during Capsule generation Igniculus.Fu via groups.io
2024-01-08 1:06 ` 回复: " gaoliming via groups.io
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox