ec/lenovo/h8: Rework invalid temperature reporting
As far back as the x201, Lenovo's EC ACPI has treated 128 as an invalid value, and returned a corrected value when it is reported/read from EC RAM. Drop the ME workaround, which most H8-equipped boards select, in favor of Lenovo's logic, since both accomplish the same result. Change-Id: Icdc91e439ec30c8263de5810a13e75f7595472a5 Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/88416 Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
621b1061d0
commit
6082bd7711
30 changed files with 8 additions and 84 deletions
|
|
@ -4,11 +4,6 @@
|
|||
|
||||
Scope(\_TZ)
|
||||
{
|
||||
#if defined(EC_LENOVO_H8_ME_WORKAROUND)
|
||||
Name (MEB1, 0)
|
||||
Name (MEB2, 0)
|
||||
#endif
|
||||
|
||||
Method(C2K, 1, NotSerialized)
|
||||
{
|
||||
Local0 = Arg0 * 10
|
||||
|
|
@ -71,14 +66,12 @@ External (\PPKG, MethodObj)
|
|||
}
|
||||
|
||||
Method(_TMP) {
|
||||
#if defined(EC_LENOVO_H8_ME_WORKAROUND)
|
||||
/* Avoid tripping alarm if ME isn't booted at all yet */
|
||||
If (!MEB1 && \_SB.PCI0.LPCB.EC.TMP0 == 128) {
|
||||
Local0 = \_SB.PCI0.LPCB.EC.TMP0
|
||||
/* Avoid tripping alarm if invalid value reported */
|
||||
If (Local0 == 128) {
|
||||
Return (C2K(40))
|
||||
}
|
||||
MEB1 = 1
|
||||
#endif
|
||||
Return (C2K(\_SB.PCI0.LPCB.EC.TMP0))
|
||||
Return (C2K(Local0))
|
||||
}
|
||||
|
||||
Method (_AC0) {
|
||||
|
|
@ -158,14 +151,12 @@ External (\PPKG, MethodObj)
|
|||
}
|
||||
|
||||
Method(_TMP) {
|
||||
#if defined(EC_LENOVO_H8_ME_WORKAROUND)
|
||||
/* Avoid tripping alarm if ME isn't booted at all yet */
|
||||
If (!MEB2 && \_SB.PCI0.LPCB.EC.TMP1 == 128) {
|
||||
Local0 = \_SB.PCI0.LPCB.EC.TMP1
|
||||
/* Avoid tripping alarm if invalid value reported */
|
||||
If (Local0 == 128) {
|
||||
Return (C2K(40))
|
||||
}
|
||||
MEB2 = 1
|
||||
#endif
|
||||
Return (C2K(\_SB.PCI0.LPCB.EC.TMP1))
|
||||
Return (C2K(Local0))
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -2,9 +2,6 @@
|
|||
|
||||
Method(_WAK,1)
|
||||
{
|
||||
/* ME may not be up yet. */
|
||||
\_TZ.MEB1 = 0
|
||||
\_TZ.MEB2 = 0
|
||||
Return(Package(){0,0})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#define BRIGHTNESS_UP \_SB.PCI0.GFX0.INCB
|
||||
#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.DECB
|
||||
#define EC_LENOVO_H8_ME_WORKAROUND 1
|
||||
#define THINKPAD_EC_GPE 17
|
||||
|
||||
#include <acpi/acpi.h>
|
||||
|
|
|
|||
|
|
@ -15,10 +15,6 @@ Method(_PTS,1)
|
|||
|
||||
Method(_WAK,1)
|
||||
{
|
||||
/* ME may not be up yet. */
|
||||
\_TZ.MEB1 = 0
|
||||
\_TZ.MEB2 = 0
|
||||
|
||||
/* Wake the HKEY to init BT/WWAN */
|
||||
\_SB.PCI0.LPCB.EC.HKEY.WAKE (Arg0)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#define THINKPAD_EC_GPE 22
|
||||
#define BRIGHTNESS_UP \_SB.PCI0.GFX0.INCB
|
||||
#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.DECB
|
||||
#define EC_LENOVO_H8_ME_WORKAROUND 1
|
||||
|
||||
#include <acpi/acpi.h>
|
||||
DefinitionBlock(
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#define THINKPAD_EC_GPE 23
|
||||
#define BRIGHTNESS_UP \_SB.PCI0.GFX0.INCB
|
||||
#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.DECB
|
||||
#define EC_LENOVO_H8_ME_WORKAROUND 1
|
||||
|
||||
#include <acpi/acpi.h>
|
||||
DefinitionBlock(
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#define THINKPAD_EC_GPE 17
|
||||
#define BRIGHTNESS_UP \_SB.PCI0.GFX0.INCB
|
||||
#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.DECB
|
||||
#define EC_LENOVO_H8_ME_WORKAROUND 1
|
||||
|
||||
#include <acpi/acpi.h>
|
||||
DefinitionBlock(
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#define THINKPAD_EC_GPE 17
|
||||
#define BRIGHTNESS_UP \_SB.PCI0.GFX0.INCB
|
||||
#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.DECB
|
||||
#define EC_LENOVO_H8_ME_WORKAROUND 1
|
||||
|
||||
#include <acpi/acpi.h>
|
||||
DefinitionBlock(
|
||||
|
|
|
|||
|
|
@ -15,10 +15,6 @@ Method(_PTS,1)
|
|||
|
||||
Method(_WAK,1)
|
||||
{
|
||||
/* ME may not be up yet. */
|
||||
\_TZ.MEB1 = 0
|
||||
\_TZ.MEB2 = 0
|
||||
|
||||
/* Wake the HKEY to init BT/WWAN */
|
||||
\_SB.PCI0.LPCB.EC.HKEY.WAKE (Arg0)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#define THINKPAD_EC_GPE 17
|
||||
#define BRIGHTNESS_UP \_SB.PCI0.GFX0.INCB
|
||||
#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.DECB
|
||||
#define EC_LENOVO_H8_ME_WORKAROUND 1
|
||||
|
||||
#include <acpi/acpi.h>
|
||||
DefinitionBlock(
|
||||
|
|
|
|||
|
|
@ -15,10 +15,6 @@ Method(_PTS,1)
|
|||
|
||||
Method(_WAK,1)
|
||||
{
|
||||
/* ME may not be up yet. */
|
||||
\_TZ.MEB1 = 0
|
||||
\_TZ.MEB2 = 0
|
||||
|
||||
/* Wake the HKEY to init BT/WWAN */
|
||||
\_SB.PCI0.LPCB.EC.HKEY.WAKE (Arg0)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#define THINKPAD_EC_GPE 17
|
||||
#define BRIGHTNESS_UP \_SB.PCI0.GFX0.INCB
|
||||
#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.DECB
|
||||
#define EC_LENOVO_H8_ME_WORKAROUND 1
|
||||
|
||||
#include <acpi/acpi.h>
|
||||
DefinitionBlock(
|
||||
|
|
|
|||
|
|
@ -15,10 +15,6 @@ Method(_PTS,1)
|
|||
|
||||
Method(_WAK,1)
|
||||
{
|
||||
/* ME may not be up yet. */
|
||||
\_TZ.MEB1 = 0
|
||||
\_TZ.MEB2 = 0
|
||||
|
||||
/* Wake the HKEY to init BT/WWAN */
|
||||
\_SB.PCI0.LPCB.EC.HKEY.WAKE (Arg0)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#define THINKPAD_EC_GPE 17
|
||||
#define BRIGHTNESS_UP \_SB.PCI0.GFX0.INCB
|
||||
#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.DECB
|
||||
#define EC_LENOVO_H8_ME_WORKAROUND 1
|
||||
|
||||
#include <acpi/acpi.h>
|
||||
DefinitionBlock(
|
||||
|
|
|
|||
|
|
@ -15,10 +15,6 @@ Method(_PTS,1)
|
|||
|
||||
Method(_WAK,1)
|
||||
{
|
||||
/* ME may not be up yet. */
|
||||
\_TZ.MEB1 = 0
|
||||
\_TZ.MEB2 = 0
|
||||
|
||||
/* Wake the HKEY to init BT/WWAN */
|
||||
\_SB.PCI0.LPCB.EC.HKEY.WAKE (Arg0)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#define THINKPAD_EC_GPE 17
|
||||
#define BRIGHTNESS_UP \_SB.PCI0.GFX0.INCB
|
||||
#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.DECB
|
||||
#define EC_LENOVO_H8_ME_WORKAROUND 1
|
||||
|
||||
#include <acpi/acpi.h>
|
||||
DefinitionBlock(
|
||||
|
|
|
|||
|
|
@ -15,10 +15,6 @@ Method(_PTS,1)
|
|||
|
||||
Method(_WAK,1)
|
||||
{
|
||||
/* ME may not be up yet. */
|
||||
\_TZ.MEB1 = 0
|
||||
\_TZ.MEB2 = 0
|
||||
|
||||
/* Wake the HKEY to init BT/WWAN */
|
||||
\_SB.PCI0.LPCB.EC.HKEY.WAKE (Arg0)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#define THINKPAD_EC_GPE 17
|
||||
#define BRIGHTNESS_UP \_SB.PCI0.GFX0.INCB
|
||||
#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.DECB
|
||||
#define EC_LENOVO_H8_ME_WORKAROUND 1
|
||||
|
||||
#include <acpi/acpi.h>
|
||||
DefinitionBlock(
|
||||
|
|
|
|||
|
|
@ -15,10 +15,6 @@ Method(_PTS,1)
|
|||
|
||||
Method(_WAK,1)
|
||||
{
|
||||
/* ME may not be up yet. */
|
||||
\_TZ.MEB1 = 0
|
||||
\_TZ.MEB2 = 0
|
||||
|
||||
/* Wake the HKEY to init BT/WWAN */
|
||||
\_SB.PCI0.LPCB.EC.HKEY.WAKE (Arg0)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#define THINKPAD_EC_GPE 17
|
||||
#define BRIGHTNESS_UP \_SB.PCI0.GFX0.INCB
|
||||
#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.DECB
|
||||
#define EC_LENOVO_H8_ME_WORKAROUND 1
|
||||
|
||||
#include <acpi/acpi.h>
|
||||
DefinitionBlock(
|
||||
|
|
|
|||
|
|
@ -15,10 +15,6 @@ Method(_PTS,1)
|
|||
|
||||
Method(_WAK,1)
|
||||
{
|
||||
/* ME may not be up yet. */
|
||||
\_TZ.MEB1 = 0
|
||||
\_TZ.MEB2 = 0
|
||||
|
||||
/* Wake the HKEY to init BT/WWAN */
|
||||
\_SB.PCI0.LPCB.EC.HKEY.WAKE (Arg0)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#define THINKPAD_EC_GPE 22
|
||||
#define BRIGHTNESS_UP \_SB.PCI0.GFX0.INCB
|
||||
#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.DECB
|
||||
#define EC_LENOVO_H8_ME_WORKAROUND 1
|
||||
|
||||
#include <acpi/acpi.h>
|
||||
DefinitionBlock(
|
||||
|
|
|
|||
|
|
@ -15,10 +15,6 @@ Method(_PTS,1)
|
|||
|
||||
Method(_WAK,1)
|
||||
{
|
||||
/* ME may not be up yet. */
|
||||
\_TZ.MEB1 = 0
|
||||
\_TZ.MEB2 = 0
|
||||
|
||||
/* Wake the HKEY to init BT/WWAN */
|
||||
\_SB.PCI0.LPCB.EC.HKEY.WAKE (Arg0)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#define THINKPAD_EC_GPE 17
|
||||
#define BRIGHTNESS_UP \_SB.PCI0.GFX0.INCB
|
||||
#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.DECB
|
||||
#define EC_LENOVO_H8_ME_WORKAROUND 1
|
||||
#define EC_LENOVO_H8_ALT_FN_F2F3_LAYOUT 1
|
||||
|
||||
#include <acpi/acpi.h>
|
||||
|
|
|
|||
|
|
@ -15,10 +15,6 @@ Method(_PTS,1)
|
|||
|
||||
Method(_WAK,1)
|
||||
{
|
||||
/* ME may not be up yet. */
|
||||
\_TZ.MEB1 = 0
|
||||
\_TZ.MEB2 = 0
|
||||
|
||||
/* Wake the HKEY to init BT/WWAN */
|
||||
\_SB.PCI0.LPCB.EC.HKEY.WAKE (Arg0)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#define THINKPAD_EC_GPE 17
|
||||
#define BRIGHTNESS_UP \_SB.PCI0.GFX0.INCB
|
||||
#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.DECB
|
||||
#define EC_LENOVO_H8_ME_WORKAROUND 1
|
||||
|
||||
#include <acpi/acpi.h>
|
||||
DefinitionBlock(
|
||||
|
|
|
|||
|
|
@ -15,10 +15,6 @@ Method(_PTS,1)
|
|||
|
||||
Method(_WAK,1)
|
||||
{
|
||||
/* ME may not be up yet. */
|
||||
\_TZ.MEB1 = 0
|
||||
\_TZ.MEB2 = 0
|
||||
|
||||
/* Wake the HKEY to init BT/WWAN */
|
||||
\_SB.PCI0.LPCB.EC.HKEY.WAKE (Arg0)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#define THINKPAD_EC_GPE 17
|
||||
#define BRIGHTNESS_UP \_SB.PCI0.GFX0.INCB
|
||||
#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.DECB
|
||||
#define EC_LENOVO_H8_ME_WORKAROUND 1
|
||||
|
||||
#include <acpi/acpi.h>
|
||||
DefinitionBlock(
|
||||
|
|
|
|||
|
|
@ -15,10 +15,6 @@ Method(_PTS,1)
|
|||
|
||||
Method(_WAK,1)
|
||||
{
|
||||
/* ME may not be up yet. */
|
||||
\_TZ.MEB1 = 0
|
||||
\_TZ.MEB2 = 0
|
||||
|
||||
/* Wake the HKEY to init BT/WWAN */
|
||||
\_SB.PCI0.LPCB.EC.HKEY.WAKE (Arg0)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#define THINKPAD_EC_GPE 17
|
||||
#define BRIGHTNESS_UP \_SB.PCI0.GFX0.INCB
|
||||
#define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.DECB
|
||||
#define EC_LENOVO_H8_ME_WORKAROUND 1
|
||||
|
||||
#include <acpi/acpi.h>
|
||||
DefinitionBlock(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue