[PATCH 1/1] DynamicTablesPkg: SsdtCpuTopology: Generate _STA method for processors


PierreGondois
 

From: Pierre Gondois <pierre.gondois@...>

The _STA object is defined in ACPI 6.4, s6.3.7 "_STA (Device Status)"
and describes the status of a device. Add this method for the
generated processor devices.
To be coherent with the GicC flags available in s5.2.12.14 "GIC CPU
Interface (GICC) Structure", flip the _STA 'device enable' bit
according to the GicC 'Enabled' bit flag.

Signed-off-by: Pierre Gondois <pierre.gondois@...>
---
.../SsdtCpuTopologyGenerator.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/=
SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCp=
uTopologyLibArm/SsdtCpuTopologyGenerator.c
index 3266d8dd9892..d601f8e2190f 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpu=
TopologyGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpu=
TopologyGenerator.c
@@ -1,7 +1,7 @@
/** @file
SSDT Cpu Topology Table Generator.
=20
- Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
+ Copyright (c) 2021 - 2022, Arm Limited. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
=20
@par Reference(s):
@@ -477,6 +477,7 @@ CreateAmlCpu (
EFI_STATUS Status;
AML_OBJECT_NODE_HANDLE CpuNode;
CHAR8 AslName[AML_NAME_SEG_SIZE + 1];
+ BOOLEAN CpuEnabled;
=20
ASSERT (Generator !=3D NULL);
ASSERT (ParentNode !=3D NULL);
@@ -516,6 +517,22 @@ CreateAmlCpu (
return Status;
}
=20
+ CpuEnabled =3D ((GicCInfo->Flags & EFI_ACPI_6_2_GIC_ENABLED) !=3D 0);
+
+ Status =3D AmlCodeGenMethodRetInteger (
+ "_STA",
+ CpuEnabled ? 0xF : 0xD,
+ 0,
+ FALSE,
+ 0,
+ CpuNode,
+ NULL
+ );
+ if (EFI_ERROR (Status)) {
+ ASSERT (0);
+ return Status;
+ }
+
// If requested, return the handle to the CpuNode.
if (CpuNodePtr !=3D NULL) {
*CpuNodePtr =3D CpuNode;
--=20
2.25.1