[coreboot-gerrit] New patch to review for coreboot: 227a231 chromeec: Fix logging of EC wake events

Stefan Reinauer (stefan.reinauer@coreboot.org) gerrit at coreboot.org
Wed Apr 1 22:53:09 CEST 2015


Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9215

-gerrit

commit 227a231c73da9fcabb089cf280051732dec116f0
Author: Duncan Laurie <dlaurie at chromium.org>
Date:   Mon Sep 29 13:04:06 2014 -0700

    chromeec: Fix logging of EC wake events
    
    The EC behavior for reading events from the ACPI interface was broken
    with this commit:
    
    d899fda lpc: ACPI query-next-event drops masked events
    https://chromium-review.googlesource.com/194935
    
    This is causing no EC wake events to be logged.  To make sure they are
    logged once again set the wake mask before querying for events.
    
    Also remove the check for port80 event logging since this is no longer
    used as we now store the port80 code in CMOS and this is unnecessary
    commands to do for the resume path.
    
    BUG=chrome-os-partner:32462
    BRANCH=samus,auron
    TEST=build and boot on samus, check for EC wake events for keyboard
    and lid in the event log.
    
    Change-Id: Ib46fc00006ff0e5777941fc3ab1d81607359c4cb
    Signed-off-by: Stefan Reinauer <reinauer at chromium.org>
    Original-Commit-Id: b4dccc03bdded8411cc1429521579ea006ec58a7
    Original-Change-Id: Icdd0c1a37a94e0cbd9fd256172324bf989e6d0dc
    Original-Signed-off-by: Duncan Laurie <dlaurie at chromium.org>
    Original-Reviewed-on: https://chromium-review.googlesource.com/220373
    Original-Reviewed-by: Aaron Durbin <adurbin at chromium.org>
---
 src/ec/google/chromeec/ec.c | 33 ++++++---------------------------
 1 file changed, 6 insertions(+), 27 deletions(-)

diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c
index a329b5d..83c22d3 100644
--- a/src/ec/google/chromeec/ec.c
+++ b/src/ec/google/chromeec/ec.c
@@ -379,43 +379,22 @@ u32 google_chromeec_get_wake_mask(void)
 		EC_CMD_HOST_EVENT_GET_WAKE_MASK);
 }
 
-#if CONFIG_ELOG
-/* Find the last port80 code from the previous boot */
-static u16 google_chromeec_get_port80_last_boot(void)
-{
-	struct ec_response_port80_last_boot rsp;
-	struct chromeec_command cmd = {
-		.cmd_code = EC_CMD_PORT80_LAST_BOOT,
-		.cmd_data_out = &rsp,
-		.cmd_size_out = sizeof(rsp),
-	};
-
-	/* Get last port80 code */
-	if (google_chromeec_command(&cmd) == 0)
-		return rsp.code;
-
-	return 0;
-}
-#endif
-
 void google_chromeec_log_events(u32 mask)
 {
 #if CONFIG_ELOG
 	u8 event;
-	u16 code;
-
-	/* Find the last port80 code */
-	code = google_chromeec_get_port80_last_boot();
+	u32 wake_mask;
 
-	/* Log the last post code only if it is abornmal */
-	if (code > 0 && code != POST_OS_BOOT && code != POST_OS_RESUME)
-		printk(BIOS_DEBUG, "Chrome EC: Last POST code was 0x%02x\n",
-		       code);
+	/* Set wake mask so events will be read from ACPI interface */
+	wake_mask = google_chromeec_get_wake_mask();
+	google_chromeec_set_wake_mask(mask);
 
 	while ((event = google_chromeec_get_event()) != 0) {
 		if (EC_HOST_EVENT_MASK(event) & mask)
 			elog_add_event_byte(ELOG_TYPE_EC_EVENT, event);
 	}
+
+	google_chromeec_set_wake_mask(wake_mask);
 #endif
 }
 



More information about the coreboot-gerrit mailing list