diff options
author | Julius Werner <jwerner@chromium.org> | 2019-01-24 16:35:37 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-03-01 23:41:27 -0800 |
commit | 99a0f5bf78126a145fe15670040dce7d81843223 (patch) | |
tree | 800b372df264ae9d21a96f2f5570c8838a5f0011 | |
parent | 5c298d83faaf29a10bc411e074c0c61fcc10b68a (diff) | |
download | vboot-99a0f5bf78126a145fe15670040dce7d81843223.tar.gz |
Add console logging to make UI easier to navigate without a screen
Many people seem to have problems doing things in the detachable UI on
early bring-up devices that don't yet support display output. This patch
is supposed to alleviate that problem by adding more log output so that
people can see on the UART which menu option they have selected (with
actual text rather than just screen and menu item indices).
While we're at it, let's also dump the TAB output to the console so that
it's easier to retrieve that information without a display as well.
BRANCH=None
BUG=chromium:924446
TEST=None, because make runtests is broken and nobody seems to care.
Change-Id: If9350255a68821b7e232726ba56d001571d52cd4
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1436494
Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r-- | firmware/lib/include/vboot_ui_menu_private.h | 1 | ||||
-rw-r--r-- | firmware/lib/vboot_display.c | 1 | ||||
-rw-r--r-- | firmware/lib/vboot_ui_menu.c | 26 |
3 files changed, 28 insertions, 0 deletions
diff --git a/firmware/lib/include/vboot_ui_menu_private.h b/firmware/lib/include/vboot_ui_menu_private.h index 828a4a0f..aef2dff6 100644 --- a/firmware/lib/include/vboot_ui_menu_private.h +++ b/firmware/lib/include/vboot_ui_menu_private.h @@ -17,6 +17,7 @@ struct vb2_menu_item { }; struct vb2_menu { + const char *name; uint16_t size; uint16_t screen; struct vb2_menu_item *items; diff --git a/firmware/lib/vboot_display.c b/firmware/lib/vboot_display.c index a17d6dd1..ad23ebf8 100644 --- a/firmware/lib/vboot_display.c +++ b/firmware/lib/vboot_display.c @@ -413,6 +413,7 @@ VbError_t VbDisplayDebugInfo(struct vb2_context *ctx) * - Information on current disks */ buf[DEBUG_INFO_SIZE - 1] = '\0'; + VB2_DEBUG("[TAB] Debug Info:\n%s", buf); return VbExDisplayDebugInfo(buf); } diff --git a/firmware/lib/vboot_ui_menu.c b/firmware/lib/vboot_ui_menu.c index 380dd3ed..39b00d6f 100644 --- a/firmware/lib/vboot_ui_menu.c +++ b/firmware/lib/vboot_ui_menu.c @@ -76,6 +76,17 @@ static void vb2_flash_screen(struct vb2_context *ctx) vb2_draw_current_screen(ctx); } +static void vb2_log_menu_change(void) +{ + if (menus[current_menu].size) + VB2_DEBUG("================ %s Menu ================ [ %s ]\n", + menus[current_menu].name, + menus[current_menu].items[current_menu_idx].text); + else + VB2_DEBUG("=============== %s Screen ===============\n", + menus[current_menu].name); +} + /** * Switch to a new menu (but don't draw it yet). * @@ -110,6 +121,8 @@ static void vb2_change_menu(VB_MENU new_current_menu, new_current_menu_idx++; if (new_current_menu_idx < menus[current_menu].size) current_menu_idx = new_current_menu_idx; + + vb2_log_menu_change(); } /************************ @@ -425,6 +438,8 @@ static void vb2_update_selection(uint32_t key) { VB2_DEBUG("ERROR: %s called with key 0x%x!\n", __func__, key); break; } + + vb2_log_menu_change(); } static VbError_t vb2_handle_menu_input(struct vb2_context *ctx, @@ -488,6 +503,7 @@ static VbError_t vb2_handle_menu_input(struct vb2_context *ctx, /* Master table of all menus. Menus with size == 0 count as menuless screens. */ static struct vb2_menu menus[VB_MENU_COUNT] = { [VB_MENU_DEV_WARNING] = { + .name = "Developer Warning", .size = VB_WARN_COUNT, .screen = VB_SCREEN_DEVELOPER_WARNING_MENU, .items = (struct vb2_menu_item[]){ @@ -514,6 +530,7 @@ static struct vb2_menu menus[VB_MENU_COUNT] = { }, }, [VB_MENU_DEV] = { + .name = "Developer Boot Options", .size = VB_DEV_COUNT, .screen = VB_SCREEN_DEVELOPER_MENU, .items = (struct vb2_menu_item[]){ @@ -548,6 +565,7 @@ static struct vb2_menu menus[VB_MENU_COUNT] = { }, }, [VB_MENU_TO_NORM] = { + .name = "TO_NORM Confirmation", .size = VB_TO_NORM_COUNT, .screen = VB_SCREEN_DEVELOPER_TO_NORM_MENU, .items = (struct vb2_menu_item[]){ @@ -570,6 +588,7 @@ static struct vb2_menu menus[VB_MENU_COUNT] = { }, }, [VB_MENU_TO_DEV] = { + .name = "TO_DEV Confirmation", .size = VB_TO_DEV_COUNT, .screen = VB_SCREEN_RECOVERY_TO_DEV_MENU, .items = (struct vb2_menu_item[]){ @@ -592,10 +611,12 @@ static struct vb2_menu menus[VB_MENU_COUNT] = { }, }, [VB_MENU_LANGUAGES] = { + .name = "Language Selection", .screen = VB_SCREEN_LANGUAGES_MENU, /* Rest is filled out dynamically by vb2_init_menus() */ }, [VB_MENU_OPTIONS] = { + .name = "Options", .size = VB_OPTIONS_COUNT, .screen = VB_SCREEN_OPTIONS_MENU, .items = (struct vb2_menu_item[]){ @@ -618,26 +639,31 @@ static struct vb2_menu menus[VB_MENU_COUNT] = { }, }, [VB_MENU_RECOVERY_INSERT] = { + .name = "Recovery INSERT", .size = 0, .screen = VB_SCREEN_RECOVERY_INSERT, .items = NULL, }, [VB_MENU_RECOVERY_NO_GOOD] = { + .name = "Recovery NO_GOOD", .size = 0, .screen = VB_SCREEN_RECOVERY_NO_GOOD, .items = NULL, }, [VB_MENU_RECOVERY_BROKEN] = { + .name = "Non-manual Recovery (BROKEN)", .size = 0, .screen = VB_SCREEN_OS_BROKEN, .items = NULL, }, [VB_MENU_TO_NORM_CONFIRMED] = { + .name = "TO_NORM Interstitial", .size = 0, .screen = VB_SCREEN_TO_NORM_CONFIRMED, .items = NULL, }, [VB_MENU_ALT_FW] = { + .name = "Alternative Firmware Selection", .screen = VB_SCREEN_ALT_FW_MENU, .size = VB_ALTFW_COUNT + 1, .items = (struct vb2_menu_item[]) {{ |