summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2015-03-25 14:50:02 -0700
committerPatrick Sosinski <sosinski@google.com>2015-05-07 22:23:37 +0000
commit38e1db535f9fb674e98868eff4b3b2cb04419baa (patch)
treefc1c97fbdf8158b7916169318370ac8c747defbf
parent8803c1805f0e4378770ef72489f85196a6a31f34 (diff)
downloadvboot-stabilize-6812.85.B.tar.gz
crossystem: provide a way to clear wipeout requeststabilize-6812.85.B
For test purposes it should be possible to clear the wipeout request raised by firmware. BRANCH=none BUG=chrome-os-partner:36059 TEST=verified that crossystem wipeout_request=0 changes the bit from 1 to 0, and wipeout_request=1 does not change it from 0 to 1. Change-Id: Ic45ec03ed3e40e6fee4244804b8c231ee88af95b Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/262466 Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit 52ec0758968d779e3bbacfa0ac988af0624fb274) Reviewed-on: https://chromium-review.googlesource.com/270005 Reviewed-by: Patrick Sosinski <sosinski@google.com> Commit-Queue: Patrick Sosinski <sosinski@google.com> Tested-by: Patrick Sosinski <sosinski@google.com>
-rw-r--r--firmware/lib/vboot_nvstorage.c7
-rw-r--r--host/lib/crossystem.c3
-rw-r--r--utility/crossystem.c2
3 files changed, 11 insertions, 1 deletions
diff --git a/firmware/lib/vboot_nvstorage.c b/firmware/lib/vboot_nvstorage.c
index 9d99b1c7..af24fac1 100644
--- a/firmware/lib/vboot_nvstorage.c
+++ b/firmware/lib/vboot_nvstorage.c
@@ -366,6 +366,13 @@ int VbNvSet(VbNvContext *context, VbNvParam param, uint32_t value)
raw[BOOT2_OFFSET] |= (uint8_t)value << BOOT2_PREV_RESULT_SHIFT;
break;
+ case VBNV_FW_REQ_WIPEOUT:
+ if (value)
+ raw[HEADER_OFFSET] |= HEADER_WIPEOUT;
+ else
+ raw[HEADER_OFFSET] &= ~HEADER_WIPEOUT;
+ break;
+
default:
return 1;
}
diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c
index 1eef737b..bf4cb542 100644
--- a/host/lib/crossystem.c
+++ b/host/lib/crossystem.c
@@ -610,6 +610,9 @@ int VbSetSystemPropertyInt(const char* name, int value) {
return VbSetNvStorage(VBNV_FW_TRY_COUNT, value);
} else if (!strcasecmp(name,"oprom_needed")) {
return VbSetNvStorage(VBNV_OPROM_NEEDED, value);
+ } else if (!strcasecmp(name,"wipeout_request")) {
+ /* Can only clear this flag, set only by firmware. */
+ return VbSetNvStorage(VBNV_FW_REQ_WIPEOUT, 0);
} else if (!strcasecmp(name,"backup_nvram_request")) {
/* Best-effort only, since it requires firmware and TPM support. */
return VbSetNvStorage(VBNV_BACKUP_NVRAM_REQUEST, value);
diff --git a/utility/crossystem.c b/utility/crossystem.c
index adc828d7..d1623811 100644
--- a/utility/crossystem.c
+++ b/utility/crossystem.c
@@ -94,7 +94,7 @@ const Param sys_param_list[] = {
{"vdat_lkdebug", IS_STRING|NO_PRINT_ALL,
"LoadKernel() debug data (not in print-all)"},
{"vdat_timers", IS_STRING, "Timer values from VbSharedData"},
- {"wipeout_request", 0, "Firmware requested factory reset (wipeout)"},
+ {"wipeout_request", CAN_WRITE, "Firmware requested factory reset (wipeout)"},
{"wpsw_boot", 0, "Firmware write protect hardware switch position at boot"},
{"wpsw_cur", 0, "Firmware write protect hardware switch current position"},
/* Terminate with null name */