Vboot wrapper - add recovery reason, refactor timing

Pressing Tab at a firmware screen now displays real data, including
the recovery reason, HWID, and contents of VbNvStorage.

Entry point start/end time tracking in VbSharedData now refers to the
new wrapper APIs.

Added capability for calling firmware to request recovery mode (for
example, if it's unable to initialize RAM, can't find the SSD, etc.).
Previously, calling firmware had no (good) way to do this other than
faking the recovery button being pressed.

BUG=chromium-os:17018
TEST=emerge on x86 and tegra2_seaboard

Change-Id: I7d377f279842b30a10d945d13571c41c464633f1
Reviewed-on: http://gerrit.chromium.org/gerrit/3814
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
Randall Spangler
2011-07-08 14:01:54 -07:00
parent 1b1998dff0
commit 9619112a57
10 changed files with 175 additions and 180 deletions

View File

@@ -20,11 +20,15 @@ VbError_t VbSelectFirmware(VbCommonParams* cparams,
VbNvContext vnc;
int rv;
/* Start timer */
shared->timer_vb_select_firmware_enter = VbExGetTimer();
/* If recovery is requested, go straight to recovery without checking the
* RW firmware. */
if (VBNV_RECOVERY_NOT_REQUESTED != shared->recovery_reason) {
VBDEBUG(("VbSelectFirmware() detected recovery request, reason=%d.\n",
(int)shared->recovery_reason));
shared->timer_vb_select_firmware_exit = VbExGetTimer();
fparams->selected_firmware = VB_SELECT_FIRMWARE_RECOVERY;
return VBERROR_SUCCESS;
}
@@ -66,6 +70,9 @@ VbError_t VbSelectFirmware(VbCommonParams* cparams,
/* Copy amount of used shared data back to the wrapper API struct */
cparams->shared_data_size = (uint32_t)p.shared_data_size;
/* Stop timer */
shared->timer_vb_select_firmware_exit = VbExGetTimer();
/* Translate return codes */
if (LOAD_FIRMWARE_SUCCESS == rv) {
/* Found good firmware in either A or B */