Re: [edk2-platforms][PATCH V2 0/8] Platform/Sgi: Add PPTT table for Neoverse Reference Design platforms
Sami Mujawar
Hi Pranav,
toggle quoted messageShow quoted text
Is it possible to send the PPTT table dump using ACPIview for these platforms, please? Shell> acpiview -s PPTT Regards, Sami Mujawar
On 28/04/2021 01:12 PM, Pranav Madhu wrote:
Changes since V1:
|
|
Re: [edk2-platforms][PATCH V1 10/17] Platform/Sgi: Macro definitions for ACPI CPPC
Sami Mujawar
Hi Pranav,
Please find my response inline marked [SAMI]. Regards, Sami Mujawar On 28/04/2021 01:35 PM, Pranav Madhu wrote: Add helper macros required for use with ACPI collaborative processor[SAMI] I think it would be good to add a coment in the macro header clarifying that this macro is intended to be used in ASL definitition. The same would apply for the following macro. Alternatively, you could introduce a new header file for the ASL macro definitions SgiAslHeader.h. What do you think ? [/SAMI] + { \
|
|
Re: [edk2-platforms][PATCH V1 02/17] Platform/Sgi: Add CPU container for SGI-575
Sami Mujawar
Hi Pranav,
Please find my response inline marked [SAMI]. Regards, Sami Mujawar On 28/04/2021 01:35 PM, Pranav Madhu wrote: The SGI-575 platform includes two clusters with four single-thread CPUs.[SAMI] Please see my comment for the patch in your previous series at https://edk2.groups.io/g/devel/message/74863 [/SAMI] +
|
|
[PATCH 1/1] Platform/RaspberryPi: Update ACPI table revision
Sunny Wang
As per ACPI 6.3 specification, the DSDT/SSDT table should use revision 2
, so update the revision numbers to 2. This also fixes https://github.com/pftf/RPi4/issues/94 (FWTS failures). Testing Done: - Booted to UEFI Shell and used apciview command to check all ACPI tables' revision. - Ran FWTS test and no longer see the ACPI DSDT and SSDT revision failures. Note that the XSDT revision failure is caused by the FWTS tool's issue that got fixed in commit c522bfedc9839a474b8d590ba36bec77436d2e90 Cc: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@...> Cc: Jeremy Linton <jeremy.linton@...> Cc: Sami Mujawar <sami.mujawar@...> Cc: Pete Batard <pete@...> Cc: Ard Biesheuvel <ardb+tianocore@...> Signed-off-by: Sunny Wang <sunny.wang@...> --- Platform/RaspberryPi/AcpiTables/Dsdt.asl | 3 ++- Platform/RaspberryPi/AcpiTables/Emmc.asl | 4 ++-- Platform/RaspberryPi/AcpiTables/SsdtThermal.asl | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Platform/RaspberryPi/AcpiTables/Dsdt.asl b/Platform/Raspberr= yPi/AcpiTables/Dsdt.asl index d116f965e1..54fa3eca7b 100644 --- a/Platform/RaspberryPi/AcpiTables/Dsdt.asl +++ b/Platform/RaspberryPi/AcpiTables/Dsdt.asl @@ -5,6 +5,7 @@ * Copyright (c) 2020, Pete Batard <pete@...> * Copyright (c) 2018-2020, Andrey Warkentin <andrey.warkentin@...= m> * Copyright (c) Microsoft Corporation. All rights reserved. + * Copyright (c) 2021, ARM Limited. All rights reserved. * * SPDX-License-Identifier: BSD-2-Clause-Patent * @@ -58,7 +59,7 @@ Store (Length, LE ## Index) \ Add (MI ## Index, LE ## Index - 1, MA ## Index) =20 -DefinitionBlock ("Dsdt.aml", "DSDT", 5, "RPIFDN", "RPI", 2) +DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RPIFDN", "RPI", 2) { Scope (\_SB_) { diff --git a/Platform/RaspberryPi/AcpiTables/Emmc.asl b/Platform/Raspberr= yPi/AcpiTables/Emmc.asl index 179dd3ecdb..88811eb354 100644 --- a/Platform/RaspberryPi/AcpiTables/Emmc.asl +++ b/Platform/RaspberryPi/AcpiTables/Emmc.asl @@ -1,6 +1,6 @@ /** @file * - * Copyright (c) 2021 Arm. All rights reserved. + * Copyright (c) 2021, ARM Limited. All rights reserved. * * SPDX-License-Identifier: BSD-2-Clause-Patent * @@ -11,7 +11,7 @@ =20 #include "AcpiTables.h" =20 -DefinitionBlock (__FILE__, "SSDT", 5, "RPIFDN", "RPI4EMMC", 2) +DefinitionBlock (__FILE__, "SSDT", 2, "RPIFDN", "RPI4EMMC", 2) { Scope (\_SB_) { diff --git a/Platform/RaspberryPi/AcpiTables/SsdtThermal.asl b/Platform/R= aspberryPi/AcpiTables/SsdtThermal.asl index acfa4699bb..e82f55bebd 100644 --- a/Platform/RaspberryPi/AcpiTables/SsdtThermal.asl +++ b/Platform/RaspberryPi/AcpiTables/SsdtThermal.asl @@ -2,7 +2,7 @@ * * Secondary System Description Table (SSDT) for active (fan) cooling * - * Copyright (c) 2020, Arm Ltd. All rights reserved. + * Copyright (c) 2020 - 2021, ARM Limited. All rights reserved. * * SPDX-License-Identifier: BSD-2-Clause-Patent * @@ -14,7 +14,7 @@ =20 #include <IndustryStandard/Acpi.h> =20 -DefinitionBlock (__FILE__, "SSDT", 5, "RPIFDN", "RPITHFAN", 2) +DefinitionBlock (__FILE__, "SSDT", 2, "RPIFDN", "RPITHFAN", 2) { External (\_SB_.EC00, DeviceObj) External (\_SB_.EC00.TZ00, DeviceObj) --=20 2.31.0.windows.1
|
|
Re: [PATCH v4 2/7] TigerlakeOpenBoard: Move ReportCpuHob library path
Heng Luo
Reviewed-by: Heng Luo <heng.luo@...>
toggle quoted messageShow quoted text
-----Original Message-----
|
|
Re: [PATCH] MdeModulePkg: Retrive boot manager menu from any fv
Zhiguang Liu
Hi Hao,
toggle quoted messageShow quoted text
I don't have the data about the boot performance. However, I think it has little impact for the originally working platforms. In function GetSectionFromAnyFv, It will first search section in current FV. If it finds the section, it will return succuss. Only if it can't find the section, it will take extra time to search in other FV. This case won't happen in originally working platforms Thanks Zhiguang
-----Original Message-----
|
|
Re: [PATCH RESEND v1 1/1] ArmPkg: Update SCMI Base Protocol version to 0x20000
Sami Mujawar
Hi All,
I have tested this patch on Juno R2. Tested-by: Sami Mujawar <sami.mujawar@...> Reviewed-by: Sami Mujawar <sami.mujawar@...> Regards, Sami Mujawar On 10/05/2021, 09:26, "Pierre.Gondois@..." <Pierre.Gondois@...> wrote: From: Nicola Mazzucato <nicola.mazzucato@...> The SCP-firmware has moved to full support for SCMIv2 which means that the base protocol can be either compliant with SCMI v1 or v2. Allow any version between SCMI v1.0 and SCMI v2.0 to be compatible with the current implementation. Signed-off-by: Nicola Mazzucato <nicola.mazzucato@...> Signed-off-by: Pierre Gondois <Pierre.Gondois@...> --- The changes can be seen at: https://github.com/PierreARM/edk2/tree/1732_Update_SCMI_version_v1 ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c | 10 ++++++---- ArmPkg/Include/Protocol/ArmScmiBaseProtocol.h | 10 +++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c b/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c index d5890a7633a2..fb4e79aa3610 100644 --- a/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c +++ b/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c @@ -4,9 +4,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent - System Control and Management Interface V1.0 - http://infocenter.arm.com/help/topic/com.arm.doc.den0056a/ - DEN0056A_System_Control_and_Management_Interface.pdf + @par Specification Reference: + - Arm System Control and Management Interface - Platform Design Document + (https://developer.arm.com/documentation/den0056/) **/ #include <Base.h> @@ -86,7 +86,9 @@ ArmScmiDxeEntryPoint ( return Status; } - if (Version != BASE_PROTOCOL_VERSION) { + // Accept any version between SCMI v1.0 and SCMI v2.0 + if ((Version < BASE_PROTOCOL_VERSION_V1) || + (Version > BASE_PROTOCOL_VERSION_V2)) { ASSERT (FALSE); return EFI_UNSUPPORTED; } diff --git a/ArmPkg/Include/Protocol/ArmScmiBaseProtocol.h b/ArmPkg/Include/Protocol/ArmScmiBaseProtocol.h index 73ad3e32a2f5..c4b81c0f56d3 100644 --- a/ArmPkg/Include/Protocol/ArmScmiBaseProtocol.h +++ b/ArmPkg/Include/Protocol/ArmScmiBaseProtocol.h @@ -4,9 +4,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent - System Control and Management Interface V1.0 - http://infocenter.arm.com/help/topic/com.arm.doc.den0056a/ - DEN0056A_System_Control_and_Management_Interface.pdf + @par Specification Reference: + - Arm System Control and Management Interface - Platform Design Document + (https://developer.arm.com/documentation/den0056/) **/ #ifndef ARM_SCMI_BASE_PROTOCOL_H_ @@ -14,7 +14,8 @@ #include <Protocol/ArmScmi.h> -#define BASE_PROTOCOL_VERSION 0x10000 +#define BASE_PROTOCOL_VERSION_V1 0x10000 +#define BASE_PROTOCOL_VERSION_V2 0x20000 #define NUM_PROTOCOL_MASK 0xFFU #define NUM_AGENT_MASK 0xFFU @@ -165,4 +166,3 @@ typedef enum { } SCMI_MESSAGE_ID_BASE; #endif /* ARM_SCMI_BASE_PROTOCOL_H_ */ - -- 2.17.1 IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
|
|
Re: [edk2-platforms][PATCH V2 2/8] Platform/Sgi: ACPI PPTT table for SGI-575 platform
Sami Mujawar
Hi Pranav,
Please see my response inline marked [SAMI]. Regards, Sami Mujawar On 28/04/2021 01:12 PM, Pranav Madhu wrote: From: Pranav Madhu <Pranav.Madhu@...>[SAMI] Can you add a doxygen style header describing the parameters. As it stands the meaning of the macro parameter is not intutive. I can see the difficulty if PPTT_CORE_INIT() were to be a generic macro, in which case it may be better to describe the parameters as affinity levels. However, in the current case this macro is local, so - the macro could be modified to suit parameters specific to this file OR - Describe the macro parameters as affinity levels and add a Doxygen function style comment header clarifying the parameter usage. [/SAMI] + { \IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
|
|
Re: [edk2-platforms][PATCH V2 1/8] Platform/Sgi: Helper macros for PPTT Table
Sami Mujawar
Hi Pranav,
Please find my response inline marked [SAMI]. Regards, Sami Mujawar On 28/04/2021 01:12 PM, Pranav Madhu wrote: Add helper macros for the creation for PPTT table. These macros help[SAMI] Is there a reason for setting the ID as invalid? In the next CPPC patch series 'Platform/Sgi: Add CPU container for xxx' the processor containers "ACPI0010" are described with valid UIDs. According to the ACPI 6.4 sepcification, Table 5.138: Processor Hierarchy Node Structure, Field description for 'ACPI Processor ID' states the following: "If the processor structure represents a group of associated processors, the structure might match a processor container in the name space. In that case this entry will match the value of the _UID method of the associated processor container. Where there is a match it must be represented." So, either this patch series or the next patch series 'Platform/Sgi: Add CPU container for xxx' will need to address this. [/SAMI] + EFI_ACPI_6_3_PPTT_PROCESSOR_IS_NOT_THREAD, \IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
|
|
Re: [PATCH] MdeModulePkg: Retrive boot manager menu from any fv
Wu, Hao A
toggle quoted messageShow quoted text
-----Original Message----- Hello Zhiguang, Sorry for a question. Do you know what is the boot performance impact if 'GetSectionFromAnyFv()' is being used? Any data on the impact for originally working platforms? Best Regards, Hao Wu
|
|
Re: [PATCH v1 1/1] ArmPkg: Update SCMI Base Protocol version to 0x20000
PierreGondois
Hi Ard,
On 5/7/21 6:33 PM, Ard Biesheuvel wrote: Hello Pierre,Ok, I re-sent the patch with my SOB added. I kept Nicola's one as for (a) of the certificate of origin: "The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file" Regards, Pierre
|
|
[PATCH RESEND v1 1/1] ArmPkg: Update SCMI Base Protocol version to 0x20000
PierreGondois
From: Nicola Mazzucato <nicola.mazzucato@...>
The SCP-firmware has moved to full support for SCMIv2 which means that the base protocol can be either compliant with SCMI v1 or v2. Allow any version between SCMI v1.0 and SCMI v2.0 to be compatible with the current implementation. Signed-off-by: Nicola Mazzucato <nicola.mazzucato@...> Signed-off-by: Pierre Gondois <Pierre.Gondois@...> --- The changes can be seen at: https://github.com/PierreARM/edk2/tree/1732_Update_SCMI_version_v1 ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c | 10 ++++++---- ArmPkg/Include/Protocol/ArmScmiBaseProtocol.h | 10 +++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c b/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c index d5890a7633a2..fb4e79aa3610 100644 --- a/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c +++ b/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c @@ -4,9 +4,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent - System Control and Management Interface V1.0 - http://infocenter.arm.com/help/topic/com.arm.doc.den0056a/ - DEN0056A_System_Control_and_Management_Interface.pdf + @par Specification Reference: + - Arm System Control and Management Interface - Platform Design Document + (https://developer.arm.com/documentation/den0056/) **/ #include <Base.h> @@ -86,7 +86,9 @@ ArmScmiDxeEntryPoint ( return Status; } - if (Version != BASE_PROTOCOL_VERSION) { + // Accept any version between SCMI v1.0 and SCMI v2.0 + if ((Version < BASE_PROTOCOL_VERSION_V1) || + (Version > BASE_PROTOCOL_VERSION_V2)) { ASSERT (FALSE); return EFI_UNSUPPORTED; } diff --git a/ArmPkg/Include/Protocol/ArmScmiBaseProtocol.h b/ArmPkg/Include/Protocol/ArmScmiBaseProtocol.h index 73ad3e32a2f5..c4b81c0f56d3 100644 --- a/ArmPkg/Include/Protocol/ArmScmiBaseProtocol.h +++ b/ArmPkg/Include/Protocol/ArmScmiBaseProtocol.h @@ -4,9 +4,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent - System Control and Management Interface V1.0 - http://infocenter.arm.com/help/topic/com.arm.doc.den0056a/ - DEN0056A_System_Control_and_Management_Interface.pdf + @par Specification Reference: + - Arm System Control and Management Interface - Platform Design Document + (https://developer.arm.com/documentation/den0056/) **/ #ifndef ARM_SCMI_BASE_PROTOCOL_H_ @@ -14,7 +14,8 @@ #include <Protocol/ArmScmi.h> -#define BASE_PROTOCOL_VERSION 0x10000 +#define BASE_PROTOCOL_VERSION_V1 0x10000 +#define BASE_PROTOCOL_VERSION_V2 0x20000 #define NUM_PROTOCOL_MASK 0xFFU #define NUM_AGENT_MASK 0xFFU @@ -165,4 +166,3 @@ typedef enum { } SCMI_MESSAGE_ID_BASE; #endif /* ARM_SCMI_BASE_PROTOCOL_H_ */ - -- 2.17.1
|
|
[PATCH] MdeModulePkg: Retrive boot manager menu from any fv
Zhiguang Liu
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3384
Currently, UefiBootManagerLib has the below assumption: Assume the BootManagerMenuFile is in the same FV as the module links to t= his library. It has some limitation now, so remove the assumption. Cc: Jian J Wang <jian.j.wang@...> Cc: Hao A Wu <hao.a.wu@...> Cc: Zhichao Gao <zhichao.gao@...> Cc: Ray Ni <ray.ni@...> Signed-off-by: Zhiguang Liu <zhiguang.liu@...> --- MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePk= g/Library/UefiBootManagerLib/BmBoot.c index 6cc34d29c0..b8df4d590f 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c @@ -2,7 +2,7 @@ Library functions which relates with booting.=0D =0D Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.=0D -Copyright (c) 2011 - 2020, Intel Corporation. All rights reserved.<BR>=0D +Copyright (c) 2011 - 2021, Intel Corporation. All rights reserved.<BR>=0D (C) Copyright 2015-2021 Hewlett Packard Enterprise Development LP<BR>=0D SPDX-License-Identifier: BSD-2-Clause-Patent=0D =0D @@ -2385,7 +2385,6 @@ EfiBootManagerRefreshAllBootOption ( This function is called to get or create the boot option for the Boot Ma= nager Menu.=0D =0D The Boot Manager Menu is shown after successfully booting a boot option.= =0D - Assume the BootManagerMenuFile is in the same FV as the module links to = this library.=0D =0D @param BootOption Return the boot option of the Boot Manager Menu=0D =0D @@ -2437,7 +2436,7 @@ BmRegisterBootManagerMenu ( =0D if (DevicePath =3D=3D NULL) {=0D Data =3D NULL;=0D - Status =3D GetSectionFromFv (=0D + Status =3D GetSectionFromAnyFv (=0D PcdGetPtr (PcdBootManagerMenuFile),=0D EFI_SECTION_PE32,=0D 0,=0D @@ -2455,7 +2454,7 @@ BmRegisterBootManagerMenu ( //=0D // Get BootManagerMenu application's description from EFI User Interfa= ce Section.=0D //=0D - Status =3D GetSectionFromFv (=0D + Status =3D GetSectionFromAnyFv (=0D PcdGetPtr (PcdBootManagerMenuFile),=0D EFI_SECTION_USER_INTERFACE,=0D 0,=0D --=20 2.30.0.windows.2
|
|
[edk2-platforms][PATCH 4/4] Platform/StandaloneMm: build StandaloneMmRpmb for 32bit architectures
Etienne Carriere
Build PlatformStandaloneMmRpmb for ARM architecture (32bit arm machine).
The generated image targets an execution environment similar to AArch64 StMM secure partition in OP-TEE but in 32bit mode. GCC flag -fno-stack-protector added. The stack protection code bring GOT dependencies we prefer avoid when StMM runs in OP-TEE. Cc: Ard Biesheuvel <ardb+tianocore@...> Cc: Ilias Apalodimas <ilias.apalodimas@...> Cc: Leif Lindholm <leif@...> Cc: Sami Mujawar <sami.mujawar@...> Signed-off-by: Etienne Carriere <etienne.carriere@...> --- Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc b/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc index cb3f1ddf52..996d4e4ba9 100644 --- a/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc +++ b/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc @@ -16,7 +16,7 @@ PLATFORM_VERSION = 1.0 DSC_SPECIFICATION = 0x0001001C OUTPUT_DIRECTORY = Build/$(PLATFORM_NAME) - SUPPORTED_ARCHITECTURES = AARCH64 + SUPPORTED_ARCHITECTURES = ARM|AARCH64 BUILD_TARGETS = DEBUG|RELEASE|NOOPT SKUID_IDENTIFIER = DEFAULT FLASH_DEFINITION = Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.fdf @@ -68,6 +68,12 @@ # NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf +[LibraryClasses.ARM] + ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf + NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf + NULL|ArmPkg/Library/ArmSvcLib/ArmSvcLib.inf + RegisterFilterLib|MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf + [LibraryClasses.common.MM_STANDALONE] HobLib|StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.inf MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf @@ -160,3 +166,7 @@ [BuildOptions.AARCH64] GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 -march=armv8-a+nofp GCC:*_*_*_CC_FLAGS = -mstrict-align + +[BuildOptions.ARM] +GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 -march=armv7-a +GCC:*_*_*_CC_FLAGS = -fno-stack-protector -- 2.17.1
|
|
[edk2-platforms][PATCH 3/4] Drivers/OpTee: address cast build warning issue in 32b mode
Etienne Carriere
Use (UINTN) cast to cast physical or virtual address values to the
pointer size before casting from/to a pointer value. Cc: Ard Biesheuvel <ardb+tianocore@...> Cc: Ilias Apalodimas <ilias.apalodimas@...> Cc: Leif Lindholm <leif@...> Cc: Sami Mujawar <sami.mujawar@...> Signed-off-by: Etienne Carriere <etienne.carriere@...> --- Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c | 21 +++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c b/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c index 6eb19bed0e..83c2750368 100644 --- a/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c +++ b/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c @@ -305,7 +305,8 @@ OpTeeRpmbFvbRead ( } } - Base = (VOID *)Instance->MemBaseAddress + (Lba * Instance->BlockSize) + Offset; + Base = (VOID *)(UINTN)Instance->MemBaseAddress + (Lba * Instance->BlockSize) + + Offset; // We could read the data from the RPMB instead of memory // The 2 copies should already be identical // Copy from memory image @@ -387,7 +388,8 @@ OpTeeRpmbFvbWrite ( return Status; } } - Base = (VOID *)Instance->MemBaseAddress + Lba * Instance->BlockSize + Offset; + Base = (VOID *)(UINTN)Instance->MemBaseAddress + (Lba * Instance->BlockSize) + + Offset; Status = ReadWriteRpmb ( SP_SVC_RPMB_WRITE, (UINTN)Buffer, @@ -477,7 +479,8 @@ OpTeeRpmbFvbErase ( return EFI_INVALID_PARAMETER; } NumBytes = NumLba * Instance->BlockSize; - Base = (VOID *)Instance->MemBaseAddress + Start * Instance->BlockSize; + Base = (VOID *)(UINTN)Instance->MemBaseAddress + + (Start * Instance->BlockSize); Buf = AllocatePool (NumLba * Instance->BlockSize); if (Buf == NULL) { return EFI_DEVICE_ERROR; @@ -689,7 +692,7 @@ InitializeFvAndVariableStoreHeaders ( goto Exit; } // Install the combined header in memory - CopyMem ((VOID*)Instance->MemBaseAddress, Headers, HeadersLength); + CopyMem ((VOID*)(UINTN)Instance->MemBaseAddress, Headers, HeadersLength); Exit: FreePool (Headers); @@ -747,14 +750,18 @@ FvbInitialize ( // Read the file from disk and copy it to memory ReadEntireFlash (Instance); - FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER *)Instance->MemBaseAddress; + FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)Instance->MemBaseAddress; Status = ValidateFvHeader (FwVolHeader); if (EFI_ERROR (Status)) { // There is no valid header, so time to install one. DEBUG ((DEBUG_INFO, "%a: The FVB Header is not valid.\n", __FUNCTION__)); // Reset memory - SetMem64 ((VOID *)Instance->MemBaseAddress, Instance->NBlocks * Instance->BlockSize, ~0UL); + SetMem64 ( + (VOID *)(UINTN)Instance->MemBaseAddress, + Instance->NBlocks * Instance->BlockSize, + ~0UL + ); DEBUG ((DEBUG_INFO, "%a: Erasing Flash.\n", __FUNCTION__)); Status = ReadWriteRpmb ( SP_SVC_RPMB_WRITE, @@ -827,7 +834,7 @@ OpTeeRpmbFvbInit ( mInstance.FvbProtocol.Write = OpTeeRpmbFvbWrite; mInstance.FvbProtocol.Read = OpTeeRpmbFvbRead; - mInstance.MemBaseAddress = (EFI_PHYSICAL_ADDRESS)Addr; + mInstance.MemBaseAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)Addr; mInstance.Signature = FLASH_SIGNATURE; mInstance.Initialize = FvbInitialize; mInstance.BlockSize = EFI_PAGE_SIZE; -- 2.17.1
|
|
[edk2-platforms][PATCH 2/4] Drivers/OpTee: Add Aarch32 SVC IDs for 32bit Arm targets
Etienne Carriere
Add SMCCC function IDs for RPMB read/write service on 32bit architectures.
Define generic SP_SVC_RPMB_READ/SP_SVC_RPMB_WRITE IDs for native target architecture (32b or 64b). Changes OpTeeRpmbFvb.c to use architecture agnostic macro ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ for 32b and 64b support. Cc: Ard Biesheuvel <ardb+tianocore@...> Cc: Ilias Apalodimas <ilias.apalodimas@...> Cc: Leif Lindholm <leif@...> Cc: Sami Mujawar <sami.mujawar@...> Signed-off-by: Etienne Carriere <etienne.carriere@...> --- Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c | 2 +- Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.h | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c b/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c index 5197c95abd..6eb19bed0e 100644 --- a/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c +++ b/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c @@ -68,7 +68,7 @@ ReadWriteRpmb ( ZeroMem (&SvcArgs, sizeof (SvcArgs)); - SvcArgs.Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH64; + SvcArgs.Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ; SvcArgs.Arg1 = mStorageId; SvcArgs.Arg2 = 0; SvcArgs.Arg3 = SvcAct; diff --git a/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.h b/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.h index c17fc287ef..bf4a39b9db 100644 --- a/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.h +++ b/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.h @@ -13,8 +13,20 @@ contract between OP-TEE and EDK2. For more details check core/arch/arm/include/kernel/stmm_sp.h in OP-TEE **/ -#define SP_SVC_RPMB_READ 0xC4000066 -#define SP_SVC_RPMB_WRITE 0xC4000067 +#define SP_SVC_RPMB_READ_64 0xC4000066 +#define SP_SVC_RPMB_WRITE_64 0xC4000067 + +#define SP_SVC_RPMB_READ_32 0x84000066 +#define SP_SVC_RPMB_WRITE_32 0x84000067 + +#ifdef MDE_CPU_AARCH64 +#define SP_SVC_RPMB_READ SP_SVC_RPMB_READ_64 +#define SP_SVC_RPMB_WRITE SP_SVC_RPMB_WRITE_64 +#endif +#ifdef MDE_CPU_ARM +#define SP_SVC_RPMB_READ SP_SVC_RPMB_READ_32 +#define SP_SVC_RPMB_WRITE SP_SVC_RPMB_WRITE_32 +#endif #define FLASH_SIGNATURE SIGNATURE_32 ('r', 'p', 'm', 'b') #define INSTANCE_FROM_FVB_THIS(a) CR (a, MEM_INSTANCE, FvbProtocol, \ -- 2.17.1
|
|
[edk2-platforms][PATCH 1/4] sync with edk2 where StandaloneMmCpu moved to AArch64/ parent directory
Etienne Carriere
Synchronize with edk2 package where StandaloneMmCpu component has moved
from StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf to StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf Cc: Ard Biesheuvel <ardb+tianocore@...> Cc: Ilias Apalodimas <ilias.apalodimas@...> Cc: Leif Lindholm <leif@...> Cc: Sami Mujawar <sami.mujawar@...> Cc: Sughosh Ganu <sughosh.ganu@...> Cc: Thomas Abraham <thomas.abraham@...> Signed-off-by: Etienne Carriere <etienne.carriere@...> --- Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc | 2 +- Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf | 2 +- Platform/Socionext/DeveloperBox/DeveloperBoxMm.dsc | 2 +- Platform/Socionext/DeveloperBox/DeveloperBoxMm.fdf | 2 +- Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc | 2 +- Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.fdf | 3 ++- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc b/Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc index e281d54909..1e0af23711 100644 --- a/Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc +++ b/Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc @@ -122,7 +122,7 @@ StandaloneMmPkg/Core/StandaloneMmCore.inf [Components.AARCH64] - StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf + StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf ################################################################################################### # diff --git a/Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf b/Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf index 5a0772cd85..96b4272dd6 100644 --- a/Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf +++ b/Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf @@ -49,7 +49,7 @@ READ_LOCK_CAP = TRUE READ_LOCK_STATUS = TRUE INF StandaloneMmPkg/Core/StandaloneMmCore.inf - INF StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf + INF StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf ################################################################################ # diff --git a/Platform/Socionext/DeveloperBox/DeveloperBoxMm.dsc b/Platform/Socionext/DeveloperBox/DeveloperBoxMm.dsc index e078de4bbb..b5524f87a6 100644 --- a/Platform/Socionext/DeveloperBox/DeveloperBoxMm.dsc +++ b/Platform/Socionext/DeveloperBox/DeveloperBoxMm.dsc @@ -80,7 +80,7 @@ gEfiMdePkgTokenSpaceGuid.PcdMaximumGuidedExtractHandler|0x2 } - StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf + StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/Fip006StandaloneMm.inf MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.inf MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf { diff --git a/Platform/Socionext/DeveloperBox/DeveloperBoxMm.fdf b/Platform/Socionext/DeveloperBox/DeveloperBoxMm.fdf index 33de03c8e7..89453477c9 100644 --- a/Platform/Socionext/DeveloperBox/DeveloperBoxMm.fdf +++ b/Platform/Socionext/DeveloperBox/DeveloperBoxMm.fdf @@ -111,7 +111,7 @@ READ_LOCK_STATUS = TRUE INF Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/Fip006StandaloneMm.inf INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.inf INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf - INF StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf + INF StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf ################################################################################ # diff --git a/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc b/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc index f99a47ebf6..cb3f1ddf52 100644 --- a/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc +++ b/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc @@ -133,7 +133,7 @@ # Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFv.inf StandaloneMmPkg/Core/StandaloneMmCore.inf - StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf + StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.inf { <LibraryClasses> NULL|Drivers/OpTee/OpteeRpmbPkg/FixupPcd.inf diff --git a/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.fdf b/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.fdf index e175dc7b2d..c4295a3e63 100644 --- a/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.fdf +++ b/Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.fdf @@ -68,7 +68,8 @@ READ_LOCK_STATUS = TRUE INF Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFv.inf INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.inf INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf - INF StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf + INF StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf + ################################################################################ # # Rules are use with the [FV] section's module INF type to define -- 2.17.1
|
|
[edk2-platforms][PATCH 0/4] Arm 32bit support in StandaloneMmRpmb
Etienne Carriere
This series brings support for building PlatformStandaloneMmRpmb for
32bit Arm architectures. This series is based on series [1] in edk2 that allows to build StandaloneMm package for 32bit Arm. This series starts by syncing with paths changes from [1] series, then comes changes for Arm 32bit support in OpTee drivers and last updates PlatformStandaloneMmRpmb.dsc for 32bit the ARM architure. [1] https://edk2.groups.io/g/devel/message/74734 Etienne Carriere (4): sync with edk2 where StandaloneMmCpu moved to AArch64/ parent directory Drivers/OpTee: Add Aarch32 SVC IDs for 32bit Arm targets Drivers/OpTee: address cast build warning issue in 32b mode Platform/StandaloneMm: build StandaloneMmRpmb for 32bit architectures Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c | 23 ++++++++++++------- Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.h | 16 +++++++++++-- Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc | 2 +- Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf | 2 +- .../Socionext/DeveloperBox/DeveloperBoxMm.dsc | 2 +- .../Socionext/DeveloperBox/DeveloperBoxMm.fdf | 2 +- .../PlatformStandaloneMmRpmb.dsc | 14 +++++++++-- .../PlatformStandaloneMmRpmb.fdf | 3 ++- 8 files changed, 47 insertions(+), 17 deletions(-) -- 2.17.1
|
|
Re: [Patch 1/1] BaseTools: Fix DSC override of Guided tool
Bob Feng
This patch is good to me.
toggle quoted messageShow quoted text
Reviewed-by: Bob Feng <bob.c.feng@...>
-----Original Message-----
From: Kinney, Michael D <michael.d.kinney@...> Sent: Sunday, May 9, 2021 3:43 AM To: devel@edk2.groups.io Cc: Feng, Bob C <bob.c.feng@...>; Liming Gao <gaoliming@...>; Chen, Christine <yuwei.chen@...> Subject: [Patch 1/1] BaseTools: Fix DSC override of Guided tool REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3359 If the DSC file provides an override of a Guided tool path and/or Guided tool GUID value, then make sure the one from the DSC file is used if it is higher priority than the Guided tool in the tools_def.txt file. This makes the Guided tool used by GenFds match the tool listed GuidedSectionTools.txt. Cc: Bob Feng <bob.c.feng@...> Cc: Liming Gao <gaoliming@...> Cc: Yuwei Chen <yuwei.chen@...> Signed-off-by: Michael D Kinney <michael.d.kinney@...> --- .../Source/Python/AutoGen/PlatformAutoGen.py | 7 +- .../Python/GenFds/GenFdsGlobalVariable.py | 228 ++++++++++++------ BaseTools/Source/Python/build/build.py | 52 ++-- 3 files changed, 190 insertions(+), 97 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py index 832c0da86bb7..592d4824a4b3 100644 --- a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py @@ -918,14 +918,13 @@ class PlatformAutoGen(AutoGen): if Tool in self._BuildOptionWithToolDef(RetVal) and Attr in self._BuildOptionWithToolDef(RetVal)[Tool]: # check if override is indicated if self._BuildOptionWithToolDef(RetVal)[Tool][Attr].startswith('='): - Value = self._BuildOptionWithToolDef(RetVal)[Tool][Attr][1:] + Value = + self._BuildOptionWithToolDef(RetVal)[Tool][Attr][1:].strip() else: - if Attr != 'PATH': + # Do not append PATH or GUID + if Attr != 'PATH' and Attr != 'GUID': Value += " " + self._BuildOptionWithToolDef(RetVal)[Tool][Attr] else: Value = self._BuildOptionWithToolDef(RetVal)[Tool][Attr] - Def = '_'.join([self.BuildTarget, self.ToolChain, self.Arch, Tool, Attr]) - self.Workspace.ToolDef.ToolsDefTxtDictionary[Def] = Value if Attr == "PATH": # Don't put MAKE definition in the file if Tool != "MAKE": diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py index c31fc24870d5..25f9d54874d3 100644 --- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py +++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py @@ -32,6 +32,7 @@ from Common.LongFilePathSupport import OpenLongFilePath as open from Common.MultipleWorkspace import MultipleWorkspace as mws import Common.GlobalData as GlobalData from Common.BuildToolError import * +from AutoGen.AutoGen import CalculatePriorityValue ## Global variables # @@ -850,6 +851,10 @@ class GenFdsGlobalVariable: # @param NameGuid The Guid name # def FindExtendTool(KeyStringList, CurrentArchList, NameGuid): + if GenFdsGlobalVariable.GuidToolDefinition: + if NameGuid in GenFdsGlobalVariable.GuidToolDefinition: + return GenFdsGlobalVariable.GuidToolDefinition[NameGuid] + ToolDefObj = ToolDefDict((os.path.join(os.getenv("WORKSPACE"), "Conf"))) ToolDef = ToolDefObj.ToolDef ToolDb = ToolDef.ToolsDefTxtDatabase @@ -864,86 +869,159 @@ def FindExtendTool(KeyStringList, CurrentArchList, NameGuid): if Target + '_' + ToolChain + '_' + Arch not in KeyStringList: KeyStringList.append(Target + '_' + ToolChain + '_' + Arch) - if GenFdsGlobalVariable.GuidToolDefinition: - if NameGuid in GenFdsGlobalVariable.GuidToolDefinition: - return GenFdsGlobalVariable.GuidToolDefinition[NameGuid] - - ToolDefinition = ToolDef.ToolsDefTxtDictionary ToolPathTmp = None ToolOption = None - ToolPathKey = None - ToolOptionKey = None - KeyList = None - for tool_def in ToolDefinition.items(): - KeyList = tool_def[0].split('_') - if len(KeyList) < 5: - continue - if KeyList[4] != DataType.TAB_GUID: - continue - if NameGuid.lower() != tool_def[1].lower(): - continue - Key = KeyList[0] + \ - '_' + \ - KeyList[1] + \ - '_' + \ - KeyList[2] + for Arch in CurrentArchList: + MatchItem = None + MatchPathItem = None + MatchOptionsItem = None for KeyString in KeyStringList: KeyStringBuildTarget, KeyStringToolChain, KeyStringArch = KeyString.split('_') - if KeyList[0] == DataType.TAB_STAR: - KeyList[0] = KeyStringBuildTarget - if KeyList[1] == DataType.TAB_STAR: - KeyList[1] = KeyStringToolChain - if KeyList[2] == DataType.TAB_STAR: - KeyList[2] = KeyStringArch - if KeyList[0] == KeyStringBuildTarget and KeyList[1] == KeyStringToolChain and KeyList[2] == KeyStringArch: - ToolPathKey = Key + '_' + KeyList[3] + '_PATH' - ToolOptionKey = Key + '_' + KeyList[3] + '_FLAGS' - ToolPath = ToolDefinition.get(ToolPathKey) - ToolOption = ToolDefinition.get(ToolOptionKey) - if ToolPathTmp is None: - ToolPathTmp = ToolPath - else: - if ToolPathTmp != ToolPath: - EdkLogger.error("GenFds", GENFDS_ERROR, "Don't know which tool to use, %s or %s ?" % (ToolPathTmp, ToolPath)) + if KeyStringArch != Arch: + continue + for Item in ToolDef.ToolsDefTxtDictionary: + if len(Item.split('_')) < 5: + continue + ItemTarget, ItemToolChain, ItemArch, ItemTool, ItemAttr = Item.split('_') + if ItemTarget == DataType.TAB_STAR: + ItemTarget = KeyStringBuildTarget + if ItemToolChain == DataType.TAB_STAR: + ItemToolChain = KeyStringToolChain + if ItemArch == DataType.TAB_STAR: + ItemArch = KeyStringArch + if ItemTarget != KeyStringBuildTarget: + continue + if ItemToolChain != KeyStringToolChain: + continue + if ItemArch != KeyStringArch: + continue + if ItemAttr != DataType.TAB_GUID: + # Not GUID attribute + continue + if ToolDef.ToolsDefTxtDictionary[Item].lower() != NameGuid.lower(): + # No GUID value match + continue + if MatchItem: + if MatchItem.split('_')[3] == ItemTool: + # Tool name is the same + continue + if CalculatePriorityValue(MatchItem) > CalculatePriorityValue(Item): + # Current MatchItem is higher priority than new match item + continue + MatchItem = Item + if not MatchItem: + continue + ToolName = MatchItem.split('_')[3] + for Item in ToolDef.ToolsDefTxtDictionary: + if len(Item.split('_')) < 5: + continue + ItemTarget, ItemToolChain, ItemArch, ItemTool, ItemAttr = Item.split('_') + if ItemTarget == DataType.TAB_STAR: + ItemTarget = KeyStringBuildTarget + if ItemToolChain == DataType.TAB_STAR: + ItemToolChain = KeyStringToolChain + if ItemArch == DataType.TAB_STAR: + ItemArch = KeyStringArch + if ItemTarget != KeyStringBuildTarget: + continue + if ItemToolChain != KeyStringToolChain: + continue + if ItemArch != KeyStringArch: + continue + if ItemTool != ToolName: + continue + if ItemAttr == 'PATH': + if MatchPathItem: + if CalculatePriorityValue(MatchPathItem) <= CalculatePriorityValue(Item): + MatchPathItem = Item + else: + MatchPathItem = Item + if ItemAttr == 'FLAGS': + if MatchOptionsItem: + if CalculatePriorityValue(MatchOptionsItem) <= CalculatePriorityValue(Item): + MatchOptionsItem = Item + else: + MatchOptionsItem = Item + if MatchPathItem: + ToolPathTmp = ToolDef.ToolsDefTxtDictionary[MatchPathItem] + if MatchOptionsItem: + ToolOption = + ToolDef.ToolsDefTxtDictionary[MatchOptionsItem] - BuildOption = {} for Arch in CurrentArchList: - Platform = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag] - # key is (ToolChainFamily, ToolChain, CodeBase) - for item in Platform.BuildOptions: - if '_PATH' in item[1] or '_FLAGS' in item[1] or '_GUID' in item[1]: - if not item[0] or (item[0] and GenFdsGlobalVariable.ToolChainFamily== item[0]): - if item[1] not in BuildOption: - BuildOption[item[1]] = Platform.BuildOptions[item] - if BuildOption: - ToolList = [DataType.TAB_TOD_DEFINES_TARGET, DataType.TAB_TOD_DEFINES_TOOL_CHAIN_TAG, DataType.TAB_TOD_DEFINES_TARGET_ARCH] - for Index in range(2, -1, -1): - for Key in list(BuildOption.keys()): - List = Key.split('_') - if List[Index] == DataType.TAB_STAR: - for String in ToolDb[ToolList[Index]]: - if String in [Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]: - List[Index] = String - NewKey = '%s_%s_%s_%s_%s' % tuple(List) - if NewKey not in BuildOption: - BuildOption[NewKey] = BuildOption[Key] - continue - del BuildOption[Key] - elif List[Index] not in ToolDb[ToolList[Index]]: - del BuildOption[Key] - if BuildOption: - if not KeyList: - for Op in BuildOption: - if NameGuid == BuildOption[Op]: - KeyList = Op.split('_') - Key = KeyList[0] + '_' + KeyList[1] +'_' + KeyList[2] - if Key in KeyStringList and KeyList[4] == DataType.TAB_GUID: - ToolPathKey = Key + '_' + KeyList[3] + '_PATH' - ToolOptionKey = Key + '_' + KeyList[3] + '_FLAGS' - if ToolPathKey in BuildOption: - ToolPathTmp = BuildOption[ToolPathKey] - if ToolOptionKey in BuildOption: - ToolOption = BuildOption[ToolOptionKey] - + MatchItem = None + MatchPathItem = None + MatchOptionsItem = None + for KeyString in KeyStringList: + KeyStringBuildTarget, KeyStringToolChain, KeyStringArch = KeyString.split('_') + if KeyStringArch != Arch: + continue + Platform = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, KeyStringBuildTarget, KeyStringToolChain] + for Item in Platform.BuildOptions: + if len(Item[1].split('_')) < 5: + continue + ItemTarget, ItemToolChain, ItemArch, ItemTool, ItemAttr = Item[1].split('_') + if ItemTarget == DataType.TAB_STAR: + ItemTarget = KeyStringBuildTarget + if ItemToolChain == DataType.TAB_STAR: + ItemToolChain = KeyStringToolChain + if ItemArch == DataType.TAB_STAR: + ItemArch = KeyStringArch + if ItemTarget != KeyStringBuildTarget: + continue + if ItemToolChain != KeyStringToolChain: + continue + if ItemArch != KeyStringArch: + continue + if ItemAttr != DataType.TAB_GUID: + # Not GUID attribute match + continue + if Platform.BuildOptions[Item].lower() != NameGuid.lower(): + # No GUID value match + continue + if MatchItem: + if MatchItem[1].split('_')[3] == ItemTool: + # Tool name is the same + continue + if CalculatePriorityValue(MatchItem[1]) > CalculatePriorityValue(Item[1]): + # Current MatchItem is higher priority than new match item + continue + MatchItem = Item + if not MatchItem: + continue + ToolName = MatchItem[1].split('_')[3] + for Item in Platform.BuildOptions: + if len(Item[1].split('_')) < 5: + continue + ItemTarget, ItemToolChain, ItemArch, ItemTool, ItemAttr = Item[1].split('_') + if ItemTarget == DataType.TAB_STAR: + ItemTarget = KeyStringBuildTarget + if ItemToolChain == DataType.TAB_STAR: + ItemToolChain = KeyStringToolChain + if ItemArch == DataType.TAB_STAR: + ItemArch = KeyStringArch + if ItemTarget != KeyStringBuildTarget: + continue + if ItemToolChain != KeyStringToolChain: + continue + if ItemArch != KeyStringArch: + continue + if ItemTool != ToolName: + continue + if ItemAttr == 'PATH': + if MatchPathItem: + if CalculatePriorityValue(MatchPathItem[1]) <= CalculatePriorityValue(Item[1]): + MatchPathItem = Item + else: + MatchPathItem = Item + if ItemAttr == 'FLAGS': + if MatchOptionsItem: + if CalculatePriorityValue(MatchOptionsItem[1]) <= CalculatePriorityValue(Item[1]): + MatchOptionsItem = Item + else: + MatchOptionsItem = Item + if MatchPathItem: + ToolPathTmp = Platform.BuildOptions[MatchPathItem] + if MatchOptionsItem: + ToolOption = Platform.BuildOptions[MatchOptionsItem] GenFdsGlobalVariable.GuidToolDefinition[NameGuid] = (ToolPathTmp, ToolOption) return ToolPathTmp, ToolOption diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index e5693c0d27a2..037493f0b02a 100755 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -62,6 +62,7 @@ from AutoGen.ModuleAutoGenHelper import WorkSpaceInfo, PlatformInfo from GenFds.FdfParser import FdfParser from AutoGen.IncludesAutoGen import IncludesAutoGen from GenFds.GenFds import resetFdsGlobalVariable +from AutoGen.AutoGen import CalculatePriorityValue ## standard targets of build command gSupportedTarget = ['all', 'genc', 'genmake', 'modules', 'libraries', 'fds', 'clean', 'cleanall', 'cleanlib', 'run'] @@ -2425,27 +2426,42 @@ class Build(): FvDir = Wa.FvDir if not os.path.exists(FvDir): continue - for Arch in self.ArchList: - # Look through the tool definitions for GUIDed tools + guidList = [] + tooldefguidList = [] guidAttribs = [] - for (attrib, value) in self.ToolDef.ToolsDefTxtDictionary.items(): - GuidBuildTarget, GuidToolChain, GuidArch, GuidTool, GuidAttr = attrib.split('_') - if GuidAttr.upper() == 'GUID': - if GuidBuildTarget == TAB_STAR: - GuidBuildTarget = BuildTarget - if GuidToolChain == TAB_STAR: - GuidToolChain = ToolChain - if GuidArch == TAB_STAR: - GuidArch = Arch - if GuidBuildTarget == BuildTarget and GuidToolChain == ToolChain and GuidArch == Arch: - path = '_'.join(attrib.split('_')[:-1]) + '_PATH' - if path in self.ToolDef.ToolsDefTxtDictionary: - path = self.ToolDef.ToolsDefTxtDictionary[path] - path = self.GetRealPathOfTool(path) - guidAttribs.append((value.lower(), GuidTool, path)) + for Platform in Wa.AutoGenObjectList: + if Platform.BuildTarget != BuildTarget: + continue + if Platform.ToolChain != ToolChain: + continue + if Platform.Arch != Arch: + continue + if hasattr (Platform, 'BuildOption'): + for Tool in Platform.BuildOption: + if 'GUID' in Platform.BuildOption[Tool]: + if 'PATH' in Platform.BuildOption[Tool]: + value = Platform.BuildOption[Tool]['GUID'] + if value in guidList: + EdkLogger.error("build", FORMAT_INVALID, "Duplicate GUID value %s used with Tool %s in DSC [BuildOptions]." % (value, Tool)) + path = Platform.BuildOption[Tool]['PATH'] + guidList.append(value) + guidAttribs.append((value, Tool, path)) + for Tool in Platform.ToolDefinition: + if 'GUID' in Platform.ToolDefinition[Tool]: + if 'PATH' in Platform.ToolDefinition[Tool]: + value = Platform.ToolDefinition[Tool]['GUID'] + if value in tooldefguidList: + EdkLogger.error("build", FORMAT_INVALID, "Duplicate GUID value %s used with Tool %s in tools_def.txt." % (value, Tool)) + tooldefguidList.append(value) + if value in guidList: + # Already added by platform + continue + path = Platform.ToolDefinition[Tool]['PATH'] + guidList.append(value) + guidAttribs.append((value, Tool, + path)) # Sort by GuidTool name - sorted (guidAttribs, key=lambda x: x[1]) + guidAttribs = sorted (guidAttribs, key=lambda x: + x[1]) # Write out GuidedSecTools.txt toolsFile = os.path.join(FvDir, 'GuidedSectionTools.txt') toolsFile = open(toolsFile, 'wt') -- 2.31.1.windows.1
|
|
[PATCH] EmulatorPkg: Update lldbefi.py to work with current lldb which uses python3
Rebecca Cran
The version of lldb shipping with macOS Big Sur is lldb-1205.0.27.3, and
it uses python3. Update lldbefi.py to work with it, including removing the unused 'commands' import and fixing the print statements. Signed-off-by: Rebecca Cran <rebecca@...> --- EmulatorPkg/Unix/lldbefi.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/EmulatorPkg/Unix/lldbefi.py b/EmulatorPkg/Unix/lldbefi.py index c3fb2675cb..952f8bf982 100755 --- a/EmulatorPkg/Unix/lldbefi.py +++ b/EmulatorPkg/Unix/lldbefi.py @@ -10,7 +10,6 @@ import lldb import os=0D import uuid=0D import string=0D -import commands=0D import optparse=0D import shlex=0D =0D @@ -389,7 +388,7 @@ def LoadEmulatorEfiSymbols(frame, bp_loc , internal_dic= t): =0D FileName =3D frame.thread.process.ReadCStringFromMemory (FileNamePtr, = FileNameLen, Error)=0D if not Error.Success():=0D - print "!ReadCStringFromMemory() did not find a %d byte C string at= %x" % (FileNameLen, FileNamePtr)=0D + print("!ReadCStringFromMemory() did not find a %d byte C string at= %x" % (FileNameLen, FileNamePtr))=0D # make breakpoint command continue=0D return False=0D =0D @@ -398,7 +397,7 @@ def LoadEmulatorEfiSymbols(frame, bp_loc , internal_dic= t): LoadAddress =3D frame.FindVariable ("LoadAddress").GetValueAsUnsig= ned() - 0x240=0D =0D debugger.HandleCommand ("target modules add %s" % FileName)=0D - print "target modules load --slid 0x%x %s" % (LoadAddress, FileNam= e)=0D + print("target modules load --slid 0x%x %s" % (LoadAddress, FileNam= e))=0D debugger.HandleCommand ("target modules load --slide 0x%x --file %= s" % (LoadAddress, FileName))=0D else:=0D target =3D debugger.GetSelectedTarget()=0D @@ -408,7 +407,7 @@ def LoadEmulatorEfiSymbols(frame, bp_loc , internal_dic= t): if FileName =3D=3D ModuleName or FileName =3D=3D SBModule.GetF= ileSpec().GetFilename():=0D target.ClearModuleLoadAddress (SBModule)=0D if not target.RemoveModule (SBModule):=0D - print "!lldb.target.RemoveModule (%s) FAILED" % SBModu= le=0D + print("!lldb.target.RemoveModule (%s) FAILED" % SBModu= le)=0D =0D # make breakpoint command continue=0D return False=0D @@ -490,15 +489,15 @@ def efi_guid_command(debugger, command, result, dict): =0D if len(args) >=3D 1:=0D if GuidStr in guid_dict:=0D - print "%s =3D %s" % (guid_dict[GuidStr], GuidStr)=0D - print "%s =3D %s" % (guid_dict[GuidStr], GuidToCStructStr (Gui= dStr))=0D + print("%s =3D %s" % (guid_dict[GuidStr], GuidStr))=0D + print("%s =3D %s" % (guid_dict[GuidStr], GuidToCStructStr (Gui= dStr)))=0D else:=0D - print GuidStr=0D + print(GuidStr)=0D else:=0D # dump entire dictionary=0D width =3D max(len(v) for k,v in guid_dict.iteritems())=0D for value in sorted(guid_dict, key=3Dguid_dict.get):=0D - print '%-*s %s %s' % (width, guid_dict[value], value, GuidToCS= tructStr(value))=0D + print('%-*s %s %s' % (width, guid_dict[value], value, GuidToCS= tructStr(value)))=0D =0D return=0D =0D @@ -538,4 +537,4 @@ def __lldb_init_module (debugger, internal_dict): if Breakpoint.GetNumLocations() =3D=3D 1:=0D # Set the emulator breakpoints, if we are in the emulator=0D debugger.HandleCommand("breakpoint command add -s python -F ll= dbefi.LoadEmulatorEfiSymbols {id}".format(id=3DBreakpoint.GetID()))=0D - print 'Type r to run emulator. SecLldbScriptBreak armed. EFI m= odules should now get source level debugging in the emulator.'=0D + print('Type r to run emulator. SecLldbScriptBreak armed. EFI m= odules should now get source level debugging in the emulator.')=0D --=20 2.30.1 (Apple Git-130)
|
|