diff options
author | Julius Werner <jwerner@chromium.org> | 2014-10-22 19:58:23 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-10-25 08:14:23 +0000 |
commit | 9e39efd6474449ec38bb2bcc2209a070fb6e6937 (patch) | |
tree | 1c7de135574a6de7f2ec594b880ad082acf9a30b | |
parent | 21f100c9d62bfb0d1ec2d26c132c82ce47ee9350 (diff) | |
download | vboot-9e39efd6474449ec38bb2bcc2209a070fb6e6937.tar.gz |
vboot2: Log recovery reason and subcode to console
Looks like vboot2 currently never outputs the current recovery reason
anywhere, which is annoying for debugging devices without working
display (where you could press TAB). This patch adds log messages both
when deciding to go into recovery mode and when picking up an existing
recovery request from NVRAM, for maximum visibility.
Also removes the "Both slots are bad." part of the vb2_fail() message,
since this is not necessarily true and can be confusing (there are many
other possible reasons why it might want to go into recovery).
BRANCH=ToT
BUG=None
TEST=Manual
Change-Id: Ic98c61223dce00e830ea0f199878d47b214bb224
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225160
Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r-- | firmware/2lib/2misc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/firmware/2lib/2misc.c b/firmware/2lib/2misc.c index a0ae60e0..ba5cd279 100644 --- a/firmware/2lib/2misc.c +++ b/firmware/2lib/2misc.c @@ -105,7 +105,7 @@ void vb2_fail(struct vb2_context *ctx, uint8_t reason, uint8_t subcode) * If recovery is already requested, it's a more specific error code * than later code is providing and we shouldn't overwrite it. */ - VB2_DEBUG("Both slots are bad. Need recovery\n"); + VB2_DEBUG("Need recovery, reason: %#x / %#x\n", reason, subcode); if (!vb2_nv_get(ctx, VB2_NV_RECOVERY_REQUEST)) { vb2_nv_set(ctx, VB2_NV_RECOVERY_REQUEST, reason); vb2_nv_set(ctx, VB2_NV_RECOVERY_SUBCODE, subcode); @@ -166,8 +166,12 @@ void vb2_check_recovery(struct vb2_context *ctx) } /* If recovery reason is non-zero, tell caller we need recovery mode */ - if (sd->recovery_reason) + if (sd->recovery_reason) { ctx->flags |= VB2_CONTEXT_RECOVERY_MODE; + VB2_DEBUG("We have a recovery request: %#x / %#x\n", + sd->recovery_reason, + vb2_nv_get(ctx, VB2_NV_RECOVERY_SUBCODE)); + } } int vb2_fw_parse_gbb(struct vb2_context *ctx) |