History log of /external/vboot_reference/firmware/lib/vboot_firmware.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
527ba810eff4006cf69579f6b96cb4350cb1e189 25-Jul-2013 Simon Glass <sjg@chromium.org> Implementation of Region API

At present reading data from storage in Vboot is a little fragmented. For
the firmware image, we expect the boot loader to handle this. For the disk
we have a block-level API. For the GBB (which also sits in the firmware
image) we expect the entire thing to be read before Vboot is called.

Add the concept of a region, and an API to read from a region. At present,
and most pressing, is reading from a GBB region. In the future this could
be extended to other parts of the firmware or even the disk.

Move all access to the GBB into this API so that the boot loader can provide
either a GBB region in one large contiguous chunk, or a function to deal with
read requests from vboot.

The call to VbExRegionRead() is behind a flag since not all boot loaders
support it yet.

The main change for boot loaders which don't support this new API is that
vboot will do more behind the scenes. For example, it will allocate memory
for chunks of data that it reads from the GBB, rather than just accessing it
directly. This approach is considerably simpler than trying to pass char **
everywhere and have vboot decide whether something needs to be allocated or
not.

The tests are updated, mainly to include setting up a GBB structure
accessible from VbCommonParams, which is now required by the firmware and
kernel functions. In normal operation this is set up at the start of
VbLoadFIrmware() and VbSelectAndLoadKernel() but for tests which call
children of these functions directly, the GBB structure must be set up
manually by the test.

BUG=chrome-os-partner:21115
BRANCH=none
TEST=manual
FEATURES=test sudo -E emerge vboot_reference

Change-Id: If2b8bbe467fdbd643239d8d9b5d7aa98df4d286f
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/63336
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/167361
/external/vboot_reference/firmware/lib/vboot_firmware.c
8fa13ad6f727d44fdc0ae1d2bde5f54b32dab9b9 29-Aug-2013 Yoshiki Iguchi <yoshiki@chromium.org> Revert "Implementation of Region API"

This reverts commit 1d3c804b6b9d2ffb6953a7ee98fabfd548915ad7.

This patch breaks cbuildbot on internal paladins bots.

Change-Id: Icf7f9d9bbb56b092035888eaa3e249ffd23fac16
(cherry picked from commit 3a60335ebb1530e5fd9d5da3bc6214949bc59caf)
Reviewed-on: https://chromium-review.googlesource.com/167451
Reviewed-by: Yoshiki Iguchi <yoshiki@chromium.org>
Commit-Queue: Yoshiki Iguchi <yoshiki@chromium.org>
Tested-by: Yoshiki Iguchi <yoshiki@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
1d3c804b6b9d2ffb6953a7ee98fabfd548915ad7 25-Jul-2013 Simon Glass <sjg@chromium.org> Implementation of Region API

At present reading data from storage in Vboot is a little fragmented. For
the firmware image, we expect the boot loader to handle this. For the disk
we have a block-level API. For the GBB (which also sits in the firmware
image) we expect the entire thing to be read before Vboot is called.

Add the concept of a region, and an API to read from a region. At present,
and most pressing, is reading from a GBB region. In the future this could
be extended to other parts of the firmware or even the disk.

Move all access to the GBB into this API so that the boot loader can provide
either a GBB region in one large contiguous chunk, or a function to deal with
read requests from vboot.

The call to VbExRegionRead() is behind a flag since not all boot loaders
support it yet.

The main change for boot loaders which don't support this new API is that
vboot will do more behind the scenes. For example, it will allocate memory
for chunks of data that it reads from the GBB, rather than just accessing it
directly. This approach is considerably simpler than trying to pass char **
everywhere and have vboot decide whether something needs to be allocated or
not.

The tests are updated, mainly to include setting up a GBB structure
accessible from VbCommonParams, which is now required by the firmware and
kernel functions. In normal operation this is set up at the start of
VbLoadFIrmware() and VbSelectAndLoadKernel() but for tests which call
children of these functions directly, the GBB structure must be set up
manually by the test.

BUG=chrome-os-partner:21115
BRANCH=none
TEST=manual
FEATURES=test sudo -E emerge vboot_reference

Change-Id: I2c19e9dc2ed602d0642bbf4f7d27f79fe9fad873
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/63336
Reviewed-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
981cb2acdc2f26ae27732a4e590c326787936381 12-Aug-2013 Simon Glass <sjg@chromium.org> Enable vboot for sandbox and improve debugging/format strings

Some functions of vboot are disabled for sandbox because sandbox could not
support them. This has changed, so remove the sandbox #ifdefs in the code.

Some printf() strings cause warnings on sandbox - mostly that uin64_t is
not 'long long' on a 64-bit machine. The existing format strings in U-Boot
do not seem to take account of this, so add casts to remove the warnings.

Also add a few more debug strings to make it easier to see what is happening
in the vboot flow.

BUG=chrome-os-partner:21115
BRANCH=pit
TEST=manual
crosfw -b sandbox -V

See there are no warnings.

Change-Id: I86f90a693e4bd23fcacf6d48297dd32229348dd4
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/65621
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
952c2d32452fc582900cc542edd75c7da6b3f830 27-Jun-2013 Aaron Durbin <adurbin@chromium.org> Fix recovery mode entry due to invalid FW hash.

If FW hash is invalid, it is possible for boot to continue as normal
because the shared recovery reason is not updated. Update the shared
recovery reason to ensure the bootloader knows to do a recovery boot.

This change affects only systems that do not support RO_NORMAL (ex.
Haswell systems).

BUG=chrome-os-partner:20518.
TEST=Run firmware_CorruptBothFwSigAB on Peppy, verify PASS.
BRANCH=None.
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>

Change-Id: I3b311416bf8c504deb4154e5850d967253c9dc17
Reviewed-on: https://gerrit.chromium.org/gerrit/60148
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Commit-Queue: Shawn Nematbakhsh <shawnn@chromium.org>
Tested-by: Shawn Nematbakhsh <shawnn@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
0c3ba249abb1dc60f5ebabccf84ff13206440b83 29-Mar-2013 Bill Richardson <wfrichar@chromium.org> Massive refactoring of external header files.

This reduces the number of exported header files to the minimum needed by
the existing userspace utilities and firmware implementations.

BUG=chromium:221544
BRANCH=none
TEST=manual, trybots
CQ-DEPEND=CL:47019,CL:47022,CL:47023

sudo FEATURES=test emerge vboot_reference
FEATURES=test emerge-$BOARD \
vboot_reference \
chromeos-cryptohome \
chromeos-installer \
chromeos-u-boot \
peach-u-boot \
depthcharge

Change-Id: I2946cc2dbaf5459a6c5eca92ca57d546498e6d85
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/47021
Reviewed-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
ac8805e7e9bd40c03baf44e37b26f28d9b763ab5 16-Mar-2013 Gabe Black <gabeblack@chromium.org> Get rid of some crufty macros.

These were macros that were never used, or that were only set to one thing and
could be substituted up front.

I left in code guarded by the HAVE_ENDIAN_H and HAVE_LITTLE_ENDIAN macros even
though those are never defined because they guard a reportedly significantly
faster implementation of some functionality, at least according to a comment
in the source. It would be a good idea to enable that code path and see if it
really does make a big difference before removing it entirely.

BUG=None
TEST=Built for Link, Daisy, and the host with FEATURES=test. Built depthcharge
for Link and booted in normal mode.
BRANCH=None

Change-Id: I934a4dd0da169ac018ba07350d56924ab88b1acc
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/45687
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
7993f257af87c7c38cdc71b76bc67cde6c3cdbca 30-Jan-2013 Randall Spangler <rspangler@chromium.org> Reformat to kernel style

No code changes, just reformatting.

BUG=none
BRANCH=none
TEST=make runtests

Change-Id: Id690c8334147970784db5ac54933ad1f5a58dcc1
Reviewed-on: https://gerrit.chromium.org/gerrit/42263
Tested-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Queue: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
acd6f4688abb9a0253bb469a8a52046c97281347 14-Jun-2012 Randall Spangler <rspangler@chromium.org> Add GBB flags to enable dev mode by default

And enable dev_boot_usb by default.
And disable rollback checks.

The first flag is necessary for factory to build with keyboard
controlled dev mode. The other flags are really handy for development
on systems where you've defeated firmware WP and are installing custom
firmware.

BUG=chromium-os:31844
TEST=make && make runtests

Signed-off-by: Randall Spangler <rspangler@chromium.org>

Change-Id: I9d837fee676cb0186ea98f13005ad60a9ab86393
Reviewed-on: https://gerrit.chromium.org/gerrit/25265
Tested-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Ready: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
c0e3742996a84d3c503cfa002b09a0831bcb2c32 08-Jun-2012 Randall Spangler <rspangler@chromium.org> Remove unused test fields from VbNvStorage

Confirmed via codesearch that these fields are not used outside of
vboot_reference itself, and the only use inside vboot_reference is one
test which checked that the test error generation itself worked.

BUG=chromium-os:31668
TEST=make && make runtests

Signed-off-by: Randall Spangler <rspangler@chromium.org>
Change-Id: Ic393e126ca2853f7aaff19ffd6fcdbdb1c47689f
Reviewed-on: https://gerrit.chromium.org/gerrit/24895
Reviewed-by: Simon Glass <sjg@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
6c6babc51b5a500af4c37a6a691cd2a4b5612345 31-Aug-2011 Randall Spangler <rspangler@chromium.org> Add tests for vboot_firmware.c

Yaay, LoadFirmware() finally has unit tests!

Fix minor memory leak in LoadFirmware().

BUG=chromium-os:17564
TEST=make && make runtests

Change-Id: I7eabc14484271f488b77f286e846781ccc22b8f2
(cherry picked from commit 2b7c5635d7069c55a1d96d11b99d02291b7e308b)
Reviewed-on: http://gerrit.chromium.org/gerrit/7052
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
8eead8e560fe334b970dfd8c3657dd55e9fa6a75 29-Jul-2011 Randall Spangler <rspangler@chromium.org> Clean up calling LoadFirmware() from VbSelectFirmware()

BUG=chromium-os:18383
TEST=compiles for both x86 and ARM; boots on my test system

Change-Id: I6c7dc1dd086fb06e4ad8daa053bccdf61a463240
Reviewed-on: http://gerrit.chromium.org/gerrit/4977
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Tested-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
57e91f713f7e647e79ecdf7a6de878f638661e05 26-Jul-2011 Randall Spangler <rspangler@chromium.org> Move VbNvContext setup/teardown to vboot wrapper funcs

BUG=chromium-os:18226
TEST=make && make runtests

Change-Id: Ie22e99a9796866e646ed92158410bc7a2fdf90f6
Reviewed-on: http://gerrit.chromium.org/gerrit/4754
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Tested-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
dfb0175a5b077e2c3c2809ee71c9b3368d91dbd9 25-Jul-2011 Randall Spangler <rspangler@chromium.org> Refactor LoadFirmware() and LoadKernel() to return VbError_t

BUG=chromium-os:18161
TEST=make && make runtests

Change-Id: I1f60654fef84e26ee15fa8bdaacdb87fb1ddf69e
Reviewed-on: http://gerrit.chromium.org/gerrit/4676
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
22e7bb2b8e73614d7171cc8d1d51c9bd21f22f54 22-Jul-2011 Randall Spangler <rspangler@chromium.org> Refactor TPM calls into vboot wrapper

Try #2, now that ARM has the fix from http://gerrit.chromium.org/gerrit/4667

This cleans up the TPM calls inside vboot_reference.
* TPM calls share mode code between boot modes.
* Better handling for TPM_E_MUST_REBOOT, particularly in recovery mode.
* TAB screen shows current TPM versions.

No changes required to the wrapper API; these changes are internal to vboot.

BUG=chromium-os:18084
TEST=make && make runtests; built for both alex and tegra2-seaboard

Original-Change-Id: I2a52066f2889210af83409872b10f9d6380470af
(cherry picked from commit da55560cddcf7a1aa8a881cdf52792a21a01e766)

Change-Id: I120797145772116f09b8125b9e56fdbb11dc16b3
Reviewed-on: http://gerrit.chromium.org/gerrit/4671
Tested-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
64b2ba41cc5b9125c78b6372eb7f9ed51f4b65a6 25-Jul-2011 Elly Jones <ellyjones@chromium.org> Revert "Refactor TPM calls into vboot wrapper"

This reverts commit da55560cddcf7a1aa8a881cdf52792a21a01e766. This commit caused http://build.chromium.org/p/chromiumos/builders/arm%20tegra2%20binary/builds/6301 to fail.

Change-Id: Ie132c1e600ab28f97337ecfe0e7cff053987717d
Reviewed-on: http://gerrit.chromium.org/gerrit/4661
Reviewed-by: Elly Jones <ellyjones@chromium.org>
Tested-by: Elly Jones <ellyjones@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
4bc713d0df70117a6459fb1ac0ca248eef774c66 22-Jul-2011 Randall Spangler <rspangler@chromium.org> Refactor TPM calls into vboot wrapper

This cleans up the TPM calls inside vboot_reference.
* TPM calls share mode code between boot modes.
* Better handling for TPM_E_MUST_REBOOT, particularly in recovery mode.
* TAB screen shows current TPM versions.

No changes required to the wrapper API; these changes are internal to vboot.

BUG=chromium-os:18084
TEST=make && make runtests; built for both alex and tegra2-seaboard

Change-Id: I2a52066f2889210af83409872b10f9d6380470af
Reviewed-on: http://gerrit.chromium.org/gerrit/4611
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
ad03a439bc97523e03d19aa1dcd568744d60889c 22-Jul-2011 Randall Spangler <rspangler@chromium.org> Cleanup and preparation for inside-wrapper TPM refactoring.

Add recovery reason for already in recovery and need to reboot to
recovery to let the TPM init.

Add vboot_struct fields.

Fix type for keyblock flags param to SetTPMBootModeState().

BUG=none
TEST=make && make runtests

Change-Id: I4035bdb377aaebaca03a43799be57977166da739
Reviewed-on: http://gerrit.chromium.org/gerrit/4599
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
8409b374980721bd120de2511c37bd6e171de910 15-Jul-2011 Randall Spangler <rspangler@chromium.org> Add typecast to fix compiling in MSVC

BUG=none
TEST=make && make runtests

Change-Id: I774645c1059df70cd25ea6a3f78161eb916d7293
Reviewed-on: http://gerrit.chromium.org/gerrit/4192
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Tested-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
7d1c22b75ad4173f5d319e049e766e04cea110f8 14-Jul-2011 Che-Liang Chiou <clchiou@chromium.org> Fix compiler error

BUG=chromium-os:17304
TEST=make successfully

Change-Id: Icebd25069a445960eb4e1e92f10dec195ea3fbf1
Reviewed-on: http://gerrit.chromium.org/gerrit/4152
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
8bf0d5ff0ff77aaf496507bbe8d65a5f3027c80c 14-Jul-2011 Randall Spangler <rspangler@chromium.org> Add vboot support for RO-normal code path.

BUG=chromium-os:17304
TEST=make && make runtests

Change-Id: I4d0f8afd516649fba67119845ec1c4479ba54c43
Reviewed-on: http://gerrit.chromium.org/gerrit/4065
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
9619112a574b975476667545e3a326052fa0c50b 08-Jul-2011 Randall Spangler <rspangler@chromium.org> Vboot wrapper - add recovery reason, refactor timing

Pressing Tab at a firmware screen now displays real data, including
the recovery reason, HWID, and contents of VbNvStorage.

Entry point start/end time tracking in VbSharedData now refers to the
new wrapper APIs.

Added capability for calling firmware to request recovery mode (for
example, if it's unable to initialize RAM, can't find the SSD, etc.).
Previously, calling firmware had no (good) way to do this other than
faking the recovery button being pressed.

BUG=chromium-os:17018
TEST=emerge on x86 and tegra2_seaboard

Change-Id: I7d377f279842b30a10d945d13571c41c464633f1
Reviewed-on: http://gerrit.chromium.org/gerrit/3814
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
1b1998dff0002f20b3f27a21e6e79d8951e64684 02-Jul-2011 Randall Spangler <rspangler@chromium.org> Vboot wrapper initial implementation

Patch 1: Initial change
Patch 2: Fix comment in vboot_struct.h
Patch 3: Revert files unintentionally reverted
Patch 4: (rebase)
Patch 5: (rebase)
Patch 6: Revert files unintentionally reverted (again)
Patch 7: Fix mocked tlcl for ARM build

BUG=chromium-os:17010
TEST=make && make runtests; works on H2C; emerge-tegra2_seaboard chromeos-bootimage compiles

Change-Id: I6e5ce72d41b9297c07a3f330a881eba68cfabee2
Reviewed-on: http://gerrit.chromium.org/gerrit/3593
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
e49e8af65fce38da7a308305566f8a14f102254a 08-Jul-2011 Randall Spangler <rspangler@chromium.org> Port vboot_reference to use new wrapper API utility functions

Third time's the charm. Now that we've moved to u-boot-next, this
won't break the ARM build.

BUG=chromium-os:17006
TEST=make && make runtests; emerge vboot_reference; emerge-tegra2_seaboard chromeos-bootimage

Change-Id: Ib4fa26c7a23868dd2ffd2b321ee8dc08c66ea322
Original-Change-Id: I771085dcdf79d9592de64f35e3b758111a80dd9f
Original-Reviewed-on: http://gerrit.chromium.org/gerrit/3263
Original-Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/3803
Tested-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
cfd841d3c2c8bb91e7024c62d0acc8668c5041b3 02-Jul-2011 Randall Spangler <rspangler@chromium.org> Revert "Verified boot wrapper - replace utility functions"

This reverts commit 0184886c8cb35e8e01d610622df448a7cb063e06

(This works with uboot-next, but not uboot, which doesn't implement its half of the new wrapper API. So rolling back to leave uboot working.

Change-Id: I1f9e3c63e5bbdb20b9195cd68787bef89f24afee
Reviewed-on: http://gerrit.chromium.org/gerrit/3588
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
f8c65491595a8e849cf61b600b2371357ec75ff4 27-Jun-2011 Randall Spangler <rspangler@chromium.org> Verified boot wrapper - replace utility functions

This is part 3 of the vboot wrapper API refactoring. It replaces the
function calls to utility.c functions with new API calls. (It also
fixes up some integer type mismatches in cryptolib that were causing
warnings on the H2C build; those had been fixed a while ago in H2C but
hadn't been propagated across.)

This is a re-commit of the original; I've verified it compiles on both
x86-alex and tegra2, for both vboot_reference and
vboot_reference-firmware, now that the patch from
1c1a883bc746a6216bb634825d33d80562853020 is checked in.

BUG=chromium-os:17006
TEST=make && make runtests, and emerged on both x86-alex and tegra2

Original-Change-Id: I771085dcdf79d9592de64f35e3b758111a80dd9f
Original-Reviewed-on: http://gerrit.chromium.org/gerrit/3263
Original-Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
(cherry picked from commit bd81b3a7d3b7fe4ca6179ade665e565800ab17fc)

Change-Id: Iefdbfb3d10eb9aa385fb6dfc3bf0896f637cb64b
Reviewed-on: http://gerrit.chromium.org/gerrit/3582
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
a7b9481f343fb4a19b5a5ed44c2fda2c59547e84 28-Jun-2011 mukesh agrawal <quiche@chromium.org> Revert "Verified boot wrapper - replace utility functions"

This reverts commit bd81b3a7d3b7fe4ca6179ade665e565800ab17fc.

Change-Id: I2be2c076a37bf0e49569248691fceac417254f0b
Reviewed-on: http://gerrit.chromium.org/gerrit/3295
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
bd81b3a7d3b7fe4ca6179ade665e565800ab17fc 27-Jun-2011 Randall Spangler <rspangler@chromium.org> Verified boot wrapper - replace utility functions

This is part 3 of the vboot wrapper API refactoring. It replaces the
function calls to utility.c functions with new API calls. (It also
fixes up some integer type mismatches in cryptolib that were causing
warnings on the H2C build; those had been fixed a while ago in H2C but
hadn't been propagated across.)

BUG=chromium-os:17006
TEST=make && make runtests

Change-Id: I771085dcdf79d9592de64f35e3b758111a80dd9f
Reviewed-on: http://gerrit.chromium.org/gerrit/3263
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
4dd03035c2cd9deeaebac68bf7181fe50dc30237 10-May-2011 Randall Spangler <rspangler@chromium.org> Fix build break

BUG=none
TEST=emerge-x86-generic vboot_reference

Change-Id: Ic34f0aedbb6522e2ac4bbea3cb33f303435a0d33
Reviewed-on: http://gerrit.chromium.org/gerrit/608
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
9243e616d727c3e57525f8dec2b5f22840900451 10-May-2011 Randall Spangler <rspangler@chromium.org> Add more specific recovery reasons for RW firmware invalid

BUG=chrome-os-partner:3698
TEST=manual

1. Run the firmware key/version autoupdate test; this rolls forward your stored TPM version numbers.
2. Put back the original firmware.
3. Reboot.
4. Press TAB at recovery screen.
5. Should see Recovery Reason 0x14.

Change-Id: I7791f594dbd8919e74d1e6b97b99775cf1e73d1d
Reviewed-on: http://gerrit.chromium.org/gerrit/567
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/firmware/lib/vboot_firmware.c
cabe6b3514f3228b350a7d07d6cc7cb39eecaaf6 18-Mar-2011 Randall Spangler <rspangler@chromium.org> Use VbSharedData instead of VbNvStorage for fwb_tries and kernkey_vfy

Change-Id: I5ed3509a9d4e578cd2e98f493dab59bc2fbd5827

R=dlaurie@chromium.org
BUG=chrome-os-partner:2748
TEST=manual

crossystem fwb_tries=3
(reboot)
crossystem tried_fwb
(should print 1)

crossystem fwb_tries=0
(reboot)
crossystem tried_fwb
(should print 0)

In dev mode...
Boot a kernel signed with the same key as in the firmware
crossystem kernkey_vfy
(should print sig)
Boot a kernel signed with a different key than the firmware
crossystem kernkey_vfy
(should print hash)

Review URL: http://codereview.chromium.org/6711045
/external/vboot_reference/firmware/lib/vboot_firmware.c
5ac39bfff0d9e2ad2c3e1fe9b3fd3f314b50a472 18-Mar-2011 Randall Spangler <rspangler@chromium.org> Add TPM version checking

Change-Id: Ic32b7bcf0bc5501e21dc84e79419a256d9b0d095

R=semenzato@chromium.org,reinauer@chromium.org
BUG=chrome-os-partner:2832
TEST=manual

crossystem tpm_fwver tpm_kernver
On a debug system, this will return 0x00010001 0x00010001

Review URL: http://codereview.chromium.org/6685075
/external/vboot_reference/firmware/lib/vboot_firmware.c
f4ba19d81d4fefa0dba4efbdd57dc863138fde3a 18-Mar-2011 Randall Spangler <rspangler@chromium.org> Add VbSharedData field parsing

R=reinauer@chromium.org
BUG=chrome-os-partner:2578
TEST=manual

crossystem vdat_timers
should show 'LFS=0,0 LF=number1,number2 LK=number3,number4'
where number1 < number2 < number3 < number4

crossystem vdat_lfdebug
run from a dev mode console, should show
'check=12,0 index=0x00 tpmver=(hex number) lowestver=(hex number)'

crossystem vdat_flags
run from a dev mode console, flags should be 0x04.

Review URL: http://codereview.chromium.org/6685068

Change-Id: Id7b958ae300d10cdcdc1b17a1bb17b7e5069166f
/external/vboot_reference/firmware/lib/vboot_firmware.c
ad6824ba4fc18c4eba4e98ba2b2e476dfcedbbae 17-Mar-2011 Randall Spangler <rspangler@chromium.org> Added timing data to VbSharedData.

Change-Id: I8d52765227fd3355431bebc77dfbe0106c889eca

BUG=chrome-os-partner:2748
TEST=compiles; will be porting to H2C next

Review URL: http://codereview.chromium.org/6672068
/external/vboot_reference/firmware/lib/vboot_firmware.c
4c6e6dac28edfdfc724074b929ec95c6e3104d91 16-Mar-2011 Randall Spangler <rspangler@chromium.org> Fix compiler errors on MSVC

Change-Id: I47fd6d0be5542e5f540a34410b3f694ae0f67fd9

R=gauravsh@chromium.org
BUG=none
TEST=make && make runtests

Review URL: http://codereview.chromium.org/6676039
/external/vboot_reference/firmware/lib/vboot_firmware.c
b64faaa7f4167344765eb32baebb0aa01a03bc29 16-Mar-2011 Gaurav Shah <gauravsh@chromium.org> Update PCR state with the state of the firmware keyblock flags too.

I re-factored the extend call into its own module, since it doesn't necessarily
need to be couple with rollbackfirmwaresetup.

BUG=chrome-os-partner:2372
TEST=Tried emerge-x86-generic and emerge-arm-generic vboot_reference.

Change-Id: I0d3115b10b686133e63e304570325ebdbd50ae3a

Review URL: http://codereview.chromium.org/6696006
/external/vboot_reference/firmware/lib/vboot_firmware.c
99ca3466ba097cceacaff0129e9060578a8fcb20 15-Mar-2011 Randall Spangler <rspangler@chromium.org> LoadFirmware() and LoadKernel() handling for test errors

Change-Id: Icecfcab8f5cc30e80da7a2d77a1b1729f5094fee

R=wfrichar@chromium.org
BUG=13107
TEST=make && make runtests

Review URL: http://codereview.chromium.org/6673048
/external/vboot_reference/firmware/lib/vboot_firmware.c
95c4031ce903258036beeed0705d25c7e9d25da0 10-Mar-2011 Randall Spangler <rspangler@chromium.org> This is necessary to pass additional information about whether firmware A or B is being run. This change also passes the GBB directly into LoadFirmware() and LoadKernel().

Change-Id: I976c11c82c3d665a4feb88226e919f16c2440f60

BUG=chrome-os-partner:1657
TEST=manual - see below

make && make runtests

Then test verifying a test image in both dev mode (-b1, no key specified) and recovery mode (key specified)

build/utility/load_kernel_test -b1 ~/b/USB_images/0.11.224.0-alex/chromiumos_test_image.bin

build/utility/load_kernel_test ~/b/USB_images/0.11.224.0-alex/chromiumos_test_image.bin tests/devkeys/recovery_key.vbpubk

And make sure the firmware with this change actually boots to USB and SSD.

NOTE: u-boot-next needs to change to work with this change. will attempt a follow-up CL with that change

Review URL: http://codereview.chromium.org/6626045
/external/vboot_reference/firmware/lib/vboot_firmware.c
c324fbfb6d37aa62b0e6e2f22dae7c949896ddef 04-Mar-2011 Randall Spangler <rspangler@chromium.org> Only advance kernel version when the booted partition has a valid key block

Change-Id: I879c18cc139f8a02bcaa6eb80437eaf836a5e851

BUG=chrome-os-partner:2597
TEST=manual

install pvt-signed image
flip dev switch on and boot
install dev-signed firmware
reboot
reboot
sudo bash
stop tcsd
tpmc read 0x1008 0x0d

bytes 6-10 should be 1 0 1 0, not FF FF FF FF

Review URL: http://codereview.chromium.org/6626020
/external/vboot_reference/firmware/lib/vboot_firmware.c
b416714a10cc8b8048009ca2ab0f3fa1dc4ac24b 01-Mar-2011 Randall Spangler <rspangler@chromium.org> Add crossystem support for nvram_cleared and kern_nv

Fix try_b processing

And move key block flags check up in LoadFirmware(), which speeds up
boot when the dev switch is off because it doesn't do a signature
check and then throw it out.

BUG=12282
TEST=build firmware, try by hand

Review URL: http://codereview.chromium.org/6596081

Change-Id: I10474e9e0ae324906dfe02a351347d04ce847f67
/external/vboot_reference/firmware/lib/vboot_firmware.c
c4d21025bb57d78c512c014b694ea148cea18d7e 25-Feb-2011 Randall Spangler <rspangler@chromium.org> Add LoadFirmware() support for NvStorage API

Change-Id: I19f402904978581eb5ca990ffbdf2f762b48c217

BUG=12282
TEST=make H2C firmware and verify using crossystem utility

(set fwb_tries, reboot, verify that mainfw_act is B)

Review URL: http://codereview.chromium.org/6597018
/external/vboot_reference/firmware/lib/vboot_firmware.c
a8e0f94b94c2181a95a984fbcd8de80c3ca1b8c9 14-Feb-2011 Randall Spangler <rspangler@chromium.org> Support dev vs consumer firmware in vboot_reference

Change-Id: I5a42ba017974b3d591abc574ef7b9b7c9ac579e8

BUG=chrome-os-partner:1824
TEST=make && make runtests

Review URL: http://codereview.chromium.org/6462010
/external/vboot_reference/firmware/lib/vboot_firmware.c
6078ca3398f5e72360fb16b1f66049b2aa7ea73c 19-Oct-2010 Randall Spangler <rspangler@chromium.org> Add profile macro calls

This matches the calls in firmware version 0037.

BUG=none
TEST=manual

Review URL: http://codereview.chromium.org/3859002

Change-Id: I3b45051dec3f4f45414802b39122c8d52c4d62f1
/external/vboot_reference/firmware/lib/vboot_firmware.c
1fe1607679a17a37ab6be390e2f04155e5c37e8e 02-Sep-2010 Randall Spangler <rspangler@chromium.org> TBR: reviewed in person with semenzato
/external/vboot_reference/firmware/lib/vboot_firmware.c
138acfe1ba4b567f470c67e22a8d9e2225beafb0 18-Aug-2010 Randall Spangler <rspangler@chromium.org> Fix KeyBlockVerify() to take an explicit param for whether to use hash only.

Fix VerifyMemberInside().

BUG=chrome-os-partner:703
TEST=make && make runtests

Review URL: http://codereview.chromium.org/3126013
/external/vboot_reference/firmware/lib/vboot_firmware.c
666802822b771c05e435973b767e494a4fff2747 16-Aug-2010 Randall Spangler <rspangler@chromium.org> Change rollback interface so kernel/firmware version numbers are
packed in the calling code rather than in rollback_index.

Review URL: http://codereview.chromium.org/3114013
/external/vboot_reference/firmware/lib/vboot_firmware.c
4abede35afc8b5ecc8165d5d79f77c203bce51fc 13-Aug-2010 Randall Spangler <rspangler@chromium.org> Add structs for TPM NV simplification. Now uses only 2 NV spaces, one for firmware and one for kernel.

Changed TlclRead / TlclWrite to take void* / const void* to reduce typecasts.

Much restructuring of rollback_index.c.

Fixed a version-packing bug in rollback_index.c (& --> |)

BUG:chrome-os-partner:304
TEST:manual testing of all code flows on CRB

Review URL: http://codereview.chromium.org/3084030
/external/vboot_reference/firmware/lib/vboot_firmware.c
63dffcb52b56f27d5315de249d20958b94eed47f 06-Aug-2010 Randall Spangler <rspangler@chromium.org> Enable TPM in developer mode again.

Also fix a few comments, and make extra debugging work when compiled
in firmware.

BUG=none
TEST=make && make runtests; all pass

Review URL: http://codereview.chromium.org/3007036
/external/vboot_reference/firmware/lib/vboot_firmware.c
87c13d806b1f58542b0fc0893144de45d31cabd2 19-Jul-2010 Randall Spangler <rspangler@chromium.org> Added size param to VerifyData()

Also renamed verify preamble functions, now that they do not need the
'2' at the end to differentiate them from the now-deleted original
implementation.

BUG=4501
TEST=Ran make runtests; all pass.

Review URL: http://codereview.chromium.org/3027009
/external/vboot_reference/firmware/lib/vboot_firmware.c
3e1081fb71385d72fd3a522599c35b516dda7a37 19-Jul-2010 Randall Spangler <rspangler@chromium.org> Add lots of debugging to TPM library.

Temporarily disable TPM in developer mode.

Review URL: http://codereview.chromium.org/3041005
/external/vboot_reference/firmware/lib/vboot_firmware.c
7a786b73e769ba9be6823adc4980d7c9a992f55e 08-Jul-2010 Randall Spangler <rspangler@chromium.org> added reboot return codes to load kernel and firmware

Review URL: http://codereview.chromium.org/2844044
/external/vboot_reference/firmware/lib/vboot_firmware.c
2b9ddae52ba564dddcfc8bdcbed04dc07a52a7c6 28-Jun-2010 Luigi Semenzato <semenzato@google.com> New rollback_index API.

Review URL: http://codereview.chromium.org/2869022
/external/vboot_reference/firmware/lib/vboot_firmware.c
d0d48b58a10ee69c65d9ba6816cdae0ed89bef0e 24-Jun-2010 Randall Spangler <rspangler@chromium.org> Add boot flags to LoadFirmware(), for TPM init

Review URL: http://codereview.chromium.org/2865015
/external/vboot_reference/firmware/lib/vboot_firmware.c
e2ec98412e3a6e24620f8d8730c50c79b7ce7d25 24-Jun-2010 Randall Spangler <rspangler@chromium.org> Add VBDEBUG macro for debug output.

Replaced in firmware/ lib; not replaced in host-side utils/tests.

Review URL: http://codereview.chromium.org/2810026
/external/vboot_reference/firmware/lib/vboot_firmware.c
07f78652276e75d3a1102e58de6078d08ceb4e69 24-Jun-2010 Randall Spangler <rspangler@chromium.org> fix passing key out of LoadFirmware

Review URL: http://codereview.chromium.org/2825019
/external/vboot_reference/firmware/lib/vboot_firmware.c
1078838fff3554c0c4bcae771984cb2164bd7359 24-Jun-2010 Randall Spangler <rspangler@chromium.org> Refactor rollback interface for LoadKernel(), LoadFirmware().

Review URL: http://codereview.chromium.org/2861020
/external/vboot_reference/firmware/lib/vboot_firmware.c
b9d60a52b7760d32d3592a76dccb6d6cefd85272 23-Jun-2010 Randall Spangler <rspangler@chromium.org> Even more integration fixes.

Review URL: http://codereview.chromium.org/2849021
/external/vboot_reference/firmware/lib/vboot_firmware.c
81d0996901387619cc782ca258fcb4a9f3f591e7 23-Jun-2010 Randall Spangler <rspangler@chromium.org> Assorted integration fixes.

MSVC does not like bitfields with extra bits in them, so it made the GptEntry struct too big.

Fixed a missing return value in LoadFirmware().

Added some debug output.

Fixed calls to SetupTPM().

Tested with 'make && make runtests'. No errors.

Review URL: http://codereview.chromium.org/2865014
/external/vboot_reference/firmware/lib/vboot_firmware.c
beb5bae09f7c7153a1a89946026ba2af8cf3c838 22-Jun-2010 Randall Spangler <rspangler@chromium.org> Fixes to compiler warnings in MSVC

Review URL: http://codereview.chromium.org/2851015
/external/vboot_reference/firmware/lib/vboot_firmware.c
620c38cf34eadcd222535b01fb71c5e9fbc1cb80 17-Jun-2010 Randall Spangler <rspangler@chromium.org> Remove unused files, and tidy the directory structure of the remaining ones.

Review URL: http://codereview.chromium.org/2815011
/external/vboot_reference/firmware/lib/vboot_firmware.c