From 23f72259612eccc4557ee7e2c40f3ea2fabf9c11 Mon Sep 17 00:00:00 2001 From: Joel Kitching Date: Fri, 19 Jun 2020 19:30:57 +0800 Subject: vboot: makeshift debug info screen Provide makeshift debug info functionality while implementation of the proper screen is in progress. BUG=b:146399181, b:144969088 TEST=Build and flash; check functionality TEST=make clean && make runtests BRANCH=none Cq-Depend: chromium:2253732 Signed-off-by: Joel Kitching Change-Id: I0a738f731361d1c344c8fc8f5ecdef5b892f5ba7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2253733 Tested-by: Joel Kitching Reviewed-by: Hsuan Ting Chen Reviewed-by: Shelley Chen Commit-Queue: Shelley Chen --- firmware/2lib/2ui.c | 20 +++++++++++++++++++- firmware/2lib/include/2ui_private.h | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/firmware/2lib/2ui.c b/firmware/2lib/2ui.c index ee0da1f1..96a7b939 100644 --- a/firmware/2lib/2ui.c +++ b/firmware/2lib/2ui.c @@ -15,6 +15,7 @@ #include "2ui_private.h" #include "vboot_api.h" /* For VB_SHUTDOWN_REQUEST_POWER_BUTTON */ #include "vboot_kernel.h" +#include "vboot_ui_legacy.h" /* TODO(b/144969088): VbDisplayDebugInfo */ #define KEY_DELAY_MS 20 /* Delay between key scans in UI loops */ @@ -324,6 +325,10 @@ vb2_error_t developer_action(struct vb2_ui_context *ui) (DETACHABLE && ui->key == VB_BUTTON_VOL_DOWN_LONG_PRESS)) return vb2_ui_developer_mode_boot_internal_action(ui); + /* TODO(b/144969088): Re-implement as debug info screen. */ + if (ui->key == '\t') + VbDisplayDebugInfo(ui->ctx); + return VB2_REQUEST_UI_CONTINUE; } @@ -332,7 +337,16 @@ vb2_error_t developer_action(struct vb2_ui_context *ui) vb2_error_t vb2_broken_recovery_menu(struct vb2_context *ctx) { - return ui_loop(ctx, VB2_SCREEN_RECOVERY_BROKEN, NULL); + return ui_loop(ctx, VB2_SCREEN_RECOVERY_BROKEN, broken_recovery_action); +} + +vb2_error_t broken_recovery_action(struct vb2_ui_context *ui) +{ + /* TODO(b/144969088): Re-implement as debug info screen. */ + if (ui->key == '\t') + VbDisplayDebugInfo(ui->ctx); + + return VB2_REQUEST_UI_CONTINUE; } /*****************************************************************************/ @@ -366,5 +380,9 @@ vb2_error_t manual_recovery_action(struct vb2_ui_context *ui) (DETACHABLE && ui->key == VB_BUTTON_VOL_UP_DOWN_COMBO_PRESS)) return vb2_ui_change_screen(ui, VB2_SCREEN_RECOVERY_TO_DEV); + /* TODO(b/144969088): Re-implement as debug info screen. */ + if (ui->key == '\t') + VbDisplayDebugInfo(ui->ctx); + return VB2_REQUEST_UI_CONTINUE; } diff --git a/firmware/2lib/include/2ui_private.h b/firmware/2lib/include/2ui_private.h index e1e47af3..effa280d 100644 --- a/firmware/2lib/include/2ui_private.h +++ b/firmware/2lib/include/2ui_private.h @@ -17,6 +17,7 @@ vb2_error_t menu_navigation_action(struct vb2_ui_context *ui); vb2_error_t ui_loop(struct vb2_context *ctx, enum vb2_screen root_screen_id, vb2_error_t (*global_action)(struct vb2_ui_context *ui)); vb2_error_t developer_action(struct vb2_ui_context *ui); +vb2_error_t broken_recovery_action(struct vb2_ui_context *ui); vb2_error_t manual_recovery_action(struct vb2_ui_context *ui); /* From 2ui_screens.c */ -- cgit v1.2.1