From cb85206ebf1e5fc551c1df1d1f6e016b05a16b2f Mon Sep 17 00:00:00 2001 From: Hung-Te Lin Date: Thu, 27 Sep 2012 14:54:02 +0800 Subject: vboot_api_kernel: Print warning in TONORM when GBB flags force DEV. We use gbb-flag-force-dev-switch-on in default firmware images to make things easier for factory and some devs. But when we request normal mode there should be some sort of warning/error telling the user that this is not available, otherwise we can spent time trying to figure out why the firmware doesn't work. BRANCH=all BUG=chrome-os-partner:14474 TEST=flash image to Link, set GBB flags to 0x39, boot to DEV screen and press SPACE (TONORM); gets beep and warning messages. Change-Id: Id48c12693c7575001fae7fad92a868cb5465e83d Reviewed-on: https://gerrit.chromium.org/gerrit/34172 Reviewed-by: Simon Glass Reviewed-by: Randall Spangler Commit-Ready: Hung-Te Lin Tested-by: Hung-Te Lin --- firmware/lib/vboot_api_kernel.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c index 750edb24..8f7be6ab 100644 --- a/firmware/lib/vboot_api_kernel.c +++ b/firmware/lib/vboot_api_kernel.c @@ -201,6 +201,15 @@ VbError_t VbBootDeveloper(VbCommonParams* cparams, LoadKernelParams* p) { if (shared->flags & VBSD_HONOR_VIRT_DEV_SWITCH && shared->flags & VBSD_BOOT_DEV_SWITCH_ON) { VbAudioClose(audio); /* Stop the countdown while we go ask... */ + if (gbb->flags & GBB_FLAG_FORCE_DEV_SWITCH_ON) { + /* TONORM won't work (only for non-shipping devices). */ + VBDEBUG(("%s() - TONORM rejected by GBB_FLAG_FORCE_DEV_SWITCH_ON\n", + __func__)); + VbExDisplayDebugInfo("WARNING: TONORM is prohibited by " + "GBB_FLAG_FORCE_DEV_SWITCH_ON.\n\n"); + VbExBeep(120, 400); + break; + } VbDisplayScreen(cparams, VB_SCREEN_DEVELOPER_TO_NORM, 0, &vnc); switch (VbUserConfirms(cparams, 0)) { /* Ignore space */ case 1: -- cgit v1.2.1