Attention is currently required from: Caveh Jalali, Boris Mittelberg.
Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/74603 )
Change subject: [WIP] mb/google/link: Use chromeec_smi_sleep() ......................................................................
[WIP] mb/google/link: Use chromeec_smi_sleep()
Board did not use MAINBOARD_EC_S5_WAKE attribute before.
Change-Id: I54c7d7455a6737f731c65e57c91b6457643c7cb2 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/ec/google/chromeec/smihandler.c M src/mainboard/google/link/smihandler.c 2 files changed, 17 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/03/74603/1
diff --git a/src/ec/google/chromeec/smihandler.c b/src/ec/google/chromeec/smihandler.c index 599a66e..5df39d3 100644 --- a/src/ec/google/chromeec/smihandler.c +++ b/src/ec/google/chromeec/smihandler.c @@ -40,9 +40,11 @@ while (google_chromeec_get_event() != EC_HOST_EVENT_NONE) ;
+ printk(BIOS_DEBUG, "Clearing pending EC events. Error code EC_RES_UNAVAILABLE(9) is expected.\n"); while (google_chromeec_get_mkbp_event(&mkbp_event) == 0) ; + }
void chromeec_set_usb_charge_mode(bool u0disable, bool u1disable) @@ -62,6 +64,7 @@ /* Enable wake events */ google_chromeec_set_wake_mask(s3_mask); break; + case ACPI_S4: case ACPI_S5: /* Enable wake events */ google_chromeec_set_wake_mask(s5_mask); diff --git a/src/mainboard/google/link/smihandler.c b/src/mainboard/google/link/smihandler.c index cc19d34..9c76c33 100644 --- a/src/mainboard/google/link/smihandler.c +++ b/src/mainboard/google/link/smihandler.c @@ -19,6 +19,7 @@ chromeec_smi_process_events(); }
+/* test slp_typ */ void mainboard_smi_sleep(u8 slp_typ) { bool u0disable = 0, u1disable = 0; @@ -27,16 +28,7 @@ usb_charge_mode_from_gnvs(slp_typ, &u0disable, &u1disable); chromeec_set_usb_charge_mode(u0disable, u1disable);
- /* Disable SCI and SMI events */ - google_chromeec_set_smi_mask(0); - google_chromeec_set_sci_mask(0); - - /* Clear pending events that may trigger immediate wake */ - while (google_chromeec_get_event() != EC_HOST_EVENT_NONE) - ; - - /* Enable wake events */ - google_chromeec_set_wake_mask(MAINBOARD_EC_S3_WAKE_EVENTS); + chromeec_smi_sleep(slp_typ, MAINBOARD_EC_S3_WAKE_EVENTS, MAINBOARD_EC_S5_WAKE_EVENTS); }
int mainboard_smi_apmc(u8 apmc)