Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: firmware/lib/vboot_nvstorage.c

Issue 6719005: Cherry-pick vboot_reference files from TOT to support crossystem (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@0.11.257.B
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « firmware/lib/vboot_kernel.c ('k') | firmware/linktest/main.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: firmware/lib/vboot_nvstorage.c
diff --git a/firmware/lib/vboot_nvstorage.c b/firmware/lib/vboot_nvstorage.c
index 419a9fbc1bfa485eabc6b8bf185c9f3492a41656..575fcb98fadff5805e44c44705d26e2f30362fb6 100644
--- a/firmware/lib/vboot_nvstorage.c
+++ b/firmware/lib/vboot_nvstorage.c
@@ -27,8 +27,9 @@
#define LOCALIZATION_OFFSET 3
#define FIRMWARE_FLAGS_OFFSET 5
-#define FIRMWARE_TRIED_FIRMWARE_B 0x80
-#define FIRMWARE_FW_VERIFIED_KERNEL_KEY 0x40
+#define FIRMWARE_TEST_ERR_FUNC_MASK 0x38
+#define FIRMWARE_TEST_ERR_FUNC_SHIFT 3
+#define FIRMWARE_TEST_ERR_NUM_MASK 0x07
#define KERNEL_FIELD_OFFSET 11
#define CRC_OFFSET 15
@@ -125,13 +126,13 @@ int VbNvGet(VbNvContext* context, VbNvParam param, uint32_t* dest) {
| (raw[KERNEL_FIELD_OFFSET + 3] << 24));
return 0;
- case VBNV_TRIED_FIRMWARE_B:
- *dest = (raw[FIRMWARE_FLAGS_OFFSET] & FIRMWARE_TRIED_FIRMWARE_B ? 1 : 0);
+ case VBNV_TEST_ERROR_FUNC:
+ *dest = (raw[FIRMWARE_FLAGS_OFFSET] & FIRMWARE_TEST_ERR_FUNC_MASK)
+ >> FIRMWARE_TEST_ERR_FUNC_SHIFT;
return 0;
- case VBNV_FW_VERIFIED_KERNEL_KEY:
- *dest = (raw[FIRMWARE_FLAGS_OFFSET] & FIRMWARE_FW_VERIFIED_KERNEL_KEY ?
- 1 : 0);
+ case VBNV_TEST_ERROR_NUM:
+ *dest = raw[FIRMWARE_FLAGS_OFFSET] & FIRMWARE_TEST_ERR_NUM_MASK;
return 0;
default:
@@ -201,18 +202,15 @@ int VbNvSet(VbNvContext* context, VbNvParam param, uint32_t value) {
raw[KERNEL_FIELD_OFFSET + 3] = (uint8_t)(value >> 24);
break;
- case VBNV_TRIED_FIRMWARE_B:
- if (value)
- raw[FIRMWARE_FLAGS_OFFSET] |= FIRMWARE_TRIED_FIRMWARE_B;
- else
- raw[FIRMWARE_FLAGS_OFFSET] &= ~FIRMWARE_TRIED_FIRMWARE_B;
+ case VBNV_TEST_ERROR_FUNC:
+ raw[FIRMWARE_FLAGS_OFFSET] &= ~FIRMWARE_TEST_ERR_FUNC_MASK;
+ raw[FIRMWARE_FLAGS_OFFSET] |= (value << FIRMWARE_TEST_ERR_FUNC_SHIFT)
+ & FIRMWARE_TEST_ERR_FUNC_MASK;
break;
- case VBNV_FW_VERIFIED_KERNEL_KEY:
- if (value)
- raw[FIRMWARE_FLAGS_OFFSET] |= FIRMWARE_FW_VERIFIED_KERNEL_KEY;
- else
- raw[FIRMWARE_FLAGS_OFFSET] &= ~FIRMWARE_FW_VERIFIED_KERNEL_KEY;
+ case VBNV_TEST_ERROR_NUM:
+ raw[FIRMWARE_FLAGS_OFFSET] &= ~FIRMWARE_TEST_ERR_NUM_MASK;
+ raw[FIRMWARE_FLAGS_OFFSET] |= (value & FIRMWARE_TEST_ERR_NUM_MASK);
break;
default:
« no previous file with comments | « firmware/lib/vboot_kernel.c ('k') | firmware/linktest/main.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698