public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 1/1] DynamicTablesPkg: SsdtCpuTopology: Generate _STA method for processors
@ 2022-08-22 13:32 PierreGondois
  0 siblings, 0 replies; only message in thread
From: PierreGondois @ 2022-08-22 13:32 UTC (permalink / raw)
  To: devel; +Cc: Sami Mujawar, Alexei Fedorov, Nishant.Sharma

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

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@arm.com>
---
 .../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/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
index 3266d8dd9892..d601f8e2190f 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c
@@ -1,7 +1,7 @@
 /** @file
   SSDT Cpu Topology Table Generator.
 
-  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
 
   @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;
 
   ASSERT (Generator != NULL);
   ASSERT (ParentNode != NULL);
@@ -516,6 +517,22 @@ CreateAmlCpu (
     return Status;
   }
 
+  CpuEnabled = ((GicCInfo->Flags & EFI_ACPI_6_2_GIC_ENABLED) != 0);
+
+  Status = 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 != NULL) {
     *CpuNodePtr = CpuNode;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-22 13:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-22 13:32 [PATCH 1/1] DynamicTablesPkg: SsdtCpuTopology: Generate _STA method for processors PierreGondois

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox