Date   

Re: [edk2-platforms][PATCH V2 0/8] Platform/Sgi: Add PPTT table for Neoverse Reference Design platforms

Sami Mujawar
 

Hi Pranav,

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:
- Rebase the patches on top of latest master branch
- Addressed comments from Pierre

Processor Properties Topology Table (PPTT) describes the topological
structure of processors, and their shared resources such as caches.
This patch series adds PPTT table for Arm's Neoverse Reference Design
platforms.

The first patch in this series adds helper macros for PPTT table, and
the subsequent patches in this series adds PPTT table for Neoverse
Reference Design platforms which is mandatory as per Arm SystemReady SR
specification.

Link to github branch with the patches in this series -
https://github.com/Pranav-Madhu/edk2-platforms/tree/topics/rd_pptt

Pranav Madhu (8):
Platform/Sgi: Helper macros for PPTT Table
Platform/Sgi: ACPI PPTT table for SGI-575 platform
Platform/Sgi: ACPI PPTT table for RD-N1-Edge platform
Platform/Sgi: ACPI PPTT table for RD-N1-Edge dual-chip
Platform/Sgi: ACPI PPTT table for RD-E1-Edge platform
Platform/Sgi: ACPI PPTT Table for RD-V1 platform
Platform/Sgi: ACPI PPTT Table for RD-V1 quad-chip platform
Platform/Sgi: ACPI PPTT table for RD-N2 platform

.../SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf | 3 +-
.../SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf | 3 +-
.../AcpiTables/RdN1EdgeX2AcpiTables.inf | 1 +
.../ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf | 3 +-
.../ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf | 3 +-
.../SgiPkg/AcpiTables/RdV1McAcpiTables.inf | 1 +
.../SgiPkg/AcpiTables/Sgi575AcpiTables.inf | 3 +-
Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h | 160 ++++++++++++
.../ARM/SgiPkg/AcpiTables/RdE1Edge/Pptt.aslc | 230 ++++++++++++++++++
.../ARM/SgiPkg/AcpiTables/RdN1Edge/Pptt.aslc | 175 +++++++++++++
.../SgiPkg/AcpiTables/RdN1EdgeX2/Pptt.aslc | 192 +++++++++++++++
Platform/ARM/SgiPkg/AcpiTables/RdN2/Pptt.aslc | 163 +++++++++++++
Platform/ARM/SgiPkg/AcpiTables/RdV1/Pptt.aslc | 164 +++++++++++++
.../ARM/SgiPkg/AcpiTables/RdV1Mc/Pptt.aslc | 169 +++++++++++++
.../ARM/SgiPkg/AcpiTables/Sgi575/Pptt.aslc | 161 ++++++++++++
15 files changed, 1426 insertions(+), 5 deletions(-)
create mode 100644 Platform/ARM/SgiPkg/AcpiTables/RdE1Edge/Pptt.aslc
create mode 100644 Platform/ARM/SgiPkg/AcpiTables/RdN1Edge/Pptt.aslc
create mode 100644 Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2/Pptt.aslc
create mode 100644 Platform/ARM/SgiPkg/AcpiTables/RdN2/Pptt.aslc
create mode 100644 Platform/ARM/SgiPkg/AcpiTables/RdV1/Pptt.aslc
create mode 100644 Platform/ARM/SgiPkg/AcpiTables/RdV1Mc/Pptt.aslc
create mode 100644 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Pptt.aslc


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
performance control (CPPC). This patch adds macros for initializing ACPI
_CPC and _PSD control method. The CPC initializer macro initializes _CPC
control method with revision 3 as specified in Arm FFH specification
1.1. The CPC initilizer exposes the reference performance counter and
delivered perfrmance counter (AMU registers) as FFixedHW registers. The
initilizer also expose the fastchannel memories for performance level
set performance limit set protocols as desired performance register and
performance limited register respectively.

Signed-off-by: Pranav Madhu <pranav.madhu@...>
---
Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h | 53 ++++++++++++++++++++
1 file changed, 53 insertions(+)

diff --git a/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h b/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h
index 4977d4d898aa..1b5305f15fb8 100644
--- a/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h
+++ b/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h
@@ -423,4 +423,57 @@ typedef struct {
LineSize /* Line size in bytes */ \
}
+// CPPC _CPC object initialization
+#define CPPC_PACKAGE_INIT(DesiredPerfReg, PerfLimitedReg, GranularityMHz, \
+ HighestPerf, NominalPerf, LowestNonlinearPerf, LowestPerf, RefPerf) \
[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]
+ { \
+ 23, /* NumEntries */ \
+ 3, /* Revision */ \
+ HighestPerf, /* Highest Performance */ \
+ NominalPerf, /* Nominal Performance */ \
+ LowestNonlinearPerf, /* Lowest Nonlinear Performance */ \
+ LowestPerf, /* Lowest Performance */ \
+ /* Guaranteed Performance Register */ \
+ ResourceTemplate () { Register (SystemMemory, 0, 0, 0, 0) }, \
+ /* Desired Performance Register */ \
+ ResourceTemplate () { Register (SystemMemory, 32, 0, DesiredPerfReg, 3) }, \
+ /* Minimum Performance Register */ \
+ ResourceTemplate () { Register (SystemMemory, 0, 0, 0, 0) }, \
+ /* Maximum Performance Register */ \
+ ResourceTemplate () { Register (SystemMemory, 0, 0, 0, 0) }, \
+ /* Performance Reduction Tolerance Register */ \
+ ResourceTemplate () { Register (SystemMemory, 0, 0, 0, 0) }, \
+ /* Time Window Register */ \
+ ResourceTemplate () { Register (SystemMemory, 0, 0, 0, 0) }, \
+ /* Counter Wraparound Time */ \
+ ResourceTemplate () { Register (SystemMemory, 0, 0, 0, 0) }, \
+ /* Reference Performance Counter Register */ \
+ ResourceTemplate () { Register (FFixedHW, 64, 0, 1, 4) }, \
+ /* Delivered Performance Counter Register */ \
+ ResourceTemplate () { Register (FFixedHW, 64, 0, 0, 4) }, \
+ /* Performance Limited Register */ \
+ ResourceTemplate () { Register (SystemMemory, 32, 0, PerfLimitedReg, 3) }, \
+ /* CPPC Enable Register */ \
+ ResourceTemplate () { Register (SystemMemory, 0, 0, 0, 0) }, \
+ /* Autonomous Selection Enable Register */ \
+ ResourceTemplate () { Register (SystemMemory, 0, 0, 0, 0) }, \
+ /* Autonomous Activity Window Register */ \
+ ResourceTemplate () { Register (SystemMemory, 0, 0, 0, 0) }, \
+ /* Energy Performance Preference Register */ \
+ ResourceTemplate () { Register (SystemMemory, 0, 0, 0, 0) }, \
+ RefPerf, /* Reference Performance */ \
+ (LowestPerf * GranularityMHz), /* Lowest Frequency */ \
+ (NominalPerf * GranularityMHz), /* Nominal Frequency */ \
+ }
+
+// Power state dependancy (_PSD) for CPPC
+#define PSD_INIT(Domain) \
+ { \
+ 5, /* Entries */ \
+ 0, /* Revision */ \
+ Domain, /* Domain */ \
+ 0xFD, /* Coord Type- SW_ANY */ \
+ 1 /* Processors */ \
+ }
+
#endif /* __SGI_ACPI_HEADER__ */


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.
Add processor container devices for the two clusters on the SGI-575
platform and move the existing processor devices into respective
processor containers.

Signed-off-by: Pranav Madhu <pranav.madhu@...>
---
Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl | 99 +++++++++++---------
1 file changed, 54 insertions(+), 45 deletions(-)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl
index fe0b92137bde..7390849e6231 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl
+++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl
@@ -12,53 +12,62 @@
DefinitionBlock("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI", EFI_ACPI_ARM_OEM_REVISION) {
Scope(_SB) {
-
- Device(CP00) { // A75-0: Cluster 0, Cpu 0
- Name(_HID, "ACPI0007")
- Name(_UID, 0)
- Name(_STA, 0xF)
- }
-
- Device(CP01) { // A75-0: Cluster 0, Cpu 1
- Name(_HID, "ACPI0007")
- Name(_UID, 1)
- Name(_STA, 0xF)
- }
-
- Device(CP02) { // A75-0: Cluster 0, Cpu 2
- Name(_HID, "ACPI0007")
- Name(_UID, 2)
- Name(_STA, 0xF)
- }
-
- Device(CP03) { // A75-0: Cluster 0, Cpu 3
- Name(_HID, "ACPI0007")
- Name(_UID, 3)
- Name(_STA, 0xF)
- }
-
- Device(CP04) { // A75-0: Cluster 1, Cpu 0
- Name(_HID, "ACPI0007")
- Name(_UID, 4)
- Name(_STA, 0xF)
- }
-
- Device(CP05) { // A75-0: Cluster 1, Cpu 1
- Name(_HID, "ACPI0007")
- Name(_UID, 5)
- Name(_STA, 0xF)
- }
-
- Device(CP06) { // A75-0: Cluster 1, Cpu 2
- Name(_HID, "ACPI0007")
- Name(_UID, 6)
- Name(_STA, 0xF)
+ Device (CLU0) { // Cluster 0
+ Name (_HID, "ACPI0010")
+ Name (_UID, 0)
[SAMI] Please see my comment for the patch in your previous series at https://edk2.groups.io/g/devel/message/74863
[/SAMI]
+
+ Device (CP00) { // A75-0: Cluster 0, Cpu 0
+ Name (_HID, "ACPI0007")
+ Name (_UID, 0)
+ Name (_STA, 0xF)
+ }
+
+ Device (CP01) { // A75-0: Cluster 0, Cpu 1
+ Name (_HID, "ACPI0007")
+ Name (_UID, 1)
+ Name (_STA, 0xF)
+ }
+
+ Device (CP02) { // A75-0: Cluster 0, Cpu 2
+ Name (_HID, "ACPI0007")
+ Name (_UID, 2)
+ Name (_STA, 0xF)
+ }
+
+ Device (CP03) { // A75-0: Cluster 0, Cpu 3
+ Name (_HID, "ACPI0007")
+ Name (_UID, 3)
+ Name (_STA, 0xF)
+ }
}
- Device(CP07) { // A75-0: Cluster 1, Cpu 3
- Name(_HID, "ACPI0007")
- Name(_UID, 7)
- Name(_STA, 0xF)
+ Device (CLU1) { // Cluster 1
+ Name (_HID, "ACPI0010")
+ Name (_UID, 1)
+
+ Device (CP04) { // A75-0: Cluster 1, Cpu 0
+ Name (_HID, "ACPI0007")
+ Name (_UID, 4)
+ Name (_STA, 0xF)
+ }
+
+ Device (CP05) { // A75-0: Cluster 1, Cpu 1
+ Name (_HID, "ACPI0007")
+ Name (_UID, 5)
+ Name (_STA, 0xF)
+ }
+
+ Device (CP06) { // A75-0: Cluster 1, Cpu 2
+ Name (_HID, "ACPI0007")
+ Name (_UID, 6)
+ Name (_STA, 0xF)
+ }
+
+ Device (CP07) { // A75-0: Cluster 1, Cpu 3
+ Name (_HID, "ACPI0007")
+ Name (_UID, 7)
+ Name (_STA, 0xF)
+ }
}
// UART PL011


[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@...>

-----Original Message-----
From: Chuang, SofiaX <sofiax.chuang@...>
Sent: Tuesday, May 4, 2021 2:22 AM
To: devel@edk2.groups.io
Cc: Chuang, SofiaX <sofiax.chuang@...>; Chaganty, Rangasai V
<rangasai.v.chaganty@...>; Desimone, Nathaniel L
<nathaniel.l.desimone@...>; Luo, Heng <heng.luo@...>
Subject: [edk2-devel][PATCH v4 2/7]
TigerlakeOpenBoard: Move ReportCpuHob library path

From: SofiaX Chuang <sofiax.chuang@...>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3298

Move ReportCpuHob library from MinPlatformPkg to IntelSiliconPkg.

Cc: Sai Chaganty <rangasai.v.chaganty@...>
Cc: Nate DeSimone <nathaniel.l.desimone@...>
Cc: Heng Luo <heng.luo@...>
---
.../Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git
a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
index a4265a839c..1adf634034 100644
--- a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
+++
b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
@@ -89,7 +89,6 @@



PciSegmentLib|$(PLATFORM_SI_PACKAGE)/Library/BasePciSegmentMultiSegLib
Pci/BasePciSegmentMultiSegLibPci.inf

PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf

-
ReportCpuHobLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/ReportCpuHob
Lib/ReportCpuHobLib.inf



#

# Silicon Init Package

@@ -115,6 +114,7 @@
#

# Silicon Init Package

#

+
ReportCpuHobLib|IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.i
nf

!include $(PLATFORM_SI_PACKAGE)/SiPkgPeiLib.dsc



#

--
2.27.0


Re: [PATCH] MdeModulePkg: Retrive boot manager menu from any fv

Zhiguang Liu
 

Hi Hao,

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-----
From: Wu, Hao A <hao.a.wu@...>
Sent: Monday, May 10, 2021 4:42 PM
To: devel@edk2.groups.io; Liu, Zhiguang <zhiguang.liu@...>
Cc: Wang, Jian J <jian.j.wang@...>; Gao, Zhichao
<zhichao.gao@...>; Ni, Ray <ray.ni@...>
Subject: RE: [edk2-devel] [PATCH] MdeModulePkg: Retrive boot manager
menu from any fv

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
Zhiguang Liu
Sent: Monday, May 10, 2021 4:16 PM
To: devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Wu, Hao A
<hao.a.wu@...>; Gao, Zhichao <zhichao.gao@...>; Ni, Ray
<ray.ni@...>
Subject: [edk2-devel] [PATCH] MdeModulePkg: Retrive boot manager
menu
from any fv

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3384

Currently, UefiBootManagerLib has the below assumption:
Assume the BootManagerMenuFile is in the same FV as the module links
to this library.
It has some limitation now, so remove the assumption.

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



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/MdeModulePkg/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. Copyright (c) 2019,
NVIDIA CORPORATION. All rights reserved.-Copyright (c) 2011 - 2020,
Intel Corporation. All rights reserved.<BR>+Copyright (c) 2011 - 2021,
Intel Corporation. All rights reserved.<BR> (C) Copyright 2015-2021
Hewlett Packard Enterprise Development LP<BR> SPDX-License-Identifier:
BSD-2- Clause-Patent @@ -2385,7 +2385,6 @@
EfiBootManagerRefreshAllBootOption (
This function is called to get or create the boot option for the Boot
Manager
Menu. The Boot Manager Menu is shown after successfully booting a
boot
option.- Assume the BootManagerMenuFile is in the same FV as the
module
links to this library. @param BootOption Return the boot option of the
Boot Manager Menu @@ -2437,7 +2436,7 @@
BmRegisterBootManagerMenu (
if (DevicePath == NULL) { Data = NULL;- Status = GetSectionFromFv (+
Status = GetSectionFromAnyFv ( PcdGetPtr
(PcdBootManagerMenuFile), EFI_SECTION_PE32, 0,@@ -
2455,7 +2454,7 @@ BmRegisterBootManagerMenu (
// // Get BootManagerMenu application's description from EFI User
Interface Section. //- Status = GetSectionFromFv (+ Status =
GetSectionFromAnyFv ( PcdGetPtr (PcdBootManagerMenuFile),
EFI_SECTION_USER_INTERFACE, 0,--
2.30.0.windows.2



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#74859):
https://edk2.groups.io/g/devel/message/74859
Mute This Topic: https://groups.io/mt/82714887/1768737
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [hao.a.wu@...]
- =-=-=-=-=-=


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@...>

The SGI-575 platform includes two clusters with four single-thread CPUs.
Each of the CPUs include 64KB L1 Data cache, 64KB L1 Instruction cache
and 512KB L2 cache. Each cluster includes a 2MB L3 cache. Add PPTT table
for SGI-575 platform with this information.

Signed-off-by: Pranav Madhu <pranav.madhu@...>
---
Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf | 3 +-
Platform/ARM/SgiPkg/AcpiTables/Sgi575/Pptt.aslc | 161 ++++++++++++++++++++
2 files changed, 163 insertions(+), 1 deletion(-)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
index 2121fd39f2f0..b1ee16e98ea3 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
@@ -1,7 +1,7 @@
## @file
# ACPI table data and ASL sources required to boot the platform.
#
-# Copyright (c) 2018, ARM Ltd. All rights reserved.
+# Copyright (c) 2018 - 2021, ARM Ltd. All rights reserved.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -22,6 +22,7 @@
Mcfg.aslc
Sgi575/Dsdt.asl
Sgi575/Madt.aslc
+ Sgi575/Pptt.aslc
Spcr.aslc
Ssdt.asl

diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Pptt.aslc b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Pptt.aslc
new file mode 100644
index 000000000000..3388a012dd55
--- /dev/null
+++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Pptt.aslc
@@ -0,0 +1,161 @@
+/** @file
+* Processor Properties Topology Table (PPTT) for SGI-575 platform
+*
+* This file describes the topological structure of the processor block on the
+* SGI-575 platform in the form as defined by ACPI PPTT table. The SGI-575
+* platform includes two clusters with four single-thread CPUS. Each of the CPUs
+* include 64KB L1 Data cache, 64KB L1 Instruction cache and 512KB L2 cache.
+* Each cluster includes a 2MB L3 cache.
+*
+* Copyright (c) 2021, ARM Limited. All rights reserved.
+*
+* SPDX-License-Identifier: BSD-2-Clause-Patent
+*
+* @par Specification Reference:
+* - ACPI 6.3, Chapter 5, Section 5.2.29, Processor Properties Topology Table
+**/
+
+#include <IndustryStandard/Acpi.h>
+#include <Library/AcpiLib.h>
+#include <Library/ArmLib.h>
+#include <Library/PcdLib.h>
+
+#include "SgiPlatform.h"
+#include "SgiAcpiHeader.h"
+
+#define PPTT_CORE_INIT(pid, cid, cpuid) \
[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]
+ { \
+ /* Parameters for CPU Core */ \
+ EFI_ACPI_6_3_PPTT_STRUCTURE_PROCESSOR_INIT ( \
+ OFFSET_OF (RD_PPTT_CORE, DCache), /* Length */ \
+ PPTT_PROCESSOR_CORE_FLAGS, /* Flag */ \
+ OFFSET_OF (EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE, \
+ Package.Cluster[cid]), /* Parent */ \
+ ((pid << 3) | (cid << 2) | cpuid), /* ACPI Id */ \
+ 2 /* Num of private resource */ \
+ ), \
+ \
+ /* Offsets of the private resources */ \
+ { \
+ OFFSET_OF (EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE, \
+ Package.Cluster[cid].Core[cpuid].DCache), \
+ OFFSET_OF (EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE, \
+ Package.Cluster[cid].Core[cpuid].ICache) \
+ }, \
+ \
+ /* L1 data cache parameters */ \
+ EFI_ACPI_6_3_PPTT_STRUCTURE_CACHE_INIT ( \
+ PPTT_CACHE_STRUCTURE_FLAGS, /* Flag */ \
+ OFFSET_OF (EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE, \
+ Package.Cluster[cid].Core[cpuid].L2Cache), \
+ /* Next level of cache */ \
+ SIZE_64KB, /* Size */ \
+ 64, /* Num of sets */ \
+ 16, /* Associativity */ \
+ PPTT_DATA_CACHE_ATTR, /* Attributes */ \
+ 64 /* Line size */ \
+ ), \
+ \
+ /* L1 instruction cache parameters */ \
+ EFI_ACPI_6_3_PPTT_STRUCTURE_CACHE_INIT ( \
+ PPTT_CACHE_STRUCTURE_FLAGS, /* Flag */ \
+ OFFSET_OF (EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE, \
+ Package.Cluster[cid].Core[cpuid].L2Cache), \
+ /* Next level of cache */ \
+ SIZE_64KB, /* Size */ \
+ 256, /* Num of sets */ \
+ 4, /* Associativity */ \
+ PPTT_INST_CACHE_ATTR, /* Attributes */ \
+ 64 /* Line size */ \
+ ), \
+ \
+ /* L2 cache parameters */ \
+ EFI_ACPI_6_3_PPTT_STRUCTURE_CACHE_INIT ( \
+ PPTT_CACHE_STRUCTURE_FLAGS, /* Flag */ \
+ 0, /* Next level of cache */ \
+ SIZE_512KB, /* Size */ \
+ 1024, /* Num of sets */ \
+ 8, /* Associativity */ \
+ PPTT_UNIFIED_CACHE_ATTR, /* Attributes */ \
+ 64 /* Line size */ \
+ ), \
+ }
+
+#define PPTT_CLUSTER_INIT(pid, cid) \
+ { \
+ /* Parameters for Cluster */ \
+ EFI_ACPI_6_3_PPTT_STRUCTURE_PROCESSOR_INIT ( \
+ OFFSET_OF (RD_PPTT_CLUSTER, L3Cache), \
+ /* Length */ \
+ PPTT_PROCESSOR_CLUSTER_FLAGS, /* Flag */ \
+ OFFSET_OF (EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE, \
+ Package), /* Parent */ \
+ 0, /* ACPI Id */ \
+ 1 /* Num of private resource */ \
+ ), \
+ \
+ /* Offsets of the private resources */ \
+ OFFSET_OF (EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE, \
+ Package.Cluster[cid].L3Cache), \
+ \
+ /* L3 cache parameters */ \
+ EFI_ACPI_6_3_PPTT_STRUCTURE_CACHE_INIT ( \
+ PPTT_CACHE_STRUCTURE_FLAGS, /* Flag */ \
+ 0, /* Next level of cache */ \
+ SIZE_2MB, /* Size */ \
+ 2048, /* Num of sets */ \
+ 16, /* Associativity */ \
+ PPTT_UNIFIED_CACHE_ATTR, /* Attributes */ \
+ 64 /* Line size */ \
+ ), \
+ \
+ /* Initialize child cores */ \
+ { \
+ PPTT_CORE_INIT (pid, cid, 0), \
+ PPTT_CORE_INIT (pid, cid, 1), \
+ PPTT_CORE_INIT (pid, cid, 2), \
+ PPTT_CORE_INIT (pid, cid, 3) \
+ } \
+ }
+
+#pragma pack(1)
+typedef struct {
+ EFI_ACPI_6_3_PPTT_STRUCTURE_PROCESSOR Package;
+ RD_PPTT_CLUSTER Cluster[CLUSTER_COUNT];
+} SGI575_PPTT_PACKAGE;
+
+/*
+ * Processor Properties Topology Table
+ */
+typedef struct {
+ EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER Header;
+ SGI575_PPTT_PACKAGE Package;
+} EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE;
+#pragma pack ()
+
+STATIC EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE Pptt = {
+ {
+ ARM_ACPI_HEADER (
+ EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_STRUCTURE_SIGNATURE,
+ EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE,
+ EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_REVISION
+ )
+ },
+
+ {
+ EFI_ACPI_6_3_PPTT_STRUCTURE_PROCESSOR_INIT (
+ OFFSET_OF (SGI575_PPTT_PACKAGE, Cluster[0]),
+ PPTT_PROCESSOR_PACKAGE_FLAGS, 0, 0, 0
+ ),
+ {
+ PPTT_CLUSTER_INIT (0, 0),
+ PPTT_CLUSTER_INIT (0, 1)
+ }
+ }
+};
+
+/*
+ * Reference the table being generated to prevent the optimizer from removing
+ * the data structure from the executable
+ */
+VOID* CONST ReferenceAcpiTable = &Pptt;
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
with initializing processor hierarchy node structure, cache type
structure and ID structure.

Signed-off-by: Pranav Madhu <pranav.madhu@...>
---
Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h | 160 ++++++++++++++++++++
1 file changed, 160 insertions(+)

diff --git a/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h b/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h
index dcb4e6c77a74..7bb8b6dec6a3 100644
--- a/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h
+++ b/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h
@@ -20,6 +20,131 @@
#define EFI_ACPI_ARM_CREATOR_ID SIGNATURE_32('A','R','M',' ')
#define EFI_ACPI_ARM_CREATOR_REVISION 0x00000099

+#define CORE_COUNT FixedPcdGet32 (PcdCoreCount)
+#define CLUSTER_COUNT FixedPcdGet32 (PcdClusterCount)
+
+#pragma pack(1)
+// PPTT processor core structure
+typedef struct {
+ EFI_ACPI_6_3_PPTT_STRUCTURE_PROCESSOR Core;
+ UINT32 ResourceOffset[2];
+ EFI_ACPI_6_3_PPTT_STRUCTURE_CACHE DCache;
+ EFI_ACPI_6_3_PPTT_STRUCTURE_CACHE ICache;
+ EFI_ACPI_6_3_PPTT_STRUCTURE_CACHE L2Cache;
+} RD_PPTT_CORE;
+
+// PPTT processor cluster structure
+typedef struct {
+ EFI_ACPI_6_3_PPTT_STRUCTURE_PROCESSOR Cluster;
+ UINT32 ResourceOffset;
+ EFI_ACPI_6_3_PPTT_STRUCTURE_CACHE L3Cache;
+ RD_PPTT_CORE Core[CORE_COUNT];
+} RD_PPTT_CLUSTER;
+
+// PPTT processor cluster structure without cache
+typedef struct {
+ EFI_ACPI_6_3_PPTT_STRUCTURE_PROCESSOR Cluster;
+ RD_PPTT_CORE Core[CORE_COUNT];
+} RD_PPTT_MINIMAL_CLUSTER;
+
+// PPTT processor package structure
+typedef struct {
+ EFI_ACPI_6_3_PPTT_STRUCTURE_PROCESSOR Package;
+ UINT32 ResourceOffset;
+ EFI_ACPI_6_3_PPTT_STRUCTURE_CACHE Slc;
+ RD_PPTT_MINIMAL_CLUSTER Cluster[CLUSTER_COUNT];
+} RD_PPTT_SLC_PACKAGE;
+#pragma pack ()
+
+//
+// PPTT processor structure flags for different SoC components as defined in
+// ACPI 6.3 specification
+//
+
+// Processor structure flags for SoC package
+#define PPTT_PROCESSOR_PACKAGE_FLAGS \
+ { \
+ EFI_ACPI_6_3_PPTT_PACKAGE_PHYSICAL, \
+ EFI_ACPI_6_3_PPTT_PROCESSOR_ID_INVALID, \
+ EFI_ACPI_6_3_PPTT_PROCESSOR_IS_NOT_THREAD, \
+ EFI_ACPI_6_3_PPTT_NODE_IS_NOT_LEAF, \
+ EFI_ACPI_6_3_PPTT_IMPLEMENTATION_IDENTICAL \
+ }
+
+// Processor structure flags for cluster
+#define PPTT_PROCESSOR_CLUSTER_FLAGS \
+ { \
+ EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL, \
+ EFI_ACPI_6_3_PPTT_PROCESSOR_ID_INVALID, \
[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, \
+ EFI_ACPI_6_3_PPTT_NODE_IS_NOT_LEAF, \
+ EFI_ACPI_6_3_PPTT_IMPLEMENTATION_IDENTICAL \
+ }
+
+// Processor structure flags for single-thread core
+#define PPTT_PROCESSOR_CORE_FLAGS \
+ { \
+ EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL, \
+ EFI_ACPI_6_3_PPTT_PROCESSOR_ID_VALID, \
+ EFI_ACPI_6_3_PPTT_PROCESSOR_IS_NOT_THREAD, \
+ EFI_ACPI_6_3_PPTT_NODE_IS_LEAF \
+ }
+
+// Processor structure flags for multi-thread core
+#define PPTT_PROCESSOR_CORE_THREADED_FLAGS \
+ { \
+ EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL, \
+ EFI_ACPI_6_3_PPTT_PROCESSOR_ID_INVALID, \
+ EFI_ACPI_6_3_PPTT_PROCESSOR_IS_NOT_THREAD, \
+ EFI_ACPI_6_3_PPTT_NODE_IS_NOT_LEAF, \
+ EFI_ACPI_6_3_PPTT_IMPLEMENTATION_IDENTICAL \
+ }
+
+// Processor structure flags for CPU thread
+#define PPTT_PROCESSOR_THREAD_FLAGS \
+ { \
+ EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL, \
+ EFI_ACPI_6_3_PPTT_PROCESSOR_ID_VALID, \
+ EFI_ACPI_6_3_PPTT_PROCESSOR_IS_THREAD, \
+ EFI_ACPI_6_3_PPTT_NODE_IS_LEAF \
+ }
+
+// PPTT cache structure flags as defined in ACPI 6.3 Specification
+#define PPTT_CACHE_STRUCTURE_FLAGS \
+ { \
+ EFI_ACPI_6_3_PPTT_CACHE_SIZE_VALID, \
+ EFI_ACPI_6_3_PPTT_NUMBER_OF_SETS_VALID, \
+ EFI_ACPI_6_3_PPTT_ASSOCIATIVITY_VALID, \
+ EFI_ACPI_6_3_PPTT_ALLOCATION_TYPE_VALID, \
+ EFI_ACPI_6_3_PPTT_CACHE_TYPE_VALID, \
+ EFI_ACPI_6_3_PPTT_WRITE_POLICY_VALID, \
+ EFI_ACPI_6_3_PPTT_LINE_SIZE_VALID \
+ }
+
+// PPTT cache attributes for data cache
+#define PPTT_DATA_CACHE_ATTR \
+ { \
+ EFI_ACPI_6_3_CACHE_ATTRIBUTES_ALLOCATION_READ_WRITE, \
+ EFI_ACPI_6_3_CACHE_ATTRIBUTES_CACHE_TYPE_DATA, \
+ EFI_ACPI_6_3_CACHE_ATTRIBUTES_WRITE_POLICY_WRITE_BACK \
+ }
+
+// PPTT cache attributes for instruction cache
+#define PPTT_INST_CACHE_ATTR \
+ { \
+ EFI_ACPI_6_3_CACHE_ATTRIBUTES_ALLOCATION_READ, \
+ EFI_ACPI_6_3_CACHE_ATTRIBUTES_CACHE_TYPE_INSTRUCTION, \
+ EFI_ACPI_6_3_CACHE_ATTRIBUTES_WRITE_POLICY_WRITE_BACK \
+ }
+
+// PPTT cache attributes for unified cache
+#define PPTT_UNIFIED_CACHE_ATTR \
+ { \
+ EFI_ACPI_6_3_CACHE_ATTRIBUTES_ALLOCATION_READ_WRITE, \
+ EFI_ACPI_6_3_CACHE_ATTRIBUTES_CACHE_TYPE_UNIFIED, \
+ EFI_ACPI_6_3_CACHE_ATTRIBUTES_WRITE_POLICY_WRITE_BACK \
+ }
+
// A macro to initialise the common header part of EFI ACPI tables as defined by
// EFI_ACPI_DESCRIPTION_HEADER structure.
#define ARM_ACPI_HEADER(Signature, Type, Revision) { \
@@ -246,4 +371,39 @@
TotalCacheLevels, CacheLevel, CacheAssociativity, WritePolicy, CacheLineSize \
}

+// EFI_ACPI_6_3_PPTT_STRUCTURE_PROCESSOR
+#define EFI_ACPI_6_3_PPTT_STRUCTURE_PROCESSOR_INIT(Length, Flag, Parent, \
+ ACPIProcessorID, NumberOfPrivateResource) \
+ { \
+ EFI_ACPI_6_3_PPTT_TYPE_PROCESSOR, /* Type 0 */ \
+ Length, /* Length */ \
+ { \
+ EFI_ACPI_RESERVED_BYTE, \
+ EFI_ACPI_RESERVED_BYTE, \
+ }, \
+ Flag, /* Processor flags */ \
+ Parent, /* Ref to parent node */ \
+ ACPIProcessorID, /* UID, as per MADT */ \
+ NumberOfPrivateResource /* Resource count */ \
+ }
+
+// EFI_ACPI_6_3_PPTT_STRUCTURE_CACHE
+#define EFI_ACPI_6_3_PPTT_STRUCTURE_CACHE_INIT(Flag, NextLevelCache, Size, \
+ NoOfSets, Associativity, Attributes, LineSize) \
+ { \
+ EFI_ACPI_6_3_PPTT_TYPE_CACHE, /* Type 1 */ \
+ sizeof (EFI_ACPI_6_3_PPTT_STRUCTURE_CACHE), /* Length */ \
+ { \
+ EFI_ACPI_RESERVED_BYTE, \
+ EFI_ACPI_RESERVED_BYTE, \
+ }, \
+ Flag, /* Cache flags */ \
+ NextLevelCache, /* Ref to next level */ \
+ Size, /* Size in bytes */ \
+ NoOfSets, /* Num of sets */ \
+ Associativity, /* Num of ways */ \
+ Attributes, /* Cache attributes */ \
+ LineSize /* Line size in bytes */ \
+ }
+
#endif /* __SGI_ACPI_HEADER__ */
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
 

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
Zhiguang Liu
Sent: Monday, May 10, 2021 4:16 PM
To: devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Wu, Hao A <hao.a.wu@...>;
Gao, Zhichao <zhichao.gao@...>; Ni, Ray <ray.ni@...>
Subject: [edk2-devel] [PATCH] MdeModulePkg: Retrive boot manager menu
from any fv

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3384

Currently, UefiBootManagerLib has the below assumption:
Assume the BootManagerMenuFile is in the same FV as the module links to
this library.
It has some limitation now, so remove the assumption.

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



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/MdeModulePkg/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. Copyright (c) 2019, NVIDIA
CORPORATION. All rights reserved.-Copyright (c) 2011 - 2020, Intel
Corporation. All rights reserved.<BR>+Copyright (c) 2011 - 2021, Intel
Corporation. All rights reserved.<BR> (C) Copyright 2015-2021 Hewlett
Packard Enterprise Development LP<BR> SPDX-License-Identifier: BSD-2-
Clause-Patent @@ -2385,7 +2385,6 @@
EfiBootManagerRefreshAllBootOption (
This function is called to get or create the boot option for the Boot Manager
Menu. The Boot Manager Menu is shown after successfully booting a boot
option.- Assume the BootManagerMenuFile is in the same FV as the module
links to this library. @param BootOption Return the boot option of the
Boot Manager Menu @@ -2437,7 +2436,7 @@
BmRegisterBootManagerMenu (
if (DevicePath == NULL) { Data = NULL;- Status = GetSectionFromFv (+
Status = GetSectionFromAnyFv ( PcdGetPtr
(PcdBootManagerMenuFile), EFI_SECTION_PE32, 0,@@ -
2455,7 +2454,7 @@ BmRegisterBootManagerMenu (
// // Get BootManagerMenu application's description from EFI User
Interface Section. //- Status = GetSectionFromFv (+ Status =
GetSectionFromAnyFv ( PcdGetPtr (PcdBootManagerMenuFile),
EFI_SECTION_USER_INTERFACE, 0,--
2.30.0.windows.2



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#74859): https://edk2.groups.io/g/devel/message/74859
Mute This Topic: https://groups.io/mt/82714887/1768737
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [hao.a.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,

On Thu, 6 May 2021 at 12:43, <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@...>
SOB is not an attribution of authorship, it is a statement made by the
person contributing the patch asserting that the contribution complies
with the license.

IOW, you can keep the From: line, but please change the SOB to your
name and email.

Thanks,
Ard.
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.
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)

17421 - 17440 of 92217