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

Unified Diff: firmware/lib/vboot_firmware.c

Issue 6673048: LoadFirmware() and LoadKernel() handling for test errors (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: post merge 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/include/vboot_nvstorage.h ('k') | firmware/lib/vboot_kernel.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: firmware/lib/vboot_firmware.c
diff --git a/firmware/lib/vboot_firmware.c b/firmware/lib/vboot_firmware.c
index 2f358522a92c2cb5c4956d3ce1bea2369b1cbda6..bfe91866dbe5728f55f74ad201ea234875dac8dc 100644
--- a/firmware/lib/vboot_firmware.c
+++ b/firmware/lib/vboot_firmware.c
@@ -34,6 +34,7 @@ void UpdateFirmwareBodyHash(LoadFirmwareParams* params,
int LoadFirmwareSetup(void) {
+ /* TODO: handle test errors (requires passing in VbNvContext) */
/* TODO: start initializing the TPM */
return LOAD_FIRMWARE_SUCCESS;
}
@@ -50,6 +51,7 @@ int LoadFirmware(LoadFirmwareParams* params) {
uint32_t tpm_version = 0;
uint64_t lowest_version = 0xFFFFFFFF;
uint32_t status;
+ uint32_t test_err = 0;
int good_index = -1;
int is_dev;
int index;
@@ -73,6 +75,27 @@ int LoadFirmware(LoadFirmwareParams* params) {
goto LoadFirmwareExit;
}
+ /* Handle test errors */
+ VbNvGet(vnc, VBNV_TEST_ERROR_FUNC, &test_err);
+ if (VBNV_TEST_ERROR_LOAD_FIRMWARE == test_err) {
+ /* Get error code */
+ VbNvGet(vnc, VBNV_TEST_ERROR_NUM, &test_err);
+ /* Clear test params so we don't repeat the error */
+ VbNvSet(vnc, VBNV_TEST_ERROR_FUNC, 0);
+ VbNvSet(vnc, VBNV_TEST_ERROR_NUM, 0);
+ /* Handle error codes */
+ switch (test_err) {
+ case LOAD_FIRMWARE_RECOVERY:
+ recovery = VBNV_RECOVERY_RO_TEST_LF;
+ goto LoadFirmwareExit;
+ case LOAD_FIRMWARE_REBOOT:
+ retval = test_err;
+ goto LoadFirmwareExit;
+ default:
+ break;
+ }
+ }
+
/* Must have a root key from the GBB */
if (!gbb) {
VBDEBUG(("No GBB\n"));
@@ -320,6 +343,9 @@ LoadFirmwareExit:
int S3Resume(void) {
+
+ /* TODO: handle test errors (requires passing in VbNvContext) */
+
/* Resume the TPM */
uint32_t status = RollbackS3Resume();
« no previous file with comments | « firmware/include/vboot_nvstorage.h ('k') | firmware/lib/vboot_kernel.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698