From nobody Tue Feb 10 17:14:54 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+64785+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+64785+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1598652177; cv=none; d=zohomail.com; s=zohoarc; b=iIQdJ9uKezw/omYKN0hlwJkMVUK0lTxKL/KmHclgkGFM/yQln+pqcpv8x9MU4++6nsOHsTLANQvEWjPsgZ2vMd1y97h7EQwMr7FEtTxS8orhCquFFWmUmGvaoltYyZGU097Q+obwuu5xsucagGUwjuJJ/il7eeCFSa4KeTxyKMc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598652177; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=SveQ1h2jDD1OzYunL6NJgqBHTurAO4aAp2jDbnKa0Y4=; b=gROQFO5TwOjgppOGPNnwSObjE780UJy/my1WMJGVhrzeLRGDQN1lnnOVeI4VVOtuWzuv1dgy0rhxylINkVpqv7pdMFNoXt2BQ6AKcmO5d+n9+VD5F2fqZqITwWrfFM4KE42kJiXiaSTQZk7i4zAjO3RhebTcjEt+Q1B58DBC2d0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+64785+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1598652177150595.2363010603618; Fri, 28 Aug 2020 15:02:57 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 3I10YY1788612xDZkyNC664f; Fri, 28 Aug 2020 15:02:56 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.65.1598652176106917268 for ; Fri, 28 Aug 2020 15:02:56 -0700 X-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 C828131B; Fri, 28 Aug 2020 15:02:55 -0700 (PDT) X-Received: from u200856.usa.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 37BD93F71F; Fri, 28 Aug 2020 15:02:55 -0700 (PDT) From: "Jeremy Linton" To: devel@edk2.groups.io Cc: Jeremy Linton , Leif Lindholm , Pete Batard , Andrei Warkentin , Ard Biesheuvel , Samer El-Haj-Mahmoud Subject: [edk2-devel] [PATCH v3 4/5] Platform/RaspberryPi4: Create ACPI fan object Date: Fri, 28 Aug 2020 17:02:14 -0500 Message-Id: <20200828220215.101919-5-jeremy.linton@arm.com> In-Reply-To: <20200828220215.101919-1-jeremy.linton@arm.com> References: <20200828220215.101919-1-jeremy.linton@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,jeremy.linton@arm.com X-Gm-Message-State: lK9EXECmikLG3dcOxAIJo7znx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1598652176; bh=pinJ+iiKsX5zry7InRo7hEOLci6IZOKh28WsU5/1d7k=; h=Cc:Date:From:Reply-To:Subject:To; b=HjFOl/E11HRzu4wHLyDH+gjCqgasLSVW5Jhw/rbhadDBwCSp24qxN/mpBdAjhV/YUFW ZsIrDxDsNGZUYqryC3N+8dyj2i/6W4a5noX1X3DStiqX+O5D1zq5LCIR1V7rcMyNIxr3r BfI0I1GC8YxtTv4anmN6UlvyUCd2P9SpE0U= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Now that we have a thermal zone we can add active cooling by specifying active cooling points (_ACx) which can be tied to fan objects that turn fans on/off using GPIO pins. Cc: Leif Lindholm Cc: Pete Batard Cc: Andrei Warkentin Cc: Ard Biesheuvel Cc: Samer El-Haj-Mahmoud Signed-off-by: Jeremy Linton Reviewed-by: Pete Batard <@pbatard> Reviewed-by: Pete Batard --- Platform/RaspberryPi/AcpiTables/AcpiTables.inf | 1 + Platform/RaspberryPi/AcpiTables/SsdtThermal.asl | 76 +++++++++++++++++++++= ++++ 2 files changed, 77 insertions(+) create mode 100644 Platform/RaspberryPi/AcpiTables/SsdtThermal.asl diff --git a/Platform/RaspberryPi/AcpiTables/AcpiTables.inf b/Platform/Rasp= berryPi/AcpiTables/AcpiTables.inf index 28d2afe197..c40c32e16f 100644 --- a/Platform/RaspberryPi/AcpiTables/AcpiTables.inf +++ b/Platform/RaspberryPi/AcpiTables/AcpiTables.inf @@ -33,6 +33,7 @@ Csrt.aslc Spcr.aslc Pptt.aslc + SsdtThermal.asl =20 [Packages] ArmPkg/ArmPkg.dec diff --git a/Platform/RaspberryPi/AcpiTables/SsdtThermal.asl b/Platform/Ras= pberryPi/AcpiTables/SsdtThermal.asl new file mode 100644 index 0000000000..28c88cd640 --- /dev/null +++ b/Platform/RaspberryPi/AcpiTables/SsdtThermal.asl @@ -0,0 +1,76 @@ +/** @file + * + * Secondary System Description Table (SSDT) for active (fan) cooling + * + * Copyright (c) 2020, Arm Ltd. All rights reserved. + * + * SPDX-License-Identifier: BSD-2-Clause-Patent + * + **/ + +#include +#include +#include + +#include + +DefinitionBlock (__FILE__, "SSDT", 5, "RPIFDN", "RPITHFAN", 2) +{ + External (\_SB_.EC0, DeviceObj) + External (\_SB_.EC0.TZ0, DeviceObj) + + Scope (\_SB_.EC0) + { + // Define a NameOp we will modify during InstallTable + Name (GIOP, 0x2) //08 47 49 4f 50 0a 02 (value must be >1) + // Describe a fan + PowerResource (PFAN, 0, 0) { + OperationRegion (GPIO, SystemMemory, GPIO_BASE_ADDRESS, 0x1000) + Field (GPIO, DWordAcc, NoLock, Preserve) { + Offset (0x1C), + GPS0, 32, + GPS1, 32, + RES1, 32, + GPC0, 32, + GPC1, 32, + RES2, 32, + GPL1, 32, + GPL2, 32 + } + // We are hitting a GPIO pin to on/off a fan. + // This assumes that UEFI has programmed the + // direction as OUT. Given the current limitations + // on the GPIO pins, its recommended to use + // the GPIO to switch a larger voltage/current + // for the fan rather than driving it directly. + Method (_STA) { + if (GPL1 & (1 << GIOP)) { + Return (1) // present and enabled + } + Return (0) + } + Method (_ON) { //turn fan on + Store (1 << GIOP, GPS0) + } + Method (_OFF) { //turn fan off + Store (1 << GIOP, GPC0) + } + } + Device (FAN) { + // Note, not currently an ACPIv4 fan + // the latter adds speed control/detection + // but in the case of linux needs FIF, FPS, FSL, and FST + Name (_HID, EISAID ("PNP0C0B")) + Name (_PR0, Package () { PFAN }) + } + } + + // merge in an active cooling point. + Scope (\_SB_.EC0.TZ0) + { + Method (_AC0) { Return (3332) } // (60C) active cooling trip po= int, + // if this is lower than PSV th= en we + // prefer active cooling + Name (_AL0, Package () { \_SB_.EC0.FAN }) // the fan used for AC0 above + } +} --=20 2.13.7 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#64785): https://edk2.groups.io/g/devel/message/64785 Mute This Topic: https://groups.io/mt/76484335/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-