Duncan Laurie has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31560
Change subject: ec/google/wilco: Fix ACPI power status events ......................................................................
ec/google/wilco: Fix ACPI power status events
This change fixes the power status events for AC and battery events from the EC. The register that was being used is not returning the expected information.
BUG=b:125472740 TEST=enable ACPI debug in the kernel and verify that AC and battery insert/remove are detected properly.
Change-Id: I15f71fcf0ca6aa9438e951865787c9fc273792d8 Signed-off-by: Duncan Laurie dlaurie@google.com --- M src/ec/google/wilco/acpi/ec.asl M src/ec/google/wilco/acpi/ec_ram.asl M src/ec/google/wilco/acpi/event.asl 3 files changed, 7 insertions(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/60/31560/1
diff --git a/src/ec/google/wilco/acpi/ec.asl b/src/ec/google/wilco/acpi/ec.asl index 5aca187..675ee37 100644 --- a/src/ec/google/wilco/acpi/ec.asl +++ b/src/ec/google/wilco/acpi/ec.asl @@ -42,7 +42,7 @@ EREG = Arg1
/* Store initial value for power status */ - ECPR = R (APWR) + ECPR = R (PWSR)
/* Indicate to EC that OS is ready for queries */ W (ERDY, Arg1) diff --git a/src/ec/google/wilco/acpi/ec_ram.asl b/src/ec/google/wilco/acpi/ec_ram.asl index 1c030af..b7cfefa 100644 --- a/src/ec/google/wilco/acpi/ec_ram.asl +++ b/src/ec/google/wilco/acpi/ec_ram.asl @@ -53,6 +53,7 @@ Name (P6ST, Package () { 0x05, 0xff, RD }) /* PmSt6 */ Name (P6AC, Package () { 0x05, 0x08, RD }) /* PmSt6_AC_UPDATE */
+Name (PWSR, Package () { 0x06, 0xff, RD }) /* POWER_SOURCE */ Name (ACEX, Package () { 0x06, 0x01, RD }) /* AC Present */ Name (BTEX, Package () { 0x06, 0x02, RD }) /* Battery Present */ Name (BTSC, Package () { 0x06, 0x04, RD }) /* Battery Status Changed */ @@ -122,11 +123,6 @@
Name (BCCY, Package () { 0x3e, 0xffff, RD }) /* BCACHE: Cycle Count */
-Name (APWR, Package () { 0x47, 0xff, RD }) /* POWER: Full Status */ -Name (APAC, Package () { 0x47, 0x01, RD }) /* POWER: AC */ -Name (APB1, Package () { 0x47, 0x02, RD }) /* POWER: Main Battery */ -Name (APC1, Package () { 0x47, 0x04, RD }) /* POWER: Main Batt Status */ - /* * EC RAM WRITE */ diff --git a/src/ec/google/wilco/acpi/event.asl b/src/ec/google/wilco/acpi/event.asl index 24cf268..fab4fc4 100644 --- a/src/ec/google/wilco/acpi/event.asl +++ b/src/ec/google/wilco/acpi/event.asl @@ -19,17 +19,17 @@
Method (ECQP, 0, Serialized) { - Local0 = R (APWR) + Local0 = R (PWSR) Local1 = Local0 ^ ECPR ECPR = Local0
- If (EBIT (APAC, Local1)) { + If (EBIT (ACEX, Local1)) { Printf ("AC Power Status Changed") Notify (AC, 0x80) }
- If (EBIT (APB1, Local1)) { - If (EBIT (APB1, Local0)) { + If (EBIT (BTEX, Local1)) { + If (EBIT (BTEX, Local0)) { Printf ("BAT0 Inserted") Notify (BAT0, 0x81) } Else { @@ -39,7 +39,7 @@ } }
- If (EBIT (APC1, Local1)) { + If (EBIT (BTSC, Local1)) { Printf ("BAT0 Status Change") Notify (BAT0, 0x80) }