mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-25 02:35:22 +00:00
LoadFirmware() and LoadKernel() handling for test errors
Change-Id: Icecfcab8f5cc30e80da7a2d77a1b1729f5094fee R=wfrichar@chromium.org BUG=13107 TEST=make && make runtests Review URL: http://codereview.chromium.org/6673048
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user