From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web09.18037.1661175163029147270 for ; Mon, 22 Aug 2022 06:32:43 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: pierre.gondois@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 741A512FC; Mon, 22 Aug 2022 06:32:45 -0700 (PDT) Received: from pierre123.arm.com (unknown [10.57.40.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 247553F718; Mon, 22 Aug 2022 06:32:40 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Sami Mujawar , Alexei Fedorov , Nishant.Sharma@arm.com Subject: [PATCH 1/1] DynamicTablesPkg: SsdtCpuTopology: Generate _STA method for processors Date: Mon, 22 Aug 2022 15:32:09 +0200 Message-Id: <20220822133209.611030-1-Pierre.Gondois@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: 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 --- .../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.
+ Copyright (c) 2021 - 2022, Arm Limited. All rights reserved.
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