From 2ae9d698882dd0ce899a0008d5d0526373af407a Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Tue, 11 Feb 2020 12:38:29 -0600 Subject: ec/purism/librem: Add ACPI temp reporting Add EC ACPI reporting of current temp and platform critical temp. Adapted from ACPI dump of ODM AMI firmware. TEST: check reporting of current/critical temps via lm-sensors from ACPI on Librem 13v1 and 13v4 boards. Change-Id: I92641fbbdda46e0c388607a37f7a7cc2dcd6c26d Signed-off-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/c/coreboot/+/38835 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- src/ec/purism/librem/acpi/ec.asl | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src/ec') diff --git a/src/ec/purism/librem/acpi/ec.asl b/src/ec/purism/librem/acpi/ec.asl index ff325aa9a3..6f6ced1b5c 100644 --- a/src/ec/purism/librem/acpi/ec.asl +++ b/src/ec/purism/librem/acpi/ec.asl @@ -52,7 +52,9 @@ Device (EC) OperationRegion (ERAM, EmbeddedControl, Zero, 0xFF) Field (ERAM, ByteAcc, Lock, Preserve) { - Offset (0x15), + Offset (0x13), + RTMP, 8, + , 8, BSTS, 2, /* Battery Status */ , 3, BTEX, 1, /* Battery Present */ @@ -231,3 +233,23 @@ Device (EC) #include "ac.asl" #include "battery.asl" } + +Scope (\_TZ) +{ + ThermalZone (TZ0) + { + /* _TMP: Temperature */ + Method (_TMP, 0, Serialized) + { + Local0 = (0x0AAC + (\_SB.PCI0.LPCB.EC.RTMP * 0x0A)) + Return (Local0) + } + + /* _CRT: Critical Temperature */ + Method (_CRT, 0, Serialized) + { + /* defined in board ec.asl */ + Return (CRIT_TEMP) + } + } +} -- cgit v1.2.3