From nobody Wed May 8 05:37:55 2024 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+64782+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+64782+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1598652169; cv=none; d=zohomail.com; s=zohoarc; b=RX7eCi1XhCnsuK5WFn508GHqt/5JyIiQt+3aZ7ElfTCesaUosQpdiug5BpWoA36WG5lmZcj0rgkqTcbeAc1SMiwFyoG3zYQNorX0ikJEhv60VPA0R4tQte/5marXh92nA3FrK0Tg+l0Fmm8tlc2Lhgbd4wVFtje4a3R37kP6maA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598652169; 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=9cw82svjRSgWkQ6OTsg7CH/wVPDDkAtQGB1rwFpIyoI=; b=CJloBLuPKxGeNq0NpmRmu2v3jwIQwYMYwVTk2F8IhdaWDP0AYAPp0sixRqWuJZ+5p5CliYvhIi9twCf/JbWowLB/dgulOSQp8hYBcXXH/QvF9vR94Fczj+wejaesUN5SXOHWRUp29VMFojjyI5cxzQw9C4f6s7nShXJ911UsYL0= 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+64782+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1598652169281151.14493953823842; Fri, 28 Aug 2020 15:02:49 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id xqFFYY1788612xrsLEfcy3xh; Fri, 28 Aug 2020 15:02:48 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.60.1598652167720417267 for ; Fri, 28 Aug 2020 15:02:48 -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 2EF2131B; Fri, 28 Aug 2020 15:02:47 -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 DABF93F71F; Fri, 28 Aug 2020 15:02:46 -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 1/5] Platform/RaspberryPi4: Add a basic thermal zone Date: Fri, 28 Aug 2020 17:02:11 -0500 Message-Id: <20200828220215.101919-2-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: MVnm2BHLJZB6mC7VFMMOR4pTx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1598652168; bh=yhzOrv7Bd32kyBRlqNEnepSL3F4seIewAS4E+O4jTfQ=; h=Cc:Date:From:Reply-To:Subject:To; b=POIiN/b3bsz8D4HfxL7X4UjDcNgrJdULuRzXeoykOGdmB+M6sp/BrGMaJzymiJ+/1rT bV/QiE5YfSAU5HjGEs/K6CEmtZLok5IlojXMCvWsWXhM/9n4JChmor64YiFiDNJmzERnk NblsPDUb89sCseh+pWFfYYUcTXLtMdbCAWE= 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> Reviewed-by: Pete Batard --- 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..73067aefd2 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 (EC0) + { + 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 (TZ0) { + 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 (#64782): https://edk2.groups.io/g/devel/message/64782 Mute This Topic: https://groups.io/mt/76484330/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 Wed May 8 05:37:55 2024 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+64783+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+64783+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1598652171; cv=none; d=zohomail.com; s=zohoarc; b=FcnBQhofZus9C2h0+8ju1jmKkeNtIQEIXzblgJZtuupJJ//F4XhEDlE4l3/yaQ2TXW3QkmKQLJuwwSq5PxV204jrSe6qChR0lAMt6pJxwpOCl40KXSMtW8KdR/tkXZeaaSbRFJfeWk0zmy37e8KJxdu4u2Hc6XJQqYQGBesPRPo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598652171; 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=Uuv+B7/KbKaFwTiexsjPrqHiSxiZ6XBZtEfitMpsOIA=; b=As02y+LxU/7vHbxTsjCmXqKXqCWWNFpXyIdN2T/xkUCZkYyrISLLWInhYfmYDJWjXHJ1cfT40bdTG7gtwtRuoI9EcO5HrQoyQeIU7cIM7QNbmwhxjKrQViSN7Wf4AsGgf/CwKYXPTXkDv8dlt4Jy2Ueg30gxPMnPzD5DXDAMasQ= 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+64783+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1598652171791641.8715147485141; Fri, 28 Aug 2020 15:02:51 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id uZcKYY1788612xwCgYvPAk62; Fri, 28 Aug 2020 15:02:51 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.72.1598652170728560562 for ; Fri, 28 Aug 2020 15:02:50 -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 500EA31B; Fri, 28 Aug 2020 15:02:50 -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 F18FB3F71F; Fri, 28 Aug 2020 15:02:49 -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 2/5] Platform/RaspberryPi: Monitor ACPI Table installs Date: Fri, 28 Aug 2020 17:02:12 -0500 Message-Id: <20200828220215.101919-3-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: RO8TwNnJJTgducUX4RyqNmbzx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1598652171; bh=NpepjNxvYDGQaVwdums0L70wWBhwqNTEYvnLUfLDb9g=; h=Cc:Date:From:Reply-To:Subject:To; b=wI2TQzPyj+MEKrq/5LZZUYQc4i9nLVi+sLSHvXxHSWl+vpGSxOOAQsfVY139/B8FvnC 3cy2lNwkYznv3+gO144/74WcngMpg5lnexcXTb+Rjlri2JqX5lA0b38AzdWEOxYR3eYQb qhPIIsEXzktTzt5TaJAJ9PNhrI/Q165oUYs= 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 --- 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 (#64783): https://edk2.groups.io/g/devel/message/64783 Mute This Topic: https://groups.io/mt/76484331/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 Wed May 8 05:37:55 2024 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+64784+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+64784+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1598652174; cv=none; d=zohomail.com; s=zohoarc; b=H44NgMY7ctksd21IkSIRloXETpJ200FO8s1YaqDkNwWu4c2sJ/BKyx96K/cKe5pW3k6PDrZS38bc5d4Rluj71eA8xBlEhi8ucMEcA0E2tRwZBOCIvFBkR8bcBO6uh80BBnTkngJM9ibZxPmPAlzq1b8kiiPnU+DvIEnkPK5xjRw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598652174; 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=OP3cDrisU3JCpwCiFRu1DCB2ycA2L3OSXQvVRglVx8U=; b=AbFhsGGP9uZPNTFbjHiPNQAQljYfx7XXvD4R2K1usb8hrhwGC6efPIGLkMV7IDsqNRnJC/u1XVUMe8QaZhJxHou1ABG6vIgcR7/CCUoJ2rSKYADF0BWlSe+dOIwLYXhYDAoukfPCtSMDuR1EkjqOEPBPXzU1ZT4z3RiQbdC9N5Y= 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+64784+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 15986521745891023.6914215386901; Fri, 28 Aug 2020 15:02:54 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id uUPDYY1788612xr5YzTRZspi; Fri, 28 Aug 2020 15:02:54 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.63.1598652173447250072 for ; Fri, 28 Aug 2020 15:02:53 -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 0FF0BD6E; Fri, 28 Aug 2020 15:02:53 -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 B83BA3F71F; Fri, 28 Aug 2020 15:02:52 -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 3/5] Platform/RaspberryPi: Add entry for user fan control Date: Fri, 28 Aug 2020 17:02:13 -0500 Message-Id: <20200828220215.101919-4-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: GnlAmZMh5g4TSeZvDECZAezYx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1598652174; bh=wK+7d5yH3TaKTf3GQrFirUH00o0jlLIP/77Hv8O36mg=; h=Cc:Date:From:Reply-To:Subject:To; b=aspmDptIa2QdtDsaIq+CTPCkajNcTlAY//4n9TrYEscdYCT7uAGVXevi/OND8+cWsFJ ujcbam3JjAb0uyr2+c5SrZtw2bGtmsi9Yjc8NmAVBpXDLy3u1RDxIyCfNbRGIkxFhjn07 wEZ1o9T4BdOksgxdSXldf1+VPSJbjWwBtA4= 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> Reviewed-by: Pete Batard --- 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 (#64784): https://edk2.groups.io/g/devel/message/64784 Mute This Topic: https://groups.io/mt/76484333/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 Wed May 8 05:37:55 2024 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- From nobody Wed May 8 05:37:55 2024 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+64786+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+64786+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1598652180; cv=none; d=zohomail.com; s=zohoarc; b=X/WGgEYum2V2U2kniGSsYdnmcDkAYthvIcRiR0Kv5EDq/Mp+wEKmMHv7TLf9/jb1JHvU9VjysitCE9/qnll68Y6Eku9MqKjFPHTIse/Pa0bUJCCKEWr6Mh8II+TccPbq8t8E9ahBNRusXS+lzYgw+R7lxNwUt8SjLbHWI/fetJk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598652180; 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=8MgB7rhZ/u+I8LV7gHf+OVtWxnJ4KiiNDAf5sRgjoTE=; b=A210InS8JGcc9GFTQOQUDZxRFvKNYSiIgcz7ByFihGtqOp+r/lA8iZ+cQTGvNtteRskcAwxtOGazQSWy92GVTh1fdg+XqO8fYlRWaUngvz7BBgwthsxP2S+FSTniy1y95KDoB10ODmyH+9hngmGIW7Qy+iuO1UXF9FcQsE91gRU= 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+64786+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1598652180537849.5332667434669; Fri, 28 Aug 2020 15:03:00 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id RA3wYY1788612xhq8PS6G972; Fri, 28 Aug 2020 15:02:59 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.62.1598652179243765050 for ; Fri, 28 Aug 2020 15:02:59 -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 CE96231B; Fri, 28 Aug 2020 15:02:58 -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 7EB943F71F; Fri, 28 Aug 2020 15:02:58 -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 5/5] Platform/RaspberryPi: Trivial whitespace cleanup Date: Fri, 28 Aug 2020 17:02:15 -0500 Message-Id: <20200828220215.101919-6-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: JovIKhlqBwQ2L9ziUR9ZtYLox1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1598652179; bh=zB2DaAzWxMhjL+CSqgbS9yXPDTb9LAT1LUvRl/Rhzts=; h=Cc:Date:From:Reply-To:Subject:To; b=MxbQQweueSVFBCV3alUbhGVuKsaYk26W3Z70FmWVvvwcUCoz6R7aDApuM9rIbYS0ISy csw55EJKyyyb+G72XzH52us93tk/C5yjW9vO45nfrliDcNK/VmfMYglukGMHbOBZEGBG0 nUWixALQfJm0TfKOd1hTOyplerD/33w0pgw= 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 --- Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 26 +++++++++++-------= ---- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/= RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c index d58cbbdfe7..2712194d2b 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); @@ -256,9 +256,9 @@ SetupVariables ( PcdSet32 (PcdFanOnGpio, PcdGet32 (PcdFanOnGpio)); } =20 - Size =3D sizeof(AssetTagVar); + Size =3D sizeof (AssetTagVar); =20 - Status =3D gRT->GetVariable(L"AssetTag", + Status =3D gRT->GetVariable (L"AssetTag", &gConfigDxeFormSetGuid, NULL, &Size, AssetTagVar); =20 @@ -267,7 +267,7 @@ SetupVariables ( L"AssetTag", &gConfigDxeFormSetGuid, EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_A= CCESS | EFI_VARIABLE_RUNTIME_ACCESS, - sizeof(AssetTagVar), + sizeof (AssetTagVar), AssetTagVar ); } @@ -433,9 +433,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 @@ -528,14 +528,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 (#64786): https://edk2.groups.io/g/devel/message/64786 Mute This Topic: https://groups.io/mt/76484336/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-