summaryrefslogtreecommitdiff
path: root/firmware/2lib/2kernel.c
Commit message (Collapse)AuthorAgeFilesLines
* Minidiag: Enable minidiag by defaultMeng-Huan Yu2021-02-051-1/+1
| | | | | | | | | | | | | | | | | | | This CL enabled the pre-boot diagolostic tools entry in recovery mode. BRANCH=none BUG=b:176947486 TEST=CQ TEST=FEATURES=test P2_TEST_FILTER='*' emerge-zork vboot_reference TEST=manually build, flash FW to device, and confirm minidiag works Signed-off-by: Meng-Huan Yu <menghuan@chromium.org> Change-Id: I8500cbaaa4e8d0f1aa668d56d38095ecdcf50aaf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2617391 Reviewed-by: Hung-Te Lin <hungte@chromium.org> (cherry picked from commit 6f6efdc6fa38ed3bcacfa9e152f415d50ee8bad0) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2677612 Reviewed-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Julius Werner <jwerner@chromium.org>
* vboot/ui: fix some rogue spacingJoel Kitching2020-10-051-1/+1
| | | | | | | | | | | | | BUG=b:146399181 TEST=make clean && make runtests BRANCH=none Signed-off-by: Joel Kitching <kitching@google.com> Change-Id: I884ec94adc762549ad565fe0796d3db625039f64 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2428563 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* vboot2: use hwcrypto for RSA when allowedKangheui Won2020-08-261-0/+1
| | | | | | | | | | | | | | | | | | | Add vb2ex_hwcrypto_rsa_verify support for RSA verification. If firmware implements the function it will used instead of SW implementation in vboot. Also separate hwcrypto stubs to 2stub_hwcrypto.c for depthcharge and coreboot. Depthcharge needs stubs but fails to compile 2stub.c BRANCH=none BUG=b:163710320, b:161205813 TEST=make runtests TEST=check hwcrypto is allowed/disallowed depending on nvmem flag Change-Id: I85573e7cff31f32043db4b0a6b24b642856024e3 Signed-off-by: Kangheui Won <khwon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2353775 Reviewed-by: Julius Werner <jwerner@chromium.org>
* vboot: adjust VB2_SECDATA_KERNEL_FLAGS in non-recovery pathChun-Ta Lin2020-08-241-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | Currently, VB2_SECDATA_KERNEL_FLAGS controls experimental features like phone recovery (and its UI), diagnostics entry. All of those are under recovery screen. In order to allow later update pushes to enable specific features in write-protected RO, we should not set those flags in recovery path. Otherwise, it will always toggle back and forth when booting RO recovery path vs. normal boot path. BRANCH=puff BUG=b:165181118 TEST=MENU_UI=0 DIAGNOSTIC_UI=0 make runtests TEST=MENU_UI=0 DIAGNOSTIC_UI=1 make runtests TEST=MENU_UI=1 DIAGNOSTIC_UI=0 make runtests TEST=MENU_UI=1 DIAGNOSTIC_UI=1 make runtests TEST=Cherry-pick locally to ToT of firmware-puff-13324.B with chromium:2360066 to manually check flags on Kaisa device. Change-Id: I7ec45b4ecfa6d50781cec2690dbc88894c734073 Signed-off-by: Chun-Ta Lin <itspeter@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2361983 Tested-by: Chun-ta Lin <itspeter@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Chun-ta Lin <itspeter@chromium.org>
* vboot: create secdata_kernel flag to disable diagnostic UIJoel Kitching2020-08-091-1/+2
| | | | | | | | | | | | | | | | | | | Diagnostic UI is currently not ready to ship. Disable the UI (including both entry point and the UI itself) until it is ready. Also remove unused mock_presence from vboot_api_kernel4_tests. BUG=b:155848434, b:162486211 TEST=make clean && make runtests BRANCH=none Signed-off-by: Joel Kitching <kitching@google.com> Change-Id: I5cad7d40b2f52015f17f930a4d061c9cdf976a49 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2328985 Tested-by: Chun-ta Lin <itspeter@chromium.org> Commit-Queue: Chun-ta Lin <itspeter@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org>
* vboot: add vb2api_phone_recovery_ui_enabled()stabilize-quickfix-13310.91.Bstabilize-quickfix-13310.76.Bstabilize-quickfix-13310.73.Bstabilize-13310.99.Bstabilize-13310.94.Bstabilize-13310.83.Bstabilize-13310.74.Bstabilize-13310.72.Brelease-R85-13310.BYu-Ping Wu2020-06-251-1/+2
| | | | | | | | | | | | | | | | | | Add a new flag VB2_SECDATA_KERNEL_FLAG_PHONE_RECOVERY_UI_DISABLED to vb2_secdata_kernel_flags to separate phone recovery functionality from UI instructions. Also add vb2api_phone_recovery_ui_enabled() to control the UI behavior. BRANCH=none BUG=b:156532222 TEST=make runtests Cq-Depend: chromium:2260155 Change-Id: Ib91a206e680ba2cb47762d8a5c0c0ce146918b7d Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2259632 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org>
* vboot: enable phone recoveryYu-Ping Wu2020-05-141-2/+2
| | | | | | | | | | | | | Enable the phone recovery functionality and UI. BRANCH=none BUG=b:153596126 TEST=make runtests Change-Id: If4fc29db44903e79cecd959a9b558c509ad19e1a Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2196093 Reviewed-by: Joel Kitching <kitching@chromium.org>
* vboot: Convert reboot-related errors to vboot2-styleYu-Ping Wu2020-04-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Error codes are renamed as follows: VBERROR_SHUTDOWN_REQUESTED --> VB2_REQUEST_SHUTDOWN VBERROR_REBOOT_REQUIRED --> VB2_REQUEST_REBOOT VBERROR_EC_REBOOT_TO_SWITCH_RW --> VB2_REQUEST_REBOOT_EC_SWITCH_RW VBERROR_EC_REBOOT_TO_RO_REQUIRED --> VB2_REQUEST_REBOOT_EC_TO_RO VBERROR_KEEP_LOOPING --> VB2_REQUEST_UI_CONTINUE Since these are not really "errors", they're renamed to VB2_REQUEST_* instead, with larger values to separate from real errors. The old vboot1-style errors will be removed once the errors are renamed in coreboot and depthcharge. BRANCH=none BUG=b:124141368, chromium:988410 TEST=make runtests Change-Id: Ide1328f9c0f2803534fb3f1f1ecd16ad8ea36a4e Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2143030 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org>
* 2api: Add kernel version getter and make dev-signed check fail softJulius Werner2020-04-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This patch adds a function to retrieve the kernel rollback version from secdata, which may be interesting to callers that have more advanced ways of retrieving bootable images and want to be able to spot check whether an image can be booted without passing the full thing to vboot. Also reduce the penalty from calling vb2api_is_developer_signed() out of turn from an immediate DIE() to an angry error message, to support a case in depthcharge where for all practical purposes the call should never happen too early, but the framework can't quite guarantee it. BRANCH=None BUG=b:153758197 TEST=None Signed-off-by: Julius Werner <jwerner@chromium.org> Change-Id: Ic7c2fc62e1ba80f69f70421907b9686f0b3dae77 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2153592 Reviewed-by: Jes Klinke <jbk@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org> Tested-by: Jes Klinke <jbk@chromium.org>
* vboot: Add vb2api_phone_recovery_enabled() to vboot APIYu-Ping Wu2020-04-201-0/+6
| | | | | | | | | | | | | | | | | | | In order to implement a kill switch for phone recovery in recovery UI, add VB2_SECDATA_KERNEL_FLAGS to enum vb2_secdata_kernel_flags, and add VB2_SECDATA_KERNEL_FLAG_PHONE_RECOVERY_DISABLED to the flags to indicate whether to disable phone recovery. Set this flag to 1 in vb2api_kernel_phase1(). Also add vb2api_phone_recovery_enabled() to vboot API. BRANCH=none BUG=b:146399181, b:147744345 TEST=make runtests Change-Id: I65c8faa593f5f90dd762f0092058048983c5b3a2 Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2131236 Reviewed-by: Joel Kitching <kitching@chromium.org>
* secdata: Initialize secdata kernel in vb2api_fw_phase1dnojiri2020-04-181-8/+2
| | | | | | | | | | | | | | | | | | | | | | | Currently, secdata kernel is initialized in vb2api_kernel_phase1. Since we'll be using secdata kernel in romstage for EFS2, it needs to be initialized earlier. This patch makes vb2api_fw_phase1 call vb2_secdata_kernel_init. Signed-off-by: dnojiri <dnojiri@chromium.org> BUG=b:147298634, chromium:1045217, b:148259137 BRANCH=none TEST=Verify Hmir is updated in romstage on Puff. Cq-Depend: chromium:2155377 Change-Id: I8a537126a952ecccc9cc496ce60fc6dc81541a8f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2153852 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org>
* vboot: create 2kernel.c for kernel-related functionsJoel Kitching2020-03-091-0/+193
Create 2kernel.c for kernel-related functions (including both internal and API-facing). Relocate functions which are currently in active use from lib20/api_kernel.c to 2lib/2kernel.c. Create vb2_kernel_tests.c and move appropriate tests there. Tests for vb2_normal_boot (previously VbBootNormal) will be added in a subsequent CL. BUG=b:124141368, chromium:968464 TEST=make clean && make runtests BRANCH=none Change-Id: I153ea318ba238b7b30bf871105388437f63075d1 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2091126 Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org>