summaryrefslogtreecommitdiff
path: root/src/mainboard/google
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2013-04-25 19:49:40 +0800
committerHung-Te Lin <hungte@chromium.org>2013-04-29 15:34:10 +0200
commit3f73eec4d3ea2bfdbece083dc0b8721e458b46fb (patch)
treeccac2960ad43fe37693bce2720fb1c331fc94de0 /src/mainboard/google
parent31039e315c78b1b8a2cbef108ec4c07cb95c5e60 (diff)
downloadcoreboot-3f73eec4d3ea2bfdbece083dc0b8721e458b46fb.tar.xz
Google/Snow: Enable suspend/resume.
Add the suspend/resume feature into bootblock and romstage. Note, resuming with X and touchpad driver may be still unstable. Verified by building and booting successfully on Google/Snow, and then executing the "suspend_stress_test" in text mode ("stop ui; suspend_stress_test") in Chromium OS, passed at least 20 iterations. Change-Id: I65681c42eeef2736e55bb906595f42a5b1dfdf11 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: http://review.coreboot.org/3102 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/mainboard/google')
-rw-r--r--src/mainboard/google/snow/bootblock.c18
-rw-r--r--src/mainboard/google/snow/romstage.c13
2 files changed, 23 insertions, 8 deletions
diff --git a/src/mainboard/google/snow/bootblock.c b/src/mainboard/google/snow/bootblock.c
index d2e0b50b54..09edbadc85 100644
--- a/src/mainboard/google/snow/bootblock.c
+++ b/src/mainboard/google/snow/bootblock.c
@@ -25,16 +25,24 @@
#include <console/console.h>
#include <cpu/samsung/exynos5250/periph.h>
#include <cpu/samsung/exynos5250/pinmux.h>
+#include "mainboard.h"
void bootblock_mainboard_init(void);
void bootblock_mainboard_init(void)
{
- /* kick off the microsecond timer. We want to do this as early
- * as we can.
- */
- timer_start();
+ switch (snow_get_wakeup_state()) {
+ case SNOW_WAKEUP_DIRECT:
+ snow_wakeup();
+ break;
- exynos_pinmux_config(PERIPH_ID_SPI1, PINMUX_FLAG_NONE);
+ case SNOW_IS_NOT_WAKEUP:
+ /* kick off the microsecond timer.
+ * We want to do this as early as we can.
+ */
+ timer_start();
+ exynos_pinmux_config(PERIPH_ID_SPI1, PINMUX_FLAG_NONE);
+ break;
+ }
#if CONFIG_EARLY_CONSOLE
exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE);
console_init();
diff --git a/src/mainboard/google/snow/romstage.c b/src/mainboard/google/snow/romstage.c
index fd5cfcec4c..f131e81c8f 100644
--- a/src/mainboard/google/snow/romstage.c
+++ b/src/mainboard/google/snow/romstage.c
@@ -170,15 +170,22 @@ void main(void)
{
struct mem_timings *mem;
void *entry;
+ int is_resume = (snow_get_wakeup_state() != SNOW_IS_NOT_WAKEUP);
/* Clock must be initialized before console_init, otherwise you may need
* to re-initialize serial console drivers again. */
mem = snow_setup_clock();
- console_init();
- snow_setup_power();
+ if (!is_resume) {
+ console_init();
+ snow_setup_power();
+ }
+
+ snow_setup_memory(mem, is_resume);
- snow_setup_memory(mem, 0);
+ if (is_resume) {
+ snow_wakeup();
+ }
snow_setup_storage();
snow_setup_gpio();