From nobody Mon Feb 9 20:17:31 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+64850+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+64850+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1598894763; cv=none; d=zohomail.com; s=zohoarc; b=UOTg33HV+WciQtgsU1VQeWfm4CRRm2OXcp5VggeHml3x1Mdga1DqXyKb2ArICLrMEo5AgXqwUX/tiPX78YZ+T0O9NA+09yJl2vwja2kUGzIcGHJZTpEOEoGCLp3FEcBBdiKL5oLfT7xg/qX9v/mA1KoZ/FQ+de8nzRa8tvmSztA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598894763; 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=P+fQZVMOM65EknDOebQBdN2tHyCwDMzeqNiAUL7jmQ0=; b=fnu/DJj/AniGYzkqhxnxmvjYJAtSF8aIp+5trkCCf+wwg7tEyxLCSA1v0QhJie9VEAe8vq4p90bHz6a0IThBUikYUgqezdzUbF+HGpgvsxHRgG4cR0ZNRSvvjbuEns+o/XjXCrPSGZ4KDGns/5MKoZQZGnXDpMcLKkfO2WVdM9w= 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+64850+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1598894763578791.315351851883; Mon, 31 Aug 2020 10:26:03 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id ZsPyYY1788612x5dFrS6MjeT; Mon, 31 Aug 2020 10:26:03 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.58747.1598894761500236831 for ; Mon, 31 Aug 2020 10:26:01 -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 1F3361045; Mon, 31 Aug 2020 10:26:01 -0700 (PDT) X-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 0F17D3F66F; Mon, 31 Aug 2020 10:26:01 -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 v4 1/6] Platform/RaspberryPi4: Add a basic thermal zone Date: Mon, 31 Aug 2020 12:25:44 -0500 Message-Id: <20200831172549.24079-2-jeremy.linton@arm.com> In-Reply-To: <20200831172549.24079-1-jeremy.linton@arm.com> References: <20200831172549.24079-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: T8pBZz4zNetpkZdUr4svdKHyx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1598894763; bh=qgpiAaw6tubKYrEp4/ch7QTQk0axpYbSPmDuWDqLyOg=; h=Cc:Date:From:Reply-To:Subject:To; b=cTriZU1N0QrbgVtWZHZF9LnBgxK2noSS6s2dyqZJgvgiwUr7OknsfyIwDFHv81D9e8U N3OT17I9x12un3Cr97m93/+drXF5ptZdwC0XqXlUhm+jMsmzYK7QmoPK/jQfIn80cWpv9 8YtyUjZkoR06IYu6Wgupu9B5hNYRn4Jf/SI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Rather than exporting the temp sensor or mailbox in ACPI land we can wrap them in AML and use the default ACPI drivers provided by the OS. This enables the use of "sensors" in linux to report the SOC temp. As a first pass add a basic passive cooling ACPI thermalzone with trip points for passive cooling (throttling) handled by the vc firmware, hibernate and critical shutdown. The vc apparently kicks in at ~80C, so the hibernate and critical set points are set at +5 and +10 of that. In the future CPPC should be able to monitor the thermal throttling. 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> --- Platform/RaspberryPi/AcpiTables/Dsdt.asl | 31 ++++++++++++++++++= ++++ .../Bcm27xx/Include/IndustryStandard/Bcm2711.h | 2 ++ 2 files changed, 33 insertions(+) diff --git a/Platform/RaspberryPi/AcpiTables/Dsdt.asl b/Platform/RaspberryP= i/AcpiTables/Dsdt.asl index 353af2d876..2b9e8211cf 100644 --- a/Platform/RaspberryPi/AcpiTables/Dsdt.asl +++ b/Platform/RaspberryPi/AcpiTables/Dsdt.asl @@ -252,6 +252,37 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 5, "RPIFDN", "RPI= ", 2) } }) } + + // Define a simple thermal zone. The idea here is we compute the SOC t= emp + // via a register we can read, and give it to the OS. This enables bas= ic + // reports from the "sensors" utility, and the OS can then poll and ta= ke + // actions if that temp exceeds any of the given thresholds. + Device (EC00) + { + Name (_HID, EISAID ("PNP0C06")) + Name (_CCA, 0x0) + + // all temps in are tenths of K (aka 2732 is the min temps in Linux = (aka 0C)) + ThermalZone (TZ00) { + Method (_TMP, 0, Serialized) { + OperationRegion (TEMS, SystemMemory, THERM_SENSOR, 0x8) + Field (TEMS, DWordAcc, NoLock, Preserve) { + TMPS, 32 + } + return (((419949 - ((TMPS & 0x3ff) * 487)) / 100) + 2732); + } + Method (_SCP, 3) { } // receive cooling policy from = OS + + Method (_CRT) { Return (3632) } // (90C) Critical temp point (i= mmediate power-off) + Method (_HOT) { Return (3582) } // (85C) HOT state where OS sho= uld hibernate + Method (_PSV) { Return (3532) } // (80C) Passive cooling (CPU t= hrottling) trip point + + // SSDT inserts _AC0/_AL0 @60C here, if a FAN is configured + + Name (_TZP, 10) //The OSPM must poll this device= every 1 seconds + Name (_PSL, Package () { \_SB_.CPU0, \_SB_.CPU1, \_SB_.CPU2, \_SB_= .CPU3 }) + } + } #endif =20 } diff --git a/Silicon/Broadcom/Bcm27xx/Include/IndustryStandard/Bcm2711.h b/= Silicon/Broadcom/Bcm27xx/Include/IndustryStandard/Bcm2711.h index e9c81cafa1..86906b2438 100644 --- a/Silicon/Broadcom/Bcm27xx/Include/IndustryStandard/Bcm2711.h +++ b/Silicon/Broadcom/Bcm27xx/Include/IndustryStandard/Bcm2711.h @@ -86,4 +86,6 @@ #define GENET_BASE_ADDRESS FixedPcdGet64 (PcdBcmGenetRegistersAddr= ess) #define GENET_LENGTH 0x00010000 =20 +#define THERM_SENSOR 0xfd5d2200 + #endif /* BCM2711_H__ */ --=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 (#64850): https://edk2.groups.io/g/devel/message/64850 Mute This Topic: https://groups.io/mt/76538741/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- From nobody Mon Feb 9 20:17:31 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+64852+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+64852+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1598894765; cv=none; d=zohomail.com; s=zohoarc; b=i3rQK0lKirbzfYusBRy5ppoV0NsYi6Diq4S7DfuQYYJifAssKK5OsLTT/NJahuahcwqAeW1L1sgEk2CqaOBv+EZUetJflPai8dX+kYSDDnMovJDH4M9AEdiTDo+DnWVcsvjOZ05fOLICzrN7CcaRku2b7o5014mrz584aZhAA5E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598894765; 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=DG4R2Xt0h9bpcVO2rDkJmyZ59R3yEYtsORhCagQB4e0=; b=Fd73cmQIzp1rx5PRLC3ceIAuQPkGgEy8QxM3vlYYRV6yT2HE4DyBMHGYuEXyFQUG7ij3VKpiJcFQsaWxk9TWiMxBmAz72rbX9pJDo8sBW5l+2QlvP/XFsUMvL0XSqmHKYC7OONisO/kCYkqaKXIl2gB/osnYc6wWzV4agwJlDYk= 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+64852+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1598894765256512.9431452522329; Mon, 31 Aug 2020 10:26:05 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id G3I7YY1788612xCK3W8leuOm; Mon, 31 Aug 2020 10:26:04 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.58531.1598894764022881729 for ; Mon, 31 Aug 2020 10:26:04 -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 BBB9030E; Mon, 31 Aug 2020 10:26:03 -0700 (PDT) X-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 B3EA93F66F; Mon, 31 Aug 2020 10:26:03 -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 v4 2/6] Platform/RaspberryPi: Monitor ACPI Table installs Date: Mon, 31 Aug 2020 12:25:45 -0500 Message-Id: <20200831172549.24079-3-jeremy.linton@arm.com> In-Reply-To: <20200831172549.24079-1-jeremy.linton@arm.com> References: <20200831172549.24079-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: PUjyeqso8IOHbVI4nnCFYwojx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1598894764; bh=DUfMullXe0E+HDQTVXPL+ZHoke4dEYgFXCfRAyWRRFM=; h=Cc:Date:From:Reply-To:Subject:To; b=novsz0xWrrQVzxyzQLcH21xZA8xDpxG0aLFlBLdYilrD0192V+ZaPhBOmAkJJVKRJ3f gZG5pEzupBn3WSCpq7e1qDqLkplfuCz3tps0sKmyf1FH3YEg8qMm0bGrHwwRLUQODe85F yG8avwEuK5V3fzMuvzEie46Nhzm1Odw87pA= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Hook the ACPI table install sequence and add some basic conditional and AML NameOp update logic. If a table has a non-zero PCD declared that pcd is checked for a non-zero value before allowing the table to be installed. We also add a table of NameOp to PCD's which will be written into a DSDT/SSDT table as part of its install process. With this change we can declare something in ASL like: Name (VARN, 0x1234) and then add a table entry like: {"VARN", PcdToken(PcdVarn)} and the value of PcdVarn will replace the 0x1234 declared in the ASL above. 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: Andrei Warkentin --- Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 153 +++++++++++++++++= +++- 1 file changed, 152 insertions(+), 1 deletion(-) diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/= RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c index af54136ade..9e5d9734ca 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c @@ -568,6 +568,156 @@ ApplyVariables ( } =20 =20 +typedef struct { + CHAR8 Name[4]; + UINTN PcdToken; +} AML_NAME_OP_REPLACE; + +typedef struct { + UINT64 OemTableId; + UINTN PcdToken; + AML_NAME_OP_REPLACE *SdtNameOpReplace; +} NAMESPACE_TABLES; + +#define SSDT_PATTERN_LEN 5 +#define AML_NAMEOP_8 0x0A +#define AML_NAMEOP_16 0x0B +#define AML_NAMEOP_32 0x0C +#define AML_NAMEOP_STR 0x0D +/* + * Scan the given namespace table (DSDT/SSDT) for AML NameOps + * listed in the NameOpReplace structure. If one is found then + * update the value in the table from the specified Pcd + * + * This allows us to have conditionals in AML controlled + * by options in the BDS or detected during firmware bootstrap. + * We could extend this concept for strings/etc but due to len + * variations its probably easier to encode the strings + * in the ASL and pick the correct one based off a variable. + */ +STATIC VOID +UpdateSdtNameOps( + EFI_ACPI_DESCRIPTION_HEADER *AcpiTable, + AML_NAME_OP_REPLACE *NameOpReplace + ) +{ + UINTN Idx; + UINTN Index; + CHAR8 Pattern[SSDT_PATTERN_LEN]; + UINTN PcdVal; + UINT8 *SdtPtr; + UINT32 SdtSize; + + SdtSize =3D AcpiTable->Length; + + if (SdtSize > 0) { + SdtPtr =3D (UINT8*)AcpiTable; + + for (Idx =3D 0; NameOpReplace && NameOpReplace[Idx].PcdToken; Idx++) { + /* + * Do a single NameOp variable replacement these are of the + * form 08 XXXX SIZE VAL, where SIZE is 0A=3Dbyte, 0B=3Dword, 0C=3Dd= word + * and XXXX is the name and VAL is the value + */ + Pattern[0] =3D 0x08; + Pattern[1] =3D NameOpReplace[Idx].Name[0]; + Pattern[2] =3D NameOpReplace[Idx].Name[1]; + Pattern[3] =3D NameOpReplace[Idx].Name[2]; + Pattern[4] =3D NameOpReplace[Idx].Name[3]; + + for (Index =3D 0; Index < (SdtSize - SSDT_PATTERN_LEN); Index++) { + if (CompareMem (SdtPtr + Index, Pattern, SSDT_PATTERN_LEN) =3D=3D = 0) { + PcdVal =3D LibPcdGet32 (NameOpReplace[Idx].PcdToken); + switch (SdtPtr[Index + SSDT_PATTERN_LEN]) { + case AML_NAMEOP_32: + SdtPtr[Index + SSDT_PATTERN_LEN + 4] =3D (PcdVal >> 24) & 0xFF; + SdtPtr[Index + SSDT_PATTERN_LEN + 3] =3D (PcdVal >> 16) & 0xFF; + // Fallthrough + case AML_NAMEOP_16: + SdtPtr[Index + SSDT_PATTERN_LEN + 2] =3D (PcdVal >> 8) & 0xFF; + // Fallthrough + case AML_NAMEOP_8: + SdtPtr[Index + SSDT_PATTERN_LEN + 1] =3D PcdVal & 0xFF; + break; + case 0: + case 1: + SdtPtr[Index + SSDT_PATTERN_LEN + 1] =3D !!PcdVal; + break; + case AML_NAMEOP_STR: + /* + * If the string val is added to the NameOpReplace, we can + * dynamically update things like _HID too as long as the + * string length matches. + */ + break; + } + break; + } + } + } + } +} + + +STATIC BOOLEAN +VerifyUpdateTable( + IN EFI_ACPI_DESCRIPTION_HEADER *AcpiHeader, + IN NAMESPACE_TABLES *SdtTable + ) +{ + BOOLEAN ret; + + ret =3D TRUE; + if (SdtTable->PcdToken && !LibPcdGet32 (SdtTable->PcdToken)) { + ret =3D FALSE; + } + if (ret && SdtTable->SdtNameOpReplace) { + UpdateSdtNameOps (AcpiHeader, SdtTable->SdtNameOpReplace); + } + + return ret; +} + + +STATIC NAMESPACE_TABLES SdtTables[] =3D { + { + SIGNATURE_64 ('R', 'P', 'I', 0, 0, 0, 0, 0), + 0, + NULL + }, + { } +}; + +/* + * Monitor the ACPI tables being installed and when + * a DSDT/SSDT is detected validate that we want to + * install it, and if so update any "NameOp" defined + * variables contained in the table from PCD values + */ +STATIC BOOLEAN +HandleDynamicNamespace ( + IN EFI_ACPI_DESCRIPTION_HEADER *AcpiHeader + ) +{ + UINTN Tables; + + switch (AcpiHeader->Signature) { + case SIGNATURE_32 ('D', 'S', 'D', 'T'): + case SIGNATURE_32 ('S', 'S', 'D', 'T'): + for (Tables =3D 0; SdtTables[Tables].OemTableId; Tables++) { + if (AcpiHeader->OemTableId =3D=3D SdtTables[Tables].OemTableId) { + return VerifyUpdateTable (AcpiHeader, &SdtTables[Tables]); + } + } + DEBUG ((DEBUG_ERROR, "Found namespace table not in table list.\n")); + + return FALSE; + } + + return TRUE; +} + + EFI_STATUS EFIAPI ConfigInitialize ( @@ -618,7 +768,8 @@ ConfigInitialize ( =20 if (PcdGet32 (PcdSystemTableMode) =3D=3D SYSTEM_TABLE_MODE_ACPI || PcdGet32 (PcdSystemTableMode) =3D=3D SYSTEM_TABLE_MODE_BOTH) { - Status =3D LocateAndInstallAcpiFromFv (&mAcpiTableFile); + Status =3D LocateAndInstallAcpiFromFvConditional (&mAcpiTableFile, + &HandleDynamicNamespa= ce); ASSERT_EFI_ERROR (Status); } =20 --=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 (#64852): https://edk2.groups.io/g/devel/message/64852 Mute This Topic: https://groups.io/mt/76538744/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- From nobody Mon Feb 9 20:17:31 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+64853+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+64853+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1598894767; cv=none; d=zohomail.com; s=zohoarc; b=UYl+ph21FRMmCz+CG90XPdfwG5BtgVfPaSXGQssHh96ZyK1zuD9zXG1BfByc+jJMQlcSbsorYH/dT7PnAed9DrRZpgVw+3+L5M9i0chcQszokEgDpO67cex37qCSpT4Um34jVmMSdzSQV2/jztmwGPkvbSCZV+eT54OYOFYfODY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598894767; 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=Av9L2FzyVq7W518EhcXGnNyDz9QhoEqDa7sTlnh1jRg=; b=V8HTfP+RsbbPP+OhdQ47Tek4kY5OkX/1/gQFtybbhIiSj1Jv8R2uMcljDoMoPrwf9PDBL8ECotu06fjCpnP6chrPnBGlkw7PoQdSwTPucWLH/acLzbGMoKHCkxv2k5SrZO/QnSYL8p1e28zEF8cERnkxg+RvcYOT+izPSDlP23k= 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+64853+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1598894767088788.663441077005; Mon, 31 Aug 2020 10:26:07 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 18YlYY1788612xIf8ZYuUrcd; Mon, 31 Aug 2020 10:26:06 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.58533.1598894765966778529 for ; Mon, 31 Aug 2020 10:26:06 -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 9269030E; Mon, 31 Aug 2020 10:26:05 -0700 (PDT) X-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 8A61D3F66F; Mon, 31 Aug 2020 10:26:05 -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 v4 3/6] Platform/RaspberryPi: Add entry for user fan control Date: Mon, 31 Aug 2020 12:25:46 -0500 Message-Id: <20200831172549.24079-4-jeremy.linton@arm.com> In-Reply-To: <20200831172549.24079-1-jeremy.linton@arm.com> References: <20200831172549.24079-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: 6RAcHWGOuriawNg6ugE7cQfLx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1598894766; bh=Nfvhbfb7UKJtzTe7m1wgvZQ64YihiaKybMd8TktDnZ4=; h=Cc:Date:From:Reply-To:Subject:To; b=c5uqsV3mXMmICgutQHyQZiH4JecEiJSimEADJIYCjAVqRMkCOomvesKw6YpRcvXtuVR L72LCwq6tiUHmtiXQhJTp0oGUBkURVeqENtm3QWUbdaUBozkFj2wi2XOViwjUmigfSY2m E47HndN8SSlJ4A+1NLGyye7RxfAyDfSQ4bI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Add a menu item that allows the user to enable GPIO based fan control via SSDT and the previous NameObj replacement commit. This should only be seen/enabled on RPI4 because that is what its been tested with. Given GPIO pin current limitations its likely that a bit of additional circuitry is required to drive a fan, and the GPIO high/low signal can only be used as a enable/disable signal. A search for "rpi npn gpio fan" or similar should turn up some hits for how to do this. Alternatively there are some commercial boards (FAN SHIM) which operate via simple GPIO control. 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> --- Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 26 ++++++++++++++++++= ++++ .../RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf | 2 ++ .../RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni | 6 +++++ .../RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr | 18 +++++++++++++++ Platform/RaspberryPi/Include/ConfigVars.h | 4 ++++ Platform/RaspberryPi/RPi3/RPi3.dsc | 5 +++++ Platform/RaspberryPi/RPi4/RPi4.dsc | 8 +++++++ Platform/RaspberryPi/RaspberryPi.dec | 1 + 8 files changed, 70 insertions(+) diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/= RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c index 9e5d9734ca..d58cbbdfe7 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -22,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -246,6 +248,14 @@ SetupVariables ( ASSERT_EFI_ERROR (Status); } =20 + Size =3D sizeof (UINT32); + Status =3D gRT->GetVariable (L"FanOnGpio", + &gConfigDxeFormSetGuid, + NULL, &Size, &Var32); + if (EFI_ERROR (Status)) { + PcdSet32 (PcdFanOnGpio, PcdGet32 (PcdFanOnGpio)); + } + Size =3D sizeof(AssetTagVar); =20 Status =3D gRT->GetVariable(L"AssetTag", @@ -368,6 +378,7 @@ ApplyVariables ( UINT32 CpuClock =3D PcdGet32 (PcdCpuClock); UINT32 CustomCpuClock =3D PcdGet32 (PcdCustomCpuClock); UINT32 Rate =3D 0; + UINT32 FanOnGpio =3D PcdGet32 (PcdFanOnGpio); =20 switch (CpuClock) { case CHIPSET_CPU_CLOCK_LOW: @@ -565,6 +576,11 @@ ApplyVariables ( GpioPinFuncSet (23, GPIO_FSEL_INPUT); GpioPinFuncSet (24, GPIO_FSEL_INPUT); } + + if (FanOnGpio) { + DEBUG ((DEBUG_INFO, "Fan enabled on GPIO %d\n", FanOnGpio)); + GpioPinFuncSet (FanOnGpio, GPIO_FSEL_OUTPUT); + } } =20 =20 @@ -679,8 +695,18 @@ VerifyUpdateTable( } =20 =20 +STATIC AML_NAME_OP_REPLACE SsdtNameOpReplace[] =3D { + {"GIOP", PcdToken(PcdFanOnGpio)}, + {} +}; + STATIC NAMESPACE_TABLES SdtTables[] =3D { { + SIGNATURE_64 ('R', 'P', 'I', 'T', 'H', 'F', 'A', 'N'), + PcdToken(PcdFanOnGpio), + SsdtNameOpReplace + }, + { SIGNATURE_64 ('R', 'P', 'I', 0, 0, 0, 0, 0), 0, NULL diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf b/Platfor= m/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf index cdce35bc74..321e402e65 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf @@ -46,6 +46,7 @@ AcpiLib BaseLib DebugLib + DxeServicesLib DxeServicesTableLib GpioLib HiiLib @@ -89,6 +90,7 @@ gRaspberryPiTokenSpaceGuid.PcdSystemTableMode gRaspberryPiTokenSpaceGuid.PcdRamMoreThan3GB gRaspberryPiTokenSpaceGuid.PcdRamLimitTo3GB + gRaspberryPiTokenSpaceGuid.PcdFanOnGpio =20 [Depex] gPcdProtocolGuid AND gRaspberryPiFirmwareProtocolGuid diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni b/Plat= form/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni index 03763710a1..e2d1bb4b39 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni @@ -48,6 +48,12 @@ #string STR_ADVANCED_SYSTAB_BOTH #language en-US "ACPI + Devicetree" #string STR_ADVANCED_SYSTAB_DT #language en-US "Devicetree" =20 +#string STR_ADVANCED_FANONGPIO_PROMPT #language en-US "ACPI fan control" +#string STR_ADVANCED_FANONGPIO_HELP #language en-US "Cycle a fan via GPI= O if temp exceeds 60C" +#string STR_ADVANCED_FANONGPIO_OFF #language en-US "Disabled" +#string STR_ADVANCED_FANONGPIO_18 #language en-US "Fan Shim/GPIO-18" +#string STR_ADVANCED_FANONGPIO_19 #language en-US "GPIO-19" + #string STR_ADVANCED_ASSET_TAG_PROMPT #language en-US "Asset Tag" #string STR_ADVANCED_ASSET_TAG_HELP #language en-US "Set the system Asse= t Tag" =20 diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr b/Plat= form/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr index d5615d7af0..94332caab3 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr @@ -10,6 +10,7 @@ #include #include "ConfigDxeFormSetGuid.h" #include +#include =20 // // EFI Variable attributes @@ -45,6 +46,11 @@ formset name =3D RamLimitTo3GB, guid =3D CONFIGDXE_FORM_SET_GUID; =20 + efivarstore ADVANCED_FAN_ON_GPIO_VARSTORE_DATA, + attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME= _ACCESS | EFI_VARIABLE_NON_VOLATILE, + name =3D FanOnGpio, + guid =3D CONFIGDXE_FORM_SET_GUID; + efivarstore SYSTEM_TABLE_MODE_VARSTORE_DATA, attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME= _ACCESS | EFI_VARIABLE_NON_VOLATILE, name =3D SystemTableMode, @@ -174,6 +180,18 @@ formset option text =3D STRING_TOKEN(STR_ADVANCED_SYSTAB_DT), value = =3D SYSTEM_TABLE_MODE_DT, flags =3D DEFAULT; endoneof; =20 +#if (RPI_MODEL =3D=3D 4) + grayoutif NOT ideqval SystemTableMode.Mode =3D=3D SYSTEM_TABLE_MOD= E_ACPI; + oneof varid =3D FanOnGpio.Enabled, + prompt =3D STRING_TOKEN(STR_ADVANCED_FANONGPIO_PROMPT), + help =3D STRING_TOKEN(STR_ADVANCED_FANONGPIO_HELP), + flags =3D NUMERIC_SIZE_4 | INTERACTIVE | RESET_REQUIRE= D, + option text =3D STRING_TOKEN(STR_ADVANCED_FANONGPIO_OFF), va= lue =3D 0, flags =3D DEFAULT; + option text =3D STRING_TOKEN(STR_ADVANCED_FANONGPIO_18), val= ue =3D 18, flags =3D 0; + option text =3D STRING_TOKEN(STR_ADVANCED_FANONGPIO_19), val= ue =3D 19, flags =3D 0; + endoneof; + endif; +#endif string varid =3D AssetTag.AssetTag, prompt =3D STRING_TOKEN(STR_ADVANCED_ASSET_TAG_PROMPT), help =3D STRING_TOKEN(STR_ADVANCED_ASSET_TAG_HELP), diff --git a/Platform/RaspberryPi/Include/ConfigVars.h b/Platform/Raspberry= Pi/Include/ConfigVars.h index b1689b004d..1a40469bfa 100644 --- a/Platform/RaspberryPi/Include/ConfigVars.h +++ b/Platform/RaspberryPi/Include/ConfigVars.h @@ -69,6 +69,10 @@ typedef struct { } ADVANCED_RAM_LIMIT_TO_3GB_VARSTORE_DATA; =20 typedef struct { + UINT32 Enabled; +} ADVANCED_FAN_ON_GPIO_VARSTORE_DATA; + +typedef struct { #define SYSTEM_TABLE_MODE_ACPI 0 #define SYSTEM_TABLE_MODE_BOTH 1 #define SYSTEM_TABLE_MODE_DT 2 diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc b/Platform/RaspberryPi/RPi3= /RPi3.dsc index 0998d8366c..cef8932ca2 100644 --- a/Platform/RaspberryPi/RPi3/RPi3.dsc +++ b/Platform/RaspberryPi/RPi3/RPi3.dsc @@ -499,6 +499,11 @@ gRaspberryPiTokenSpaceGuid.PcdSystemTableMode|L"SystemTableMode"|gConfig= DxeFormSetGuid|0x0|1 =20 # + # Enable a fan in the ACPI thermal zone on GPIO pin # + # + gRaspberryPiTokenSpaceGuid.PcdFanOnGpio|L"FanOnGpio"|gConfigDxeFormSetGu= id|0x0|0 + + # # Common UEFI ones. # =20 diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc b/Platform/RaspberryPi/RPi4= /RPi4.dsc index baa7e63483..9d0eaf10a1 100644 --- a/Platform/RaspberryPi/RPi4/RPi4.dsc +++ b/Platform/RaspberryPi/RPi4/RPi4.dsc @@ -510,6 +510,14 @@ gRaspberryPiTokenSpaceGuid.PcdSystemTableMode|L"SystemTableMode"|gConfig= DxeFormSetGuid|0x0|0 =20 # + # Enable a fan in the ACPI thermal zone on GPIO pin # + # + # 0 - DISABLED + # 19 - Enabled on pin 19 + # + gRaspberryPiTokenSpaceGuid.PcdFanOnGpio|L"FanOnGpio"|gConfigDxeFormSetGu= id|0x0|0 + + # # Common UEFI ones. # =20 diff --git a/Platform/RaspberryPi/RaspberryPi.dec b/Platform/RaspberryPi/Ra= spberryPi.dec index c71177a2f7..a73650f2c3 100644 --- a/Platform/RaspberryPi/RaspberryPi.dec +++ b/Platform/RaspberryPi/RaspberryPi.dec @@ -66,3 +66,4 @@ gRaspberryPiTokenSpaceGuid.PcdSystemTableMode|1|UINT32|0x0000001B gRaspberryPiTokenSpaceGuid.PcdRamMoreThan3GB|0|UINT32|0x00000019 gRaspberryPiTokenSpaceGuid.PcdRamLimitTo3GB|0|UINT32|0x0000001A + gRaspberryPiTokenSpaceGuid.PcdFanOnGpio|0|UINT32|0x0000001C --=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 (#64853): https://edk2.groups.io/g/devel/message/64853 Mute This Topic: https://groups.io/mt/76538746/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- From nobody Mon Feb 9 20:17:31 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+64854+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+64854+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1598894768; cv=none; d=zohomail.com; s=zohoarc; b=KZEyLkGZBTYvHWPpiy6o95h1+jUSk+i//ZfUo8YP9vA1s9H55RTwLWRdxilLXpEQGj4Fl0okDFEEefjT1lO/CQkgOBeW90EBb243dBphm4vJ9mI02PlLwb9LZ0nIVaeAJit4JPJ6dWBDKz/ttLoYL7VJW7G4Hty5r4ErRWm546c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598894768; 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=5QZWtWPKLBUmYyn8APkTGUYKyQy0s5WdifneJaVTRrY=; b=BWz3qOwRCM3Q/9c33GNGLbk9Mr9KquJDQLOahPCyyUYyRDFvSMWyOy3YcyoiVljuC2nPS3+3gTmLSZw0aLktVg+xD9zbiNXCl6Y7euecKFBO4I153xLBPQFgpm9NFPHsc2Zo5QE/VgVtame3OwBJgaH0AbDbVUpYWVPxkJUqrSs= 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+64854+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1598894768803338.6381176663856; Mon, 31 Aug 2020 10:26:08 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id lrGyYY1788612xv8Z6tbcrGv; Mon, 31 Aug 2020 10:26:08 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.58749.1598894767667547438 for ; Mon, 31 Aug 2020 10:26:07 -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 592CA1045; Mon, 31 Aug 2020 10:26:07 -0700 (PDT) X-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 524973F66F; Mon, 31 Aug 2020 10:26:07 -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 v4 4/6] Platform/RaspberryPi4: Create ACPI fan object Date: Mon, 31 Aug 2020 12:25:47 -0500 Message-Id: <20200831172549.24079-5-jeremy.linton@arm.com> In-Reply-To: <20200831172549.24079-1-jeremy.linton@arm.com> References: <20200831172549.24079-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: GsLVlrb4idoFq54ALIPcMGYSx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1598894768; bh=S1CnsGkG84FO/S2Q42DxNDvruqxmOnC56qzd4qHq8FE=; h=Cc:Date:From:Reply-To:Subject:To; b=NqaG1SD6iIfoUXr1gt86SWYXtjb3jmljpjM/eZpTuRlPQVtw8pWVZziKvaQjluryXyD +xRRiBTE0CKnfxG9HEiGCDq/vGik4Jdp6cN9329TL/8/4+9QWyobItoJb7fIPiNLWHc51 FwClQBFeb1ZSkajkxf613KPBM8acbHm+dW8= 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> --- 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..ee028173e1 --- /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_.EC00, DeviceObj) + External (\_SB_.EC00.TZ00, DeviceObj) + + Scope (\_SB_.EC00) + { + // 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 (FAN0) { + // 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_.EC00.TZ00) + { + 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_.EC00.FAN0 }) // the fan used for AC0 ab= ove + } +} --=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 (#64854): https://edk2.groups.io/g/devel/message/64854 Mute This Topic: https://groups.io/mt/76538748/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- From nobody Mon Feb 9 20:17:31 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+64855+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+64855+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1598894772; cv=none; d=zohomail.com; s=zohoarc; b=C8uYCxuf1aD3USHfJn3Z4lDodK2BigBTAGqvbFgIYqOKU5wT9hP+twLi8McYHwmJU140x8bJWR8iCd1Tk4Cuz2dNs448bV2SGkqB3c04lxFzNYdQzXzSkzelwkDFn6U4J44PL5LbwDeDKtLqras3EmeK+nBsoYfLMZyPyXLNeUU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598894772; 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=Dlg9iWWP4M3zeYuogmdEWKmGYFKSyDeyL53FVJqW8DA=; b=ju06EnwUC1bU84mOM5KuBrSV4CFjiaumBnqaf4jwCFsCMhM0zwBeBgxywV0/ZOIJT1VfWis51FOhBRt/2f1vKyHRRVsnn/d0ERz2K+ZIIChCj7rhjzPFJxQiL+4RrKN3pLVHSkiOKGtTgZdf/Pvfqwg+k72JSGoW4beNrYWloo4= 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+64855+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 159889477285029.916459060385137; Mon, 31 Aug 2020 10:26:12 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id otSnYY1788612xsAjbKR1XMV; Mon, 31 Aug 2020 10:26:12 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.58535.1598894771595988741 for ; Mon, 31 Aug 2020 10:26:11 -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 407E230E; Mon, 31 Aug 2020 10:26:11 -0700 (PDT) X-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 2F71B3F66F; Mon, 31 Aug 2020 10:26:11 -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 v4 5/6] Platform/RaspberryPi4: Allow the user to set Temp Date: Mon, 31 Aug 2020 12:25:48 -0500 Message-Id: <20200831172549.24079-6-jeremy.linton@arm.com> In-Reply-To: <20200831172549.24079-1-jeremy.linton@arm.com> References: <20200831172549.24079-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: sWHxkw1ADFYlq7CoB2ZIZBi6x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1598894772; bh=INOjSXSdYRwC44zvrQSiRHFKQV116/32ODO7CjqYtk0=; h=Cc:Date:From:Reply-To:Subject:To; b=OFNdjNoDopmYCj/cXqDnmlVSMmEXMI4xgSMSsuaPbDY4+7AE/XhZcVMR/bVkPzR7lHy wb0F/XLzAvZcIwsHGueJjXEc55FkgpkBT5n36yo+zZ4v16SSmHLEE9iK9dv/+vmesi1SD Aw99tYTqsxt/5KzhwPvZiDeOjkLDWj9qOqw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Now that we have the ability to enable an AML fan object, allow the user to select the temperature at which the fan cycles on. 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 --- Platform/RaspberryPi/AcpiTables/SsdtThermal.asl | 9 +++++---- Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 11 ++++++++++- Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf | 1 + Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni | 5 ++++- Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr | 16 +++++++++++++= +++ Platform/RaspberryPi/Include/ConfigVars.h | 4 ++++ Platform/RaspberryPi/RPi3/RPi3.dsc | 1 + Platform/RaspberryPi/RPi4/RPi4.dsc | 1 + Platform/RaspberryPi/RaspberryPi.dec | 1 + 9 files changed, 43 insertions(+), 6 deletions(-) diff --git a/Platform/RaspberryPi/AcpiTables/SsdtThermal.asl b/Platform/Ras= pberryPi/AcpiTables/SsdtThermal.asl index ee028173e1..acfa4699bb 100644 --- a/Platform/RaspberryPi/AcpiTables/SsdtThermal.asl +++ b/Platform/RaspberryPi/AcpiTables/SsdtThermal.asl @@ -23,6 +23,7 @@ DefinitionBlock (__FILE__, "SSDT", 5, "RPIFDN", "RPITHFAN= ", 2) { // Define a NameOp we will modify during InstallTable Name (GIOP, 0x2) //08 47 49 4f 50 0a 02 (value must be >1) + Name (FTMP, 0x2) // Describe a fan PowerResource (PFAN, 0, 0) { OperationRegion (GPIO, SystemMemory, GPIO_BASE_ADDRESS, 0x1000) @@ -68,9 +69,9 @@ DefinitionBlock (__FILE__, "SSDT", 5, "RPIFDN", "RPITHFAN= ", 2) // merge in an active cooling point. Scope (\_SB_.EC00.TZ00) { - 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_.EC00.FAN0 }) // the fan used for AC0 ab= ove + Method (_AC0) { Return ( (FTMP * 10) + 2732) } // (60C) active cooling= trip point, + // if this is lower tha= n PSV then we + // prefer active cooling + Name (_AL0, Package () { \_SB_.EC00.FAN0 }) // the fan used for AC0= above } } diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/= RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c index d58cbbdfe7..e8f964a329 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c @@ -256,8 +256,16 @@ SetupVariables ( PcdSet32 (PcdFanOnGpio, PcdGet32 (PcdFanOnGpio)); } =20 - Size =3D sizeof(AssetTagVar); + Size =3D sizeof (UINT32); + Status =3D gRT->GetVariable (L"FanTemp", + &gConfigDxeFormSetGuid, + NULL, &Size, &Var32); + if (EFI_ERROR (Status)) { + PcdSet32 (PcdFanTemp, PcdGet32 (PcdFanTemp)); + } + =20 + Size =3D sizeof (AssetTagVar); Status =3D gRT->GetVariable(L"AssetTag", &gConfigDxeFormSetGuid, NULL, &Size, AssetTagVar); @@ -697,6 +705,7 @@ VerifyUpdateTable( =20 STATIC AML_NAME_OP_REPLACE SsdtNameOpReplace[] =3D { {"GIOP", PcdToken(PcdFanOnGpio)}, + {"FTMP", PcdToken(PcdFanTemp)}, {} }; =20 diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf b/Platfor= m/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf index 321e402e65..544e3b3e10 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf @@ -91,6 +91,7 @@ gRaspberryPiTokenSpaceGuid.PcdRamMoreThan3GB gRaspberryPiTokenSpaceGuid.PcdRamLimitTo3GB gRaspberryPiTokenSpaceGuid.PcdFanOnGpio + gRaspberryPiTokenSpaceGuid.PcdFanTemp =20 [Depex] gPcdProtocolGuid AND gRaspberryPiFirmwareProtocolGuid diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni b/Plat= form/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni index e2d1bb4b39..2afe8f32ae 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni @@ -49,11 +49,14 @@ #string STR_ADVANCED_SYSTAB_DT #language en-US "Devicetree" =20 #string STR_ADVANCED_FANONGPIO_PROMPT #language en-US "ACPI fan control" -#string STR_ADVANCED_FANONGPIO_HELP #language en-US "Cycle a fan via GPI= O if temp exceeds 60C" +#string STR_ADVANCED_FANONGPIO_HELP #language en-US "Cycle a fan via GPI= O at given temperature" #string STR_ADVANCED_FANONGPIO_OFF #language en-US "Disabled" #string STR_ADVANCED_FANONGPIO_18 #language en-US "Fan Shim/GPIO-18" #string STR_ADVANCED_FANONGPIO_19 #language en-US "GPIO-19" =20 +#string STR_ADVANCED_FANTEMP_PROMPT #language en-US "ACPI fan temperatur= e" +#string STR_ADVANCED_FANTEMP_HELP #language en-US "Cycle a fan at C" + #string STR_ADVANCED_ASSET_TAG_PROMPT #language en-US "Asset Tag" #string STR_ADVANCED_ASSET_TAG_HELP #language en-US "Set the system Asse= t Tag" =20 diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr b/Plat= form/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr index 94332caab3..de5e43471a 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr @@ -51,6 +51,11 @@ formset name =3D FanOnGpio, guid =3D CONFIGDXE_FORM_SET_GUID; =20 + efivarstore ADVANCED_FANTEMP_VARSTORE_DATA, + attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME= _ACCESS | EFI_VARIABLE_NON_VOLATILE, + name =3D FanTemp, + guid =3D CONFIGDXE_FORM_SET_GUID; + efivarstore SYSTEM_TABLE_MODE_VARSTORE_DATA, attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME= _ACCESS | EFI_VARIABLE_NON_VOLATILE, name =3D SystemTableMode, @@ -191,6 +196,17 @@ formset option text =3D STRING_TOKEN(STR_ADVANCED_FANONGPIO_19), val= ue =3D 19, flags =3D 0; endoneof; endif; + + grayoutif ideqval FanOnGpio.Enabled =3D=3D 0; + numeric varid =3D FanTemp.Value, + prompt =3D STRING_TOKEN(STR_ADVANCED_FANTEMP_PROMPT), + help =3D STRING_TOKEN(STR_ADVANCED_FANTEMP_HELP), + flags =3D DISPLAY_UINT_DEC | NUMERIC_SIZE_4 | INTERACT= IVE | RESET_REQUIRED, + minimum =3D 50, + maximum =3D 80, + default =3D 60, + endnumeric; + endif; #endif string varid =3D AssetTag.AssetTag, prompt =3D STRING_TOKEN(STR_ADVANCED_ASSET_TAG_PROMPT), diff --git a/Platform/RaspberryPi/Include/ConfigVars.h b/Platform/Raspberry= Pi/Include/ConfigVars.h index 1a40469bfa..8094d4ef9a 100644 --- a/Platform/RaspberryPi/Include/ConfigVars.h +++ b/Platform/RaspberryPi/Include/ConfigVars.h @@ -73,6 +73,10 @@ typedef struct { } ADVANCED_FAN_ON_GPIO_VARSTORE_DATA; =20 typedef struct { + UINT32 Value; +} ADVANCED_FANTEMP_VARSTORE_DATA; + +typedef struct { #define SYSTEM_TABLE_MODE_ACPI 0 #define SYSTEM_TABLE_MODE_BOTH 1 #define SYSTEM_TABLE_MODE_DT 2 diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc b/Platform/RaspberryPi/RPi3= /RPi3.dsc index cef8932ca2..484a46ffba 100644 --- a/Platform/RaspberryPi/RPi3/RPi3.dsc +++ b/Platform/RaspberryPi/RPi3/RPi3.dsc @@ -502,6 +502,7 @@ # Enable a fan in the ACPI thermal zone on GPIO pin # # gRaspberryPiTokenSpaceGuid.PcdFanOnGpio|L"FanOnGpio"|gConfigDxeFormSetGu= id|0x0|0 + gRaspberryPiTokenSpaceGuid.PcdFanTemp|L"FanTemp"|gConfigDxeFormSetGuid|0= x0|0 =20 # # Common UEFI ones. diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc b/Platform/RaspberryPi/RPi4= /RPi4.dsc index 9d0eaf10a1..823c9fc007 100644 --- a/Platform/RaspberryPi/RPi4/RPi4.dsc +++ b/Platform/RaspberryPi/RPi4/RPi4.dsc @@ -516,6 +516,7 @@ # 19 - Enabled on pin 19 # gRaspberryPiTokenSpaceGuid.PcdFanOnGpio|L"FanOnGpio"|gConfigDxeFormSetGu= id|0x0|0 + gRaspberryPiTokenSpaceGuid.PcdFanTemp|L"FanTemp"|gConfigDxeFormSetGuid|0= x0|60 =20 # # Common UEFI ones. diff --git a/Platform/RaspberryPi/RaspberryPi.dec b/Platform/RaspberryPi/Ra= spberryPi.dec index a73650f2c3..c64c61930e 100644 --- a/Platform/RaspberryPi/RaspberryPi.dec +++ b/Platform/RaspberryPi/RaspberryPi.dec @@ -67,3 +67,4 @@ gRaspberryPiTokenSpaceGuid.PcdRamMoreThan3GB|0|UINT32|0x00000019 gRaspberryPiTokenSpaceGuid.PcdRamLimitTo3GB|0|UINT32|0x0000001A gRaspberryPiTokenSpaceGuid.PcdFanOnGpio|0|UINT32|0x0000001C + gRaspberryPiTokenSpaceGuid.PcdFanTemp|0|UINT32|0x0000001D --=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 (#64855): https://edk2.groups.io/g/devel/message/64855 Mute This Topic: https://groups.io/mt/76538749/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- From nobody Mon Feb 9 20:17:31 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+64856+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+64856+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1598894778; cv=none; d=zohomail.com; s=zohoarc; b=AqRI9ckoum/NyAFYdO3rMT89VK11ErSaNjGEU6fCiGgvCSw1moKOOVJUrISMrDJmYtKRV8pJR8eWWHgeTLZSupdbQjBxPWyfJ1mBq55shQueiTVQ8zkMA0z9U5Dtwp0oQSULWIYwChenWKyABFuz5Cgi1sTAaZ3ZOwmqm5p3vPg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598894778; 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=em50zFm8adPrN6S1++FDaQo7uACJsdazZVBbOZmQx2k=; b=JKLPlxB8lV4qgP1GDTRBwNhMXep6UsB+YJ3y/sRR4c84joUAbd4GzEvr1xWzngRn9mJ9HpgVRFM79cTrmBDSR65+J9bXprGOp+SgUBHVQjuGqnrvjmAaNCbrdYIkkZiY3dWrd3sTXYFTDS01u/JzpPgtRIfF6uNNQlfW52tEDxQ= 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+64856+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1598894778323890.0788276699753; Mon, 31 Aug 2020 10:26:18 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 1U1cYY1788612xs2ECYil45i; Mon, 31 Aug 2020 10:26:17 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.58384.1598894777187642439 for ; Mon, 31 Aug 2020 10:26:17 -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 CA93F30E; Mon, 31 Aug 2020 10:26:16 -0700 (PDT) X-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 B9BB43F66F; Mon, 31 Aug 2020 10:26:16 -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 v4 6/6] Platform/RaspberryPi: Trivial whitespace cleanup Date: Mon, 31 Aug 2020 12:25:49 -0500 Message-Id: <20200831172549.24079-7-jeremy.linton@arm.com> In-Reply-To: <20200831172549.24079-1-jeremy.linton@arm.com> References: <20200831172549.24079-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: 3wtokv72m1h79tLZd169hdnmx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1598894777; bh=IgzHap/u1OWVu7GZ0x5gh6Le5UulGOelFTu7aSeDHVU=; h=Cc:Date:From:Reply-To:Subject:To; b=Rw7OiNKD+ghPdh9AqhFuDKB4QSDjZOfJyU/LZ6ZUUIKl7bE41oK06/mR+ITzfaEgyJF FSj5ksbSESZroBPiconvWoR9VsQlX2z8nqLbLILTxfrwPlxGcv3mqIIBzHI5pYIOw9nm5 Nj30MoOjmHTu+wx5hlqMKDkkuYkkKTs+t+s= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Pete's review pointed out some whitespace issues in the context of a previous patch. Since there are a number of similar errors in the file lets fix them separately. 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> --- Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 24 +++++++++++-------= ---- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/= RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c index e8f964a329..4ed294cdfe 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c @@ -209,9 +209,9 @@ SetupVariables ( } =20 Size =3D sizeof (UINT32); - Status =3D gRT->GetVariable(L"CustomCpuClock", - &gConfigDxeFormSetGuid, - NULL, &Size, &Var32); + Status =3D gRT->GetVariable (L"CustomCpuClock", + &gConfigDxeFormSetGuid, + NULL, &Size, &Var32); if (EFI_ERROR (Status)) { Status =3D PcdSet32S (PcdCustomCpuClock, PcdGet32 (PcdCustomCpuClock)); ASSERT_EFI_ERROR (Status); @@ -266,7 +266,7 @@ SetupVariables ( =20 =20 Size =3D sizeof (AssetTagVar); - Status =3D gRT->GetVariable(L"AssetTag", + Status =3D gRT->GetVariable (L"AssetTag", &gConfigDxeFormSetGuid, NULL, &Size, AssetTagVar); =20 @@ -275,7 +275,7 @@ SetupVariables ( L"AssetTag", &gConfigDxeFormSetGuid, EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_A= CCESS | EFI_VARIABLE_RUNTIME_ACCESS, - sizeof(AssetTagVar), + sizeof (AssetTagVar), AssetTagVar ); } @@ -441,9 +441,9 @@ ApplyVariables ( * spaces. SystemMemorySizeBelow4GB tracks the maximum memory below 4GB * line, factoring in the limit imposed by the SoC register range. */ - SystemMemorySizeBelow4GB =3D MIN(SystemMemorySize, 4UL * SIZE_1GB); - SystemMemorySizeBelow4GB =3D MIN(SystemMemorySizeBelow4GB, BCM2836_SOC= _REGISTERS); - SystemMemorySizeBelow4GB =3D MIN(SystemMemorySizeBelow4GB, BCM2711_SOC= _REGISTERS); + SystemMemorySizeBelow4GB =3D MIN (SystemMemorySize, 4UL * SIZE_1GB); + SystemMemorySizeBelow4GB =3D MIN (SystemMemorySizeBelow4GB, BCM2836_SO= C_REGISTERS); + SystemMemorySizeBelow4GB =3D MIN (SystemMemorySizeBelow4GB, BCM2711_SO= C_REGISTERS); =20 ASSERT (SystemMemorySizeBelow4GB > 3UL * SIZE_1GB); =20 @@ -536,14 +536,14 @@ ApplyVariables ( /* * SD card pins go to Arasan. */ - MmioWrite32((GPIO_BASE_ADDRESS + 0xD0), - MmioRead32(GPIO_BASE_ADDRESS + 0xD0) | 0x2); + MmioWrite32 ((GPIO_BASE_ADDRESS + 0xD0), + MmioRead32 (GPIO_BASE_ADDRESS + 0xD0) | 0x2); } else { /* * SD card pins back to eMMC2. */ - MmioWrite32((GPIO_BASE_ADDRESS + 0xD0), - MmioRead32(GPIO_BASE_ADDRESS + 0xD0) & ~0x2); + MmioWrite32 ((GPIO_BASE_ADDRESS + 0xD0), + MmioRead32 (GPIO_BASE_ADDRESS + 0xD0) & ~0x2); /* * WiFi back to Arasan. */ --=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 (#64856): https://edk2.groups.io/g/devel/message/64856 Mute This Topic: https://groups.io/mt/76538751/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-