summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2012-09-06 14:57:54 -0700
committerTom Wai-Hong Tam <waihong@chromium.org>2012-09-07 01:09:23 -0700
commit003bdd249ed089adb6bf7256f134d2a52f56b82e (patch)
treeb9806601c4016a2fd24e734f2b68a6966919422c
parentcd9118496c69b473b937197354700ffd8a948e06 (diff)
downloadvboot-003bdd249ed089adb6bf7256f134d2a52f56b82e.tar.gz
Remove power button work-around for ARM
On x86 U-Boot cannot see the power button, which means that the EC must deal with it, and may power off the unit at any time. To get around this, we write the vbcontext every time we change it. Since this isn't a problem on ARM, and we want to avoid spurious writes (due to delay and disk wear), make this code execute only on x86 machines. BUG=chrome-os-partner:13717 BUG=chrome-os-partner:7689 BRANCH=snow,link TEST=manual On snow, see that the EC no longer gets MKBP messages to write the nv context. On link, manually add a print to U-Boot's nvstorage_write_disk() function and see that changing language in recovery still causes a write. Original-Change-Id: I62508739c9fc3aca46fba58b196a8af45269af2a Reviewed-on: https://gerrit.chromium.org/gerrit/32464 Commit-Ready: Tom Wai-Hong Tam <waihong@chromium.org> Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org> Tested-by: Tom Wai-Hong Tam <waihong@chromium.org> (cherry picked from commit 985e90e26320c73949d5dfbf218773f2cb744598) Change-Id: I2e47e5880101d581aebc2a6a6d433ccfc0be852e Reviewed-on: https://gerrit.chromium.org/gerrit/32525 Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org> Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
-rw-r--r--firmware/Makefile6
-rw-r--r--firmware/lib/vboot_display.c8
2 files changed, 9 insertions, 5 deletions
diff --git a/firmware/Makefile b/firmware/Makefile
index 811c158b..87971c85 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -42,6 +42,12 @@ CFLAGS += -DTPM_BLOCKING_CONTINUESELFTEST
ifeq ($(FIRMWARE_ARCH),i386)
CFLAGS += -DUNROLL_LOOPS
+
+# Workaround for coreboot on x86, which will power off asynchronously
+# without giving us a chance to react. This is not an example of the Right
+# Way to do things. See chrome-os-partner:7689, and the commit message
+# that made this change.
+CFLAGS += -DRANDOM_POWER_OFF
endif
INCLUDES = \
diff --git a/firmware/lib/vboot_display.c b/firmware/lib/vboot_display.c
index b15b5183..5c45ae1e 100644
--- a/firmware/lib/vboot_display.c
+++ b/firmware/lib/vboot_display.c
@@ -632,14 +632,12 @@ VbError_t VbCheckDisplayKey(VbCommonParams* cparams, uint32_t key,
loc = (loc > 0 ? loc - 1 : count - 1);
VBDEBUG(("VbCheckDisplayKey() - change localization to %d\n", (int)loc));
VbNvSet(vncptr, VBNV_LOCALIZATION_INDEX, loc);
- /* Workaround for coreboot on x86, which will power off asynchronously
- * without giving us a chance to react. This is not an example of the Right
- * Way to do things. See chrome-os-partner:7689, and the commit message
- * that made this change.
- */
+
+#ifdef RANDOM_POWER_OFF
VbNvTeardown(vncptr); /* really only computes checksum */
if (vncptr->raw_changed)
VbExNvStorageWrite(vncptr->raw);
+#endif
/* Force redraw of current screen */
return VbDisplayScreen(cparams, disp_current_screen, 1, vncptr);