summaryrefslogtreecommitdiff
path: root/firmware
Commit message (Collapse)AuthorAgeFilesLines
* Fix potential memory leak in KeyBlockVerify()Bill Richardson2012-05-091-0/+1
| | | | | | | | | | | BUG=none TEST=none Change-Id: I17f1cff7d6f750dfd862d71941c6b8cfec57b6bf Reviewed-on: https://gerrit.chromium.org/gerrit/22312 Commit-Ready: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org>
* Separate SHA256 and SHA512 into separate filesBill Richardson2012-05-093-287/+342
| | | | | | | | | | | | | | | | This is just to pave the way for better use of vboot by the EC. BUG=chrome-os-partner:7459 TEST=manual make make runtests Change-Id: I2e68371039bfc1b492245db12facf0c5ad592824 Reviewed-on: https://gerrit.chromium.org/gerrit/22301 Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Ready: Bill Richardson <wfrichar@chromium.org>
* Protect ARRAY_SIZE macro from being #defined twiceBill Richardson2012-05-091-0/+2
| | | | | | | | | | | BUG=chrome-os-partner:7459 TEST=none Change-Id: I3664ad9db4a4e0cecd38443bf01f99531ba80972 Reviewed-on: https://gerrit.chromium.org/gerrit/22183 Commit-Ready: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Create vbutil_ec tool for signing EC firmware.Bill Richardson2012-05-043-1/+130
| | | | | | | | | | | | | | | | | | This just adds the vbutil_ec tool (and a simple test of the library functions related to it). BUG=chrome-os-partner:7459, chromium-os:27142 TEST=manual make make runtests Change-Id: I2a2c4e7cfb8ac6ce2229c5de4252a5cc89321fa5 Reviewed-on: https://gerrit.chromium.org/gerrit/21868 Commit-Ready: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@google.com> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* Require -Wall -Werror for everything.Bill Richardson2012-05-031-1/+0
| | | | | | | | | | | BUG=none TEST=none Change-Id: Ib9781238274285f73d00d8fca4ecda28fc2c6678 Reviewed-on: https://gerrit.chromium.org/gerrit/21748 Commit-Ready: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
* Omit body load address checkChe-Liang Chiou2012-04-243-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | Omit this check because this check is not really necessary and it is dealing more harms than goods to ARM boards. While body load address is configurable, it is not quite possible to fix all the build scripts and runtime scripts to carry this address; so in reality all scripts use the default body load address. The problem is, this default address is not friendly to ARM boards, and it virtually makes this check fails on ARM boards. BUG=chromium-os:28077 TEST=emerge-{daisy,x86-alex} vboot_reference TEST=load_kernel_test -b 1 chromiumos_image.bin TEST=run verified boot on Daisy Change-Id: I1a1cc0aedf254e2a2b680046812ab7154f26dea7 Reviewed-on: https://gerrit.chromium.org/gerrit/20947 Tested-by: Che-Liang Chiou <clchiou@chromium.org> Reviewed-by: Gaurav Shah <gauravsh@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Commit-Ready: Che-Liang Chiou <clchiou@chromium.org>
* mount-encrypted: close TPM when spawning resizerKees Cook2012-04-052-0/+8
| | | | | | | | | | | | | | | When the filesystem resizing process starts, it has the TPM open, which means it can collide with tcsd after the main process exits. Additionally, improve the debugging around TPM usage for better timing analysis. BUG=None TEST=lumpy build & manual testing Change-Id: I7028131015fb972c99e8b3d035f58346f08fbd06 Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/19535 Reviewed-by: Elly Jones <ellyjones@chromium.org>
* tpm_lite: implement TPM_GetRandomKees Cook2012-03-014-3/+46
| | | | | | | | | | | | Provide TPM_GetRandom function to library callers. BUG=chromium-os:22172 TEST=lumpy build & manual testing Change-Id: Id604fd92490ba697033158a580b0b4df1d975932 Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/17120 Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
* Add new line after printing non-zero GBB flags.Stefan Reinauer2012-02-281-0/+1
| | | | | | | | | | | | | | | | Callers of vboot might print some additional information in VbExDisplayDebugInfo(). Add a new line to the end of the buffer so that output is aligned with the normal <tab> information. BUG=none TEST=set gbb flags to 1, see cursor go to next line at dev screen. Change-Id: I8dd77404338a05bddc5f3ec54d7b65c890a60c50 Reviewed-on: https://gerrit.chromium.org/gerrit/17001 Tested-by: Stefan Reinauer <reinauer@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Commit-Ready: Stefan Reinauer <reinauer@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Add Ctrl-Enter as an additional key to trigger dev USB boot.Tom Wai-Hong Tam2012-02-142-1/+4
| | | | | | | | | | | | | | | | | Due to the limitation of servo that is unable to send U keys, dev USB boot (triggered by Ctrl-U) is unable to be tested on FAFT. To solve it, firmware should add an addition key combination to workaround it. Ctrl-Enter is the one we picked. BUG=chrome-os-partner:6759 TEST=compile the firmware and update it to Lumpy; during the dev screen, press Ctrl-Enter to trigger USB boot. Change-Id: I8215a241c3c07dc2f5e194c324459f106d007f47 Reviewed-on: https://gerrit.chromium.org/gerrit/15749 Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Ready: Tom Wai-Hong Tam <waihong@chromium.org> Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
* Oops. Must still distinguish "no disks" from "no valid disks".Bill Richardson2012-01-271-1/+0
| | | | | | | | | | | | | | | | | | The fix for chrome-os-partner:7715 introduced a new bug. This fixes that. BUG=chrome-os-partner:7775 TEST=manual Boot into recovery mode. Insert invalid USB. You should see the YUCK screen. Change-Id: I868287eecd34bb0c48127bee04f573b418f5945c Reviewed-on: https://gerrit.chromium.org/gerrit/14963 Commit-Ready: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
* Make VbTryLoadKernel() go to recovery when no valid disks are foundBill Richardson2012-01-251-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, it was going to recovery only when no disks existed. That didn't catch the case where disks exist but none of them are usable. BUG=chrome-os-partner:7715 TEST=manual I've added a test specifically for this, so just make make runtests should verify it. To test on actual hardware, find a disk or USB drive that has something other than 512 bytes per LBA, and try it. It won't be bootable, but using it shouldn't hang the system or cause weird behavior. Once in recovery, press TAB, and you should see the reason code VBNV_RECOVERY_RW_NO_DISK Change-Id: I475ddd01e13fa806025a2107c260c030d098a17e Reviewed-on: https://gerrit.chromium.org/gerrit/14816 Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@chromium.org> Commit-Ready: Bill Richardson <wfrichar@chromium.org>
* Be aggressive in saving locale to nvram.Bill Richardson2012-01-242-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On x86 platforms, the power button and lid switch events have to be handled by coreboot SMM code, because it needs to interact with the southbridge and/or EC, and U-Boot doesn't have a way to do that. Once the kernel takes over, it sends an SMI to that code which tells it to start delivering ACPI events instead of whatever pre-ACPI handling it has been doing. U-Boot doesn't have any code to handle either case, and adding it would either be a major undertaking (adding ACPI support to U-Boot!), or would require creating yet another special-purpose interface just for our U-Boot (yuck). It's much simpler to just make vboot_reference be more aggressive about writing to the nvram for this one case where it matters. OTOH, ARM will need U-Boot to handle the lid switch and power button via GPIOs since it uses only U-Boot and has no SMI handler. This change isn't necessary for ARM, but shouldn't hurt either. BUG=chrome-os-partner:7689 TEST=manual 1. Boot to dev-mode screen or recovery screen. 2. Press arrow keys to change locale. 3. Power off (press power button or yank A/C & battery) 4. Power on again. The BIOS screen locale should still be set to your last choice before powering off. Change-Id: I9008811c3be71de47ff1c6899e81955cf0560a52 Reviewed-on: https://gerrit.chromium.org/gerrit/14721 Tested-by: Bill Richardson <wfrichar@chromium.org> Commit-Ready: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Remove debug messages from VbAudioLooping() - too noisy.Bill Richardson2012-01-221-9/+0
| | | | | | | | | | | | | | | | | The VBDEBUG() is logged even for production builds (visible as /sys/firmware/log once the system boots). Too many messages clutter it up. BUG=chrome-os-partner:7669 TEST=manual Boot in dev-mode, log in and look at /sys/firmware/log. You shouldn't see more than dozen lines or so of VbAudio debug messages. Change-Id: I00465c0092d49feaa8d94aa8a13acbfa1e07743d Reviewed-on: https://gerrit.chromium.org/gerrit/14603 Commit-Ready: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Fix audio loop for long-delay keyboard reads.Bill Richardson2012-01-193-70/+103
| | | | | | | | | | | | | | | | | | | BUG=chrome-os-partner:7428 TEST=manual Switch to dev-mode, turn it on, see how long it takes. With gbb.flags == 1 (factory mode), it should take 2 seconds. (You'll see a warning on the screen if gbb.flags is nonzero) With gbb.flags == 0 (after factory install), it should take 30 seconds. You should hear two beeps at 20 seconds. Change-Id: I4f14128b87d3482e291b1b40a11a6d27c72c1ad1 Reviewed-on: https://gerrit.chromium.org/gerrit/14534 Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@chromium.org> Commit-Ready: Bill Richardson <wfrichar@chromium.org>
* Acknowledge Ctrl+U fasterVincent Palatin2012-01-181-12/+18
| | | | | | | | | | | | | | | | | | When the user hits Ctrl+U on the dev screen, we used to change the screen only after we enumerate the USB devices, load the kernel from USB mass storage and boot it (about 4 seconds on the current firmware). Let's blank the screen earlier to show we got the key press. BUG=chrome-os-partner:7563 TEST=on a Stumpy in developer, hit Ctrl+U on the dev screen with an invalid key, then a valid key. Check which screen are displayed and how long it takes to get a new display after the key strokes. Change-Id: Ifc73b56055bcd50360d71c1cb6dee052d0fdf9aa Reviewed-on: https://gerrit.chromium.org/gerrit/14395 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
* Clean up return codes for better interaction with U-Boot.Bill Richardson2012-01-172-5/+7
| | | | | | | | | | | BUG=none TEST=none Change-Id: I432de92e00444b58c20faadf8671ccc1c0056e28 Reviewed-on: https://gerrit.chromium.org/gerrit/14181 Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Ready: Bill Richardson <wfrichar@chromium.org>
* Fix compile by eliminating unused variableSonny Rao2012-01-091-1/+0
| | | | | | | | | | | | | | bug was introduced in https://gerrit.chromium.org/gerrit/#change,13891 946370d012a809bba833ff9d37fe0ce86af09860 BUG=none TEST=package compiles again Change-Id: Iaa1d4479b713b379955073eff02599c26b4b5bc4 Reviewed-on: https://gerrit.chromium.org/gerrit/13922 Tested-by: Sonny Rao <sonnyrao@chromium.org> Reviewed-by: Gabe Black (Do Not Use) <gabeblack@google.com>
* tpmc: add PCR reading functionKees Cook2012-01-094-0/+34
| | | | | | | | | | | | | | | Add ability to report a single PCR value via the tpmc utility. Using /sys/devices/platform/tpm_tis/pcrs is too slow, since it reads all PCRs before returning. Anything wanting to read PCR0 on a time-critical path needs maximum speed. BUG=chromium-os:22172 TEST=install and test x86-alex. Change-Id: I2d450961d33fa314d54b909135a74aa756279ec6 Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/13891 Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
* ONLY pressing the recovery button okays booting from USBBill Richardson2011-11-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | BUG=chrome-os-partner:1113 TEST=manual With the dev-switch OFF, insert a bootable USB drive, reboot while holding down recovery button. It should boot from the USB without prompting for removal. With the dev-switch OFF and the same bootable USB drive inserted, run crossystem recovery_request=2 reboot The BIOS screen should prompt you to remove the USB drive, then to insert it before it will boot from the USB. Prior to this fix, using recovery_request=2 would NOT require removal, while other non-zero values would. NO values of recovery_request should be able to override the removal request. Only physically pressing the button should allow booting immediately from recovery mode with the dev-switch OFF. Change-Id: I6d63ecb761c4b26820091cc7a97ca540b362c22e Reviewed-on: https://gerrit.chromium.org/gerrit/12143 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org>
* Revert "Revert "Add x86_64 architecture support""Simon Glass2011-11-221-0/+46
| | | | | | | | | | This reverts commit 354630570900cd5c2180610acfa47422ff484fe6 Change-Id: I832a675911f66837f31ea47d19babf5c656bfaf9 Reviewed-on: https://gerrit.chromium.org/gerrit/12044 Commit-Ready: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* Dev-mode allows booting self-signed kernels by default.Bill Richardson2011-11-185-20/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | When you enter dev-mode, Pressing Ctrl-U to boot from USB is DISABLED. Booting any self-signed kernel from the SSD is ENABLED. This replaces the "crossystem dev_boot_custom" argument with "crossystem dev_boot_signed_only", which has the opposite polarity. So if you want to dev-mode to only boot official kernels, you have to explictly set it that way. If you leave dev-mode and then come back, it will go back to the conditions shown above. BUG=chrome-os-partner:5954 TEST=manual Just run the factory flow. It was broken; this should fix it (except for any workarounds that were added while it was broken; those may need to be reverted). Change-Id: I13e0edbc0e77c5d6ea609dabf771085006cd1805 Reviewed-on: https://gerrit.chromium.org/gerrit/11853 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
* Pressing the recovery button okays booting from USBBill Richardson2011-11-161-2/+4
| | | | | | | | | | | | | | | | | | | | | | BUG=chrome-os-partner:1113 TEST=manual With the dev-switch OFF, insert a bootable USB drive, reboot while holding down recovery button. It should boot from the USB without prompting for removal. With the dev-switch OFF and the same bootable USB drive inserted, run crossystem recovery_request=1 reboot The BIOS screen should prompt you to remove the USB drive, then to insert it before it will boot from the USB. Change-Id: Ie2fe4302443e14b1f85f409b54aa43a94d6c5477 Reviewed-on: https://gerrit.chromium.org/gerrit/11788 Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Add VB_INIT_OUT_ENABLE_ALTERNATE_OS flagBill Richardson2011-11-164-9/+22
| | | | | | | | | | | | | | | | | | | This adds a flag to the list of values returned by VbInit(). When this flag is set, the BIOS may be asked to boot something other than ChromeOS. If this requires some sort of special preparation, the BIOS should do it. BUG=chromium-os:22454 TEST=none There is no test for this. It requires a change to the BIOS in order to do anything differently, and we haven't yet decided whether the BIOS should pay attention to it. Change-Id: I5d89e7cd5b745ee74b8ace7fa613c0db03eebefd Reviewed-on: https://gerrit.chromium.org/gerrit/11714 Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Fix typo, add one VBDEBUG.Bill Richardson2011-11-142-1/+2
| | | | | | | | | | BUG=none TEST=none Change-Id: Ie82c5eb3052c84272da4bf21d80cc2bf204fd08d Reviewed-on: https://gerrit.chromium.org/gerrit/11670 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org>
* Revert "Add x86_64 architecture support"Nick Sanders2011-11-141-46/+0
| | | | | | | | | | | This reverts commit fbf9de6b2ba3162a7183211872bd23ca52f58289 Mysterious ARM PFQ breakage Change-Id: I354630570900cd5c2180610acfa47422ff484fe6 Reviewed-on: https://gerrit.chromium.org/gerrit/11664 Reviewed-by: Nick Sanders <nsanders@chromium.org> Tested-by: Nick Sanders <nsanders@chromium.org>
* Add x86_64 architecture supportSimon Glass2011-11-141-0/+46
| | | | | | | | | | | | This is required for U-Boot's sandbox test system. BUG=chromium-os:16808 TEST=emerge vboot_reference-firmware for tegra2-seaboard, x86-mario Change-Id: I18b48b069dc56f9b2c826de99780dfff1e544ded Reviewed-on: https://gerrit.chromium.org/gerrit/5980 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* Add a few comments and warnings when building incorrectlySimon Glass2011-11-142-0/+7
| | | | | | | | | | | | | The Makefile requires a few defines and isn't very friendly if they are missing. This adds some warnings which should alert as to what is wrong. BUG=chromium-os:16808 TEST=emerge vboot_reference-firmware for tegra2-seaboard, x86-mario Change-Id: Id3b20365cfcc7f0aa7d984b33b6a0906ae0d44a5 Reviewed-on: https://gerrit.chromium.org/gerrit/11548 Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* Address security concerns for vboot_audio.cBill Richardson2011-11-141-2/+25
| | | | | | | | | | | | | Based on the compile-time constants, I don't think we were in any danger, but I've added the checks anyway. It never hurts to be certain! BUG=chromium-os:22786 TEST=none Change-Id: I469dda19b4589e484a41ca9bae1e107787f3cf4d Reviewed-on: https://gerrit.chromium.org/gerrit/11516 Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
* Sanity-check output of VbExDiskGetInfo()Bill Richardson2011-11-141-0/+9
| | | | | | | | | | | | BUG=chromium-os:22724 TEST=none Source change only, nothing for QA to test. Change-Id: I058137c04622b5aedae4a94ce6e3887325c16974 Reviewed-on: https://gerrit.chromium.org/gerrit/11546 Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
* Add flag to GBB to allow loading PCI Option ROMsBill Richardson2011-11-113-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As shipped, H2C only loads the option ROM for the built-in video, and that only when it needs display the BIOS warning screens. By setting a flag in the GBB, you can allow all option ROMs to be loaded: Note that we'll never enable this ourselves (and there's a factory test to ensure that*) because it executes non-verified code. But if a customer wants to void their warranty and set this flag in the read-only flash so they can install and use other PCI devices, they should be able to do so. BUG=chrome-os-partner:6148 TEST=none The only way to test this is to use a BIOS that was compiled with serial debugging enabled, so there's nothing for QA to do. If you have such a BIOS, you can see the difference like so: flashrom -r oldbios.bin gbb_utility -s --flags=2 oldbios.bin newbios.bin flashrom -w newbios.bin <reboot> When bit 1 of the GBB flags is 0, you'll see these lines in the serial output: LoadOpRomImage-->GetSystemConfigurationTable Status = Success LoadOpRomImage-->GetH2cBootMode Status = Success When bit 1 of the GBB flags is 1, you'll see these lines in the serial output: LoadOpRomImage-->GetSystemConfigurationTable Status = Success LoadOpRomImage-->GetH2cBootMode Status = Success LoadOpRomImage-->PCI OpRom on 1.0.0 is allowed!!! This happens in any boot mode (normal, developer, recovery). -- *The factory test for GBB zero flags is gft_clear_gbb_flags.sh, in src/platform/factory_test_tools Change-Id: I31a10cc9d562b4b83669ca8a114b60e87ae28b0a Reviewed-on: https://gerrit.chromium.org/gerrit/11505 Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Gaurav Shah <gauravsh@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Dev-mode only boots official kernels by defaultBill Richardson2011-11-106-8/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although we're now using a single unified BIOS, it is pretty nice to be able to get a shell in developer mode while still using verified boot for the kernel and filesystem. Alex & ZGB implemented this by requiring the dev-mode user to install a special dev-mode BIOS. We don't do that, but we DO require setting a special flag with "crossystem" to accomplish the same thing. In order to allow booting a self-signed kernel, you must boot in developer mode, open a shell, and run this: crossystem dev_boot_custom=1 Special note to internal developers: If you're in the habit (as I am) of booting directly from a USB stick in dev-mode, you'll have to run this: crossystem dev_boot_custom=1 dev_boot_usb=1 Just using dev_boot_usb=1 is no longer enough, because the USB kernel is signed using the recovery key and by pressing Ctrl-U, we validate it with the kernel data key. That worked before this change because any self-signed kernel was fine, and that's how the USB key was treated. Now it actually requires a verified signature until you enable dev_boot_custom=1 also. BUG=chrome-os-partner:5954 TEST=manual Boot once in normal mode, which clears the special flags. Then switch to developer mode. You should be able to boot and get a root shell. Run crossystem dev_boot_usb=1 Obtain a USB recovery image that's keyed differently. For example, if you're testing with dev-keys, use a PVT-signed image or vice-versa. Reboot into dev-mode with the USB recovery stick inserted. At the dev-mode screen, press Ctrl-U. You should hear a single beep, but it should not boot. Press Ctrl-D to boot from the hard drive, log in to a shell and run crossystem dev_boot_custom=1 Repeat the previous test. This time when you press Ctrl-U, it should boot the recovery image. Turn the system off before it does anything. That's it. Change-Id: I1811ee9a188974b3f94c83c52b00b60028b86c69 Reviewed-on: https://gerrit.chromium.org/gerrit/11442 Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Fix the tree for tangentStefan Reinauer2011-11-021-0/+2
| | | | | | | | | | | | | | u-boot got too big on ARM, so don't unroll the loops there. BUG=none TEST=none Change-Id: I426621e147bef7cff1285b0ce063123fbeea751b Reviewed-on: https://gerrit.chromium.org/gerrit/11078 Reviewed-by: Vince Laviano <vlaviano@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jon Kliegman <kliegs@chromium.org> Tested-by: Stefan Reinauer <reinauer@chromium.org>
* vboot_reference: clean up CFLAGS and enable unrolled loopsStefan Reinauer2011-11-021-1/+7
| | | | | | | | | | | | | | | | | | - loop unrolling has a positive effect on execution speed. - This change also drops the -march=i386 and thus allows the compiler to use SSE instructions. - A few duplicate options are dropped from CFLAGS. - drop -fno-toplevel-reordering. This sneaked in from u-boot where it might be needed by some drivers. With this change I just successfully booted my Stumpy in 833ms BUG=chrome-os-partner:4675 TEST=boot tested on stumpy Change-Id: I805cbcaec48b4f8d1d8fa7d7bed9241178f59a8e Reviewed-on: https://gerrit.chromium.org/gerrit/11061 Tested-by: Stefan Reinauer <reinauer@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Move Memset from vboot_reference to vbexport/u-bootStefan Reinauer2011-11-022-8/+6
| | | | | | | | | | | | | | | | | | All memory operations (except the "safe ones") live in the firmware so the fast operations can be used. Except Memset. This CL changes that problem. This CL needs https://gerrit.chromium.org/gerrit/#change,10992 and a similar change in H2C. BUG=chrome-os-partner:6313 TEST=run coreboot/u-boot on Stumpy Change-Id: Ic961ebbb45470c8fc1316490b902759dcf221deb Reviewed-on: https://gerrit.chromium.org/gerrit/10993 Tested-by: Stefan Reinauer <reinauer@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* vboot_reference: Fix typo in firmware MakefileStefan Reinauer2011-11-021-1/+1
| | | | | | | | | | | BUG=none TEST=test booting on stumpy Change-Id: Ie89704d62714d1e78603d83ce86167ce9c682cb0 Reviewed-on: https://gerrit.chromium.org/gerrit/11055 Tested-by: Stefan Reinauer <reinauer@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* new signature for optional easter egg.Bill Richardson2011-10-113-6/+3
| | | | | | | | | | BUG=none TEST=none Change-Id: I86743dbba3210858d817c8e6982f17df96920420 Reviewed-on: http://gerrit.chromium.org/gerrit/9889 Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Some easter eggs may need a refresh.Bill Richardson2011-10-113-3/+5
| | | | | | | | | | BUG=none TEST=none Change-Id: I4b8cffa63dd10261e45a5ca6233b4d5cd2471f62 Reviewed-on: http://gerrit.chromium.org/gerrit/9861 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org>
* Fix potential NULL pointer dereference in vboot_kernel.cStefan Reinauer2011-10-101-1/+4
| | | | | | | | | | | | | | | | | | In the unlikely case that params is not set or the LoadKernelParams structure is not initialized correctly, LoadKernel will exit before initializing shcall. However, in LoadKernelExit it will be used to stire the function's return code, thus potentially dereferencing a NULL pointer. BUG=chrome-os-partner:6307 TEST=compile tested. Change-Id: I691c6b5054d8f77296de86834b3125de06e0e398 Reviewed-on: http://gerrit.chromium.org/gerrit/9791 Tested-by: Stefan Reinauer <reinauer@google.com> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Ready: Stefan Reinauer <reinauer@chromium.org>
* Enable (and test) custom dev-mode soundsBill Richardson2011-10-053-43/+188
| | | | | | | | | | | | | | BUG=none TEST=manual cd src/platform/vboot_reference make && make runtests Change-Id: I7f7d50d7c9c5541e0b99031245f882996a6b88ec Reviewed-on: http://gerrit.chromium.org/gerrit/8731 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Refactor dev-mode delay handling into a separate file.Bill Richardson2011-10-055-106/+188
| | | | | | | | | | | | | | BUG=none TEST=manual cd src/platform/vboot_reference make && make runtests Change-Id: I56feceb7d4fce80e4f50d5d7875eafef325363cc Reviewed-on: http://gerrit.chromium.org/gerrit/8659 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Add more debugging info to BIOS screens.Bill Richardson2011-09-281-1/+95
| | | | | | | | | | | | | | | | | | | | This displays the gbb.flags value when being warned about it being nonzero. It also decodes the recovery_reason value into English. BUG=chromium-os:20972 TEST=manual 1. Use gbb_utility to create a BIOS with valid bitmaps, but with gbb.flags set to a non-zero value. Boot into recovery mode. You should see the warning that gbb.flags is non-zero, and the value itself. 2. Press TAB. The recovery_reason field should display not only a value, but also an English string explaining the value. Change-Id: I99b7aa35bc67453bdf3385b9573491090c3dec1d Reviewed-on: http://gerrit.chromium.org/gerrit/8459 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org>
* Make startup delay and noises simpler to change.Bill Richardson2011-09-262-26/+110
| | | | | | | | | | | | | BUG=none TEST=manual Booted in dev-mode. All noises and delays are unchanged (2 second delay when gbb.flags is 1, 30-second with beeps at 20 seconds when gbb.flags is 0). Change-Id: I816e57c4f8f6025299851b3d42b4a350f9925994 Reviewed-on: http://gerrit.chromium.org/gerrit/8240 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org>
* VbExBeep() now returns VbError_t instead of voidBill Richardson2011-09-233-8/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This enables us to support playing sounds in the background if the BIOS allows it, so we don't have to block while beeping is happening. The new declaration is: VbError_t VbExBeep(uint32_t msec, uint32_t frequency); If the audio codec can run in the background, then: zero frequency means OFF, non-zero frequency means ON zero msec means return immediately, non-zero msec means delay (and then OFF if needed) else: non-zero msec and non-zero frequency means ON, delay, OFF, return zero msec or zero frequency means do nothing and return immediately The return value is used by the caller to determine the capabilities. The implementation should always do the best it can if it cannot fully support all features - for example, beeping at a fixed frequency if frequency support is not available. At a minimum, it must delay for the specified non-zero duration. Currently, VbExBeep() is called only when displaying the dev-mode screen. BUG=none TEST=manual I've tested on x86 and ARM, all timeouts and noises work as before. Note that ARM and coreboot will require a corresponding change to their VbExBeep() implementations, which will have to be handled with separate, simultaneous CLs. Change-Id: I3417ae4b99d9d0aee63f2ccaeed39b61d4333e5d Reviewed-on: http://gerrit.chromium.org/gerrit/8234 Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@google.com>
* Make BIOS screens warn when GBB.flags is nonzero.Bill Richardson2011-09-141-0/+11
| | | | | | | | | | | | | | | | | | | | | | BUG=chrome-os-partner:5919 TEST=manual Until the factory flow has completed, BIOS screens should display a warning message about GBB.flags. This message should disappear once the flags field is zero. You can see the state of the GBB flags in a particular BIOS image using gbb_utility -g --flags BIOS.bin And set it with gbb_utility -s --flags=VALUE BIOS.bin NEWBIOS.bin Change-Id: I15d336bda571978ece0a9744f19d80f0ae385fb1 Reviewed-on: http://gerrit.chromium.org/gerrit/7719 Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Stub out easter egg, in case BIOS wants to implement one.Bill Richardson2011-09-144-3/+26
| | | | | | | | | | | | BUG=none TEST=manual Type 'xyzzy' at dev-mode BIOS screen. What happens next depends on the BIOS. Change-Id: Ifdb49eb6cb53ecee91f576be91679bd5a232f008 Reviewed-on: http://gerrit.chromium.org/gerrit/7656 Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Up/Down keys should change locale in BIOS screens.Bill Richardson2011-09-131-2/+3
| | | | | | | | | | | | | BUG=chrome-os-partner:5927 TEST=manual Install BIOS with valid bitmaps, boot to dev-mode or recovery, press arrow keys. Change-Id: I3946bac94cc075f9d11b4dd3fcb118807c3318c4 Reviewed-on: http://gerrit.chromium.org/gerrit/7636 Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Change debug messages to use 1-based GPT partition numbers.Bill Richardson2011-09-082-3/+6
| | | | | | | | | | BUG=none TEST=none Change-Id: Ib717f1008edbb6c11d73fbe42d533ebe45800a45 Reviewed-on: http://gerrit.chromium.org/gerrit/7410 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org>
* Display sha1sums in BIOS debug infotest-982.Bfactory-980.BBill Richardson2011-09-011-2/+37
| | | | | | | | | | | | BUG=none TEST=manual Press 'TAB' at any BIOS screen. You should see some sha1sums. Change-Id: Id2f034ad198e4c9c53ab2f2a8fa6195f3479f6aa Reviewed-on: http://gerrit.chromium.org/gerrit/7101 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org>
* Add tests for vboot_firmware.cRandall Spangler2011-09-011-2/+5
| | | | | | | | | | | | | | | 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>