soc/intel/cannonlake: Add support for logging wake source in SMM

This patch adds support for logging wake source information in gsmi
callbacks. With this change, all the elog logging infrastructure can
be used for S0ix as well as S3 on cannonlake.

BUG=b:124131938
BRANCH=none
TEST=Verified that the wake events are logged during the S0ix resume:
6 | 2019-03-04 17:03:13 | S0ix Enter
7 | 2019-03-04 17:03:17 | S0ix Exit
8 | 2019-03-04 17:03:17 | Wake Source | RTC Alarm | 0
9 | 2019-03-04 17:03:55 | S0ix Enter
10 | 2019-03-04 17:03:56 | S0ix Exit
11 | 2019-03-04 17:03:56 | Wake Source | GPE # | 21
12 | 2019-03-04 17:04:36 | S0ix Enter
13 | 2019-03-04 17:04:45 | S0ix Exit
14 | 2019-03-04 17:04:45 | Wake Source | GPE # | 112
15 | 2019-03-04 17:05:01 | S0ix Enter
16 | 2019-03-04 17:05:09 | S0ix Exit
17 | 2019-03-04 17:05:09 | Wake Source | Power Button | 0

Change-Id: Id627843e22c2524dfa94395b780cf2134f386137
Signed-off-by: V Sowmya <v.sowmya@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/31788
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
V Sowmya 2019-03-06 17:32:45 +05:30 committed by Patrick Georgi
parent 5fe77af206
commit 91b027a351
2 changed files with 8 additions and 0 deletions

View File

@ -55,6 +55,7 @@ ramstage-y += uart.c
ramstage-y += vr_config.c
ramstage-y += sd.c
smm-y += elog.c
smm-y += p2sb.c
smm-y += pmutil.c
smm-y += smihandler.c

View File

@ -123,3 +123,10 @@ static void pch_log_state(void *unused)
}
BOOT_STATE_INIT_ENTRY(BS_DEV_INIT, BS_ON_EXIT, pch_log_state, NULL);
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);
}