chromiumos/third_party/u-boot-v1.git
2 years agoCHROMIUM: Assign the frame buffer address as FDT one instead of u-boot one. 44/6044/1 factory-980.B master test-982.B
Tom Wai-Hong Tam [Fri, 12 Aug 2011 10:27:31 +0000 (18:27 +0800)]
CHROMIUM: Assign the frame buffer address as FDT one instead of u-boot one.

The framebuffer address should be specified in the device tree and not u-boot
assigned. This FDT value should be the same as the one defined in Linux kernel;
otherwise, it causes screen flicker. The FDT value overrides the framebuffer
allocated at the top of memory by board_init_f().

If the framebuffer address is not defined in the FDT, falls back to use the
address allocated by board_init_f().

BUG=chrome-os-partner:5338
TEST=build without error and boot Chrome OS on Aebl, see the screen not
corrupted and splash screen showed.

Change-Id: Ia6a996d127d74d6084900814d2c934fb95518e23

2 years agoCHROMIUM: Change the frame buffer addresses in FDT as same as kernel ones. 43/6043/1
Tom Wai-Hong Tam [Fri, 12 Aug 2011 09:40:23 +0000 (17:40 +0800)]
CHROMIUM: Change the frame buffer addresses in FDT as same as kernel ones.

This value is from kernel, arch/arm/mach-tegra/board-seaboard-panel.c
        {
                .name   = "fbmem",
                .start  = 0x18012000,
                /* enough space for 1368*910 32bpp */
                .end    = 0x18012000 + 0x97f680 - 1,
                .flags  = IORESOURCE_MEM,
        },

BUG=chrome-os-partner:5338
TEST=build without error.

Change-Id: I614c85e8fbec4031925b07061ee7ec0251e3cd70

2 years agoFix bug of get_addr() in fdt_decode.c. 42/6042/1
Tom Wai-Hong Tam [Fri, 12 Aug 2011 09:40:39 +0000 (17:40 +0800)]
Fix bug of get_addr() in fdt_decode.c.

The original description is to match the field holding "one address with
no trailing data". So the if condition should be equal length:
  if (cell && len != sizeof(addr_t))

But it still worked fine except the lcd frame-buffer value because all
other fields are somethings like: reg = <0x70006040 0x40>, not exactly one
address.

So this CL fixed the matching to either one address or two addresses.

BUG=chrome-os-partner:5338
TEST=build without error and manually print the frame-buffer value to verify.

Change-Id: I7a1a64feafc4e883f23044c1d04da09b2122ff40

2 years agoCHROMIUM: Define CONFIG_USB_ETHER_SMSC95XX to support SMSC95XX USB Etherenet Card. 13/5713/1
Tom Wai-Hong Tam [Thu, 11 Aug 2011 05:49:15 +0000 (13:49 +0800)]
CHROMIUM: Define CONFIG_USB_ETHER_SMSC95XX to support SMSC95XX USB Etherenet Card.

BUG=none
TEST=booted u-boot and detected a SMSC9500 USB Etherenet Adadpter.

Change-Id: I4800e431e0f981dc9dc4a41746cfe3584e96fc5d

2 years agoAdd support for SMSC95XX USB 2.0 10/100MBit Ethernet Adapter. 12/5712/1
Tom Wai-Hong Tam [Thu, 11 Aug 2011 05:39:00 +0000 (13:39 +0800)]
Add support for SMSC95XX USB 2.0 10/100MBit Ethernet Adapter.

The SMSC95XX is a USB hub with a built-in Ethernet adapter. This adds support
for this, using the USB host network framework.

The source is from a prevous commit:
http://lists.denx.de/pipermail/u-boot/2011-June/094243.html

And fix warnings of "Dereferencing type-punned pointer will break
strict-aliasing rules", as:
351c351,352
<       u32 addr_lo, addr_hi;
---
>       u32 addr_lo;
>       u16 addr_hi;
356,357c357,360
<       addr_lo = cpu_to_le32(*((u32 *)eth->enetaddr));
<       addr_hi = cpu_to_le16(*((u16 *)(eth->enetaddr + 4)));
---
>       memcpy(&addr_lo, eth->enetaddr, sizeof(u32));
>       addr_lo = cpu_to_le32(addr_lo);
>       memcpy(&addr_hi, eth->enetaddr + 4, sizeof(u16));
>       addr_hi = cpu_to_le16(addr_hi);

BUG=none
TEST=booted u-boot and detected a SMSC9500 USB Etherenet Adadpter.

Change-Id: I5fc136933d9923e5e446eecbbb7aeb8e2ccc7077

2 years agoCHROMIUM: ARM: tegra: aebl: Update EMC tables to match kernel. 73/5373/1 0.15.877.B firmware-881-u-boot-v1 firmware-u-boot-v1
Doug Anderson [Wed, 3 Aug 2011 22:05:42 +0000 (15:05 -0700)]
CHROMIUM: ARM: tegra: aebl: Update EMC tables to match kernel.

This depends on:
* http://gerrit.chromium.org/gerrit/5206
    Tegra: pmu: Fix the pmu_read and pmu_write
* http://gerrit.chromium.org/gerrit/5238
    CHROMIUM: ARM: tegra: Don't call board_emc_init() before
    bi_arch_number set.

This should have been done at the same time as these kernel CLs:
* http://gerrit.chromium.org/gerrit/4516
    CHROMIUM: arm: tegra: Modify DVFS EMC table to support all sku of Aebl-DVT

BUG=chromium-os:18648
TEST=Added print statements and saw proper init.
TEST=Booted on aebl and saw things were OK.

Reviewed-on: http://gerrit.chromium.org/gerrit/5254
Tested-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
(cherry picked from commit 098bf3e25be1471a63b5c8824f02990c560ae9fe)

Change-Id: I2d23f27d7108b711760c15b166821ec126224fc1

2 years agoMake the FMAP configuration decoding function board specific.
Gabe Black [Wed, 3 Aug 2011 06:31:44 +0000 (23:31 -0700)]
Make the FMAP configuration decoding function board specific.

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>
2 years agoRemove the device tree from one of the vboot support APIs.
Gabe Black [Wed, 3 Aug 2011 06:00:03 +0000 (23:00 -0700)]
Remove the device tree from one of the vboot support APIs.

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>
2 years agoMake the chromeos FMAP data structures more generic and in their own files.
Gabe Black [Wed, 3 Aug 2011 04:45:02 +0000 (21:45 -0700)]
Make the chromeos FMAP data structures more generic and in their own files.

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>
2 years agoCHROMIUM: ARM: tegra: kaen: Update EMC tables to match kernel.
Doug Anderson [Wed, 3 Aug 2011 21:35:36 +0000 (14:35 -0700)]
CHROMIUM: ARM: tegra: kaen: Update EMC tables to match kernel.

This depends on:
* http://gerrit.chromium.org/gerrit/5206
    Tegra: pmu: Fix the pmu_read and pmu_write
* http://gerrit.chromium.org/gerrit/5238
    CHROMIUM: ARM: tegra: Don't call board_emc_init() before
    bi_arch_number set.

This should have been done at the same time as these kernel CLs:
* http://gerrit.chromium.org/gerrit/1014
    CHROMIUM: tegra: kaen: drive ULPI directly from 26MHz crystal
* http://gerrit.chromium.org/gerrit/4393
    CHROMIUM: arm: tegra: kaen: add EMC table for kaen DVT-1 and DVT-2
* http://gerrit.chromium.org/gerrit/4621
    CHROMIUM: tegra: kaen: Remove unused SDRAM configs.

BUG=chromium-os:18648
TEST=Added print statements and saw proper init.
TEST=Booted on Kaen and saw boot speed improvement.

Change-Id: I092f67adc67184fc7da6ccd42be0e1e565683c03
Reviewed-on: http://gerrit.chromium.org/gerrit/5246
Tested-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
2 years agoCHROMIUM: ARM: tegra: Don't call board_emc_init() before bi_arch_number set.
Doug Anderson [Wed, 3 Aug 2011 21:25:05 +0000 (14:25 -0700)]
CHROMIUM: ARM: tegra: Don't call board_emc_init() before bi_arch_number set.

The board_emc_init() was a complete no-op, since the bi_arch_number was
always -1.  This makes it work properly.

BUG=chromium-os:18648
TEST=Added print statements and saw proper board ID.
TEST=Booted on Kaen and saw boot speed improvement (with additional CL
fixing the emc table).

Change-Id: Ic92b014216a866e389dd760d6becdb72e5bf7243
Reviewed-on: http://gerrit.chromium.org/gerrit/5238
Reviewed-by: Doug Anderson <dianders@chromium.org>
Tested-by: Doug Anderson <dianders@chromium.org>
2 years agoarm: Tegra2: gpio: Disable pullups for state switches
Anton Staaf [Wed, 3 Aug 2011 20:23:40 +0000 (13:23 -0700)]
arm: Tegra2: gpio: Disable pullups for state switches

The write protect switch has a 200K inline resistor that is weaker
than the internal Tegra pull-up.  The result is that even when the
write protect switch is pulling the write protect line to ground
the tegra can't tell.  This doesn't effect the ability of the
write protect switch to write protect the boot flash.  It just
prevents the Tegra from reading the state of the switch.  The
solution is to disable internal pull-ups for the ATD pingroup.  The
ATD pinground is four pins, three of them are used.  The SDIO3 write
protect switch and google recovery mode switch are also wired to the
ATD pingroup.  Both of these switches have external pull-ups, making
it safe to disable the internal ones.

BUG=chrome-os-partner:5040
TEST=verify from U-Boot prompt that Write Protect switch can be read:

gpio info 59
gpio input 59

<toggle WP switch>

gpio input 59

<observe different read value>

Change-Id: If1b8da3a0d8e34a6a997c9f2fa9064f71c93de39
Reviewed-on: http://gerrit.chromium.org/gerrit/5230
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
2 years agoTegra: pmu: Fix the pmu_read and pmu_write
Wei Ni [Wed, 3 Aug 2011 07:01:37 +0000 (15:01 +0800)]
Tegra: pmu: Fix the pmu_read and pmu_write

pmu_read/pmu_write call the i2c_read/i2c_write to read/write.
In the old codes, the parameter "alen" is 0, but according to the
tegra-i2c.c, if the alen==0, the i2c_read/i2c_write will be failed
with i2c_addr_ok(), it means the alen should not be 0.
It should be 1 in here.

BUG=chromium-os:18648
TEST=test on seaboard, the pmu_read/pmu_write works fine.

Change-Id: Ib55811bcc259a9dc74993728a23329abc6f2fe5d
Signed-off-by: Wei Ni <wni@nvidia.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/5206
Reviewed-by: Doug Anderson <dianders@chromium.org>
Tested-by: Doug Anderson <dianders@chromium.org>
2 years agoCHROMIUM: make include of vboot_api.h unconditional
Sonny Rao [Wed, 3 Aug 2011 05:57:16 +0000 (22:57 -0700)]
CHROMIUM: make include of vboot_api.h unconditional

This fixes a build breakage in lib/vbexport/display.c when
VBOOT_DEBUG isn't defined.

BUG=none
TEST=compile without VBOOT_DEBUG=1 defined

Change-Id: Icdafd2783190b39bbd031565d14b4b20bdefe446
Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/5202

2 years agoTegra: pmu: Set SM1 in PWM-only mode
Wei Ni [Mon, 1 Aug 2011 10:12:22 +0000 (18:12 +0800)]
Tegra: pmu: Set SM1 in PWM-only mode

If the Tps6586x SM1 is operating in the ‘AutoPFM/PWM’ mode,
the output may overshoot a couple of hundred millivolts followed by
it undershooting by a couple of hundred millivolts.
Set SM1 operate in PWM-only mode can fix this issue.
The Kernel codes has the same fix, u-boot also should include it.

BUG=None
TEST=Under a very specific load, frequency and output level,
the problem can be observed. So it's difficult to verify.
The kernel codes has the same fix in
http://codereview.chromium.org/6792068

Change-Id: Ieb8dbd4aba4ea1cc7538b631e5defb23df0e7b4e
Signed-off-by: Wei Ni <wni@nvidia.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/5066
Reviewed-by: Yen Lin <yelin@nvidia.com>
Reviewed-by: Jimmy Zhang <jimmzhang@nvidia.com>
Reviewed-by: Doug Anderson <dianders@chromium.org>
2 years agoCHROMIUM: move VbExHashFirmwareBody() to lib/vbexport/
Che-Liang Chiou [Wed, 3 Aug 2011 06:57:09 +0000 (14:57 +0800)]
CHROMIUM: move VbExHashFirmwareBody() to lib/vbexport/

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>
2 years agoCHROMIUM: avoid using printf %s on long strings
Che-Liang Chiou [Fri, 29 Jul 2011 07:44:16 +0000 (15:44 +0800)]
CHROMIUM: avoid using printf %s on long strings

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>
2 years agoPrevent the LP0 vector from being wiped out.
Vadim Bendebury [Wed, 3 Aug 2011 01:15:01 +0000 (18:15 -0700)]
Prevent the LP0 vector from being wiped out.

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>
2 years agoCHROMIUM: fdt: increase GBB section size
Hung-Te Lin [Tue, 2 Aug 2011 09:56:02 +0000 (17:56 +0800)]
CHROMIUM: fdt: increase GBB section size

To support multiple locale in firmware bitmaps, we need larger GBB size. x86 is
currently using 256k GBB with 6 locales, so we should provide similar size on
ARM.

BUG=chromium-os:18545
TEST=emerge-tegra2_XXX tegra2-public-firmware-fdts
     emerge-tegra2_XXX chromeos-bootimage

Change-Id: Id67704dd70fcfe98fdf168104bc1a2d609d5ece0
Reviewed-on: http://gerrit.chromium.org/gerrit/5138
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoTegra: kbc: Allow keypresses during startup
Rakesh Iyer [Thu, 28 Jul 2011 21:36:00 +0000 (14:36 -0700)]
Tegra: kbc: Allow keypresses during startup

Add support to detect keys pressed before keyboard driver is loaded.

BUG=chromium-os:17229
TEST=Built and tested on Seaboard. Reset seaboard keeping any key pressed and
verify system enters u-boot console.

Change-Id: I7508c901b79bf92be755a6e81a9556ccba4c78b1
Signed-off-by: Rakesh Iyer <riyer@nvidia.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4964
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoTell the FDT library where the device tree is automatically on bringup
Gabe Black [Thu, 28 Jul 2011 11:18:05 +0000 (04:18 -0700)]
Tell the FDT library where the device tree is automatically on bringup

This change adds a call to set_working_fdt_addr near the end of u-boot
initialization which tells the fdt command/library where the device tree is.
This makes it possible to use the fdt command to look at the active device tree
since otherwise there would be no way to know what address it was at to set
things up manually.

BUG=chrome-os-partner:4993
TEST=Built for coreboot/Alex, booted, and used fdt to look at the device tree.

Change-Id: Iccd93af0c3934de5f284b76f8c894adc9dbd7f88
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4919
Reviewed-by: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2 years agoLoad and install the device tree out of CBFS automatically during startup
Gabe Black [Thu, 28 Jul 2011 09:30:59 +0000 (02:30 -0700)]
Load and install the device tree out of CBFS automatically during startup

BUG=chrome-os-partner:4993
TEST=Built and booted on Alex and used the fdt command to verify that a valid
device tree was loaded.

Change-Id: I884509aa9013a1490451bdc10500ebb210f38f91
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4917
Reviewed-by: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2 years agoImplement vbnv support.
Vadim Bendebury [Mon, 1 Aug 2011 17:38:12 +0000 (10:38 -0700)]
Implement vbnv support.

Using the tables defined by coreboot retrieve and cache
information of where the VBNV area is kept in the CMOS.

Populate VBNV access functions to actually read and write this
area.

BUG=chrome-os-partner:4552
TEST=manual
  . built and booted u-boot on an Alex.
  . compiled u-boot for kaen.
  . verified using some extra code that vbnv area is reported as
    16 bytes at offset 52 (0x34).

Change-Id: Icf6a54e12b7458af9f9c213b4afe30437565706b
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/5079
Reviewed-by: Stefan Reinauer <reinauer@google.com>
3 years agoCHROMIUM: make sure update_cmdline does not buffer overflow
Che-Liang Chiou [Thu, 28 Jul 2011 09:37:59 +0000 (17:37 +0800)]
CHROMIUM: make sure update_cmdline does not buffer overflow

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>
3 years agoCHROMIUM: return boot mode information
Che-Liang Chiou [Wed, 27 Jul 2011 15:14:22 +0000 (23:14 +0800)]
CHROMIUM: return boot mode information

We are implementing the feature that U-Boot can defer loading drivers
until they are needed. For that, U-Boot has to know which boot mode
(normal developer, or recovery) it is.

BUG=chromium-os:17060
TEST=make

Change-Id: Id843be9da07f6b9e8766225963c94e1c21863ffe
Reviewed-on: http://gerrit.chromium.org/gerrit/4812
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
3 years agoCHRIMIUM: aebl: kaen: seaboard: implement machine power off
Che-Liang Chiou [Thu, 28 Jul 2011 12:32:26 +0000 (20:32 +0800)]
CHRIMIUM: aebl: kaen: seaboard: implement machine power off

This patch is derived from kernel's seaboard power management driver and
tps6586x regulator driver.

BUG=chrome-os-partner:4738
TEST=press power button or close lid in dev and rec mode

Change-Id: I285856b52dcaba6ba3c29cacf47a8c592fbe3256
Reviewed-on: http://gerrit.chromium.org/gerrit/4922
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
3 years agoCHROMIUM: eliminate confusing comma separator
Che-Liang Chiou [Thu, 28 Jul 2011 06:54:04 +0000 (14:54 +0800)]
CHROMIUM: eliminate confusing comma separator

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>
3 years agoCHROMIUM: arm: set cros_secure to kernel command line
Che-Liang Chiou [Thu, 28 Jul 2011 13:05:20 +0000 (21:05 +0800)]
CHROMIUM: arm: set cros_secure to kernel command line

Related parameters that are supported on ARM incldue:
* cros_secure
* cros_legacy

BUG=chromium-os:18030
TEST=grep cros_secure /proc/cmdline

Change-Id: If5f26cf3c9a101efe9de1a8e194b49ef9fa2b3b4
Reviewed-on: http://gerrit.chromium.org/gerrit/4923
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
3 years agoRefactor the CBFS driver so that it's easier to use programmatically
Gabe Black [Thu, 28 Jul 2011 05:15:03 +0000 (22:15 -0700)]
Refactor the CBFS driver so that it's easier to use programmatically

This change refactors the implementation of the CBFS driver so that it can be
used effectively both from the command line and programmatically from within
u-boot.

BUG=chrome-os-partner:4993
TEST=Built and booted on Alex. Verified that the CBFS commands still behaved
correctly.

Change-Id: I97720828e282261f69479979d7d0c2c7d193c53f
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4916
Reviewed-by: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
3 years agoChange the CHROMEOS_KERNEL_LOADADDR setting for x86
Gabe Black [Thu, 28 Jul 2011 04:23:23 +0000 (21:23 -0700)]
Change the CHROMEOS_KERNEL_LOADADDR setting for x86

This value needed to be changed so that it matches what ARM uses and what a
bunch of tools expect.

BUG=chrome-os-partner:4552
TEST=Built and booted on Alex.

Change-Id: I57b0ee8607f79bceda8fe8498420a301ab60f2a2
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4915
Reviewed-by: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
3 years agoOnly define the static secure_boot_cmd function if it's going to be used
Gabe Black [Thu, 28 Jul 2011 21:11:46 +0000 (14:11 -0700)]
Only define the static secure_boot_cmd function if it's going to be used

The secure_boot_cmd was added to main.c recently and was compiled
unconditionally but used conditionally. gcc warns if a static function is
defined but not used, that was turned into an error, and the build would fail
depending on the configuration options chosen. This change makes both the
definition and use conditionally compiled.

BUG=none
TEST=Build for x86-alex (which compiles it out) and tegra2_kaen (which
compiles it in).

Change-Id: I552eb057b8e1e4cba5d1481b0dc9a7f876a4e81b
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4954
Tested-by: Gabe Black <gabeblack@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
3 years agoCHROMIUM: ARM: tegra2: Change panel power on sequence to meet timing
Dilan Lee [Wed, 27 Jul 2011 10:21:55 +0000 (18:21 +0800)]
CHROMIUM: ARM: tegra2: Change panel power on sequence to meet timing

LCD panels require delays in the power-on sequence. This adds those with
a facility for the ftd to specify them.

This introduces significant boot delays - around 120ms at minimum. We will
address these with further work.

BUG=chrome-os-partner:4854
TEST=Probe these power signals on Aebl with a scope.
Boot on Seaboard

Change-Id: Ie12abd52b66db5966de985a102aaadaea7f3d970
Signed-off-by: Dilan Lee <dilee@nvidia.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4194
Reviewed-by: Doug Anderson <dianders@chromium.org>
Tested-by: Doug Anderson <dianders@chromium.org>
3 years agoImplement shared display support.
Vadim Bendebury [Wed, 27 Jul 2011 23:38:15 +0000 (16:38 -0700)]
Implement shared display support.

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>
3 years agoCHROMIUM: Allow FDT to specify secure booting.
Doug Anderson [Wed, 27 Jul 2011 17:25:40 +0000 (10:25 -0700)]
CHROMIUM: Allow FDT to specify secure booting.

When secure booting is chosen:
* The u-boot shell is never invoked during boot--we just do a simple
  table lookup to find the command.  This means we could even remove
  the shell parsing from u-boot and still be able to boot.
* The boot command can't be interruped.
* Failure doesn't cause us to fall back to the shell.

NOTE: This bug needs some changes to chromeos-bootimage and to
cros_bundle_firmware to actually be useful.  Those are separate CLs.

BUG=chromium-os:17940, chromium-os:17582
TEST=The following:
1. Hacked bundle firmware to specify secure boot w/out boot command
   and saw: "## Error: Secure boot command not specified"
2. Hacked vboot_twostop to return -1 and saw:
   "## Error: "vboot_twostop" returned (code -1)"
3. Hacked to put bogus boot command in (zzboot_twostop) and saw:
   "## Error: "zzvboot_twostop" not defined"
4. Tried booting normally--it worked.
5. Saw that flasher worked OK (uses a FDT-boot command without
   secure).

Change-Id: If60e8c4198b58aea7dd6c9c7a2e80e3601a390f1
Reviewed-on: http://gerrit.chromium.org/gerrit/4819
Tested-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
3 years agoCHROMIUM: remove using sprintf to convert a known constant to string
Che-Liang Chiou [Thu, 28 Jul 2011 07:36:31 +0000 (15:36 +0800)]
CHROMIUM: remove using sprintf to convert a known constant to string

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>
3 years agoCHROMIUM: Measure the accurate write time on disk and firmware.
Tom Wai-Hong Tam [Wed, 27 Jul 2011 01:53:27 +0000 (09:53 +0800)]
CHROMIUM: Measure the accurate write time on disk and firmware.

The previous measurement includes one read, which is not correct.

BUG=chromium-os:18126
TEST=build and run on Aebl:
Tegra2 # vboot_test fwrw 1000
SF: Detected W25Q32 with page size 256, total 4 MiB
test_fwrw: fw_read, length: 0x1000, time: 3974
test_fwrw: fw_write, length: 0x1000, time: 58777
Read and write firmware test SUCCESS.

Tegra2 # vbexport_test diskrw 8
Requested clock rate 52000000 not honored (got 48000000)
test_diskrw: disk_read, lba_count: 8, time: 3616
test_diskrw: disk_write, lba_count: 8, time: 16370
Read and write disk test SUCCESS.

Change-Id: I165adfc894b6bb667dc2492cc5d840512ffddbc0
Reviewed-on: http://gerrit.chromium.org/gerrit/4787
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
3 years agoGet rid of the CONFIG_CHROMEOS_KERNEL_* config options
Gabe Black [Thu, 28 Jul 2011 01:08:45 +0000 (18:08 -0700)]
Get rid of the CONFIG_CHROMEOS_KERNEL_* config options

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>
3 years agoGet rid of some unused config header files
Gabe Black [Thu, 28 Jul 2011 01:11:31 +0000 (18:11 -0700)]
Get rid of some unused config header files

These files were presumably used before the recent config header
reorganization. Since they're no longer referred to by anything, this change
gets rid of them.

BUG=chrome-os-partner:4552
TEST=Build for coreboot, kaen, and aebl.

Change-Id: Ic4b568155904588536a9157f8182b9d17193b006
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4888
Reviewed-by: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
3 years agoInitialize the device tree pointer to NULL in i386.
Gabe Black [Wed, 27 Jul 2011 23:44:45 +0000 (16:44 -0700)]
Initialize the device tree pointer to NULL in i386.

If the device tree pointer isn't set to anything, which could happen if the
device tree isn't found, for instance, or simply never set up, the pointer
could be set to something arbitrary. This change forces initializes it to NULL
so that it's more obviously not set.

BUG=chrome-os-partner:4993
TEST=Built and booted u-boot on coreboot, used temporary printfs to print the
device tree pointer when booting chromeos, and verified that the pointer was
NULL if not set.

Change-Id: I9c6c34da6f3309b31a1fda920c6b139d728561f3
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4884
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Tested-by: Gabe Black <gabeblack@chromium.org>
3 years agoTurn on some of the vboot related commands in the coreboot config
Gabe Black [Thu, 21 Jul 2011 09:19:34 +0000 (02:19 -0700)]
Turn on some of the vboot related commands in the coreboot config

BUG=chrome-os-partner:4552
TEST=Built and booted u-boot on an Alex.

Change-Id: I445ebf765f215972e74ed8fa14c0652f7eab033a
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4855
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
3 years agoTurn on LZMA compression support in the coreboot config
Gabe Black [Thu, 21 Jul 2011 09:14:49 +0000 (02:14 -0700)]
Turn on LZMA compression support in the coreboot config

BUG=chrome-os-partner:4552
TEST=Built and booted u-boot on an Alex.

Change-Id: I458c8a1df4b5c238758c7e3203079055f53f186d
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4854
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Tested-by: Gabe Black <gabeblack@chromium.org>
3 years agoFix a compiler warning in serial_fdt.c
Gabe Black [Thu, 21 Jul 2011 09:10:59 +0000 (02:10 -0700)]
Fix a compiler warning in serial_fdt.c

Even though the fserial_getc function is supposed to hang and never return if
it gets past its switch statement, gcc still throws a warning because that
path doesn't return anything. This change adds a return to pacify gcc.

BUG=chrome-os-partner:4993
TEST=Built and booted u-boot on an Alex.

Change-Id: I28ca3ac301da4dfd861b98727e79cb597f2b881b
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4853
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
3 years agoTurn on MMC support in the coreboot config
Gabe Black [Thu, 21 Jul 2011 09:06:59 +0000 (02:06 -0700)]
Turn on MMC support in the coreboot config

Vboot expects mmc support, so turn it on.

BUG=chrome-os-partner:4552
TEST=Built and booted u-boot on an Alex.

Change-Id: I4f9a3b95bb417d6dec0e3ae88cca5521752bdcb3
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4852
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
3 years agoSet up the dummy SPI driver in the coreboot config
Gabe Black [Thu, 21 Jul 2011 09:00:41 +0000 (02:00 -0700)]
Set up the dummy SPI driver in the coreboot config

Since we don't have actual SPI support yet and vboot expects it, we need to
start building in the dummy driver.

BUG=chrome-os-partner:4552
TEST=Built and booted u-boot on an Alex.

Change-Id: Ic0bd5b468f9c8b83e6513e2e4dae2a615867f5e0
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4851
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Tested-by: Gabe Black <gabeblack@chromium.org>
3 years agoTurn on lib/vboot in the coreboot config file
Gabe Black [Thu, 21 Jul 2011 08:54:43 +0000 (01:54 -0700)]
Turn on lib/vboot in the coreboot config file

BUG=chrome-os-partner:4552
TEST=Built and booted u-boot on an Alex.

Change-Id: I443128fcb8919299ad178aaf58f380b751171a13
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4850
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
3 years agoOnly compile in a call to lcd_clear if the LCD driver is configured in.
Gabe Black [Wed, 27 Jul 2011 08:41:41 +0000 (01:41 -0700)]
Only compile in a call to lcd_clear if the LCD driver is configured in.

BUG=chrome-os-partner:4552
TEST=Build for coreboot

Change-Id: Ie7153f3e415e5605457713efca64953d78fb23a6
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4849
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
3 years agoAdd a missing include into main_entry.c
Gabe Black [Wed, 27 Jul 2011 08:34:41 +0000 (01:34 -0700)]
Add a missing include into main_entry.c

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>
3 years agoAdd in a stub value for the CHROMEOS_BOOTARGS config parameter
Gabe Black [Wed, 27 Jul 2011 07:36:24 +0000 (00:36 -0700)]
Add in a stub value for the CHROMEOS_BOOTARGS config parameter

This parameter is not useful for x86 since the function that uses it assumes
the kernel should be booted with bootm instead of zboot. Never the less, we
need to set a value to get u-boot to compile for coreboot again.

BUG=chrome-os-partner:4552
TEST=Built u-boot for coreboot

Change-Id: I55b6573eacdbf741093a411604d75a8a30e776af
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4847
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Tested-by: Gabe Black <gabeblack@chromium.org>
3 years agoTurn on the dummy TPM driver for u-boot/coreboot
Gabe Black [Wed, 27 Jul 2011 09:09:21 +0000 (02:09 -0700)]
Turn on the dummy TPM driver for u-boot/coreboot

Vboot depends on having a TPM driver in place. This change turns on the dummy
driver which was recently added.

BUG=chrome-os-partner:4552
TEST=Build for coreboot.

Change-Id: Id2b99cc9155836ec20abd08744e3a6801d018290
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4846
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Tested-by: Gabe Black <gabeblack@chromium.org>
3 years agoAdd a dummy TPM driver
Gabe Black [Wed, 27 Jul 2011 09:07:18 +0000 (02:07 -0700)]
Add a dummy TPM driver

Vboot depends on having a TPM driver in place, but we don't have one
implemented yet. This change adds a new empty driver which won't do anything
but will get vboot to compile.

BUG=chrome-os-partner:4552
TEST=Built for coreboot

Change-Id: I2afa4d7b3a5a70fcee76794bad113e7ae7e04d93
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4845
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Tested-by: Gabe Black <gabeblack@chromium.org>
3 years agoCompile out the second copy of wipe_unused_memory if CONFIG_OF_CONTROL isn't on
Gabe Black [Wed, 27 Jul 2011 08:55:13 +0000 (01:55 -0700)]
Compile out the second copy of wipe_unused_memory if CONFIG_OF_CONTROL isn't on

This fix is already being applied to the first copy of wipe_unused_memory.

BUG=chrome-os-partner:4552
TEST=Built for coreboot

Change-Id: I07c1c8d9cc09689e426399aecd2a022ac2e88ccf
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4844
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Tested-by: Gabe Black <gabeblack@chromium.org>
3 years agoConditionally implement vboot function wipe_unused_memory
Gabe Black [Sat, 23 Jul 2011 07:32:17 +0000 (00:32 -0700)]
Conditionally implement vboot function wipe_unused_memory

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>
3 years agoTurn on lib vbexport in the coreboot config
Gabe Black [Thu, 21 Jul 2011 08:29:52 +0000 (01:29 -0700)]
Turn on lib vbexport in the coreboot config

BUG=chrome-os-partner:4552
TEST=Built and booted u-boot on an Alex.

Change-Id: Id0d04330c90f0813356b690746190ad91e1d7b8a
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4842
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Tested-by: Gabe Black <gabeblack@chromium.org>
3 years agoUse a default value for CACHE_LINE_SIZE if no value was set
Gabe Black [Wed, 27 Jul 2011 07:18:26 +0000 (00:18 -0700)]
Use a default value for CACHE_LINE_SIZE if no value was set

This was fixed earlier, but a new instance has popped up.

BUG=chrome-os-partner:4552
TEST=Built u-boot for x86/coreboot.

Change-Id: I6db91149c5f45e1f69cd785bda7d7fd36b530181
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4841
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Tested-by: Gabe Black <gabeblack@chromium.org>
3 years agoRename some memory layout config parameters to match what the code now expects
Gabe Black [Wed, 27 Jul 2011 07:25:29 +0000 (00:25 -0700)]
Rename some memory layout config parameters to match what the code now expects

The name of these parameters changed out from under u-boot/coreboot in some
places but not in others. This change adds new #defines which are defined in
terms of the old defines so both versions are available.

BUG=chrome-os-partner:4552
TEST=Built u-boot for coreboot.

Change-Id: I3eab744601187a772904982da14ddd5c92842720
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4840
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Tested-by: Gabe Black <gabeblack@chromium.org>
3 years agoConditionally implement vbexport functions
Gabe Black [Thu, 21 Jul 2011 09:21:03 +0000 (02:21 -0700)]
Conditionally implement vbexport functions

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>
3 years agoCHROMIUM: cherry-pick gbb partial loading optimization
Che-Liang Chiou [Tue, 26 Jul 2011 14:29:41 +0000 (22:29 +0800)]
CHROMIUM: cherry-pick gbb partial loading optimization

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>
3 years agoOptimize slb9635 TPM and tegra2 I2C drivers.
Tom Wai-Hong Tam [Wed, 27 Jul 2011 07:37:19 +0000 (15:37 +0800)]
Optimize slb9635 TPM and tegra2 I2C drivers.

The original TPM and I2C drivers make the Chrome OS verified boot too slow.
    Result:  accum_time_vbex_tpm_send_receive      : 2,310,288 usec

This CL does several optimizations:
  * Move get_burstcount(chip) outside the main loop of tpm_tis_i2c_send()
    Result:  accum_time_vbex_tpm_send_receive      : 1,770,699 usec

  * Move wait_for_stat() in the retry condition.
    Result:  accum_time_vbex_tpm_send_receive      : 1,143,046 usec

  * Add NO_ACK check in wait_for_fifo of I2C driver.
    Result:  accum_time_vbex_tpm_send_receive      :   356,972 usec

  * Try to send full package once, before applying TPM_I2C_BURST_LIMITATION.
    Result:  accum_time_vbex_tpm_send_receive      :   330,334 usec

BUG=chromium-os:17805
TEST=build and boot to kernel on a TPM enabled ARM device.

Change-Id: I2d89595856103ec42effccd6ccca5ddd29c28535
Reviewed-on: http://gerrit.chromium.org/gerrit/4804
Tested-by: Rong Chang <rongchang@chromium.org>
Reviewed-by: Rong Chang <rongchang@chromium.org>
Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
3 years agoAdd stub implementations for the vbexport functions that access NV storage
Gabe Black [Mon, 25 Jul 2011 23:32:28 +0000 (16:32 -0700)]
Add stub implementations for the vbexport functions that access NV storage

These are now board specific functions which need x86 specific
implementations.

BUG=chrome-os-partner:4552
TEST=Built and booted u-boot on an Alex.

Change-Id: I0d3365559df19128fc2b900c4e0b3380b4fbe51c
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4772
Tested-by: Gabe Black <gabeblack@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoCHROMIUM: add missing config string due to rebase
Che-Liang Chiou [Wed, 27 Jul 2011 04:23:57 +0000 (12:23 +0800)]
CHROMIUM: add missing config string due to rebase

BUG=chromium-os:15700
TEST=make

Change-Id: Ia7352f4616540ee74b61a774849d79c66f089f21
Reviewed-on: http://gerrit.chromium.org/gerrit/4793
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
3 years agoCHROMIUM: reorganize config headers
Che-Liang Chiou [Tue, 26 Jul 2011 08:55:33 +0000 (16:55 +0800)]
CHROMIUM: reorganize config headers

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>
3 years agoCHROMIUM: add cros_vboot/cros_legacy to kernel command line
Che-Liang Chiou [Mon, 25 Jul 2011 06:39:35 +0000 (14:39 +0800)]
CHROMIUM: add cros_vboot/cros_legacy to kernel command line

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>
3 years agoCHROMIUM: factor out gbb loader functions
Che-Liang Chiou [Tue, 26 Jul 2011 14:10:16 +0000 (22:10 +0800)]
CHROMIUM: factor out gbb loader functions

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>
3 years agoCHROMIUM: initialize TPM in readwrite firmware
Che-Liang Chiou [Tue, 26 Jul 2011 10:20:19 +0000 (18:20 +0800)]
CHROMIUM: initialize TPM in readwrite firmware

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>
3 years agoCHROMIUM: reserve board-specific section for crossystem data
Che-Liang Chiou [Mon, 25 Jul 2011 08:10:31 +0000 (16:10 +0800)]
CHROMIUM: reserve board-specific section for crossystem data

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>
3 years agoCHROMIUM: remove dependency to deprecated code
Che-Liang Chiou [Tue, 26 Jul 2011 10:58:03 +0000 (18:58 +0800)]
CHROMIUM: remove dependency to deprecated code

(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>
3 years agoMake vbexport only use the fdt for LCD info if that's configured
Gabe Black [Fri, 22 Jul 2011 00:31:39 +0000 (17:31 -0700)]
Make vbexport only use the fdt for LCD info if that's configured

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>
3 years agoAdd memory layout info to the configuration, and move it out of boards.cfg
Gabe Black [Thu, 21 Jul 2011 08:49:30 +0000 (01:49 -0700)]
Add memory layout info to the configuration, and move it out of boards.cfg

This change moves some configuration information out of boards.cfg and puts it
into the config header. It also adds some other memory layout related settings.

BUG=chrome-os-partner:4552
TEST=Built and booted u-boot on an Alex.

Change-Id: Ie25a2424d3dc0d9ae2719e47ace114e991387436
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4716
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
3 years agoTurn on the config options for the chromeos library
Gabe Black [Thu, 21 Jul 2011 08:17:25 +0000 (01:17 -0700)]
Turn on the config options for the chromeos library

BUG=chrome-os-partner:4552
TEST=Built and booted u-boot on an Alex.

Change-Id: Iaf941b6859891a9072b507e4e0c92c2fda5ab3e1
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4715
Tested-by: Gabe Black <gabeblack@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoConfigure in the device tree library
Gabe Black [Thu, 21 Jul 2011 08:19:45 +0000 (01:19 -0700)]
Configure in the device tree library

BUG=chrome-os-partner:4993
TEST=Built and booted u-boot on an Alex.

Change-Id: Ifcf56a1ef73531b1f020fe734bcf0aec53294f3a
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4714
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
3 years agoCHROMIUM: Remove use of LOAD_KERNEL_INVALID from u-boot.
Doug Anderson [Tue, 26 Jul 2011 22:26:10 +0000 (15:26 -0700)]
CHROMIUM: Remove use of LOAD_KERNEL_INVALID from u-boot.

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>
3 years agoTegra: kbc: Add support for arrow keys
Anton Staaf [Fri, 22 Jul 2011 19:36:51 +0000 (12:36 -0700)]
Tegra: kbc: Add support for arrow keys

This patch adds a small FIFO that the tegra keyboard driver
can use to store conversions of keycodes to escape sequences
that U-Boot expects to see from its input device drivers.  The
fifo also replaces the testc/getc last keypress management
code.

BUG=chromium-os:17999
TEST=Build firmware and test on Aebl, Kaen and Seaboard:

cros_workon-tegra2_aebl start chromeos-u-boot
cros_workon-tegra2_aebl start tegra2-public-firmware-fdts

emerge-tegra2_aebl -auDN --selective=n chromeos-bootimage \
                                       chromeos-u-boot \
                                       tegra2-public-firmware-fdts

cros_write_firmware --board tegra2_aebl

Break into booting Aebl and test that arrow keys work as expected
from physical keyboard.

Change-Id: Ie19a79ce33bf03a3dce2a17248d2119f0e7afa71
Reviewed-on: http://gerrit.chromium.org/gerrit/4601
Reviewed-by: Anton Staaf <robotboy@chromium.org>
Tested-by: Anton Staaf <robotboy@chromium.org>
3 years agoassert: Rely on the compilers dead code removal
Anton Staaf [Mon, 25 Jul 2011 18:46:42 +0000 (11:46 -0700)]
assert: Rely on the compilers dead code removal

By always emitting the assert code we ensure that constructs passed
to assert will be checked by the compiler.  This also ensures that
functions that are only used in asserts aren't flagged as unused
when DEBUG is not defined.

BUG=chromium-os:17999
TEST=Build firmware and boot to ChromiumOS on Aebl, Kaen and Seaboard

Change-Id: Id5f5742622d7041c2cfb7f867742701a087f3e59
Reviewed-on: http://gerrit.chromium.org/gerrit/4666
Reviewed-by: Anton Staaf <robotboy@chromium.org>
Tested-by: Anton Staaf <robotboy@chromium.org>
3 years agoChromium: tegra: nand: Add NAND ECC support on data area
Jim Lin [Mon, 11 Jul 2011 10:39:23 +0000 (18:39 +0800)]
Chromium: tegra: nand: Add NAND ECC support on data area

BootROM code supports ECC on data area.
Original u-boot code doesn't support NAND ECC function on data area.
This will cause data not the same after reading back in u-boot NAND function.

BUG=chrome-os-partner:3221
TEST=Ran the following in u-boot command console to see whether system is
bootable.

nand read 500000 0 500000
nand erase 0 500000
nand write 500000 0 500000
nand read 10000000 0 500000
cmp.b 500000 10000000 500000
check whether data bytes are same.
If yes, press RESET button to see whether system is bootable.

Change-Id: Id06fc58ed35dc0c17694b52aaf26ce1abd590260
Signed-off-by: Jim Lin <jilin@nvidia.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/3853
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Warren <twarren@nvidia.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4674
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Anton Staaf <robotboy@chromium.org>
3 years agoMake crossystem_data.c include fdt_support.h explicitly
Gabe Black [Thu, 21 Jul 2011 08:15:16 +0000 (01:15 -0700)]
Make crossystem_data.c include fdt_support.h explicitly

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>
3 years agoCHROMIUM: Define VBOOT_PERFORMANCE if emake pass this flag.
Tom Wai-Hong Tam [Tue, 26 Jul 2011 03:11:35 +0000 (11:11 +0800)]
CHROMIUM: Define VBOOT_PERFORMANCE if emake pass this flag.

The flag VBOOT_PERFORMANCE is for performance measurement.

BUG=chromium-os:18126
TEST=build without error

Change-Id: If0aaa844638c92b8ec07af7322927487c19eb7b3
Reviewed-on: http://gerrit.chromium.org/gerrit/4724
Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
3 years agoCHROMIUM: Redirect VBDEBUG to VbExDebug if VBOOT_DEBUG on.
Tom Wai-Hong Tam [Tue, 26 Jul 2011 03:21:53 +0000 (11:21 +0800)]
CHROMIUM: Redirect VBDEBUG to VbExDebug if VBOOT_DEBUG on.

Make all debug print go to VbExDebug such that it is easy for performance
measurment.

BUG=chromium-os:18126
TEST=build without error

Change-Id: I30d59bd371dc3b122b3c1014107f2238cc01dc3c
Reviewed-on: http://gerrit.chromium.org/gerrit/4725
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
3 years agoCHROMIUM: Fix warning when cros-debug is off.
Tom Wai-Hong Tam [Tue, 26 Jul 2011 03:09:09 +0000 (11:09 +0800)]
CHROMIUM: Fix warning when cros-debug is off.

The warning is unused variable.

BUG=none
TEST=build without error:
USE="-cros-debug" emerge-tegra2_aebl chromeos-u-boot

Change-Id: I7315ca9d802826bee132525668d7e1f686ed4786
Reviewed-on: http://gerrit.chromium.org/gerrit/4723
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
3 years agoCHROMIUM: Test firmware and disk R/W with user-input length.
Tom Wai-Hong Tam [Mon, 25 Jul 2011 08:10:55 +0000 (16:10 +0800)]
CHROMIUM: Test firmware and disk R/W with user-input length.

Also add timing metrics. It is useful for benchmark the firmware and
disk R/W performance.

BUG=chromium-os:18126
TEST=build and run on Aebl:
Tegra2 # vboot_test fwrw 80000
test_fwrw: fw_read, length: 0x80000, time: 507045
test_fwrw: fw_write, length: 0x80000, time: 8620418
Read and write firmware test SUCCESS.

Tegra2 # vbexport_test diskrw 1024
test_diskrw: disk_read, lba_count: 1024, time: 31019
test_diskrw: disk_write, lba_count: 1024, time: 94955
Read and write disk test SUCCESS.

Change-Id: I8e92994dd8ca2938ec6d2b8321286f54ab5868a5
Reviewed-on: http://gerrit.chromium.org/gerrit/4652
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
3 years agoCHROMIUM: rename is_cold_boot to is_processor_reset
Che-Liang Chiou [Mon, 25 Jul 2011 04:18:13 +0000 (12:18 +0800)]
CHROMIUM: rename is_cold_boot to is_processor_reset

The predicate function is_cold_boot() is in fact telling you whether we
are booting from a processor reset.

BUG=chrome-os-partner:5100
TEST=build cleanly

Change-Id: I70f56448dd1b327426cf759854c35e20e0b4cfcf
Reviewed-on: http://gerrit.chromium.org/gerrit/4644
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
3 years agoCHROMIUM: remove should-be-removed file
Che-Liang Chiou [Tue, 26 Jul 2011 07:59:08 +0000 (15:59 +0800)]
CHROMIUM: remove should-be-removed file

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>
3 years agoCHROMIUM: reunify boot_kernel
Che-Liang Chiou [Fri, 22 Jul 2011 12:39:45 +0000 (20:39 +0800)]
CHROMIUM: reunify boot_kernel

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>
3 years agoCHROMIUM: honor /chromeos-config/twostop-optional flag of device tree
Che-Liang Chiou [Mon, 25 Jul 2011 09:38:05 +0000 (17:38 +0800)]
CHROMIUM: honor /chromeos-config/twostop-optional flag of device tree

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>
3 years agoAdd a dummy flash implementation for coreboot.
Gabe Black [Thu, 21 Jul 2011 01:44:23 +0000 (18:44 -0700)]
Add a dummy flash implementation for coreboot.

This implementation is a placeholder for future flash support.

BUG=chrome-os-partner:4552
TEST=Built and booted u-boot on an Alex.

Change-Id: Ie641c2c0fb7683301bc1063028f8fc6f31a46576
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4707
Tested-by: Gabe Black <gabeblack@chromium.org>
Reviewed-by: Gabe Black <gabeblack@chromium.org>
3 years agoAdd a dummy SPI driver so we don't have to use a real one for now.
Gabe Black [Thu, 21 Jul 2011 01:51:25 +0000 (18:51 -0700)]
Add a dummy SPI driver so we don't have to use a real one for now.

The vboot code depends (directly or indirectly) on having SPI support built
in. This dummy implementation is so that we can get things to compile without
having to first build a real one.

BUG=chrome-os-partner:4552
TEST=Built and booted u-boot on an Alex.

Change-Id: Iea298527c641d40d51485365b65ce79d945a50c3
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4706
Tested-by: Gabe Black <gabeblack@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoAdd a dummy implementation for timer_get_us.
Gabe Black [Thu, 21 Jul 2011 01:49:47 +0000 (18:49 -0700)]
Add a dummy implementation for timer_get_us.

BUG=chrome-os-partner:4552
TEST=Built and booted u-boot on an Alex.

Change-Id: I5e608fcd0f7a1b0d2e4659ea7d08265a24e59946
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4705
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Tested-by: Gabe Black <gabeblack@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoAdd some header files to flash.h that it was getting from its parent.
Gabe Black [Thu, 21 Jul 2011 01:36:23 +0000 (18:36 -0700)]
Add some header files to flash.h that it was getting from its parent.

flash.h depended on headers that happened to be included before it. This
change puts those #includes directly into flash.h

BUG=chrome-os-partner:4552
TEST=Built and booted u-boot on an Alex, built for Seaboard.

Change-Id: I46b34fccff7bf974052d08a6591fcaf7afa1766e
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4703
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Tested-by: Gabe Black <gabeblack@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoAdd some header files with stub implementations/definitions that vboot needs.
Gabe Black [Thu, 21 Jul 2011 01:29:26 +0000 (18:29 -0700)]
Add some header files with stub implementations/definitions that vboot needs.

BUG=chrome-os-partner:4552
TEST=Built and booted u-boot on an Alex.

Change-Id: I3d60b4e3c212976b160f0ca3a3b026a3945ca954
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4702
Tested-by: Gabe Black <gabeblack@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@google.com>
3 years agoUpdate the chromeos board files for x86.
Gabe Black [Thu, 21 Jul 2011 01:21:57 +0000 (18:21 -0700)]
Update the chromeos board files for x86.

This change replaces the existing stub files in chromeos with new stub files
which are consistent with what's currently required.

BUG=chrome-os-partner:4552
TEST=Built and booted u-boot on an Alex.

Change-Id: Ic0f7b0f411d797a6aab011a1a5f5991f0554c55c
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4700
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Tested-by: Gabe Black <gabeblack@chromium.org>
3 years agoMake a few files assume a reasonable default if CACHE_LINE_SIZE isn't set.
Gabe Black [Wed, 20 Jul 2011 23:04:45 +0000 (16:04 -0700)]
Make a few files assume a reasonable default if CACHE_LINE_SIZE isn't set.

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>
3 years agoAdd a default x86 implementation for cleanup_before_linux.
Gabe Black [Wed, 20 Jul 2011 22:55:43 +0000 (15:55 -0700)]
Add a default x86 implementation for cleanup_before_linux.

This function provides an opportunity for some last minute cleanup and
reconfiguration before control is handed over to Linux. It's possible this
may need to do something in the future, but for now it's left empty. It's set
up as a weak symbol so it can be overridden if necessary on a case by case
basis.

BUG=chrome-os-partner:4552
TEST=Built and booted u-boot on an Alex.

Change-Id: Ia59436b2a9d499ff659b2f41668cf951f2f7d999
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4698
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Tested-by: Gabe Black <gabeblack@chromium.org>
3 years agoAdd a minimal device tree to x86 to give us something to start with.
Gabe Black [Fri, 22 Jul 2011 06:54:03 +0000 (23:54 -0700)]
Add a minimal device tree to x86 to give us something to start with.

BUG=chrome-os-partner:4993
TEST=Built the device tree ebuild and verified that this was compiled
successfully.

Change-Id: Ia4c5c3408e63b55daa627b960b31a79028760c3f
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4697
Tested-by: Gabe Black <gabeblack@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@google.com>
3 years agoAdd a pointer to the global data structure to point to the device tree.
Gabe Black [Wed, 20 Jul 2011 22:45:45 +0000 (15:45 -0700)]
Add a pointer to the global data structure to point to the device tree.

This change adds a pointer to the global data structure in i386 to point to
the device tree. This mirrors an identical pointer in ARM.

BUG=chrome-os-partner:4993
TEST=Built and booted u-boot on an Alex.

Change-Id: I96710993bb35327ce5c4aa78aa5da763dc72109e
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/4696
Tested-by: Gabe Black <gabeblack@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@google.com>
3 years agoCHROMIUM: ARM: tegra: asymptote: Replace the current LCD timing values
Sean Paul [Fri, 22 Jul 2011 01:30:29 +0000 (18:30 -0700)]
CHROMIUM: ARM: tegra: asymptote: Replace the current LCD timing values

Replace the current LCD timing values for Asymptote with the correct
ones.

BUG=None
TEST=Built and ran on Asymptote, verified LCD functioned correctly

Change-Id: I908fa2b269fb53b70adc243c6cb02ceac781f87c
Reviewed-on: http://gerrit.chromium.org/gerrit/4546
Reviewed-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Tested-by: Sean Paul <seanpaul@chromium.org>
3 years agoCHROMIUM: unroll the outer for-loop of VbExDiskGetInfo()
Che-Liang Chiou [Wed, 20 Jul 2011 12:44:06 +0000 (20:44 +0800)]
CHROMIUM: unroll the outer for-loop of VbExDiskGetInfo()

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>
3 years agoCHROMIUM: remove CONFIG_HARDWARE_TPM
Che-Liang Chiou [Mon, 25 Jul 2011 07:20:30 +0000 (15:20 +0800)]
CHROMIUM: remove CONFIG_HARDWARE_TPM

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>
3 years agoCHROMIUM: move VbExNvStorageRead/Write to board-specific directory
Che-Liang Chiou [Mon, 25 Jul 2011 07:03:57 +0000 (15:03 +0800)]
CHROMIUM: move VbExNvStorageRead/Write to board-specific directory

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>
3 years agoCHROMIUM: Remove deprecated gbb_bmpblk library.
Tom Wai-Hong Tam [Mon, 25 Jul 2011 03:20:35 +0000 (11:20 +0800)]
CHROMIUM: Remove deprecated gbb_bmpblk library.

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>
3 years agoCHROMIUM: fix casting pointer to 32-bit type
Che-Liang Chiou [Fri, 22 Jul 2011 07:58:42 +0000 (15:58 +0800)]
CHROMIUM: fix casting pointer to 32-bit type

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>
3 years agoCHROMIUM: Fix crossystem_data members name chanaged.
Tom Wai-Hong Tam [Fri, 22 Jul 2011 10:20:42 +0000 (18:20 +0800)]
CHROMIUM: Fix crossystem_data members name chanaged.

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>