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

Unified Diff: firmware/lib/vboot_kernel.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/lib/vboot_firmware.c ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: firmware/lib/vboot_kernel.c
diff --git a/firmware/lib/vboot_kernel.c b/firmware/lib/vboot_kernel.c
index ee2890cfcd38ecc70a1dee670c5b031fb0bdfe1e..faa9c48a7204da331204446767a4cefebf877c4f 100644
--- a/firmware/lib/vboot_kernel.c
+++ b/firmware/lib/vboot_kernel.c
@@ -135,6 +135,7 @@ int LoadKernel(LoadKernelParams* params) {
uint64_t lowest_version = 0xFFFFFFFF;
int rec_switch, dev_switch;
BootMode boot_mode;
+ uint32_t test_err = 0;
uint32_t status;
/* TODO: differentiate between finding an invalid kernel (found_partitions>0)
@@ -156,6 +157,29 @@ int LoadKernel(LoadKernelParams* params) {
goto LoadKernelExit;
}
+ /* Handle test errors */
+ VbNvGet(vnc, VBNV_TEST_ERROR_FUNC, &test_err);
+ if (VBNV_TEST_ERROR_LOAD_KERNEL == 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_KERNEL_RECOVERY:
+ recovery = VBNV_RECOVERY_RW_TEST_LK;
+ goto LoadKernelExit;
+ case LOAD_KERNEL_NOT_FOUND:
+ case LOAD_KERNEL_INVALID:
+ case LOAD_KERNEL_REBOOT:
+ retval = test_err;
+ goto LoadKernelExit;
+ default:
+ break;
+ }
+ }
+
/* Initialization */
blba = params->bytes_per_lba;
kbuf_sectors = KBUF_SIZE / blba;
« no previous file with comments | « firmware/lib/vboot_firmware.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698