[coreboot-gerrit] Change in coreboot[master]: soc/intel/apollolake: Enable logging for wake sources in S0ix

Furquan Shaikh (Code Review) gerrit at coreboot.org
Mon Jun 25 23:32:55 CEST 2018


Furquan Shaikh has uploaded this change for review. ( https://review.coreboot.org/27234


Change subject: soc/intel/apollolake: Enable logging for wake sources in S0ix
......................................................................

soc/intel/apollolake: Enable logging for wake sources in S0ix

This change adds GSMI callback elog_gsmi_cb_platform_log_wake_source
to enable wake source logging from S0ix on APL/GLK. Additionally,
elog.c is added to smm stage.

BUG=b:79449585
TEST=Verified that S0ix entry/exit events are added to eventlog:

=========== Power button ============
59 | 2018-06-25 14:01:11 | S0ix Enter
60 | 2018-06-25 14:01:30 | S0ix Exit
61 | 2018-06-25 14:02:00 | Wake Source | Power Button | 0

=========== Lid open ================
62 | 2018-06-25 14:02:36 | S0ix Enter
63 | 2018-06-25 14:02:56 | S0ix Exit
64 | 2018-06-25 14:03:26 | Wake Source | GPE # | 15
65 | 2018-06-25 14:03:32 | Wake Source | GPE # | 65
66 | 2018-06-25 14:03:37 | EC Event | Lid Open

=========== Trackpad ================
67 | 2018-06-25 14:04:20 | S0ix Enter
68 | 2018-06-25 14:04:33 | S0ix Exit
69 | 2018-06-25 14:05:03 | Wake Source | GPE # | 15
70 | 2018-06-25 14:05:08 | Wake Source | GPE # | 66

Change-Id: I005de58c73d00dc9d7e64f1459f6d786792b94db
Signed-off-by: Furquan Shaikh <furquan at google.com>
---
M src/soc/intel/apollolake/Makefile.inc
M src/soc/intel/apollolake/elog.c
2 files changed, 12 insertions(+), 1 deletion(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/34/27234/1

diff --git a/src/soc/intel/apollolake/Makefile.inc b/src/soc/intel/apollolake/Makefile.inc
index 9b09b09..cb66365 100644
--- a/src/soc/intel/apollolake/Makefile.inc
+++ b/src/soc/intel/apollolake/Makefile.inc
@@ -43,6 +43,7 @@
 smm-y += smihandler.c
 smm-y += spi.c
 smm-$(CONFIG_SOC_UART_DEBUG) += uart.c
+smm-y += elog.c
 
 ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi.c
 ramstage-y += cpu.c
diff --git a/src/soc/intel/apollolake/elog.c b/src/soc/intel/apollolake/elog.c
index 1e9b7d8..cbd13a8 100644
--- a/src/soc/intel/apollolake/elog.c
+++ b/src/soc/intel/apollolake/elog.c
@@ -18,6 +18,7 @@
 #include <cbmem.h>
 #include <console/console.h>
 #include <elog.h>
+#include <intelblocks/pmclib.h>
 #include <soc/pm.h>
 #include <soc/pci_devs.h>
 #include <stdint.h>
@@ -57,7 +58,8 @@
 		elog_add_event_wake(ELOG_WAKE_SOURCE_SMBUS, 0);
 
 	/* ACPI Wake Event - Always Log prev_sleep_state*/
-	elog_add_event_byte(ELOG_TYPE_ACPI_WAKE, ps->prev_sleep_state);
+	if (ps->prev_sleep_state != ACPI_S0)
+		elog_add_event_byte(ELOG_TYPE_ACPI_WAKE, ps->prev_sleep_state);
 
 	/* Log GPIO events in set A-D */
 	pch_log_gpio_gpe(ps->gpe0_sts[GPE0_A], ps->gpe0_en[GPE0_A], 0);
@@ -105,3 +107,11 @@
 	if (ps->prev_sleep_state > ACPI_S0)
 		pch_log_wake_source(ps);
 }
+
+void elog_gsmi_cb_platform_log_wake_source(void)
+{
+	struct chipset_power_state ps;
+
+	pmc_fill_pm_reg_info(&ps);
+	pch_log_wake_source(&ps);
+}

-- 
To view, visit https://review.coreboot.org/27234
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I005de58c73d00dc9d7e64f1459f6d786792b94db
Gerrit-Change-Number: 27234
Gerrit-PatchSet: 1
Gerrit-Owner: Furquan Shaikh <furquan at google.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180625/6c3ce07e/attachment.html>


More information about the coreboot-gerrit mailing list