[coreboot-gerrit] Patch set updated for coreboot: f4776e9 RTC: Skip rtc_init() in S3 resume path

Stefan Reinauer (stefan.reinauer@coreboot.org) gerrit at coreboot.org
Wed Nov 20 01:50:36 CET 2013


Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4206

-gerrit

commit f4776e9cd9335d1287f7ee63356ea94d1948dcf1
Author: Stefan Reinauer <reinauer at chromium.org>
Date:   Tue May 28 12:37:08 2013 -0700

    RTC: Skip rtc_init() in S3 resume path
    
    In addition to not clearing the pending interrupts, we also
    don't want to reset the RTC control register when booting
    with an S3 resume.
    
    On most new systems, when the RTC well is losing power, we
    will also lose state that is required to perform a resume,
    so we end up in a normal boot anyways. Hence don't do any
    RTC initialization in the S3 resume path.
    
    Signed-off-by: Stefan Reinauer <reinauer at google.com>
    
    Change-Id: I73b486082faa741e9dccd15f2b8e3a8399c98f80
    Reviewed-on: https://gerrit.chromium.org/gerrit/56826
    Reviewed-by: Duncan Laurie <dlaurie at chromium.org>
    Reviewed-by: Aaron Durbin <adurbin at chromium.org>
    Reviewed-by: Derek Basehore <dbasehore at chromium.org>
    Commit-Queue: Stefan Reinauer <reinauer at google.com>
    Tested-by: Stefan Reinauer <reinauer at google.com>
---
 src/drivers/pc80/mc146818rtc.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/drivers/pc80/mc146818rtc.c b/src/drivers/pc80/mc146818rtc.c
index be52454..79aba27 100644
--- a/src/drivers/pc80/mc146818rtc.c
+++ b/src/drivers/pc80/mc146818rtc.c
@@ -71,6 +71,17 @@ void rtc_init(int invalid)
 	unsigned char x;
 #endif
 
+#if CONFIG_HAVE_ACPI_RESUME
+	/*
+	 * Avoid clearing pending interrupts and resetting the RTC control
+	 * register in the resume path because the Linux kernel relies on
+	 * this to know if it should restart the RTC timer queue if the wake
+	 * was due to the RTC alarm.
+	 */
+	if (acpi_slp_type == 3)
+		return;
+#endif
+
 	printk(BIOS_DEBUG, "RTC Init\n");
 
 #if CONFIG_USE_OPTION_TABLE
@@ -128,16 +139,6 @@ void rtc_init(int invalid)
                         PC_CKS_RANGE_END,PC_CKS_LOC);
 #endif
 
-#if CONFIG_HAVE_ACPI_RESUME
-	/*
-	 * Avoid clearing pending interrupts in the resume path because
-	 * the Linux kernel relies on this to know if it should restart
-	 * the RTC timer queue if the wake was due to the RTC alarm.
-	 */
-	if (acpi_slp_type == 3)
-		return;
-#endif
-
 	/* Clear any pending interrupts */
 	(void) cmos_read(RTC_INTR_FLAGS);
 }



More information about the coreboot-gerrit mailing list