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.web12.44116.1597674690748791458 for ; Mon, 17 Aug 2020 07:31:30 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ard.biesheuvel@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 57B9630E; Mon, 17 Aug 2020 07:31:30 -0700 (PDT) Received: from [192.168.178.54] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id ED6D63F6CF; Mon, 17 Aug 2020 07:31:28 -0700 (PDT) Subject: Re: [PATCH 0/3] Platform/RasberryPi: Thermal zone To: Jeremy Linton , devel@edk2.groups.io Cc: Leif Lindholm , Pete Batard , Andrei Warkentin , Samer El-Haj-Mahmoud References: <20200813230056.40526-1-jeremy.linton@arm.com> From: "Ard Biesheuvel" Message-ID: <7dcba3be-778e-b3d5-20f5-ae0b205dd826@arm.com> Date: Mon, 17 Aug 2020 16:31:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200813230056.40526-1-jeremy.linton@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 8/14/20 1:00 AM, Jeremy Linton wrote: > This set creates a basic thermal zone, which reads the > SOC temp via a direct register read in AML. It also > adds an active cooling policy using a GPIO pin for fan > control that can optionally be enabled/disabled by the > user from the BDS. > > With the fan enabled it should be possible to see the > soc temp like: > > # sensors > acpitz-acpi-0 > Adapter: ACPI interface > temp1: +57.6C (crit = +90.0C) > > and the fan state may be read/cycled with: > > /sys/bus/acpi/devices/PNP0C06:00/PNP0C0B:00/physical_node/thermal_cooling/cur_state > > Cc: Leif Lindholm > Cc: Pete Batard > Cc: Andrei Warkentin > Cc: Ard Biesheuvel > Cc: Samer El-Haj-Mahmoud > > Jeremy Linton (3): > Platform/RaspberryPi4: Add a basic thermal zone > Platform/RaspberryPi4: Create ACPI fan object > Platform/RaspberryPi: Add entry for user fan control > I like this code a lot. It is very helpful to have working sample AML code that implements a thermal zone. Could you elaborate on the additional components that are needed for this? Is this a standard cape (or whatever rpi calls it)? I assume the fan just switches between 0 and max rpm depending on the actual temp wrt the trip point? > Platform/RaspberryPi/AcpiTables/Dsdt.asl | 31 ++++++++ > Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 55 ++++++++++++++ > .../RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf | 3 + > .../RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni | 5 ++ > .../RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr | 17 +++++ > .../RaspberryPi/Drivers/ConfigDxe/SsdtThermal.asl | 83 ++++++++++++++++++++++ > Platform/RaspberryPi/Include/ConfigVars.h | 4 ++ > Platform/RaspberryPi/RPi3/RPi3.dsc | 5 ++ > Platform/RaspberryPi/RPi4/RPi4.dsc | 8 +++ > Platform/RaspberryPi/RaspberryPi.dec | 1 + > .../Bcm27xx/Include/IndustryStandard/Bcm2711.h | 2 + > 11 files changed, 214 insertions(+) > create mode 100644 Platform/RaspberryPi/Drivers/ConfigDxe/SsdtThermal.asl >