Commit Graph

238 Commits

Author SHA1 Message Date
Randall Spangler
95c4031ce9 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
2011-03-09 15:54:16 -08:00
Randall Spangler
c324fbfb6d 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
2011-03-04 12:19:25 -08:00
Randall Spangler
640fb51d86 Reapply patch from http://codereview.chromium.org/6594092/
(somehow that never got committed)

Change-Id: I304e594066c5dd72fc7cf37d31e27b1096ae1a38

BUG=12282
TEST=make && make runtests

Review URL: http://codereview.chromium.org/6610019
2011-03-03 10:11:17 -08:00
Randall Spangler
c4d21025bb 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
2011-02-25 14:57:39 -08:00
Randall Spangler
92e378e453 rename tried_fwb constants
Change-Id: Ib8018bfe29eed50766c699d832efe4f1afcabb1a

BUG=none
TEST=make && make runtests

Review URL: http://codereview.chromium.org/6597015
2011-02-25 13:56:53 -08:00
Randall Spangler
172602829d Add NV storage fields for firmware flags
1) Did firmware attempt RW slot B before slot A?

2) Did firmware check the kernel keyblock signature, or just its hash?

Added crossystem support as well.

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

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

Change-Id: I0d743ae87cedd938ba988170793717d3fdbd8ce9
2011-02-25 12:06:26 -08:00
Rong Chang
baa3bbe7a5 Move tpm lite API to common include path
In order to run test cases in both Linux user mode and u-boot command
mode. The API header tlcl.h must be accessed by both ebuilds.

Change-Id: Ic027dc118f26666b88bf54c511e2455a55e4eb8f

BUG=chromium-os:10497
TEST=emerge vboot_reference-firmware successfully

Review URL: http://codereview.chromium.org/6469089
2011-02-23 10:41:38 +08:00
Randall Spangler
9e162cdaa7 VbNvStorage cleanup and comments
BUG=12282
TEST=make && make runtests

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

Change-Id: I912b53ae33d65305353a747cc0bdd2b1ea62a04f
2011-02-22 13:06:53 -08:00
Randall Spangler
b944534edd Add NV storage API to vboot reference
BUG=chromium-os:12282
TEST=make && make runtests

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

Change-Id: I57099de54ed56aa722f1944568bbb58b71b14379
2011-02-17 15:57:39 -08:00
Tom Wai-Hong Tam
ee2bc91d43 Enable LZMA compression in bmpbklk_utility.
LZMA has better compression ratio and is also supported in u-boot already.
ARM BIOS will use LZMA to compress BMP files.

BUG=chromium-os:11017
TEST=manual
$ make
$ make runbmptests

Change-Id: I6b791e3284b65eb3085b0de548bd241eab2ee598

Review URL: http://codereview.chromium.org/6523019
2011-02-17 12:58:58 +08:00
Randall Spangler
a8e0f94b94 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
2011-02-14 11:12:09 -08:00
Bill Richardson
794d4d44db New commandline args are clearer, and prepare for compression.
BUG=chromium-os:11488
TEST=none

Change-Id: I6ee493037da5746d2db6e840ac6590dd12f37cfe

Review URL: http://codereview.chromium.org/6482001
2011-02-10 19:13:10 -08:00
Bill Richardson
0ca3830a7b Add missing pragma for MSVC.
Change-Id: I37c811c52b8eb01d8e9b3888d55b2b58071711c5

BUG=chrome-os-partner:2022
TEST=none

Review URL: http://codereview.chromium.org/6462032
2011-02-09 12:52:53 -08:00
Bill Richardson
d55085da49 Slight modification to a previously-LGTM'd CL, to work with ebuild changes.
This replaces http://codereview.chromium.org/6307007. The only difference is
the Makefile. The vboot_reference ebuild has been changed so that we only
attempt to build bmpblk_utility on the host.

Change-Id: I4902703baba155e0d2d7646d19b233aa695c282f

BUG=chromium-os:11017,chromium-os:10599
TEST=none

No test needed. If buildbot is green, it's verified.

Review URL: http://codereview.chromium.org/6334111
2011-02-04 15:01:37 -08:00
Satoru Takabayashi
25364052f2 Revert for fixing the chromium os build.
Revert "This change define the data structure of bmp block and implements the create more of bmpblk_utility. It reads a YAML config file, parse the informations, and creates bmpblock file as output."

This reverts commit 95b0ae01ea.

BUG=none
TEST=emerge-x86 vboot_reference
TBR=waihong@chromium.org

Change-Id: If1692ca12ddb61b7814ca7dddccee5a395c8bed1
2011-01-27 20:05:04 +09:00
Tom Wai-Hong Tam
95b0ae01ea This change define the data structure of bmp block and implements the create more of bmpblk_utility. It reads a YAML config file, parse the informations, and creates bmpblock file as output.
The list mode and extract mode will be implemented later.

Change-Id: I2b34b323814b1d6b0a369b0e4b2bfa7cf960ff4a

BUG=chromium-os:11017
TEST=build and run, use bvi to check its output.

Review URL: http://codereview.chromium.org/6307007
2011-01-27 17:48:47 +08:00
Che-Liang Chiou
f7bdfbbb98 Expose vboot_struct.h to u-boot
BUG=chromium-os:1302
TEST=cat <<EOF | sh
	sudo emerge vboot_reference &&
	emerge-tegra2_seaboard vboot_reference-firmware &&
	[ -f /build/tegra2_seaboard/usr/include/vboot/vboot_struct.h ] &&
	echo 'Succeed!'
EOF

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

Change-Id: I363daa7ed49c49fee3b3ed0fae06857142fe5cb4
2011-01-12 17:19:07 +08:00
Che-Liang Chiou
5d9509cbde vboot TPM stub functions return error codes
TlclStubInit, TlclCloseDevice, and TlclOpenDevice were void functions but
should return error codes.

BUG=chromium-os:6695
TEST=RUNTESTS=1 make && emerge successfully

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

Change-Id: I8ddbf8b1f080d98ff6ed42c4a675fbda5b17eef1
2010-12-16 14:11:17 +08:00
Che-Liang Chiou
89678602e6 Fix integration bugs (vboot side)
BUG=chromium-os:8621
TEST=See below

1. Build and run tests of vboot (including linktest)
$ make && make runtests

2. Check if *_stub.o are not in vboot_fw.a
$ nm /build/<board>/usr/lib/vboot_fw.a | grep _stub.o

3. Build and boot x86-generic image
$ ./build_packages --board=x86-generic && ./build_image --board=x86-generic
(Then successfully boot the image you just built)

See CL=4372001 for u-boot side changes

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

Change-Id: Icc2bcc551c998f370e4b737fbe442ebf029cd81c
2010-11-09 08:33:36 +08:00
Randall Spangler
38e0de5728 Add maximum length constant for HWID, so it can be used by other utilities/firmware.
BUG=none
TEST=manual

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

Change-Id: Ic5de775353ff3145018b28dccc6d983bbaf40180
2010-10-18 12:59:08 -07:00
Randall Spangler
c93347b3c2 Add performance macros. When enabled, these are defined in each platform's biosincludes.h.
Fix assert() macro to only be defined #ifdef VBOOT_DEBUG

Change-Id: I4a65c408544cd4319628c4ad20ed46eafebe69c9

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

Review URL: http://codereview.chromium.org/3446025
2010-10-04 12:45:49 -07:00
Randall Spangler
1fe1607679 TBR: reviewed in person with semenzato 2010-09-02 11:37:51 -07:00
Gaurav Shah
37dff84dbb Make sure that our version of certain utility function implementations gets used in the firmware.
Reference code drop-in to firmware should make our implementations of Memset() and SafeMemcmp() get used now.

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

Change-Id: If0c06dfad85b67398a118985cdb751d20b2b65a4

Review URL: http://codereview.chromium.org/3173035
2010-08-20 14:30:03 -07:00
Bill Richardson
5deb67f225 Make LoadKernel() pass back the kernel partition's UniqueGuid.
LoadKernel already returns the partition number for the selected kernel.
This change makes it also return the GPT Entry's UniqueGuid, which will
eventually be passed to the kernel itself, so the kernel can determine which
of several possible devices it has booted from. It doesn't know for certain
because the BIOS and the kernel may enumerate the devices in a different
order.

BUG=chromium-os:4984

Review URL: http://codereview.chromium.org/3056014
2010-07-23 17:22:25 -07:00
Randall Spangler
39f66114c0 Add tpm lite to vboot reference
Review URL: http://codereview.chromium.org/2919010
2010-07-14 09:10:23 -07:00
Randall Spangler
7a786b73e7 added reboot return codes to load kernel and firmware
Review URL: http://codereview.chromium.org/2844044
2010-07-08 13:29:42 -07:00
Luigi Semenzato
416f681882 This test sets the TPM to a each of a large amount of "interesting" initial states, and runs the firmware code at user level.
This code compiles and installs using a modified ebuild (which needs to be committed after this change).

Review URL: http://codereview.chromium.org/2857030
2010-07-08 12:12:12 -07:00
vbendeb
3ecaf776d8 Make vboot_reference build in MSVC command line environment.
This is a mostly NOOP change which modifies the source code
to compile cleanly in the MSVC command line build
environment.

A new makefile is introduced (msc/nmakefile) along with a
README.txt in the same directory explaining how to build
the code in the DOS window. As of this submission the build
is running in a 32 bit environment, the intention is to use
the same makefile for 64 bit builds in the future.

Enabling high compilation warnings level allowed to
identify a couple of bugs in the code which are being fixed.

Not all sources are being compiled in the MSVC environment,
only those in firmware/ and most of those in test/
subdirectories. The benchmark calculations require porting
of the timer facilities and are being postponed.

TEST

Built in DOS and linux environments. Ran unit tests in
linux environment.

Review URL: http://codereview.chromium.org/2809037
2010-06-24 16:19:53 -07:00
Randall Spangler
d6aad3a088 Ignore TPM return codes in recovery mode
Review URL: http://codereview.chromium.org/2844024
2010-06-24 14:01:34 -07:00
Randall Spangler
d0d48b58a1 Add boot flags to LoadFirmware(), for TPM init
Review URL: http://codereview.chromium.org/2865015
2010-06-23 21:51:13 -07:00
Randall Spangler
e2ec98412e Add VBDEBUG macro for debug output.
Replaced in firmware/ lib; not replaced in host-side utils/tests.

Review URL: http://codereview.chromium.org/2810026
2010-06-23 21:17:07 -07:00
Randall Spangler
1078838fff Refactor rollback interface for LoadKernel(), LoadFirmware().
Review URL: http://codereview.chromium.org/2861020
2010-06-23 15:35:31 -07:00
Randall Spangler
b9d60a52b7 Even more integration fixes.
Review URL: http://codereview.chromium.org/2849021
2010-06-23 12:43:01 -07:00
Randall Spangler
81d0996901 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
2010-06-23 10:15:38 -07:00
Randall Spangler
d0dae7a438 More cleanup of MSVC errors
Review URL: http://codereview.chromium.org/2871019
2010-06-21 18:25:31 -07:00
Randall Spangler
beb5bae09f Fixes to compiler warnings in MSVC
Review URL: http://codereview.chromium.org/2851015
2010-06-21 16:33:26 -07:00
vbendeb
6216f5abe9 Include BIOS specific definitions when required.
This is a noop for host/chroot environment. When compiling
in the firmware space the standard include files will not be
included, the definitions will be supplied by the BIOS,
through the new file (firmware/include/sysincludes.h).

Testing
=======

RUNTESTS=1 make

in the top level directory succeeds, confirming that the
tree compiles cleanly and the unit tests pass.

Review URL: http://codereview.chromium.org/2862019
2010-06-21 08:40:26 -07:00
Randall Spangler
620c38cf34 Remove unused files, and tidy the directory structure of the remaining ones.
Review URL: http://codereview.chromium.org/2815011
2010-06-17 14:45:22 -07:00