From 8602d0e2aa0063aba2437957970fd8f1bd875108 Mon Sep 17 00:00:00 2001 From: Sean Rhodes Date: Sun, 18 Jan 2026 21:18:35 +0000 Subject: [PATCH] soc/intel/common/block/smm: Keep selected wake sources enabled in S5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The generic Intel SMM S5 entry path disables all GPEs before asserting SLP_EN, which clears OS-armed wake enables (e.g. LAN_WAKE) and prevents Wake-on-LAN from S5. Add a mainboard override hook, mainboard_smi_sleep_finalize(), called after the S5 teardown but before SLP_EN is asserted, allowing boards to restore required wake sources. Change-Id: I9e97308ed94961fc4c08a10714b1b53f198bb593 Signed-off-by: Sean Rhodes Reviewed-on: https://review.coreboot.org/c/coreboot/+/90792 Tested-by: build bot (Jenkins) Reviewed-by: Matt DeVillier Reviewed-by: Jérémy Compostella --- src/cpu/x86/smm/smm_module_handler.c | 1 + src/include/cpu/x86/smm.h | 1 + src/soc/intel/common/block/smm/smihandler.c | 3 +++ 3 files changed, 5 insertions(+) diff --git a/src/cpu/x86/smm/smm_module_handler.c b/src/cpu/x86/smm/smm_module_handler.c index d9f64204d6..8bcda32b33 100644 --- a/src/cpu/x86/smm/smm_module_handler.c +++ b/src/cpu/x86/smm/smm_module_handler.c @@ -226,6 +226,7 @@ void __weak southbridge_smi_handler(void) {} void __weak mainboard_smi_gpi(u32 gpi_sts) {} int __weak mainboard_smi_apmc(u8 data) { return 0; } void __weak mainboard_smi_sleep(u8 slp_typ) {} +void __weak mainboard_smi_sleep_finalize(u8 slp_typ) {} void __weak mainboard_smi_finalize(void) {} void __weak smm_soc_early_init(void) {} diff --git a/src/include/cpu/x86/smm.h b/src/include/cpu/x86/smm.h index b552d33b5a..8c41623817 100644 --- a/src/include/cpu/x86/smm.h +++ b/src/include/cpu/x86/smm.h @@ -61,6 +61,7 @@ void southbridge_smi_handler(void); void mainboard_smi_gpi(u32 gpi_sts); int mainboard_smi_apmc(u8 data); void mainboard_smi_sleep(u8 slp_typ); +void mainboard_smi_sleep_finalize(u8 slp_typ); void mainboard_smi_finalize(void); int mainboard_set_smm_log_level(void); diff --git a/src/soc/intel/common/block/smm/smihandler.c b/src/soc/intel/common/block/smm/smihandler.c index 59489a4f03..cd78de26c3 100644 --- a/src/soc/intel/common/block/smm/smihandler.c +++ b/src/soc/intel/common/block/smm/smihandler.c @@ -220,6 +220,9 @@ void smihandler_southbridge_sleep( break; } + /* Allow mainboard to restore wake sources (e.g. for S5 WOL). */ + mainboard_smi_sleep_finalize(slp_typ); + /* * Write back to the SLP register to cause the originally intended * event again. We need to set BIT13 (SLP_EN) though to make the