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.58529.1598894756660895118 for ; Mon, 31 Aug 2020 10:26:01 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: jeremy.linton@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 294CE30E; Mon, 31 Aug 2020 10:25:56 -0700 (PDT) Received: from mammon-tx2.austin.arm.com (mammon-tx2.austin.arm.com [10.118.28.62]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 205803F66F; Mon, 31 Aug 2020 10:25:56 -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: [PATCH v4 0/6] Platform/RasberryPi: Thermal zone Date: Mon, 31 Aug 2020 12:25:43 -0500 Message-Id: <20200831172549.24079-1-jeremy.linton@arm.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 on either GPIO18 (commercial fan shim board) or GPIO19 by the user from the BDS. it should now be possible when booted in ACPI mode to: # sensors acpitz-acpi-0 Adapter: ACPI interface temp1: +57.6C (crit =3D +90.0C) and the fan state, if enabled may be read with: /sys/bus/acpi/devices/PNP0C06:00/PNP0C0B:00/physical_node/thermal_cooling= /cur_state while the kernel will automatically cycle the fan if the SoC temp exceeds 60C. Included as a byproduct of this set is a generic method for updating values in ACPI DSDT/SSDT tables as they are installed. v3->v4: Allow the user to set the fan trip point Extend ACPI device names to 4 characters v2->v3: Make DSDT/SSDT PCD->Nameop update code generic Move the fan SSDT code back into the AcpiTable directory v1->v2: Add choice of GPIO pins to the BDS menu Correct whitespace/etc issues from v1 review Add an additional cleanup patch for contextual whitespace issues Cc: Leif Lindholm Cc: Pete Batard Cc: Andrei Warkentin Cc: Ard Biesheuvel Cc: Samer El-Haj-Mahmoud Jeremy Linton (6): Platform/RaspberryPi4: Add a basic thermal zone Platform/RaspberryPi: Monitor ACPI Table installs Platform/RaspberryPi: Add entry for user fan control Platform/RaspberryPi4: Create ACPI fan object Platform/RaspberryPi4: Allow the user to set Temp Platform/RaspberryPi: Trivial whitespace cleanup Platform/RaspberryPi/AcpiTables/AcpiTables.inf | 1 + Platform/RaspberryPi/AcpiTables/Dsdt.asl | 31 +++ Platform/RaspberryPi/AcpiTables/SsdtThermal.asl | 77 ++++++++ Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 214 +++++++++++++++= ++++-- .../RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf | 3 + .../RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni | 9 + .../RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr | 34 ++++ Platform/RaspberryPi/Include/ConfigVars.h | 8 + Platform/RaspberryPi/RPi3/RPi3.dsc | 6 + Platform/RaspberryPi/RPi4/RPi4.dsc | 9 + Platform/RaspberryPi/RaspberryPi.dec | 2 + .../Bcm27xx/Include/IndustryStandard/Bcm2711.h | 2 + 12 files changed, 382 insertions(+), 14 deletions(-) create mode 100644 Platform/RaspberryPi/AcpiTables/SsdtThermal.asl --=20 2.13.7