summaryrefslogtreecommitdiff
path: root/firmware
Commit message (Collapse)AuthorAgeFilesLines
* Split off modules required for VbInit() and VbSelectFirmware()Randall Spangler2013-02-268-118/+194
| | | | | | | | | | | | | | | | | This makes it more obvious which modules and VbEx*() functions must be implemented to call these entry points. This change only moves functions between modules and adds two link-test binaries; it doesn't change any functionality. BUG=chromium-os:39262 BRANCH=none TEST=make && make runtests Change-Id: If3edf0b1989b631f0e7ad18de7ccdad8315181b5 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/44076 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* rollback_index: fix -Wshadow warningsAaron Durbin2013-02-261-4/+4
| | | | | | | | | | | | | | | | | | | | The rollback_index.c file uses a macro RETURN_ON_FAILURE which creates a locally block-scoped variable named 'result'. However, when built with -Wshadow -Werror the compile will break because the 'result' variable will shadow the one function scoped variable. Fix this warning by changing the variable name from 'result' to 'result_' in the RETURN_ON_FAILURE macro. BUG=chrome-os-partner:17695 BRANCH=None TEST=built fwlib with -Werror -Wshadow. Compiles correctly. runtests still passes as well. Change-Id: I9fedef5567411beacdc1c0b8ed182573601f24aa Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/44044 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* vboot_display: fix -Wwrite-strings compiler errorsAaron Durbin2013-02-262-5/+5
| | | | | | | | | | | | | | | | | | | | VbHWID() returns a fixed string which can also be a returning a string that lives in the read only text segment or read only flash. Because of this the compiler will rightfully error when built with -Werror and -Wwrite-strings because the const qualifier is being ignored. Correct this and the ripple effect in VbRenderTextAtPos(). VbRenderTextAtPos() should be using constant strings anyhow. BUG=chrome-os-partner:17695 BRANCH=None TEST=built fwlib with -Werror -Wwrite-strings. Compiles correctly. make runtests still passes as well. Change-Id: Id03a783d2d9b5de4cc3b3ce0fa6d74934751cca4 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/44043 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* fwlib: fix errors with -Wmissing-prototypesAaron Durbin2013-02-264-2/+12
| | | | | | | | | | | | | | | | | | | | | When the fwlib is built with -Wmissing-prototypes and -Werror there build breakages that occur. Fix these errors by either including the header file with the correct declaration or provide the declaration at the top of the c files for global symbols that are used by tests. BUG=chrome-os-partner:17695 BRANCH=None TEST=built fwlib library with -Wmissing-prototypes and -Werror. Also 'make runtests' still passes. Change-Id: I992516ee2545509054887173bc65234905381e06 Signed-off-by: Aaron Durbin Reviewed-on: https://gerrit.chromium.org/gerrit/44042 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Commit-Queue: Aaron Durbin <adurbin@chromium.org> Tested-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Software sync checks for shutdown-requested in all code pathsRandall Spangler2013-02-121-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, 1) AP-RO, EC-RO -> checked 2) AP-RW, EC-RO transition to EC-RW -> checked 3) AP-RW, EC-RW already -> NOT checked Now, (3) calls VbExIsShutdownRequested() as well. This fix is needed to avoid inconsistent behavior of software sync after we ship a RW update. Whether we *should* actually shut down or not based on how/why we booted is a separate issue to be addressed by the U-boot implementation of VbExIsShutdownRequested() in a separate CL. BUG=chromium-os:38645 BRANCH=all TEST=make runtests Manual testing also possible - force AP-RW firmware, then reboot with lid closed. Previously, the first boot would shut down because of (2), but subsequent reboots of the AP only wouldn't because of (3). Change-Id: I226202f48d793b88a30ffa62731de878f8c22315 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/43044 Reviewed-by: Simon Glass <sjg@chromium.org>
* Add more display testsRandall Spangler2013-02-112-9/+22
| | | | | | | | | | | BUG=chromium-os:38139 BRANCH=none TEST=make runtests && FEATURES=test emerge-daisy vboot_reference Change-Id: I28cd31f995f078d1715acaeaccce6e864930a986 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/42846 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Add more vboot_api_kernel testsstabilize-bluetooth-smartRandall Spangler2013-02-062-26/+52
| | | | | | | | | | BUG=chromium-os:38139 BRANCH=none TEST=make runtests && FEATURES=test emerge-daisy vboot_reference Change-Id: Ib280b80ba707f8a2141d728f78ae296774b1301a Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/42669
* Reformat to kernel styleRandall Spangler2013-02-061-117/+128
| | | | | | | | | | | | No code changes, just reformatting. BUG=none BRANCH=none TEST=make runtests Change-Id: Ibffadf6c8a5911b79a29f8f554ca00c595f6b27b Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/42624
* EC software sync uses precomputed hash if availableRandall Spangler2013-02-064-19/+102
| | | | | | | | | | | | | This removes the need to load the EC code at all when the precomputed hash matches. BUG=chrome-os-partner:17606 BRANCH=spring TEST=wouldn't that be nice Change-Id: If4438b9db8b1449b8fd4d90ef3acb3bbec5e09a0 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/42567
* Remove +x permissions from source files.Bill Richardson2013-02-051-0/+0
| | | | | | | | | | | | | | | | There's no need to give execute permissions to files that aren't supposed to executed. BUG=none BRANCH=none TEST=manual make runtests Change-Id: I2480b97b39124e98c2f639d56be54cadfdc17f9b Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/42648 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Add VbExEcGetExpectedRWHash()Randall Spangler2013-02-051-1/+12
| | | | | | | | | | | | | | This is used by vboot to retrieve the precomputed hash of the expected EC image, which requires reading less data from EEPROM than getting the entire EC image. BUG=chrome-os-partner:17606 BRANCH=spring TEST=none; just a new API not used yet Change-Id: I226643144280acabba147d345ef1f83a77a91fbc Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/42566
* Reformat to kernel styleRandall Spangler2013-02-041-719/+901
| | | | | | | | | | | | | No code changes, just reformatting. BUG=none BRANCH=none TEST=make runtests Change-Id: I0adb8044ff79a1653a5093ba24934d87b142c9b7 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/42565 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Reformat cgptlib to kernel styleRandall Spangler2013-01-316-720/+800
| | | | | | | | | | | | | No code changes, just reformatting. BUG=none BRANCH=none TEST=make runtests Change-Id: Ib8748df93c64395c88e1f789805393fcfe3ac419 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/42397 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Reformat to kernel styleRandall Spangler2013-01-3112-1848/+2080
| | | | | | | | | | | | | | 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>
* Add kernel testsRandall Spangler2013-01-311-7/+6
| | | | | | | | | | BUG=chromium-os:38139 BRANCH=none TEST=make runtests Change-Id: Iee7c965d5c29063259c66d0ccb117c60f4f4a92e Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/42314
* Add tlcl testsRandall Spangler2013-01-312-0/+7
| | | | | | | | | | | | | | Verifies the right TPM commands are called, but doesn't check at a detailed level that they're packed properly. BUG=chromium-os:38139 BRANCH=none TEST=make runtests Change-Id: I6c14db083ac0a40d4738582d200d9687cddb99de Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/42261 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Reformat files to kernel styleRandall Spangler2013-01-291-604/+657
| | | | | | | | | | | | | No code changes, just reformatting. BUG=none BRANCH=none TEST=make runtests Change-Id: I93507c45c0790da6162758e0fb02031441169f65 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/42171 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Add display testsRandall Spangler2013-01-292-8/+16
| | | | | | | | | | | BUG=chromium-os:38139 BRANCH=none TEST=make runtests Change-Id: Ibfd3f5f2b7ac8871a99e5d8603baae17926ab972 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/42170 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Reformat files to kernel styleRandall Spangler2013-01-2511-652/+755
| | | | | | | | | | | | | No code changes, just reformatting. BUG=none BRANCH=none TEST=make runtests Change-Id: I30c7f74217c10ac7cc618aee30a22febe1e41f5c Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/42053 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Remove dead ECPreamble codeRandall Spangler2013-01-251-46/+0
| | | | | | | | | | | BUG=none BRANCH=none TEST=make runtests Change-Id: I99d8124a7d5a3a644f0d8d64ad36f51e78d851e5 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/42018 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Reformat header files to kernel styleRandall Spangler2013-01-2510-954/+1309
| | | | | | | | | | | | | No code changes, just reformatting. BUG=none BRANCH=none TEST=make runtests Change-Id: Id5bac79545e9803d19b45da160c535f7e06465c6 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/42016 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Start adding display testsRandall Spangler2013-01-252-3/+5
| | | | | | | | | | | BUG=chromium-os:38139 BRANCH=none TEST=make runtests Change-Id: Idd1c275077a9a00cd2f7eab684238eb5b2d235dd Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/42015 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Improve coverage of cgptlib.cRandall Spangler2013-01-242-2/+13
| | | | | | | | | | | BUG=chromium-os:38139 BRANCH=none TEST=make runtests Change-Id: I5719c6b8aa1a23fc65bf38d7096320479152f0ca Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/41955 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Remove unused vbutil_ecRandall Spangler2013-01-242-92/+0
| | | | | | | | | | | | | | | | | EC verification is done via software sync; the EC doesn't do vboot on its own. BUG=chromium-os:38139 BRANCH=none TEST=manual make runtests emerge-link vboot_reference chromeos-u-boot chromeos-bootimage Change-Id: I6e5c0db8fc54b474f044d37c2603a9c116747a85 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/41953 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Improve coverage of rollback_index.cRandall Spangler2013-01-231-416/+477
| | | | | | | | | | | BUG=chromium-os:38139 BRANCH=none TEST=make runtests Change-Id: I21b62b5dd3fc6037f54f7c3bac768c2b67a4c12d Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/41859 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Fix architecture definitions.Randall Spangler2013-01-231-0/+0
| | | | | | | | | | | | | | | | | | | | We should use only arm, x86, and x86_64; currently we also use i386 to mean x86, and amd64 to mean x86_64. BUG=chromium-os:26317 BRANCH=none TEST=manual sudo FEATURES=test emerge vboot_reference FEATURES=test emerge-link vboot_reference chromeos-u-boot chromeos-installer FEATURES=test emerge-daisy vboot_reference chromeos-u-boot chromeos-installer FEATURES=test emerge-x86-alex vboot_reference chromeos-installer make && make runtests (both inside and outside chroot) Change-Id: I4fb64fafa9c48a76ded862e074776cab9ea54ab3 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/41838 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* fix s_tpm_pcr_read_cmd structure name typoKees Cook2013-01-161-1/+1
| | | | | | | | | | | | | | Che-Liang Chiou noticed this structure was misnamed. Luckily, they have the same offsets to the useful fields. BUG=None TEST=link build, manual verification BRANCH=None Change-Id: I40abd21f053f19758e47c7775333208ad1c3c33d Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/41482 Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
* Make tpmc able to send and receive raw datagrams.Luigi Semenzato2013-01-112-2/+20
| | | | | | | | | | | | | | | | This is immediately needed to debug a Parrot TPM problems, but we've had similar situation in the past and probably will again in the future. BUG=chromium-os:37819 TEST=manually tested with a couple of different packets, and error inputs BRANCH=none Change-Id: Id7f66bdbdfe5887fa49cd62af4a9b807fa3d9a89 Reviewed-on: https://gerrit.chromium.org/gerrit/41166 Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Luigi Semenzato <semenzato@chromium.org> Tested-by: Luigi Semenzato <semenzato@chromium.org>
* Rename files and defines to simplify makefile.Randall Spangler2013-01-112-1/+5
| | | | | | | | | | | | | | BUG=chromium-os:26317 BRANCH=none TEST=manual sudo emerge vboot_reference emerge-link vboot_reference chromeos-u-boot chromeos-installer emerge-daisy vboot_reference chromeos-u-boot chromeos-installer Signed-off-by: Randall Spangler <rspangler@chromium.org> Change-Id: I8c55ca40f3f0cacf08530ab63c886fe351bcee8e Reviewed-on: https://gerrit.chromium.org/gerrit/41152
* Unify vboot build into a single makefileRandall Spangler2013-01-111-135/+0
| | | | | | | | | | | | | | | | | | This is a necessary precursor to getting coverage working. BUG=chromium-os:26317 BRANCH=none TEST=manual sudo emerge vboot_reference emerge-link vboot_reference chromeos-u-boot emerge-daisy vboot_reference chromeos-u-boot Change-Id: Ibed91c64a5ca5fa486169d64fb01a9e868ce27e5 Signed-off-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit 13ed1f4812f810ee0a47b946ad990f1fa93f366c) Reviewed-on: https://gerrit.chromium.org/gerrit/40906 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Add missing TlclLibClose function for mock TPM interfaceDuncan Laurie2013-01-111-0/+4
| | | | | | | | | | | BUG=none BRANCH=none TEST=manual: MOCK_TPM=1 emerge vboot_reference Change-Id: I81ae9bb646b1a1186629e1a3ba8317efe8397faf Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/41131 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Use a separate knob for SHA512 unrollingSimon Glass2012-12-261-46/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SH512 code gets quite large when unrolled, about 20KB larger on x86. This is a net loss on machines with slow SPI. Split this out into a separate knob, and don't enable it on any architecture for now. Also swap the code around so that we do #ifdef...#else...#endif instead of #ifndef...#else...#endif. BUG=chrome-os-partner:13961 BRANCH=none TEST=manual build and boot to kernel on link U-Boot image size before this change: text data bss dec hex filename 319403 8260 83988 411651 64803 u-boot after: 293227 8260 85492 386979 5e7a3 u-boot This is a saving of about 25KB. Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I9fa7ea8eba6691d8a06df9374950303e6f2ce2fd Reviewed-on: https://gerrit.chromium.org/gerrit/40155 Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* Add support for a V option which selects verbose Makefile output.Gabe Black2012-12-211-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | When V=1, the full command lines are printed. When V is not 1, then only a small summary line is printed which shows what commands are being executed. The command lines themselves are usually quite long and are overwhelming to see fly by on the console. Abbreviated command lines are easier to read and don't fill up your console so quickly. This change is primarily targeted at vboot_fw.a and probably excludes some things which could also be converted. The indentation between the action string (OBJCOPY, CC, etc.) and the target is three spaces longer than "normal", aka what's used in depthcharge, so that when this make is run from the other, you can tell the difference between the commands run by each. BUG=chrome-os-partner:8339 TEST=Built with and without V=1 and saw and did not see the full command lines, respectively. BRANCH=None Change-Id: Ibee244c24dc44b8da109b8c23ac7273174836bb9 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: https://gerrit.chromium.org/gerrit/40011 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Che-Liang Chiou <clchiou@chromium.org> Commit-Queue: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org>
* Add recovery_subcode field to nvstorage and crossystemBill Richardson2012-12-173-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This just adds a one-byte field in the nvstorage region for use in debugging hard-to-catch errors. There's no official meaning or expectation for this field. It's just a handy place to emit some information. BUG=chrome-os-partner:11534 BRANCH=parrot TEST=manual Just change the value and ensure that it persists across a (working) reboot. It's only updated at specific points under very exacting error conditions, so all we really want to test is that it works as a place to store some extra info. crossystem recovery_subcode crossystem recovery_subcode=14 reboot crossystem recovery_subcode The recovery_subcode byte is at index [6] of the VbNv.raw bytes that appear when you press TAB, so you can find it there too: VbNv.raw: 60 20 00 00 00 00 0e 00 00 00 00 00 00 00 00 65 Decimal 14 == 0x0e Change-Id: I1930b8f81a03ab838dbee99a8d72c35a444efdfd Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/39803 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* tlcl: move open retry into TlclKees Cook2012-12-121-6/+24
| | | | | | | | | | | | | Make sure all Tlcl users benefit from the new retry logic. BUG=None TEST=daisy build, manual testing of racing tpmc loops BRANCH=None Change-Id: I8e9656a65b5d6b45694c1c8bceb95f54f7c751bb Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/39525 Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
* Tlcl: allow OS failures to bubble up to callerstabilize2Kees Cook2012-11-283-11/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | If there were any errors communicating with the TPM at the OS layer (open, read, write failures), the library would immediately exit, not allowing the caller to make any decisions about how to handle it. This introduces a way to initialize the library so that errors will get passed back up to the caller instead of unceremoniously exiting. Setting the environment variable "TPM_NO_EXIT=1" enables the feature. To avoid needing to implement supporting functions in all backends, the feature is currently limited to just the Tlcl stub implementation. In the case of mount-encrypted, it can now survive the kernel returning read/write failures. In the past it had only worked around having open fail, but that has now been replaced with more sensible logic instead of the environment variable trickiness. BUG=chrome-os-partner:15960 TEST=daisy built with an always-failing kernel driver, u-boot builds too BRANCH=None Change-Id: Ic7b217017537980f9c239d678067398613045676 Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/38791 Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
* Add more recovery_reason codesBill Richardson2012-11-267-27/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are several places where the same recovery_reason was used to report slightly different points of failure. Let's create some new codes instead. Remember that recovery mode is handled by RO firmware, so if an updated RW firmware uses one of the new error codes, pressing TAB at the recovery screen will say "We have no idea what this means". That's not a bug. This CL deprecates the original codes, so the fact that the RO firmware doesn't recognize it just means it's a new code reported by a new RW BIOS. BUG=chromium-os:36562 TEST=manual BRANCH=parrot Run make && make runtests It should pass. You can test some of the error cases on actual hardware by using crossystem recovery_reason=86 reboot and pressing TAB at the recovery screen. For that example you should see the message recovery_reason: 0x56 TPM lock error in rewritable firmare Change-Id: I123c781e6c6f6fe0284c4fd49f5f5a855eece7df Reviewed-on: https://gerrit.chromium.org/gerrit/38652 Commit-Ready: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Add FAFT keyboard remap GBB flagMarc Jones2012-11-061-1/+2
| | | | | | | | | | | | | | | | Add a new flag, 0x100, to indicate FAFT key stroke overrides. BUG=chrome-os-partner:14056 TEST=none BRANCH=stout Change-Id: I76b7f3f4c51abec5528047f690f20a09b257abc2 Signed-off-by: Marc Jones <marc.jones@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/37074 Reviewed-by: Ronald G. Minnich <rminnich@chromium.org> Reviewed-by: Gediminas Ramanauskas <gedis@chromium.org> Tested-by: Gediminas Ramanauskas <gedis@chromium.org> Commit-Ready: Marc Jones <marc.jones@se-eng.com>
* vboot_reference: Fix keyboard input lag at confirm screen.Shawn Nematbakhsh2012-10-301-1/+3
| | | | | | | | | | | | | | | | | | | Changing languages is terribly slow at the confirm screen, when switching from dev to normal. Reduce sleep time to improve user experience. BUG=chrome-os-partner:15726 TEST=boot in dev, hit space, hit arrows rapidly to change language, observe no lag. BRANCH=butterfly, stout Change-Id: I0943debc31d78dcfce87e7f7d4537ae47f5f8cfd Reviewed-on: https://gerrit.chromium.org/gerrit/36956 Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Commit-Ready: Shawn Nematbakhsh <shawnn@google.com> Tested-by: Shawn Nematbakhsh <shawnn@google.com> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Add recovery reason for failure to correct TPM errorLuigi Semenzato2012-10-292-0/+4
| | | | | | | | | | | | | | | | | The TPM on snow devices may boot in an unusable state. The workaround is to detect this early and reboot. The workaround code prevents an infinite reboot loop by counting the number of reboots and entering recovery mode with this reason after a small threshold has been reached. BUG=chromium:156655 TEST=no test! Not even compiled! BRANCH=none Change-Id: Ica2f14f8f7df8c46b7cbe5dbd578ba93c8f3a78c Reviewed-on: https://gerrit.chromium.org/gerrit/36790 Tested-by: Luigi Semenzato <semenzato@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Ready: Luigi Semenzato <semenzato@chromium.org>
* mount-encrypted: handle missing TPM on Chrome OSKees Cook2012-10-121-0/+1
| | | | | | | | | | | | | | | | | While not having a TPM was supported for non-Chrome devices, it was not expected for Chrome devices. This adds logic to fail the TPM calls before making them when the TPM is missing. The tpm_lite library doesn't handle the TPM being missing, so we have to do this ourselves. BUG=chrome-os-partner:15192 TEST=parrot build, verified operation after "mv /dev/tpm0 /dev/tpm0.bak" BRANCH=none Change-Id: I2f625305dce7fa698fcad33e412ee37c60da9bc2 Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35440 Reviewed-by: Luigi Semenzato <semenzato@chromium.org> Reviewed-by: Will Drewry <wad@chromium.org>
* vboot_api_kernel: Print warning in Ctrl-U when dev_boot_usb is not enabled.Hung-Te Lin2012-10-031-0/+3
| | | | | | | | | | | | | | | | | | Ctrl-U used to simply beep without messages for why it does not work (due to NV data dev_boot_usb). Since the system is already in Developer mode, it should be fine to provide some debug information 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, enter DEV and press Ctrl-U; gets beep and warning messages. Change-Id: Iab20ecdb2e1c4e267b7257a7bd241006241ddf70 Reviewed-on: https://gerrit.chromium.org/gerrit/34406 Tested-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Ready: Hung-Te Lin <hungte@chromium.org>
* vboot_api_kernel: Print warning in TONORM when GBB flags force DEV.Hung-Te Lin2012-09-271-0/+9
| | | | | | | | | | | | | | | | | | | | | 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 <sjg@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Ready: Hung-Te Lin <hungte@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org>
* Make cgpt_add error messages a little more verboseVadim Bendebury2012-09-263-5/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | When the cgpt utility complaints about parameter errors, it is impossible to tell what exactly went wrong. This change consolidates error definitions and adds a function to convert integer error values into text messages. BRANCH=none BUG=none TEST=manual . emerge-link vbooot_reference . copy generated `cgpt' to a Link device . run command with wrong arguments with respect to the existing GPT: localhost var # ./cgpt add -i 3 -b 3985408 -s 1757184 -t rootfs -l ROOT-A /dev/sda ERROR: cgpt add: Starting LBA overlaps ERROR: cgpt add: -i 3 -l ROOT-A -b 3985408 -s 1757184 -t 3CB8E202-3B7E-47DD-8A3C-7FF2A13CFCEC . on the host, in the chroot in src/platform/vboot_reference run $ make && make runtests observe all tests succeed Change-Id: Ibd23ca0430a875f70524adc99e0509b26ae699b2 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/34003 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Rename RANDOM_POWER_OFF to a more descriptive SAVE_LOCALE_IMMEDIATELYRandall Spangler2012-09-242-3/+3
| | | | | | | | | | | | | --snark; no functional change. BUG=none TEST=build code BRANCH=none Change-Id: Id3a8c5aaf0e5a9d0e1949af602840efcc1895f50 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/33898 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Add CTRL-L in dev screen to support a "legacy boot option"Stefan Reinauer2012-09-208-1/+48
| | | | | | | | | | | | | | | | | | | | | This option is disabled per default and can be enabled with crossystem dev_boot_legacy=1 or by setting the GBB flag GBB_FLAG_FORCE_DEV_BOOT_LEGACY 0x00000080 BUG=chrome-os-partner:6108 TEST=crossystem dev_boot_legacy=1 boot to dev mode screen, press CTRL-L, see SeaBIOS start (other CLs needed) BRANCH=link Signed-off-by: Stefan Reinauer <reinauer@chromium.org> Change-Id: I593d2be7cff5ca07b8d08012c4514a172bd75a38 Reviewed-on: https://gerrit.chromium.org/gerrit/31265 Reviewed-by: Stefan Reinauer <reinauer@chromium.org> Tested-by: Stefan Reinauer <reinauer@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Ready: Stefan Reinauer <reinauer@chromium.org>
* Support alternative GPT header signatureStefan Reinauer2012-09-193-9/+23
| | | | | | | | | | | | | | | | | | | | | | In order to dual boot Windows and ChromeOS, Windows must not find a GPT partition table on the disk. So change ChromeOS to cope with an alternative signature "CHROMEOS" instead of the standard "EFI PART" BUG=chrome-os-partner:6108 TEST=rebuild chromeos, install it, run cgpt legacy /dev/sda dd if=/dev/sda of=/tmp/x bs=1k hexdump -C /tmp/X see the string CHROMEOS BRANCH=link Signed-off-by: Stefan Reinauer <reinauer@chromium.org> Change-Id: Ia88eff33b9880bd73a78c1b8e026c1f8298c4557 Reviewed-on: https://gerrit.chromium.org/gerrit/31264 Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Ready: Stefan Reinauer <reinauer@chromium.org> Tested-by: Stefan Reinauer <reinauer@chromium.org>
* Don't copy BMP data on ARMSimon Glass2012-09-102-0/+9
| | | | | | | | | | | | | | | | | | | | | This just chews up memory and wastes time on ARM, since the data is already in memory. BUG=chrome-os-partner:13492 BRANCH=snow TEST=manual Build and boot on snow with manually modified code, to see that the bmpfv pointer is in the same region as the bmp region. Build and boot on link and see that displaying screens is still fast. Change-Id: I98349b73671e38fa6cace966b6953a2abf129fab Reviewed-on: https://gerrit.chromium.org/gerrit/32629 Reviewed-by: Mike Truty <truty@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> Reviewed-by: Che-Liang Chiou <clchiou@chromium.org> Commit-Ready: Simon Glass <sjg@chromium.org>
* Define all screens in enum ScreenIndex and use themSimon Glass2012-09-102-12/+16
| | | | | | | | | | | | | | | | | | This enum seems partially complete, and not used in vboot_reference. Complete it and use it. BUG=chrome-os-partner:13492 BRANCH=snow TEST=manual Build and boot through to recovery on snow. Run through the various screens and check that they still appear correctly. Change-Id: Ifca54d072457d9a0396a38026f44f8334efb9cf5 Reviewed-on: https://gerrit.chromium.org/gerrit/32628 Reviewed-by: Mike Truty <truty@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> Commit-Ready: Simon Glass <sjg@chromium.org>
* Replace %L with %ll in format strings.Gabe Black2012-09-092-2/+2
| | | | | | | | | | | | | | | | | | | %L is, in some standard libraries like U-Boot's, a synonym for %ll which is for long long integers, required by the C99 standard to be at least 64 bits. For practical purposes that basically means %ll should be used with 64 bit values. Since %L seems to be non-standard and, at least in U-Boot's case, %ll is recognized in the same way, %ll seems preferable. BUG=chrome-os-partner:8339 TEST=Booted ChromeOS using depthcharge and U-Boot. Booted with depthcharge/libpayload which does not support %L and saw a number where %L had been printed. BRANCH=None Change-Id: Id51fb5c9295e0dd65b42a5c0738eb34c8210a2b2 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: https://gerrit.chromium.org/gerrit/32660 Reviewed-by: Randall Spangler <rspangler@chromium.org>