summaryrefslogtreecommitdiff
path: root/tests/vboot_detach_menu_tests.c
Commit message (Collapse)AuthorAgeFilesLines
* vboot/secdata: remove DISABLE_ROLLBACK_TPM constantJoel Kitching2019-08-281-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | This constant triggered different implementations of the two functions RollbackFwmpRead and RollbackKernelLock, whose overridden implementation would then be relied on in various tests. Instead, directly override these functions within the tests where they are required. The overridden implementations were also used in utilities/load_kernel_test.c, but this utility is currently broken and not in active use. If we would like to get it working again, simply override these two functions directly in the C file, just as is done for unit tests. (See b:139839429.) BUG=b:124141368, chromium:972956 TEST=make clean && make runtests BRANCH=none Change-Id: I0a4d24ea4ae4182b7f4f258860de6f712dae1555 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1765169 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* vboot: properly check failure from VbExGetLocalizationCountJoel Kitching2019-08-131-0/+5
| | | | | | | | | | | | | | | | | Check the return value and result of calling VbExGetLocalizationCount. If something is awry, fall back to using one language entry. BUG=b:124141368 TEST=make clean && make runtests BRANCH=none Change-Id: Ieeea54bfed303a98d16f15aceab47f1ffdd10d6d Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1729773 Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot: replace VBERROR_SIMULATED with VB2_ERROR_MOCKJoel Kitching2019-08-131-6/+6
| | | | | | | | | | | | | | | Replace vboot1-style VBERROR_SIMULATED with VB2_ERROR_MOCK. BUG=b:124141368, chromium:988410 TEST=make clean && make runtests BRANCH=none Change-Id: I9f7a21b957097672883a428a5210c14a27852085 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1722917 Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot: replace VBERROR_SUCCESS with VB2_SUCCESSJoel Kitching2019-08-131-35/+35
| | | | | | | | | | | | | | | | | Replace vboot1-style VBERROR_SUCCESS with VB2_SUCCESS (trivial change since both are equal values). BUG=b:124141368, chromium:988410 TEST=make clean && make runtests BRANCH=none Change-Id: I46e02471a031e9f36ec869d11d0b957d1c1b5769 Signed-off-by: Joel Kitching <kitching@google.com> Cq-Depend: chromium:1728114 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1722915 Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot: update vboot2 functions to use new vb2_error_tJoel Kitching2019-08-131-2/+2
| | | | | | | | | | | | | | | | | | To make explicit when vboot2 error codes should be returned, use the new vb2_error_t type on all functions which return VB2_ERROR_* constants. BUG=b:124141368, chromium:988410 TEST=make clean && make runtests BRANCH=none Change-Id: Idd3ee8afe8c78347783ce5fa829cb78f1e5719e2 Signed-off-by: Joel Kitching <kitching@google.com> Cq-Depend: chromium:1728113, chromium:1728499 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1728292 Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org>
* vboot: rename VbError_t typedef to vb2_error_tJoel Kitching2019-08-061-10/+10
| | | | | | | | | | | | | | | | | | | | | | As part of the conversion of error codes from vboot1 to vboot2, replace all instances of VbError_t with vb2_error_t. vboot2 currently uses the int type for return values, but we would like to implement the use of vb2_error_t instead, which is potentially clearer than simply using an int. Existing functions will be converted to use vb2_error_t in a subsequent CL. BUG=b:124141368, chromium:988410 TEST=make clean && make runtests BRANCH=none Change-Id: Iee90d9a1f46bcf5f088e981ba6ddbcf886ff0f18 Signed-off-by: Joel Kitching <kitching@google.com> Cq-Depend: chromium:1728112 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1722914 Reviewed-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org>
* vboot: check display init when entering normal modeJoel Kitching2019-06-071-8/+3
| | | | | | | | | | | | | | | | | | In order to simplify code which uses VB2_NV_DISPLAY_REQUEST, centralize disabling this NVRAM flag to a function called at the start of VbBootNormal. Also disable VB2_NV_DIAG_REQUEST here, since display init is enabled for this request as well. BUG=b:124141368, chromium:948592, chromium:967298, b:133175864 TEST=make clean && make runtests BRANCH=none Change-Id: I8aa7c44671ada23c0500cd8a0c5d7f737298bb11 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1634451 Commit-Queue: Jason Clinton <jclinton@chromium.org> Tested-by: Jason Clinton <jclinton@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org>
* vboot: save GBB header in workbuf during firmware verificationJoel Kitching2019-05-281-10/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since GBB header will be needed for subsequent GBB reads later on (in kernel verification stage), and since GBB header is relatively small (128 bytes), save the full GBB header onto workbuf during firmware verification stage, and store an offset pointer to it in vb2_shared_data. vb2_gbb_header object may be accessed via the vb2_get_gbb function. Additionally, update functions in firmware/lib/region-init.c to read GBB data from flash, rather than using cparams passed in by depthcharge, which is slated for deprecation. BUG=b:124141368, chromium:954774 TEST=make clean && make runtests BRANCH=none Change-Id: I6e6218231299ce3a5b383663bc3480b20f929840 Signed-off-by: Joel Kitching <kitching@google.com> Cq-Depend: chromium:1585500 Reviewed-on: https://chromium-review.googlesource.com/1627430 Commit-Ready: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org>
* vboot: deprecate v1 GoogleBinaryBlockHeader structJoel Kitching2019-05-171-9/+8
| | | | | | | | | | | | | | | | | Deprecate internal usage of GoogleBinaryBlockHeader struct in favour of vb2_gbb_header struct. Keep the v1 struct around until we remove references in other repos. BUG=b:124141368, chromium:954774 TEST=make clean && make runtests BRANCH=none Change-Id: I396d2e624bd5dcac9c461cc86e8175e8f7692d26 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/1583826 Commit-Ready: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org>
* Makefile: Enable more warnings for host utilities / testsJulius Werner2019-05-141-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a bunch of more warnings that are already enabled in coreboot and thus already enabled for firmware builds anyway (because coreboot just passes its CFLAGS through). Enabling it in the vboot Makefile means they also apply to host utilities and tests, which sounds desirable for consistency. Fix enough of the cruft and bad coding practices that accumulated over the years of not having warnings enabled to get it to build again (this includes making functions static, removing dead code, cleaning up prototypes, etc.). Also remove -fno-strict-aliasing from the x86 firmware build options, because it's not clear why it's there (coreboot isn't doing this, so presumably it's not needed). BRANCH=None BUG=None TEST=make runtests Change-Id: Ie4a42083c4770a4eca133b22725be9ba85b24184 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1598721 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
* vboot: do not check for VBSD_HONOR_VIRT_DEV_SWITCHJoel Kitching2019-03-261-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As part of chromium:942901, physical dev switch functionality is being deprecated. As such, we no longer need to specify the flag VBSD_HONOR_VIRT_DEV_SWITCH -- the virtual dev switch should always be honoured. Additionally, there is no longer a need to check this flag when looking up the value for crossystem devsw_cur. This constant will be marked as deprecated in a subsequent CL. BUG=b:124141368, b:124192753, chromium:942901 TEST=Build locally TEST=/work/vboot/src/repohooks/pre-upload.py TEST=make clean && make runtests TEST=make clean && COV=1 make coverage && make coverage_html BRANCH=none Change-Id: Ib1ab86d79b039650136f1038c23175f5990895db Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/1526070 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot: changes to allow RW_LEGACY hash verificationMatt Delco2019-03-131-3/+3
| | | | | | | | | | | | | | | | | | | | This is largely a cherry-pick of CL:1133598 - Externalize vb2_digest_buffer function to vb2api_digest_buffer. - Change VbExLegacy()'s altfw_num parameter from int to enum so caller can specify which specific payload to run. BUG=b:124358784 BRANCH=None TEST=Local compile. Verified with subsequent change that legacy boot still works and new functionality can opt-in to and utilize payload verification. CQ-DEPEND=CL:1471053 Change-Id: I9700c2e38c3cfa255eeff72ce416295af9d076fb Signed-off-by: Matt Delco <delco@google.com> Reviewed-on: https://chromium-review.googlesource.com/1471051 Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot: Add ui for setting vendor data in VPDfirmware-atlas-11827.12.BMathew King2019-02-221-1/+2
| | | | | | | | | | | | | | | BUG=b:124297157 TEST=make runtest test on device BRANCH=none CQ-DEPEND=CL:1466822 Change-Id: Ic3b1b502b1aff14a795397da3024f8a12eb04775 Reviewed-on: https://chromium-review.googlesource.com/1466290 Commit-Ready: Mathew King <mathewk@chromium.org> Tested-by: Mathew King <mathewk@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Mathew King <mathewk@chromium.org>
* vboot: Don't hardcode special keyboard values.Mathew King2019-02-221-24/+24
| | | | | | | | | | | | | | BUG=chromium:933391 TEST=make runtests Test ctrl+d, ctrl+u, and ctrl+l on device BRANCH=none Change-Id: Icf8699e5facac44a074cfd47e796b9957fd6b714 Reviewed-on: https://chromium-review.googlesource.com/1475781 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Mathew King <mathewk@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Mathew King <mathewk@chromium.org>
* Add a screen showing a menu for alternative firmwareSimon Glass2018-11-161-27/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | At present we allow the user to press a keypad number to boot into another bootloader but there is no indication which one is which. Add a new screen for this. It is entered via Ctrl-L and shows the available bootloaders, along with the number to press for each. The contents of the screen is rendered by the bootloader, as usual. This is supported by two new screens, one for the keyboard UI and one for the menu UI. Also a new function, VbExGetAltFwIdxMask(), is added to find out what bootloaders are available. Note: This CL combines changes for both UIs. The changes may be easier to review separately. CQ-DEPEND=CL:1273269 BUG=chromium:837018 BRANCH=none TEST=FEATURES=test emerge-grunt --nodeps vboot_reference Change-Id: Ib3227545dc677c8f9587944753e32f3b49647360 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1273268 Reviewed-by: Julius Werner <jwerner@chromium.org>
* Add support for booting into alternative boot loadersSimon Glass2018-09-261-1/+11
| | | | | | | | | | | | | | | | | | | Add a generic way of selecting an alternative bootloader to run from the developer-mode menu. This enables keys 1-9 to select a particular numbered bootloader. Adjust VbExLegacy() to take a numeric parameter to signal which boot loader to run. CQ-DEPEND=CL:1228875 BUG=chromium:837018 BRANCH=none TEST=FEATURES=test emerge-grunt --nodeps vboot_reference Change-Id: I02eab1b87e21a6401ec42317c4c1fa1bd2767b53 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1060854 Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot: bulk fix tabs and spacing inconsistencyJoel Kitching2018-08-031-1/+1
| | | | | | | | | | | | | | | | | | | Problem files were found with: find . -name '*.c' -o -name '*.h' | xargs grep '^ [^*]' and edited manually. Ignores utility/ and cgpt/, since they seem to globally adhere to a two-space tab convention. BUG=None TEST=make clean runtests TEST=emerge vboot_reference depthcharge Change-Id: I5a678484a119c8f1911f717e1968bdb4f1a0810f Reviewed-on: https://chromium-review.googlesource.com/1160131 Commit-Ready: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Add new GBB_FLAG_FORCE_MANUAL_RECOVERYJulius Werner2018-03-261-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | It seems like there are some testing use cases where we want the device to boot into the recovery installer but it is impractical to fully simulate a user-triggered recovery. This has become impossible with the recent change to always require manual recovery to boot an image, even when the developer mode switch is enabled (CL:924458). This patch adds a new GBB flag to support this use case. When the flag is set, all recovery mode is manual recovery mode, regardless of wheter the developer mode switch is on or not. Since the GBB_FLAG_ENABLE_SERIAL was killed off before it ever really worked anyway, we can safely reuse the bit reserved for it. BRANCH=None BUG=None TEST=make runtests, manually confirmed on Kevin Change-Id: I4f51dfd20b4ff04c522f53596896dccbceee52dc Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/976660 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Always enter BROKEN screen in non-manual recovery, even in dev modeJulius Werner2018-02-201-5/+7
| | | | | | | | | | | | | | | | | | | | Previously, non-manual recovery behavior would depend on the developer mode switch: in normal mode it would get stuck at the BROKEN screen, but in developer mode it would proceed exactly like manual recovery. This behavior was mostly just confusing to people and it seems that we have no real use case for it anymore. Remove the developer mode special case so that non-manual recovery will always go to the BROKEN screen from now on. BRANCH=scarlet? BUG=None TEST=make runtests, verified manually on Scarlet and Kevin Change-Id: Iaf33f82d7cb709a5ee309c08d1ad3015859738b3 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/924458 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* detachables: Allow 'Tab' to display debug info on all screensJulius Werner2018-02-081-0/+52
| | | | | | | | | | | | | | | | | Since we're continuing to support the boot shortcuts Ctrl+D, Ctrl+U and Ctrl+L, it makes sense to also continue to support the debug info shortcut Tab, just in case somebody may want to use it from an external keyboard. This does not affect the existing method to display debug info through the appropriate menu option in any way. BRANCH=None BUG=b:73080278 TEST=make runtests, booted Scarlet and pressed Tab on UART. Change-Id: Ia08404e0ffd1f8cac3d85f3b2fc4ce17a21d743d Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/907759 Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* detachables: Test ALL the units!Julius Werner2018-02-011-397/+1705
| | | | | | | | | | | | | | | This patch adds a bunch of new unit tests for the detachable UI and enhances some of the existing ones to more explicitly check more things. BRANCH=None BUG=b:65025540 TEST=make runtests. I actually found a real bug in my previous patch, so that's nice... and COV=1 make gives me 96.9% of lines covered in vboot_ui_menu.c, with 28 out of 28 functions touched. Change-Id: I7737a7e62d4b7e01ea98e6a0f1dd098716582794 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/894292
* detachables: The Big RefactorJulius Werner2018-01-311-59/+61
| | | | | | | | | | | | | | | | | | | | | | | | | This patch shuffles around most of the detachable UI code to try to make it more readable and maintainable. The goal is to get the business logic out of the main UI loop functions as much as possible, and concentrate the code handling each individual menu option in a single location. This is a pure refactor and should not change behavior in any (important) way. The adjustments to unit tests are only needed since the old code displayed the same screen twice in certain circumstances, and returning from the LANGUAGE menu to DEVELOPER selected the default option Power Off, although other transitions to that screen select the current default boot target. BRANCH=None BUG=None TEST=make runtests, boot Scarlet and play with all screens. Change-Id: Ibe05cbcb23c964d81f80de741bbd6f2231a2522d Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/888082 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Shelley Chen <shchen@chromium.org>
* detachables: Replace RECOVERY with OPTIONS menuShelley Chen2018-01-251-89/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements the new OPTIONS menu which will function in stead of the old basic RECOVERY menu. The TO_DEV menu is now directly reachable through the VolUp+VolDown key combo. Cancelling any menu or changing USB state will immediately drop back to the menuless base screens (INSERT or NOGOOD). Also contains some minor clean-up here and there, like decoupling code from tests a bit more by reducing reliance on global initializers. Code for the now obsolete RECOVERY menu will be removed in a follow-up patch. BUG=b:67371896, b:64400036 BRANCH=None TEST=Go through all recovery screens, trry various back-and-forth transitions between OPTIONS, LANGUAGE and TO_DEV, in addition to inserting/removing USB at various times. CQ-DEPEND=CL:884840 Change-Id: I95319778e14ce07fe2ada3edf95990560ac7081a Signed-off-by: Shelley Chen <shchen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/770258 Commit-Ready: Julius Werner <jwerner@chromium.org> Tested-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* firmware: Stop using vboot1 cparams internallyRandall Spangler2018-01-091-53/+49
| | | | | | | | | | | | | | | | | | Now that vb2_shared_data / vb2_context provides all the same data to lower-level kernel verification code that cparams did, stop passing cparams down to those functions. No change in functionality. BUG=chromium:611535 BRANCH=none TEST=make -j runtests; build bob firmware and boot it Change-Id: I86eb1801ee96d8b56404b74843a8d09e3122567f Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/852814 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
* firmware: Prune down old region APIRandall Spangler2018-01-091-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | The region API was a way for firmware and kernel verification to get at various blocks of caller-provided data. In practice, we only used it internally as a way to get at parts of the GBB. Prune it down to access only the bits of GBB we still need, from the buffer we already know we have. In the long run we should use the same vb2ex_read_resource() API that vb2 firmware verification does, but that should be done in a follow-up CL since it'll need to be coordinated with support in depthcharge. No change in functionality. BUG=chromium:611535 BRANCH=none TEST=make -j runtests; build bob firmware and boot it Change-Id: I5715cb8d88274164a1a73ed4a56bbd93af46f9bf Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/852798 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
* firmware: Include vb1 shared data in vb2 structRandall Spangler2018-01-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, firmware verification uses entirely vb2 structs, including vb2_shared_data. This goes through an ugly translation to the old vb1 VbSharedData to pass it to depthcharge. The vboot kernel verification maintains an equally ugly translation back to the vb2 struct internally. Eventually, we want to get rid of all that and use vb2 all the way down to what crossystem picks up from the OS. But before we can do that, we need to finish translating kernel verification code to use the new vb2 structs. This is a step on that path, using vb2_shared_data equivalents where present and hiding the old vb1 shared data struct as a member of vb2_shared_data so at least the vboot functions don't need to pass around cparams to get at it. This will be followed by more CLs which convert more vboot internals to use vb2 structs directly, and eventually coreboot/depthcharge CLs which pass the vb2 structs from firmware verification directly to kernel verification. No change in functionality. BUG=chromium:611535 BRANCH=none TEST=make -j runtests; build bob firmware and boot it Change-Id: I5df8ce81ba3c3ac3f2cb4229db5461757cd89d8d Reviewed-on: https://chromium-review.googlesource.com/852856 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
* firmware: Remove bmpblk codeRandall Spangler2018-01-091-4/+2
| | | | | | | | | | | | | | | | | | | | All screens are now drawn by depthcharge. ToT firmware does not include a bmpblk / bmpfv section in the GBB. Remove the code paths which are no longer used. Also drop a few cparams parameters from functions that no longer use it, now that those functions don't need to access the GBB. BUG=chromium:502066 BRANCH=none TEST=make -j runtests; build bob firmware and check recovery screens Change-Id: I4d2d0a3ba57c34151e65c6f42581df823192a4ae Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/852371 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
* firmware: simplify audioRandall Spangler2018-01-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | Vboot firmware previously supported a rather complex audio looping library. Our original intent was to allow developers to flash a custom beep sequence / tune as an easter egg. We never fully supported that, but the code to allow it lived on. Get rid of that. Vboot also previously made no assumptions about the frequency of VbExGetTimer(), which was only used by the vboot_audio library. So it spent 10ms every boot measuring the frequency. Which is silly now, because depthcharge implements that as a microsecond timer. Get rid of that measurement and define the timer as a microsecond timer. BUG=chromium:611535 BRANCH=none TEST=make -j runtests; build bob firmware and boot it Change-Id: I350246874fb36b00149423696285cfcaca0fc526 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/847311 Reviewed-by: Shelley Chen <shchen@chromium.org>
* firmware: use sd->gbb_flagsRandall Spangler2018-01-051-6/+8
| | | | | | | | | | | | | | | | | | Vboot1 code directly referenced the GBB from cparams even though now it has access to the GBB flags via the vb2 context. Refactor all existing code to use the vb2 context, since that takes us one step closer to getting rid of the old vboot1 cparams. No change in functionality. BUG=chromium:611535 BRANCH=none TEST=make -j runtests; build bob firmware and boot it Change-Id: Ic4a5bf215b723a2eacbf0a4cf0eba8b1338155a2 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/847310 Reviewed-by: Shelley Chen <shchen@chromium.org>
* detachables: Add unit testsShelley Chen2017-12-191-0/+934
Initial unit tests for detachable menu UI. With these tests, the coverage is at 81.2% for lines for code and 87.5% for function coverage. I will improve this to closer to 100%, but wanted to get this in as it's still significantly better than before, which was 0%. There are still a lot of tests in the code that are #if 0'd out currently. I still need to go through an enabled/delete those. BUG=b:65025540 BRANCH=None TEST=run COV=1 make and make sure passes without errors Change-Id: If17bfc24fb7f65deb3d2286cc39cdc311d8a6d93 Signed-off-by: Shelley Chen <shchen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/830680 Reviewed-by: Randall Spangler <rspangler@chromium.org>