summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2011-08-29CHROMIUM: guard boot_kernel fdt codes with #ifdefChe-Liang Chiou
boot_kernel sets up pointer to crossystem data for embedding into kernel device tree unconditionally regarding CONFIG_OF_UPDATE_FDT_BEFORE_BOOT. This patch guards boot_kernel codes that are specific to kernel device tree with the config flag. Note: x86 boards might use a mechanism other than device tree to deliver crossystem data to kernel. BUG=none TEST=emerge-{tegra2_aebl,x86-alex} chromeos-u-boot Change-Id: Ifd04af1681d72c918c838ba3713ddecaca0ff18a Reviewed-on: http://gerrit.chromium.org/gerrit/6466 Tested-by: Che-Liang Chiou <clchiou@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@google.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2011-08-29CHROMIUMOS: Add vbexport_init() to set up librarySimon Glass
We need to register available boot devices. It seems reasonable that this library should be initialized before use. BUG=chromium-os:19518 TEST=build on Seaboard; vbexport_test diskinfo See that all boot devices are found with SD and USB inserted Change-Id: I17a535dc85b5aaee669ea67b439632bafb19c806 Reviewed-on: http://gerrit.chromium.org/gerrit/6501 Reviewed-by: Anton Staaf <robotboy@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
2011-08-29Choose the right boot function for x86Stefan Reinauer
BUG=chrome-os-partner:4552 TEST=vboot_twostop does not fail with an error after loading the kernel. Change-Id: I16016239716c8030ea63c7da6bd99a2f03b0e40d Reviewed-on: http://gerrit.chromium.org/gerrit/5549 Tested-by: Stefan Reinauer <reinauer@google.com> Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2011-08-29Only include mmc.h when mmc is enabled.Stefan Reinauer
From http://gerrit.chromium.org/gerrit/#change,6253 BUG=none TEST=none Change-Id: I3145aa84a8426506d8dc44d094da4884f079b3b4 Reviewed-on: http://gerrit.chromium.org/gerrit/6355 Tested-by: Stefan Reinauer <reinauer@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2011-08-29Look for an IDE boot device on non-MMC systems.Stefan Reinauer
This is a rewrite of http://gerrit.chromium.org/gerrit/#change,5547 which tries to integrate more transparently into vbexport's code and at the same time removes some (false) assumptions about always booting from MMC. BUG=none TEST=none Change-Id: I18f3b91f307b16622de9ced97ab00454c29941fe Reviewed-on: http://gerrit.chromium.org/gerrit/6232 Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Stefan Reinauer <reinauer@google.com>
2011-08-29CHROMIUMOS: tidy msleep castSimon Glass
BUG=chromium-os:19353 TEST=build for Seaboard Change-Id: Iba1da73cdd5a8e3972240e939a40ee4a32e83786 Reviewed-on: http://gerrit.chromium.org/gerrit/6252 Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
2011-08-29New function VbExDecompress(), changed VbExDisplayImage().Bill Richardson
The vboot_api.h interface has changed, so we need to adapt. VbExDecompress() now allows the vboot library access to native decompression routines. The signature of VbExDisplayImage() has changed, so we now only need to support uncompressed native-format bitmaps. BUG=chromium-os:19134 TEST=manual I tested by modifying the U-Boot build so I could get into the U-Boot prompt and run "vbexport_test display". The GBB screens rendered correctly. Change-Id: Iec605dee0af46e7d9eecc89b826e260f8a5930a4 Reviewed-on: http://gerrit.chromium.org/gerrit/6131 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org>
2011-08-29Add board_panic_no_console to deal with early critical errorsSimon Glass
Change-Id: I1e1cc76214cdb45399cec090677d3164ca2d33eb Reviewed-on: http://gerrit.chromium.org/gerrit/6065 Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Anton Staaf <robotboy@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
2011-08-29CHROMIUM: remove earlier prototype codesChe-Liang Chiou
The removed codes are belong to an earlier prototype of integrating vboot wrapper API, which is not compiled/used anymore. Besieds, the prototype has a known vulnerability of buffer overflow when reading key blocks. So there is no many referential value for keeping the prototype codes in the codebase. And keeping the prototype also adds costs to new patches, which have to changes two implementations. All in all, I think it is time we retire this prototype. This patch also fixes coreboot build failure due to the removal. BUG=chromium-os:16542 TEST=emerge-{x86-alex,tegra2_aebl} chromeos-u-boot Change-Id: Ib6be9457f2dbc2daa3213c3d9c80bcdc56c520c4 Reviewed-on: http://gerrit.chromium.org/gerrit/5874 Reviewed-by: Che-Liang Chiou <clchiou@chromium.org> Tested-by: Che-Liang Chiou <clchiou@chromium.org>
2011-08-29Makes the VbExGetTimer vboot callback function board specificGabe Black
The timer_get_us function which is called by the existing implementation of VbExGetTimer isn't trivial to implement on x86. The vboot source says that the TSC is an appropriate time source to return from this function. This change makes the VbExGetTimer function per board so that it can use rdtsc instead of timer_get_us. BUG=chrome-os-partner:4552 TEST=Built and booted on x86-alex, and built on tegra2_kaen. Signed-off-by: Gabe Black <gabeblack@google.com> Change-Id: I335d5ae98949cd05c42dc3f30c52931bdf63a623 Reviewed-on: http://gerrit.chromium.org/gerrit/5544 Reviewed-by: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org>
2011-08-29Introduce generic TPM support in u-boot.Vadim Bendebury
This code is used on x86 platforms to control a standard LPC based TPM device. The actual driver implementation is based on the article "Writing a TPM Device Driver" published on http://ptgmedia.pearsoncmg.com and the submission by Stefan Berger on Qemu-devel mailing list. One substantial difference is that in the simplest configuration (the case of the Alex device under coreboot/u-boot control) the other than 0 TPM localities do not get mapped by some devices (for instance, by Infineon slb9635), so this driver provides access to locality 0 only. BUG=chrome-os-partner:4547 TEST=manual Booted an Alex with this code, tried accessing TPM. Access routines do not fail, even though it is not yet possible to write data into a TPM location and read it back. This could be related to the fact that the CLI command does not intialize the TPM properly. boot > tpm generic_lpc_tpm.c:155 found TPM SLB9635 TT 1.2 by Infineon boot > tpm r 0x1008 10 boot > tpm w 0x1008 1 2 3 4 boot > tpm r 0x1008 4 Change-Id: Id8d23e9bb24ba2bcd999135c99e7612f9010f384 Reviewed-on: http://gerrit.chromium.org/gerrit/5492 Reviewed-by: Stefan Reinauer <reinauer@google.com> Tested-by: Vadim Bendebury <vbendeb@chromium.org>
2011-08-29Implement missing functions for vboot:Stefan Reinauer
* video_clear() Clear the video framebuffer. * cold_reboot() Do a hard reset through the chipset's reset control register. This register is available on all x86 systems (at least those built in the last 10ys) * power_off() Power down the machine by using the power management sleep control of the chipset. This will currently only work on Intel chipsets. However, adapting it to new chipsets is fairly simple. You will have to find the IO address of the power management register block in your southbridge, and look up the appropriate SLP_TYP_S5 value from your southbridge's data sheet. BUG=chrome-os-partner:3912 TEST=Run vboot_twostage and see vboot first clear the screen and later cold boot. Run poweroff and coldboot command in uboot console. Change-Id: I59f49a41e8807b2ec3ebb3d083d2a06ced9553a0 Reviewed-on: http://gerrit.chromium.org/gerrit/5361 Reviewed-by: Stefan Reinauer <reinauer@chromium.org> Tested-by: Stefan Reinauer <reinauer@chromium.org>
2011-08-29Decouple x86 u-boot from fdt related functions.Vadim Bendebury
The x86 u-boot does not enable the CONFIG_OF_CONTROL flag yet, and as such should not compile in the FDT related functions. This change takes care of this arrangement and also removes the remaining common code using fdt unconditionally. BUG=chrome-os-partner:4993 TEST=manual . build u-boot for Kaen, verify that the system still comes up as expected. . build coreboot image for Alex, verify that the system still can be started manually. Change-Id: I5416f9fd0a6cc9f86aef9051b1f7b6d9b252964e Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: http://gerrit.chromium.org/gerrit/5362
2011-08-29Make the FMAP configuration decoding function board specific.Gabe Black
This change makes the FMAP configuration decoding function board specific so that it can, for instance, use CBFS to store the FMAP on x86. The ARM implementation uses fdt_decode_twostop_fmap in its implementation and should behave the same. The new more generic interace is called decode_twostop_fmap. BUG=chrome-os-partner:5248 TEST=Built, installed and booted on Kaen, built and installed on Alex, ran vboot_twostop and saw new "unimplemented" message. Signed-off-by: Gabe Black <gabeblack@google.com> Change-Id: I07f6f8f7c8a62c5998ec4919d4609a7ac84783da Reviewed-on: http://gerrit.chromium.org/gerrit/5233 Reviewed-by: Stefan Reinauer <reinauer@google.com> Tested-by: Gabe Black <gabeblack@chromium.org>
2011-08-29Remove the device tree from one of the vboot support APIs.Gabe Black
This change removes the device tree from one of the vboot support APIs so that they fit better with coreboot u-boot. Specifically this is cros_gpio_fetch which is for getting GPIO values. Coreboot will read these and provide the values through its coreboot tables. The device tree pointer is global data so it doesn't need to be passed around as a parameter to be accessible. This change also removes the device tree from other interfaces in cmd_vboot_twostop.c so the structure of the code is more consistent. This way people can expect the device tree to always be the one pointed at by the global data and not sometimes one and sometimes the other, even though as written those will be equivalent. This change also takes the opportunity to mark the local functions in that file static, which is most of them. BUG=chrome-os-partner:4552 TEST=Built for x86-alex and tegra2_kaen. Installed and booted to chromeos login on Kaen. Change-Id: I084e774d97025d9ec71abe09c92fab8a7827892f Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://gerrit.chromium.org/gerrit/5232 Reviewed-by: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org>
2011-08-29Make the chromeos FMAP data structures more generic and in their own files.Gabe Black
This change separates out the FMAP data structures from the FDT decode functions and renames them to more neutral names. These structures don't intrinsically have to be loaded from the FDT, and their new names and location remove the implied dependency. BUG=chrome-os-partner:5248 TEST=Built for x86-alex and tegra2_kaen. Installed on Kaen and booted to chromeos login. Change-Id: I5680a3f3aaa52efe44c2060d0b6db9ad47a547ec Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://gerrit.chromium.org/gerrit/5231 Reviewed-by: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org>
2011-08-29CHROMIUM: move VbExHashFirmwareBody() to lib/vbexport/Che-Liang Chiou
This patch only moves code around. BUG=chromium-os:16542 TEST=build okay Change-Id: Idc908fd2e652c114ae8029c120386fb44e63b4f9 Reviewed-on: http://gerrit.chromium.org/gerrit/5204 Tested-by: Che-Liang Chiou <clchiou@chromium.org> Reviewed-by: Gabe Black <gabeblack@chromium.org>
2011-08-29CHROMIUM: avoid using printf %s on long stringsChe-Liang Chiou
The U-Boot printf() implementation has an output buffer limitation on output, and so cannot be used for very long output. Instead, puts() has no such limitation. BUG=chromium-os:18351 TEST=run on Aebl Change-Id: I3f3e3b81968f5169a2fe1f581924fa19c3dc1a43 Reviewed-on: http://gerrit.chromium.org/gerrit/4990 Reviewed-by: Che-Liang Chiou <clchiou@chromium.org> Tested-by: Che-Liang Chiou <clchiou@chromium.org>
2011-08-29Prevent the LP0 vector from being wiped out.Vadim Bendebury
It was observed that the sleep recovery fails when Kaen is in dev mode. Further investigation has shown that the LP0 vector space is set to all zeros when the system is in dev mode, which clearly prevents it from resuming operations properly. Then it turned out that the recently introduced memory u-boot wipeout fails to exclude the LP0 vector space, so it gets erased. For some reason u-boot does this in two different places in the code, so the fix adds exclusion of the LP0 vector space in those spaces. BUG=chrome-os-partner:5152 TEST=manual Build a new u-boot image, install it on a kaen. Then bring up the kaen in normal and developer mode, login, close the lid and open it back a few times. Before the fix the machine would hang every single attempt at closing the lid when in dev mode, after the fix it enters and exits sleep state seamlessly in both dev and normal modes. Change-Id: I9ec31495bca41abed68de8559560f0b1fcdd4969 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: http://gerrit.chromium.org/gerrit/5193 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
2011-08-29CHROMIUM: make sure update_cmdline does not buffer overflowChe-Liang Chiou
Although we should not pass any command-line that causes update_cmdline to buffer overflow, it is good to check and avoid this. BUG=chromium-os:18139 TEST=unit tests on user space Change-Id: Ifc481068c30aa5c141d6e3d36f3affd5e3d95ffb Reviewed-on: http://gerrit.chromium.org/gerrit/4914 Tested-by: Che-Liang Chiou <clchiou@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
2011-08-29CHROMIUM: eliminate confusing comma separatorChe-Liang Chiou
BUG=none TEST=none Change-Id: I3b83f2df71df0227aa71dba8300e641944eb4c8b Reviewed-on: http://gerrit.chromium.org/gerrit/4909 Tested-by: Che-Liang Chiou <clchiou@chromium.org> Reviewed-by: Micah Catlin <micahc@chromium.org>
2011-08-29Implement shared display support.Vadim Bendebury
This change fills up the stubs in lib/vbexport/display.c to provide support on both ARM (where LCD driver is used) and X86 (where the CFB driver is used) platforms. BUG=chrome-os-partner:4552 TEST=manual On X86 (alex with a Dediprog programmer connected to it), run the following commands: . emerge-x86-alex vboot_reference-firmware chromeos-u-boot chromeos-coreboot dd if=/build/x86-alex/coreboot/coreboot.rom of=/tmp/coreboot seek=3584 bs=1K sudo flashrom -p dediprog -w /tmp/coreboot . Reboot the machine, observe it come up to boot> prompt, start ChromeOS (using the `boot' cli command). On ARM (tegra2_kaen) . emerge-tegra2_kaen vboot_reference-firmware chromeos-u-boot chromeos-bootimage . program the resulting image into Kaen, restart it, observe the machine come up. . install the new OS image on the machine, restart it, observe the machine come up. . request recovery reboot using crossystem, restart the machine, observe it come up in recovery request mode. This test case actually failed: the system did show the recovery request screen, but then proceeded to boot from the plugged in USB stick (it was supposed to wait for the stick to be removed/reinserted) Change-Id: I75310de3f93464645cc9e61237f65d7d19b71873 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: http://gerrit.chromium.org/gerrit/4886 Reviewed-by: Stefan Reinauer <reinauer@google.com>
2011-08-29CHROMIUM: remove using sprintf to convert a known constant to stringChe-Liang Chiou
BUG=none TEST=emerge-{ARM board, x86 board} chromeos-u-boot Change-Id: Ib6c267d6624cebf2b83cb1996ae8135b9cb0e436 Reviewed-on: http://gerrit.chromium.org/gerrit/4911 Tested-by: Che-Liang Chiou <clchiou@chromium.org> Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
2011-08-29Get rid of the CONFIG_CHROMEOS_KERNEL_* config optionsGabe Black
These were incompletely renamed to CHROMEOS_KERNEL_* this change cleans up the remaining use of the old name and gets rid of the old option from the coreboot configuration. BUG=chrome-os-partner:4552 TEST=Built for coreboot, aebl, and kaen. Change-Id: I267932ab1d2f4a148357e7c95f15a104422ba687 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://gerrit.chromium.org/gerrit/4889 Reviewed-by: Stefan Reinauer <reinauer@google.com> Reviewed-by: Che-Liang Chiou <clchiou@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org>
2011-08-29Add a missing include into main_entry.cGabe Black
main_entry.c uses the TPM_SUCCESS constant but wasn't including the file that defines it. This was breaking the build for u-boot/coreboot. BUG=chrome-os-partner:4552 TEST=Built for coreboot. Change-Id: I684c4272fcc67403eaf70e2b063dbe3db2b6eb88 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://gerrit.chromium.org/gerrit/4848 Reviewed-by: Stefan Reinauer <reinauer@google.com> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org>
2011-08-29Conditionally implement vboot function wipe_unused_memoryGabe Black
The wipe_unused_memory function in bootstub_entry.c in the vboot library which depends on being able to call fdt_decode_memory which only compiled in with CONFIG_OF_CONTROL. That setting breaks booting u-boot with coreboot right now. This change conditionally compiles in the existing implementation if the right support is available and compiles in a warning message if it isn't. BUG=chrome-os-partner:4552 TEST=Built on x86. Change-Id: I6404eb12b25c19eb21eb65ad16a5031a5e3d0ad7 Reviewed-on: http://gerrit.chromium.org/gerrit/4843 Reviewed-by: Stefan Reinauer <reinauer@google.com> Tested-by: Gabe Black <gabeblack@chromium.org>
2011-08-29Conditionally implement vbexport functionsGabe Black
There are a few functions in display.c in the vbexport library which depend on being able to call functions provided by the LCD driver. If that support isn't turned on then compilation will fail. It can't always be turned on because it's not always the right driver to use. This change conditionally compiles in the existing implementation if the right support is available and compiles in a warning message and a failing return code if it isn't. BUG=chrome-os-partner:4552 TEST=Built on x86. Signed-off-by: Gabe Black <gabeblack@google.com> Change-Id: I70695f06bb1b55063d035307e0420f8fc58b1efa Reviewed-on: http://gerrit.chromium.org/gerrit/4768 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org>
2011-08-29CHROMIUM: cherry-pick gbb partial loading optimizationChe-Liang Chiou
This patch is cherry-picked from commit 1d01c6b. You may gain 142ms in boot time. BUG=chromium-os:16542 TEST=boot normal/developer/recovery on Aebl Change-Id: I983e2dec32205dd586a2d7f267409eaafefb267f Reviewed-on: http://gerrit.chromium.org/gerrit/4806 Tested-by: Che-Liang Chiou <clchiou@chromium.org> Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
2011-08-29CHROMIUM: reorganize config headersChe-Liang Chiou
The headers are merged and split into the board-independent header chromeos.h and a board-dependent header, e.g., chromeos_tegra2_twostop.h. The board-independent header defines/enables all features that a verified boot firmware must have, and is included by a board-dependent header. Moreover, the CONFIG_CHROMEOS_* flags are reduced into a single flag CONFIG_CHROMEOS. BUG=none TEST=make chromeos_tegra2_twostop_config && make Change-Id: I2ec9092ed898c640175095e86cfcb100efbefb3a Reviewed-on: http://gerrit.chromium.org/gerrit/4731 Reviewed-by: Che-Liang Chiou <clchiou@chromium.org> Tested-by: Che-Liang Chiou <clchiou@chromium.org>
2011-08-29CHROMIUM: add cros_vboot/cros_legacy to kernel command lineChe-Liang Chiou
Some scripts, like those in factory process, detect whether Chrome OS is booted from a verified boot or a legacy boot by overloading crossystem. If crossystem returns a valid hardware id, the scripts believe that Chrome OS is booted from a verified boot. Although this trick works, it does not sound right. This patch adds "cros_vboot" and "cros_legacy" to kernel command line of verified boot firmware and legacy firmware so that the scripts can grep the value, or the crossystem may do the grep. This patch also fixes unsafe use of strncpy. BUG=chromium-os:15700,chromium-os:18139 TEST=verified boot and grep cros_vboot /proc/cmdline TEST=boot from legacy and grep cros_legacy /proc/cmdline Change-Id: Id5182c2f4e05fc566a17b1e50f9157f96c50f866 Reviewed-on: http://gerrit.chromium.org/gerrit/4645 Reviewed-by: Che-Liang Chiou <clchiou@chromium.org> Tested-by: Che-Liang Chiou <clchiou@chromium.org>
2011-08-29CHROMIUM: factor out gbb loader functionsChe-Liang Chiou
This patch also eliminates duplications of decoding fmap from the device tree. BUG=chromium-os:16542 TEST=make chromeos_seaboard_vboot_config && make Change-Id: I0af75335be10823b8644c94f6fc9aac0304a2633 Reviewed-on: http://gerrit.chromium.org/gerrit/4745 Tested-by: Che-Liang Chiou <clchiou@chromium.org> Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
2011-08-29CHROMIUM: initialize TPM in readwrite firmwareChe-Liang Chiou
VbSelectAndLoadKernel() does not initialize TPM, and because the function does not distinguish its caller (VbSelectFirmware() initializes TPM and so if the caller is read-only firmware, the function should not try to initialize TPM again), it seems unlikely that we can add TPM initialization codes in the function. So the readwrite firmware itself has to call VbExTpmInit() to initialize TPM. BUG=chromium-os:17951 TEST=resign with make_dev_firmware and boot on Aebl TEST=check hwid is "ARM AEBL TEST 5789 DEV" Change-Id: If99e09111c2152e909089a8a30a53702573ab3e1 Reviewed-on: http://gerrit.chromium.org/gerrit/4741 Reviewed-by: Che-Liang Chiou <clchiou@chromium.org> Tested-by: Che-Liang Chiou <clchiou@chromium.org>
2011-08-29CHROMIUM: reserve board-specific section for crossystem dataChe-Liang Chiou
So far there seems to be no real board-specific data that crossystem requires (the LBA/offset/size of non-volatile context used on ARM boards are constants, and could be removed from crossystem data blob). Nevertheless, I think it should be good to reserve a section for board-specific data. BUG=chromium-os:17876 TEST=make Change-Id: I249fb6bb1ac1740df9f9596e1e1a61ab08c45659 Reviewed-on: http://gerrit.chromium.org/gerrit/4648 Reviewed-by: Che-Liang Chiou <clchiou@chromium.org> Tested-by: Che-Liang Chiou <clchiou@chromium.org>
2011-08-29CHROMIUM: remove dependency to deprecated codeChe-Liang Chiou
(commit 5a4a67 does not remove all deprecated stuff) BUG=none TEST=make Change-Id: I458af1218c5afba53f56b0c75bcb0ac1b41caa68 Reviewed-on: http://gerrit.chromium.org/gerrit/4743 Reviewed-by: Che-Liang Chiou <clchiou@chromium.org> Tested-by: Che-Liang Chiou <clchiou@chromium.org>
2011-08-29Make vbexport only use the fdt for LCD info if that's configuredGabe Black
BUG=chrome-os-partner:4552 TEST=Built and booted u-boot on an Alex. Change-Id: I03eb29f70742b4dd3056b0e50c8d54f125bff225 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://gerrit.chromium.org/gerrit/4717 Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org>
2011-08-29CHROMIUM: Remove use of LOAD_KERNEL_INVALID from u-boot.Doug Anderson
The LOAD_KERNEL_INVALID constant was a VBOOT internal constant that has been removed. BUG=None TEST=compiled Change-Id: Id9158ce66c4dbb70eb0a2f8ad59ce2edc3877dd4 Reviewed-on: http://gerrit.chromium.org/gerrit/4764 Reviewed-by: Doug Anderson <dianders@chromium.org> Tested-by: Doug Anderson <dianders@chromium.org>
2011-08-29Make crossystem_data.c include fdt_support.h explicitlyGabe Black
crossystem_data.c needs definitions provided by fdt_support.h, but it doesn't include it explicitly. This change fixes that. BUG=chrome-os-partner:4993 TEST=Built and booted u-boot on an Alex. Change-Id: Ica640b9b6a3454cf8174636eca23c45f0c659e61 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://gerrit.chromium.org/gerrit/4713 Reviewed-by: Stefan Reinauer <reinauer@google.com> Tested-by: Gabe Black <gabeblack@chromium.org>
2011-08-29CHROMIUM: remove should-be-removed fileChe-Liang Chiou
I made a mistake in rebase and did not delete a file that should be removed in the previous patch. The file in question is lib/vboot/boot_kernel.c BUG=chromium-os:16542 TEST=make Change-Id: Ia91aa92762cc3cd5c410c9a335d6e5e25c3035fe Reviewed-on: http://gerrit.chromium.org/gerrit/4728 Reviewed-by: Che-Liang Chiou <clchiou@chromium.org> Tested-by: Che-Liang Chiou <clchiou@chromium.org>
2011-08-29CHROMIUM: reunify boot_kernelChe-Liang Chiou
During the code migration to the redesigned vboot_reference API, the boot_kernel (formerly named load_kernel_helper) was divided and its private functions were taken out to keep U-Boot compilable $ git log --oneline -3 -- lib/chromeos/load_kernel_helper.c 6cdb577 CHROMIUM: remove codes based on deprecated API of vboot_reference 29c5f74 CHROMIUM: Separate cmdline update part from load_kernel_helper library. f853479 CHROMIUM: Separate the pre-boot FDT update part from load_kernel_helper library. The commit 29c5f74 and f853479 took out the private functions for updating kernel command line and embedding crossystem data into a device tree. The functions are the guts of boot_kernel and serve no purpose other than helping boot kernel. In fact, if you diff load_kernel_helper and boot_kernel, you will find they are virtually identical, except that functions based on deprecated APIs of vboot_reference are removed in boot_kernel. As the code migration has been completed, it is time for the private functions to reunite with the boot_kernel. BUG=chromium-os:16542 TEST=boot on Aebl Change-Id: I6512d7a5197c41df7a2e9cc5d90c40be87b468b0 Reviewed-on: http://gerrit.chromium.org/gerrit/4573 Reviewed-by: Che-Liang Chiou <clchiou@chromium.org> Tested-by: Che-Liang Chiou <clchiou@chromium.org>
2011-08-29CHROMIUM: honor /chromeos-config/twostop-optional flag of device treeChe-Liang Chiou
BUG=none TEST=Boot and see "twostop-optional" on output TEST=Remove "twostop-optional" from flashrom-ro.dtsi and set preambles flags to 0, then boot and see "not twostop-optional" on output Change-Id: I53a151107e2bdf1a32f4aeace6f302b66cee3228 Reviewed-on: http://gerrit.chromium.org/gerrit/4651 Reviewed-by: Che-Liang Chiou <clchiou@chromium.org> Tested-by: Che-Liang Chiou <clchiou@chromium.org>
2011-08-29Make a few files assume a reasonable default if CACHE_LINE_SIZE isn't set.Gabe Black
This change modifies a few files to set a reasonable default, __BIGGEST_ALIGNMENT__, if CACHE_LINE_SIZE isn't set. There's precedence for doing this in a few other places in u-boot, and it's helpful if CACHE_LINE_SIZE isn't easy to determine. BUG=chrome-os-partner:4552 TEST=Built and booted on Alex and Seaboard. Change-Id: Id1fc373a35dd93f28c2c2f5c4bdaff707ff700e9 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://gerrit.chromium.org/gerrit/4699 Reviewed-by: Stefan Reinauer <reinauer@google.com> Tested-by: Gabe Black <gabeblack@chromium.org>
2011-08-29CHROMIUM: unroll the outer for-loop of VbExDiskGetInfo()Che-Liang Chiou
VbExDiskGetInfo() was implemented with nested loops, where the outer loop iterates iterators, and the inner loop runs through block devices via the iterator. It was quite complicated and the outer loop only iterates twice. So we believe it will make the code more readable if we unroll the outer for-loop. Besides unrolling the loop, we fix a logic error that disk_flags should be tested 'is subset of' rather than 'has non-empty intersection with' flags. BUG=chromium-os:16542 TEST=vbexport_test diskinfo Change-Id: Ic4a7d516d91ba7214b9b67eebbecf02f80b11786 Signed-off-by: Tammo Spalink <tammo@chromium.org> Reviewed-on: http://gerrit.chromium.org/gerrit/4472 Tested-by: Che-Liang Chiou <clchiou@chromium.org> Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
2011-08-29CHROMIUM: remove CONFIG_HARDWARE_TPMChe-Liang Chiou
The CONFIG_HARDWARE_TPM flag was used to disable software emulation of TPM functionality, for testing purpose or for boards that have a buggy or even do not have a hardware TPM. However, it turns out that it is easier to mock out TPM entirely in vboot_reference than implement a full software-emulated TPM in U-Boot. So we believe remove this flag and implement a mock in vboot_reference. BUG=none TEST=boot on Aebl Change-Id: Id6d2975f04f0f5e4203d45e23f36fce2ad7114f3 Reviewed-on: http://gerrit.chromium.org/gerrit/4647 Tested-by: Che-Liang Chiou <clchiou@chromium.org> Reviewed-by: Rong Chang <rongchang@chromium.org>
2011-08-29CHROMIUM: move VbExNvStorageRead/Write to board-specific directoryChe-Liang Chiou
As ARM accesses non-volatile storage from eMMC and x86 from CMOS, the accessor functions that export to vboot_reference are really not board-independent and so should be put at a board-dependent module. BUG=none TEST=make Change-Id: Idbd4d70372770597aa8897524ee6a1ffe173bfea Reviewed-on: http://gerrit.chromium.org/gerrit/4646 Tested-by: Che-Liang Chiou <clchiou@chromium.org> Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
2011-08-29CHROMIUM: Remove deprecated gbb_bmpblk library.Tom Wai-Hong Tam
The logic now goes into lib/vbexport/display. BUG=none TEST=build without error. Change-Id: I6f8e694c01c53cace462b08242c57b6649e6ef56 Reviewed-on: http://gerrit.chromium.org/gerrit/4643 Tested-by: Tom Wai-Hong Tam <waihong@chromium.org> Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
2011-08-29CHROMIUM: fix casting pointer to 32-bit typeChe-Liang Chiou
The pointer size is not guaranteed to be 32-bit wide. Casting a pointer to a 32-bit integer loses data on a 64-bit address machine. BUG=none TEST=build and boot on Kaen (I do not have a 64-bit machine for testing) Change-Id: I093a9e2a7331d7810e6af146600d047b95890631 Reviewed-on: http://gerrit.chromium.org/gerrit/4560 Reviewed-by: Che-Liang Chiou <clchiou@chromium.org> Tested-by: Che-Liang Chiou <clchiou@chromium.org>
2011-08-29CHROMIUM: Fix crossystem_data members name chanaged.Tom Wai-Hong Tam
To reflect the recent name changed in: http://gerrit.chromium.org/gerrit/#change,4554 which causes the build failed. BUG=chromium-os:17876 TEST=build without error Change-Id: Icb89448ba6c164cc1342cf1a5644fc2762938411 Reviewed-on: http://gerrit.chromium.org/gerrit/4570 Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org> Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
2011-08-29CHROMIUM: Implement VbExIsShutdownRequested() function and its test.Tom Wai-Hong Tam
The check condition is either: * a user has pressed the power button; * a user has closed the lid. BUG=chromium-os:17180,chrome-os-partner:4738 TEST=build without error, run "vbexport_test isshutdown", or boot recovery mode on Aebl --- When I pressed the power key, see the messages --- misc: Power-key-pressed is detected. VbDisplayScreen(0, 0) VbDisplayScreenFromGBB(): screen 0 not in the GBB VbSelectAndLoadKernel() returning 1 Returned 0x1 main: Failed to select and load kernel! --- When I closed the lid, see the messages --- misc: Lid-closed is detected. VbDisplayScreen(0, 0) VbDisplayScreenFromGBB(): screen 0 not in the GBB VbSelectAndLoadKernel() returning 1 Returned 0x1 main: Failed to select and load kernel! Change-Id: Ia003187215c0327b0246592404d13bab668cd323 Reviewed-on: http://gerrit.chromium.org/gerrit/4486 Tested-by: Tom Wai-Hong Tam <waihong@chromium.org> Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
2011-08-29CHROMIUM: Clear memory not-in-use before entering recovery firmware.Tom Wai-Hong Tam
BUG=chromium-os:17950 TEST=build without error, boot to recovery firmware, see memory wipe messages. tested both chromeos_tegra2_twostop and chromeos_seaboard_vboot configs. Change-Id: Icc0eebad37e8afeb158e0c0a49d3d053b91d8ac7 Reviewed-on: http://gerrit.chromium.org/gerrit/4563 Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org> Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
2011-08-29CHROMIUM: Add memory wipe library and its test.Tom Wai-Hong Tam
The old code is copied from the old recovery firmware implementation: http://gerrit.chromium.org/gerrit/gitweb?p=chromiumos/third_party/u-boot.git;a=blob;f=common/cmd_cros_rec.c;h=4188ec98d136129e45d9d6c7664f861b279185f8;hb=refs/heads/chromeos-v2010.09 BUG=chromium-os:17950 TEST=run "vboot_test memwipe" success. Tegra2 # vboot_test memwipe memory_wipe: clear memory regions: memory_wipe: [0x3f760c5c, 0x3f760c5d) memory_wipe: [0x3f760c64, 0x3f760c65) Memory wipe test SUCCESS! Change-Id: Ieb587dbe001f91a58add6bcd3a1bc505e4227bda Reviewed-on: http://gerrit.chromium.org/gerrit/4478 Tested-by: Tom Wai-Hong Tam <waihong@chromium.org> Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>