[coreboot-gerrit] Patch set updated for coreboot: intel/apollolake: Set sleep type to S5 on vboot reboot request

Furquan Shaikh (furquan@google.com) gerrit at coreboot.org
Thu Jun 23 23:32:56 CEST 2016


Furquan Shaikh (furquan at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15340

-gerrit

commit 0cce3110cf25c17c6d1d7a941d001eda84b05fa8
Author: Furquan Shaikh <furquan at google.com>
Date:   Thu Jun 23 14:00:05 2016 -0700

    intel/apollolake: Set sleep type to S5 on vboot reboot request
    
    Add support for vboot_platform_prepare_reboot which is called whenever
    vboot requests reboot of the platform. SLP_TYPE needs to be set to S5 in
    such conditions since the platform would no longer be in a resuming
    state after reset.
    
    Change-Id: I01392bfda90c9274cd52c1004555d250b1d539b7
    Signed-off-by: Furquan Shaikh <furquan at google.com>
---
 src/soc/intel/apollolake/pmutil.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/soc/intel/apollolake/pmutil.c b/src/soc/intel/apollolake/pmutil.c
index 6e47911..bec18d9 100644
--- a/src/soc/intel/apollolake/pmutil.c
+++ b/src/soc/intel/apollolake/pmutil.c
@@ -365,3 +365,16 @@ int vboot_platform_is_resuming(void)
 	typ = (inl(ACPI_PMIO_BASE + PM1_CNT) & SLP_TYP) >> SLP_TYP_SHIFT;
 	return typ == SLP_TYP_S3;
 }
+
+/*
+ * The PM1 control is set to S5 when vboot requests a reboot because the power
+ * state code above may not have collected it's data yet. Therefore, set it to
+ * S5 when vboot requests a reboot. That's necessary if vboot fails in the
+ * resume path and requests a reboot. This prevents a reboot loop where the
+ * error is continually hit on the failing vboot resume path.
+ */
+void vboot_platform_prepare_reboot(void)
+{
+	const uint16_t port = ACPI_PMIO_BASE + PM1_CNT;
+	outl((inl(port) & ~(SLP_TYP)) | (SLP_TYP_S5 << SLP_TYP_SHIFT), port);
+}



More information about the coreboot-gerrit mailing list