From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by mx.groups.io with SMTP id smtpd.web12.40744.1597662607099970631 for ; Mon, 17 Aug 2020 04:10:07 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@akeo-ie.20150623.gappssmtp.com header.s=20150623 header.b=INGNd1QZ; spf=none, err=permanent DNS error (domain: akeo.ie, ip: 209.85.221.65, mailfrom: pete@akeo.ie) Received: by mail-wr1-f65.google.com with SMTP id r4so14513982wrx.9 for ; Mon, 17 Aug 2020 04:10:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=cDOXUDU0oWKJab5yLwpdOyl11kT+TTbg2qB0GE5jj6k=; b=INGNd1QZc5GkTE8+nwlxjV5ZKWC8HZsoG6x9IPNnOsK+kCPFS1ptGL2jU7EY7Q9UVb G5ybXwd42EFgFxPAw0dcHKbRNh2A4aDhqkm5qhzMk8WRKN0YJwpA1sLQzJ5HCp2aqP92 ycg7v0YtTysj9Jix0w//kq9QIC4Ofk1h6R38VzK0lyRyqr85Iur4K5kvPtSbG/IItCA7 ORFl6A6dIFWQg3q8pIa+uiF0tuEH4vLccwxdl6tx8AXdFH20X8GZ4GW86ASC+IFWNcmT O1qzkqVg8Z5tLidCN7pql2dHOCr6eoBJ2ucTGKi6kSPwxuVGqNqLCOyXqTmGs5MyL9/6 H9Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=cDOXUDU0oWKJab5yLwpdOyl11kT+TTbg2qB0GE5jj6k=; b=ppkvCVTsw2eXAecKpaMV1jb2xAl6uW7beFergiv0nWLRqOF2rQBSyOuVUeflVMy5Sj NPC5RIY+uF2PgJUCbxNWTj7SKMLxsKBPybLjcHO6b+2iO29imD+7VWehyVQOAKZ9T71p C9QMWjDRMnKhSH5z6qtMn+TJBz9GDv14viMPH5DEjdFVLXr2jNrwMNCkIRqTgfWPvvvb jlxh98xfk4Czepa0Pq6Rmlocgrbvk6BMd0n7Zgge+LaDcvLyTYHBLNRd+fOncG84ZPq3 sWr04j+CPbaYGKRLdmCPNdqg3VdwMlK5QCT0CrRAYoyIMgKbvKVugB/8+seA73HCMi+Q x/hQ== X-Gm-Message-State: AOAM530d+Y8gIKHcZswIKlwv7D15G3smZWXJ2YDE3Uoylzx75ib4CrDV HVAUa01O5FRx6i31w6Y2RYK97g== X-Google-Smtp-Source: ABdhPJyLfNstG7QPTYcRONuH5he67HCit+i5+kNyG1rxDOigh/Kn9OpnYNcM+EiX6jtw8AieYZpLjg== X-Received: by 2002:a5d:4a0b:: with SMTP id m11mr14601560wrq.407.1597662605582; Mon, 17 Aug 2020 04:10:05 -0700 (PDT) Return-Path: Received: from [10.0.0.122] ([84.203.54.14]) by smtp.googlemail.com with ESMTPSA id p8sm31040333wrq.9.2020.08.17.04.10.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Aug 2020 04:10:04 -0700 (PDT) Subject: Re: [PATCH 1/3] Platform/RaspberryPi4: Add a basic thermal zone To: Jeremy Linton , devel@edk2.groups.io Cc: Leif Lindholm , Andrei Warkentin , Ard Biesheuvel , Samer El-Haj-Mahmoud References: <20200813230056.40526-1-jeremy.linton@arm.com> <20200813230056.40526-2-jeremy.linton@arm.com> From: "Pete Batard" Message-ID: <707de551-089f-9fdf-e1d4-e55c8abb60b5@akeo.ie> Date: Mon, 17 Aug 2020 12:10:02 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200813230056.40526-2-jeremy.linton@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Nothing major, just whitespace/style and one minor capitalization issue: On 2020.08.14 00:00, Jeremy Linton wrote: > 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. > > This commit also adds 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 > --- > Platform/RaspberryPi/AcpiTables/Dsdt.asl | 31 +++++++++++++++++++++++++++++++ > 1 file changed, 31 insertions(+) > > diff --git a/Platform/RaspberryPi/AcpiTables/Dsdt.asl b/Platform/RaspberryPi/AcpiTables/Dsdt.asl > index 353af2d876..a5c9567cdf 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 temp > > + // via a register we can read, and give it to the OS. This enables basic > > + // reports from the "sensors" utility, and the OS can then poll and take > > + // actions if that temp exceeds any of the given thresholds. > > + Device(EC0) > > + { > > + Name(_HID, EISAID("PNP0C06")) Space between EISAID and ("PNP0C06") > > + Name (_CCA, 0x0) > > + > > + // all temps in are tenths of K (aka 2732 is the min temps in linux (aka 0C)) I'd use a capital 'L' in "Linux" > > + ThermalZone(TZ0) { Space before '(' > > + Method(_TMP, 0, Serialized) { Space before '(' > > + OperationRegion (TEMS, SystemMemory, 0xfd5d2200, 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) } // (90K) Critical temp point (immediate power-off) > > + Method(_HOT) { return(3582) } // (85K) HOT state where OS should hibernate > > + Method(_PSV) { return(3532) } // (80K) Passive cooling (CPU throttling) 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}) 6 x Space before '(' > > + } > > + } > > #endif > > > > } > Reviewed by: Pete Batard