Krzysztof M Sywula has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31894
Change subject: soc/intel/cannonlake: Enable shutdown before OS ......................................................................
soc/intel/cannonlake: Enable shutdown before OS
This change enables user to shutdown the system by shortly pressing shutdown button (<10sec) before OS is loaded. Main use case is shutdown from recovery/broken screen.
Tested on Fircrest SKU2-3 (Whisky Lake EVT board)
Change-Id: I7655daf65ff058df7d9bad4567f74b4f4007acb4 Signed-off-by: Krzysztof Sywula krzysztof.m.sywula@intel.com --- M src/soc/intel/cannonlake/pmc.c 1 file changed, 15 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/31894/1
diff --git a/src/soc/intel/cannonlake/pmc.c b/src/soc/intel/cannonlake/pmc.c index 931c4af..5cd31f9 100644 --- a/src/soc/intel/cannonlake/pmc.c +++ b/src/soc/intel/cannonlake/pmc.c @@ -62,6 +62,21 @@ pmc_set_afterg3(PCH_DEV_PMC, CONFIG_MAINBOARD_POWER_FAILURE_STATE); }
+static void pm1_enable_pwrbtn_smi(void *unused) +{ + /* + * Enable power button SMI only before jumping to payload. This ensures + * that: + * 1. Power button SMI is enabled only after coreboot is done. + * 2. On resume path, power button SMI is not enabled and thus avoids + * any shutdowns because of power button presses due to power button + * press in resume path. + */ + pmc_update_pm1_enable(PWRBTN_EN); +} + +BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_LOAD, BS_ON_EXIT, pm1_enable_pwrbtn_smi, NULL); + static void config_deep_sX(uint32_t offset, uint32_t mask, int sx, int enable) { uint32_t reg;
Lijian Zhao has uploaded a new patch set (#2) to the change originally created by Krzysztof M Sywula. ( https://review.coreboot.org/c/coreboot/+/31894 )
Change subject: soc/intel/cannonlake: Enable power button smi in pre-OS ......................................................................
soc/intel/cannonlake: Enable power button smi in pre-OS
This change enables user to shutdown the system by shortly press power button (<10sec) before OS is loaded. Main use case is shutdown from recovery/broken screen.
BUG=N/A TEST=Boot up into recovery screen on Sarien platform, press power button once, and system can shutdown immediatelly.
Change-Id: I7655daf65ff058df7d9bad4567f74b4f4007acb4 Signed-off-by: Krzysztof Sywula krzysztof.m.sywula@intel.com --- M src/soc/intel/cannonlake/pmc.c 1 file changed, 15 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/31894/2
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31894 )
Change subject: soc/intel/cannonlake: Enable power button smi in pre-OS ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/#/c/31894/2/src/soc/intel/cannonlake/pmc.c File src/soc/intel/cannonlake/pmc.c:
https://review.coreboot.org/#/c/31894/2/src/soc/intel/cannonlake/pmc.c@68 PS2, Line 68: only before jumping to payload Wouldn't you need to remove enabling of power button smi from here: https://review.coreboot.org/cgit/coreboot.git/tree/src/soc/intel/cannonlake/...
Hello Pratikkumar V Prajapati, Shaunak Saha, Patrick Rudolph, Subrata Banik, Duncan Laurie, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/31894
to look at the new patch set (#3).
Change subject: soc/intel/cannonlake: Enable power button smi in pre-OS ......................................................................
soc/intel/cannonlake: Enable power button smi in pre-OS
This change enables user to shutdown the system by shortly pressing power button (<10sec) before OS is loaded. Main use case is shutdown from recovery/broken screen.
BUG=N/A TEST=Boot up into recovery screen on Sarien platform, press power button once, and system should shutdown immediatelly.
Change-Id: I7655daf65ff058df7d9bad4567f74b4f4007acb4 Signed-off-by: Krzysztof Sywula krzysztof.m.sywula@intel.com --- M src/soc/intel/cannonlake/cpu.c M src/soc/intel/cannonlake/pmc.c 2 files changed, 16 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/31894/3
Krzysztof M Sywula has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31894 )
Change subject: soc/intel/cannonlake: Enable power button smi in pre-OS ......................................................................
Patch Set 3:
Patch Set 2:
(1 comment)
You are right. I uploaded 3rd patchset. Now cannonlake is mirroring skylake.
Lijian Zhao has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31894 )
Change subject: soc/intel/cannonlake: Enable power button smi in pre-OS ......................................................................
Patch Set 3: Code-Review+2
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31894 )
Change subject: soc/intel/cannonlake: Enable power button smi in pre-OS ......................................................................
Patch Set 3: Code-Review+2
Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/31894 )
Change subject: soc/intel/cannonlake: Enable power button smi in pre-OS ......................................................................
soc/intel/cannonlake: Enable power button smi in pre-OS
This change enables user to shutdown the system by shortly pressing power button (<10sec) before OS is loaded. Main use case is shutdown from recovery/broken screen.
BUG=N/A TEST=Boot up into recovery screen on Sarien platform, press power button once, and system should shutdown immediatelly.
Change-Id: I7655daf65ff058df7d9bad4567f74b4f4007acb4 Signed-off-by: Krzysztof Sywula krzysztof.m.sywula@intel.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/31894 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Lijian Zhao lijian.zhao@intel.com Reviewed-by: Furquan Shaikh furquan@google.com --- M src/soc/intel/cannonlake/cpu.c M src/soc/intel/cannonlake/pmc.c 2 files changed, 16 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Furquan Shaikh: Looks good to me, approved Lijian Zhao: Looks good to me, approved
diff --git a/src/soc/intel/cannonlake/cpu.c b/src/soc/intel/cannonlake/cpu.c index 6bedb81..7c06d25 100644 --- a/src/soc/intel/cannonlake/cpu.c +++ b/src/soc/intel/cannonlake/cpu.c @@ -456,7 +456,7 @@ * Now that all APs have been relocated as well as the BSP let SMIs * start flowing. */ - smm_southbridge_enable(PWRBTN_EN | GBL_EN); + smm_southbridge_enable(GBL_EN);
/* Lock down the SMRAM space. */ smm_lock(); diff --git a/src/soc/intel/cannonlake/pmc.c b/src/soc/intel/cannonlake/pmc.c index 931c4af..5cd31f9 100644 --- a/src/soc/intel/cannonlake/pmc.c +++ b/src/soc/intel/cannonlake/pmc.c @@ -62,6 +62,21 @@ pmc_set_afterg3(PCH_DEV_PMC, CONFIG_MAINBOARD_POWER_FAILURE_STATE); }
+static void pm1_enable_pwrbtn_smi(void *unused) +{ + /* + * Enable power button SMI only before jumping to payload. This ensures + * that: + * 1. Power button SMI is enabled only after coreboot is done. + * 2. On resume path, power button SMI is not enabled and thus avoids + * any shutdowns because of power button presses due to power button + * press in resume path. + */ + pmc_update_pm1_enable(PWRBTN_EN); +} + +BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_LOAD, BS_ON_EXIT, pm1_enable_pwrbtn_smi, NULL); + static void config_deep_sX(uint32_t offset, uint32_t mask, int sx, int enable) { uint32_t reg;