Commit graph

9,375 commits

Author SHA1 Message Date
Jimmy Zhang
1a9d1bd73a tegra124: support tri-state Board Id
Since Nyan Big board id pins may layout in tri-state, we need code
to support this change.

We use every two-bit to encode a gpio state as below:
 b00: LOW
 b01: HIGH
 b10: TRI-STATE

BUG=none
TEST=emerge-nyan chromeos-coreboot-nyan
     coreboot log shows "Board TRISTATE ID: 0x41" for gpios 1001

Change-Id: I05d63f0bdafd533ef9d9e0da668837ecd2f4c8c0
Signed-off-by: Jimmy Zhang <jimmzhang@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/183855
Reviewed-by: Gabe Black <gabeblack@chromium.org>
Commit-Queue: Doug Anderson <dianders@chromium.org>
2014-02-05 03:21:11 +00:00
Aaron Durbin
96722f750a baytrail: implement alternative payload loading
Similarly to lynxpoint payload loading can be made faster
by taking advantage of the spi controller's caching and prefetching.
Provide the same mechanism as lynxpoint to provide a 30ms
payload loading savings. The speed up isn't as dramatic as lynxpoint
presumably because baytrail is an SoC without the DMI communication
overhead. Regardless, payload loading decreases from ~55ms to ~25ms.

BUG=chrome-os-partner:25385
BRANCH=baytrail
TEST=Built and did numerous reboots. Observe time savings.

Change-Id: I5726d41559a8b4facb4bfdb7e629d04819dc9d37
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/184853
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2014-02-05 01:27:01 +00:00
Aaron Durbin
f6d95cf4ba chromeos: provide stub functions for !CONFIG_VBOOT_VERIFY_FIRMWARE
Instead of checking #if CONFIG_VBOOT_VERIFY_FIRMWARE #else #endif
provide empty stub functions for !CONFIG_VBOOT_VERIFY_FIRMWARE.

BUG=none
BRANCH=baytrail
TEST=Built and booted.

Change-Id: Id9d1843a0ec47c5a186c9a22ea3e4c13c89ec379
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/184841
2014-02-04 23:05:32 +00:00
Duncan Laurie
ffb73af007 baytrail: I2C: Add config data to ACPI Device
The linux kernel designware i2c driver supports configuring
HCNT/LCNT and SDA Hold Time for both standard and fast mode.
These have hardcoded defaults when the controller is in PCI
mode but it uses zero if nothign is defined in ACPI.

This adds the same default values that are in the kernel for
the controllers in PCI mode in magic packages that are read
by the kernel.

BUG=chrome-os-partner:24380
BRANCH=baytrail
TEST=build and boot on rambi

Change-Id: I249b0a217170c7189d633ad97d91361578a1838f
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/184922
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-02-04 23:05:05 +00:00
Aaron Durbin
ee4620a90a rambi: configure wake pins as just wake sources
GPIO_ACPI_SCI implies wake and generating an SCI. This
is unnecessary. Therefore, configure the intended wake
pins to only just wake by using GPIO_ACPI_WAKE.

BUG=none
BRANCH=baytrail
TEST=Manual. S3 resumes from keyboard and trackpad. No
     excessive SCI's are generated.

Change-Id: I0b841e64909301e8d4789183ad53a016be7120f1
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/184719
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2014-02-04 00:53:44 +00:00
Aaron Durbin
44558c3346 baytrail: provide GPIO_ACPI_WAKE configuration
Previously the GPIO_ACPI_SCI meant generate an SCI
and wake the system. However, when using this configuration
for a device which has its interrupt line going to both
an interrupt pin and the wake pin SCIs are generated in
addition to the normal interrupt. This is unnecessary
and a waste of cpu cycles. Therefore provide the granularity
of waking but not generating an SCI. The GPIO_ACPI_SCI
still implies wake.

BUG=none
BRANCH=baytrail
TEST=Manually. Reconfigured pins with GPIO_ACPI_WAKE. Trackpad
     and keyboard still wake the system without causing SCIs.

Change-Id: I437cc4501726835aadc4abf9bbaea3daebf68775
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/184718
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2014-02-04 00:53:41 +00:00
David Hendricks
4af27f0261 nyan_big: apply cache-related changes from nyan
This applies the same changes from 07a3592 that were applied to nyan.

BUG=none
BRANCH=none
TEST=it compiles.
Signed-off-by: David Hendricks <dhendrix@chromium.org>

Change-Id: Idcbe85436d7a2f65fcd751954012eb5f4bec0b6c
Reviewed-on: https://chromium-review.googlesource.com/184551
Commit-Queue: David Hendricks <dhendrix@chromium.org>
Tested-by: David Hendricks <dhendrix@chromium.org>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
2014-02-03 23:32:16 +00:00
Aaron Durbin
3931987050 baytrail: initialize HDA device and HDMI codec
In order to play audio through a HDMI cable the
HDA device needs to be initialized and a the
verb table set up for the HDMI codec. Do this if
the HDA device is enabled.

BUG=chrome-os-partner:24908
BRANCH=baytrail
TEST=Built and booted with kernel changes to handle
     baytrail hdmi codec. Benson confirmed sound
     does come through hdmi.

Change-Id: I106fd20d8442a7ad7a47a144a1584eb311a0a583
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/184710
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2014-02-03 23:32:13 +00:00
Duncan Laurie
52bec10986 rambi: Put LPSS devices in ACPI mode
The kernel drivers have all been updated to use ACPI ID probing
methods and we can now put the I2C controllers in ACPI mode.

BUG=chrome-os-partner:24380
BRANCH=baytrail
TEST=build and boot on rambi, test that trackpad, als, sound still work

Change-Id: I50603eb48a557a5e82fd6510e42940a1f5379b87
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/184530
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-02-03 19:40:48 +00:00
Aaron Durbin
0472e6bd45 baytrail: update lpe audio firmware location
The C0 stepping wants the firmware ram information
in the MMIO space. However, the old method for informing
the driver of this location is maintained since there
is a dependency on the driver being updated.

Lastly, fix a bug for LPE in ACPI mode where the incorrect
base address value was being used for the firmware location.

BUG=chrome-os-partner:23791
BUG=chrome-os-partner:24380
BRANCH=baytrail
TEST=Built and booted on B3. Sound still works.

Change-Id: I747c133c20a330fd59ab2c8b64ac1bdcebaa9cd5
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/184481
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2014-01-31 21:41:29 +00:00
Duncan Laurie
0457b5dce1 baytrail: Fix XHCI controller reset on resume
The toggling of XHCIBAR+80E0h[24] appears to cause the XHCI
controller to be reset on resume.  This causes the kernel to
have to reinitialize the controller and all devices.

It seems this bit should only be toggled on boot path, in
the resume path it should be left as 0.

Additionally after routing ports to XHCI don't issue a port
reset to the ports in the resume path.

BUG=chrome-os-partner:25428
BRANCH=baytrail
TEST=build and boot on rambi, suspend/resume and look for usb errors

Change-Id: Ie2f02e4eda502fb670265627ed2968e0d47f3530
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/184500
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-01-31 18:31:28 +00:00
Duncan Laurie
dda4687931 rambi: Move the CPU passive/critical threshold config to DPTF
The rest of the thermal configuration is in DPTF ACPI code so
move the CPU settings there as well.

Also remove the unused thermal.asl file.

BUG=chrome-os-partner:17279
BRANCH=baytrail
TEST=build and boot on rambi, start DPTF application

Change-Id: I9048e5d4504328603f34e5d0e14c110fdda01f67
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/184443
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-01-30 21:39:50 +00:00
Duncan Laurie
e04c20962a baytrail: DPTF: Add _CRT/_PSV objects for the CPU participant
These can be used by DPTF with the CPU particpant and DTS
in addition to the external thermal sensors.

BUG=chrome-os-partner:17279
BRANCH=baytrail
TEST=build and boot on rambi, start DPTF application

Change-Id: I15df46183f4da4b2d7c8ee4687a71bff641d6b70
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/184442
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-01-30 21:39:47 +00:00
Duncan Laurie
e9c002c393 baytrail: DPTF: Add PPCC object for power limit information
This object is used by DPTF for power limiting in the CPU.
It is nominally set to the SdpProfile 2 values.

BUG=chrome-os-partner:17279
BRANCH=baytrail
TEST=build and boot on rambi, start DPTF application

Change-Id: I55f6a32cd61302dda6103745b22cb7233ad78b0b
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/184158
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-01-30 18:49:36 +00:00
Julius Werner
4a3f2e45e0 arm: Put assembly functions into separate sections
This patch changes the ENTRY() macro in asm.h to create a new section
for every assembler function, thus providing dcache_clean/invalidate_all
and friends with the same --gc-sections goodness that our C functions
have. This requires a few minor changes of moving around data (to make
sure it ends up in the right section) and changing some libgcc functions
(which apparently need to have two names?), but nothing serious.

(You may note that some of our assembly functions have data, sometimes
even writable, within the same .text section. This has been this way
before and I'm not looking to change it for now, although it's not
totally clean. Since we don't enforce read-only sections through paging,
it doesn't really hurt.)

BUG=None
TEST=Nyan and Snow still boot. Confirm dcache_invalidate_all is not
output into any binary anymore since no one actually uses it.

Change-Id: I247b29d6173ba516c8dff59126c93b66f7dc4b8d
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/183891
2014-01-29 21:33:41 +00:00
Julius Werner
07a35925dc arm: Redesign, clarify and clean up cache related code
This patch changes several cache-related pieces to be cleaner, faster or
more correct. The largest point is removing the old
arm_invalidate_caches() function and surrounding bootblock code to
initialize SCTLR and replace it with an all-assembly function that takes
care of cache and SCTLR initialization to bring the system to a known
state. It runs without stack and before coreboot makes any write
accesses to be as compatible as possible with whatever state the system
was left in by preceeding code. This also finally fixes the dreaded
icache bug that wasted hundreds of milliseconds during boot.

CQ-DEPEND=CL:183877
BUG=None
TEST=Snow and Nyan still boot. Time between entering romstage main() and
the configure_l2ctlr() call on Nyan drops from 390ms to 0.3ms. Even with
icache turned on the old implementation took 7.8ms since it cleared the
cache multiple times with a slow algorithm.

Change-Id: I7bb4995af8184f6383f8e3b1b870b0662bde8bd4
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/183890
2014-01-29 21:33:35 +00:00
Julius Werner
6d94f83301 arm: Fix up new cache flush algorithm and replace dcache_*_all() with it
This patch fixes the remaining few bugs in our shiny new cache iteration
by set/way/level algorithm to actually make it work: It makes it start
from cache level 0 (previously it would always start at LoC and be
"done" instantly), fixes up the two shifts that isolate the set bits at
the end (which didn't seem to account for the fact that the first shift
affects the second), and throws an S bit on that last shift so that it
actually affects the conditionals after it.

In addition, also moves the next_level block to the top so that we can
share (and thus eliminate) some code at initialization, and turns the
whole thing into a thrice-instantiated macro to create functions that
fit our existing interface.

BUG=None
TEST=Ran with cache_test code (see separate CL) and closely examined the
resulting output. Made sure results look as expected (iterating through
all sets (inner) and ways (outer) for L1 and then L2 cache, extracting
the right numbers from CLIDR and CCSIDR, not touching anything twice).
Time for a single dcache_clean_invalidate_all() on Nyan drops from 3.7ms
to 0.3ms.

Change-Id: I1338a589cbb37d74ea6e7a3d4f67ff827e24edbe
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/183879
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
2014-01-29 04:58:17 +00:00
Julius Werner
4698467320 arm: Import armv7_dcache_wbinv_all function from NetBSD
This patch pulls in NetBSD's full cache flushing algorithm for ARM, to
replace our old, slow and slightly overzealous C-only implementation.
It's a beautiful piece of code that manages to run on only caller-saved
registers (meaning it doesn't need to write to memory) in a very tight
loop, and it's BSD-licensed to boot (which we need for libpayload).
Unfortunately it's also not quite correct, but I can fix that. Pulling
the original in a separate commit to make it more obvious what changes
are mine.

BUG=None
TEST=None

Change-Id: I7a71c9e570866a6e25f756cb09ae2b6445048d83
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/183878
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
2014-01-29 04:58:14 +00:00
Hung-Te Lin
35e5c5e473 nyan_big: use RAM_CODE[3:2] for ram code
Cherry-picking https://chromium-review.googlesource.com/183833 for nyan_big.

BootROM uses RAM_CODE[3:2] value as index to retrieve boot device
array in BCT to reconfigure device. Since there will be one kind
of boot device, we can reuse RAM_CODE[3:2] in conjunction with
RAM_CODE[1:0] to select up to 16 RAM parameters. To support this
change without leading BootROM to read wrong boot device parameters,
we need to fill up boot device array.

BUG=none
TEST=emerge-nyan chromeos-coreboot-nyan # boots successfully.

Change-Id: I0eb37ecf65ca041fe2f10c426b8dfbaafee24b2d
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/184076
Reviewed-by: Julius Werner <jwerner@chromium.org>
2014-01-29 04:58:09 +00:00
Hung-Te Lin
a5b7ce7052 tegra124: Get RAM_CODE for SDRAM initialization.
The RAM_CODE on Tegra can be used to determine SDRAM configuration type.

BUG=none
TEST=emerge-nyan chromeos-coreboot-nyan

Change-Id: Ica770ed6089f6ff8c38841f2cc8fd2778b6d786f
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/183781
Reviewed-by: Julius Werner <jwerner@chromium.org>
2014-01-29 04:58:05 +00:00
Duncan Laurie
1d6aeb85fd rambi: Set TSRx passive threshold to 60C
To avoid throttling at low temps raise the passive threshold
to 60C until things are better calibrated.

Also add a dependency for the charger participant to the thermal
relationship table so when it is enabled it will be used properly.

BUG=chrome-os-partner:17279
BRANCH=rambi
TEST=build and boot on rambi, start DPTF application

Change-Id: I4b50eff6a019b1cab0c781962a94c069ddbf0727
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/184008
2014-01-28 21:41:59 +00:00
Duncan Laurie
edde584bb2 rambi: Add LPE GPIOs for Jack/Mic detect
These GPIOs are defined in the mainboard and will be returned
as part of the LPE Device _CRS method.

BUG=chrome-os-partner:24380
BRANCH=rambi
TEST=build and boot on rambi

Change-Id: I7fe0852b63499530f6dfef4553e818e7364f4101
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/184007
2014-01-28 21:41:54 +00:00
Duncan Laurie
398387ed75 baytrail: Add support for LPE device in ACPI mode
This adds an ACPI Device entry for the LPE Audio controller
and code to put the device in ACPI mode if set in devicetree.cb

The ACPI device attempts to append GPIOs that may be defined in
the mainboard-supplied ACPI code.

BUG=chrome-os-partner:24380
BRANCH=baytrail
TEST=manual: Build and boot on rambi with LPE in ACPI mode.
Without kernel support this is not very useful but it did show
that the device was no longer visible as a PCI device.

Change-Id: I44d5423f5bbea77e156012c071df6cb335fe658b
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/184006
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Commit-Queue: Aaron Durbin <adurbin@chromium.org>
2014-01-28 21:41:52 +00:00
Tom Warren
61d0122fdc nyan_big: Add initial 792MHz BCT
792MHz BCT is from the board manuf, but boots fine on my
nyan. 924 BCT will be added later, when available.

BUG=none
TEST=builds and boots OK on my nyan board with depthcharge
changes for board id 0 in nyan_big.
BRANCH=none

Change-Id: I35f04dd7520ed9471287b2ecdbc1f0508bd78b6c
Signed-off-by: Tom Warren <twarren@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/183975
Reviewed-by: David Hendricks <dhendrix@chromium.org>
2014-01-28 13:51:46 +00:00
Tom Warren
a6df76afb5 nyan_big: Add 204MHz BCT for bringup, use 1.2V for VDD_CPU
PMIC VDD_CPU voltage is always 1.2V, so skip board_id check.

204MHz BCT is from the board manuf, but boots fine on my
nyan. 792/924 BCTs will be added later, when available.

BUG=none
TEST=builds and boots OK on my nyan board with depthcharge
changes for board id 0 in nyan_big.
BRANCH=none

Change-Id: Ib26bed66414b4a0943f3cfd5de907d7135a69152
Signed-off-by: Tom Warren <twarren@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/183939
Reviewed-by: David Hendricks <dhendrix@chromium.org>
2014-01-28 13:51:42 +00:00
Hung-Te Lin
5a60ae93b0 tegra124: SDRAM Initialization.
To support memory initialization without BootROM (which allows better
customization, updatable DRAM init procedure, and supporting more SDRAM
configurations that BootROM cannot handle), a new function "sdram_init(param)"
is introduced.

The input must be a "struct sdram_params", which has exactly the same layout as
the SDRAM fields in standard BCT file.

BUG=none
TEST=emerge-nyan chromeos-coreboot-nyan # Boots successfully

Change-Id: I36a26fb5236eee8f329e3f84cbdcc1ec6992fe6b
Reviewed-on: https://chromium-review.googlesource.com/182615
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
2014-01-28 06:12:43 +00:00
Hung-Te Lin
a534e5b7c6 tegra124: Allow setting PLLM (clock for SDRAM).
The new clock_sdram(...) initialized PLLM by given configuration (which needs to
be explicitly determined, usually from BCT or SDRAM parameters).

BUG=none
TEST=emerge-nyan chromeos-coreoot-nyan
     # With other patches, the new function starts PLLM in correct clock.

Change-Id: I606d0506c734d312db9e1b72a910700ca766f2d3
Reviewed-on: https://chromium-review.googlesource.com/183621
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
2014-01-28 02:43:49 +00:00
Ronald G. Minnich
89cbd15c95 emulation/foundation-armv8: add support for armv8 mainboard
This is a cpu supported by the foundation emulator. This will not build
at all without my cbfstool changes.

Not that our chromiumos qemu for x86 is months behind upstream.

BUG=None
TEST=breaks no builds
BRANCH=None
Signed-off-by: Ronald G. Minnich <rminnich@google.com>

Change-Id: I0e7df1a2d3801778e83c89ff18285b026403adc0
Reviewed-on: https://chromium-review.googlesource.com/180355
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: Ronald Minnich <rminnich@chromium.org>
Reviewed-by: Ronald Minnich <rminnich@chromium.org>
Commit-Queue: Ronald Minnich <rminnich@chromium.org>
2014-01-25 05:54:34 +00:00
Ronald G. Minnich
919e89c303 cbfstool: add code to serialize the header using the new xdr functions
This change adds a header serialization function. Programmers can thus just
set up a header as needed, without worrying about forgetting if and how to
use the [hn]to[hn]* functions.

BUG=None
TEST=Build a peppy image and verify that it's bit for bit the same.
BRANCH=None

Change-Id: I0f9b8e7cac5f52d0ea330ba948650fa0803aa0d5
Signed-off-by: Ronald G. Minnich <rminnich@google.com>
Reviewed-on: https://chromium-review.googlesource.com/181552
Reviewed-by: Ronald Minnich <rminnich@chromium.org>
Commit-Queue: Ronald Minnich <rminnich@chromium.org>
Tested-by: Ronald Minnich <rminnich@chromium.org>
2014-01-25 05:54:30 +00:00
Jimmy Zhang
0154239467 tegra124: use RAM_CODE[3:2] for ram code
BootROM uses RAM_CODE[3:2] value as index to retrieve boot device
array in BCT to reconfigure device. Since there will be one kind
of boot device, we can reuse RAM_CODE[3:2] in conjunction with
RAM_CODE[1:0] to select up to 16 RAM parameters. To support this
change without leading BootROM to read wrong boot device parameters,
we need to fill up boot device array.

BUG=none
TEST=emerge-nyan chromeos-coreboot-nyan # boots successfully.

Change-Id: I901e052bc785561cfcb25fb24cf4629572af390a
Signed-off-by: Jimmy Zhang <jimmzhang@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/183833
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Gabe Black <gabeblack@chromium.org>
2014-01-25 04:34:46 +00:00
Gabe Black
13f24d9672 snow: Rename snow to daisy.
The name snow goes by in many places in chromeos is daisy. Snow is technically
a variant of daisy and should really be called daisy_snow, but for historical
reasons the daisy board with no variant was used instead. To make it easier to
work with within chromeos, this change renames the snow board to daisy.

BUG=None
TEST=Built for daisy.
BRANCH=None

Change-Id: I569b31bf417db55be91832f15271bea4bc30f163
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://chromium-review.googlesource.com/183553
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2014-01-25 04:34:43 +00:00
Gabe Black
cbbe1e9f04 pit: Rename pit to peach_pit.
The name pit goes by in many places in chromeos is peach_pit, where peach is
the base name and pit is the name of this particular variant. To make it
easier to work with within chromeos and to make the board names a little less
ambiguous, this change renames the pit board to peach_pit, and from Pit to
Peach Pit.

BUG=None
TEST=Built for peach_pit.
BRANCH=None

Change-Id: I51c89ba3785cf4cb9769a989b1cac71bcd1b0a05
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://chromium-review.googlesource.com/183552
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2014-01-25 04:34:38 +00:00
Gabe Black
d1a453fe1a big: Create a nyan_big mainboard which is a copy of nyan.
The nyan_big mainboard is very similar to nyan, but will be different in a few
ways. For instance, the BCT will be different, and the GPIOs may need to be
configured slightly differently.

This change also adds prefixes to the kconfig variables in "choice" blocks
for both boards since having multiple instances of choice blocks with the same
options confuses kconfig even if all of the instances have mutually exclusive
dependencies.

BUG=None
TEST=Built for nyan and nyan_big.
BRANCH=None

Change-Id: I290a32e47fc118bd4b86d543df617ad324325dbc
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://chromium-review.googlesource.com/183532
Reviewed-by: Tom Warren <twarren@nvidia.com>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2014-01-25 04:34:34 +00:00
Stefan Reinauer
3940197a4c haswell: Allow pre-graphics delay
Some slow monitors/TVs can't wake up quickly enough for coreboot,
so when the VBIOS is run it won't detect them. Hence, add an option
to wait for a while before running the VBIOS.

BUG=none
BRANCH=panther
TEST=Boot to dev mode on one of the systems that exposed the problem
     and see it go away.

Change-Id: Ib9524f1c7ee08bedf96a6468da8b4ccf712fe0e2
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: https://chromium-review.googlesource.com/183545
Reviewed-by: Mohammed Habibulla <moch@google.com>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2014-01-25 02:03:21 +00:00
Aaron Durbin
3022c82b02 rambi: fix trackpad and touchscreen wake sources
The GPIOs were not being put into SCI mode to enable
their respective interrupt lines as wake sources. Also
the bit index into the GPE block was incorrect. Fix
both of these issues.

BUG=chrome-os-partner:25251
BRANCH=baytrail
TEST=Noted the appropriate bit was enabled for wake.
     Also was able to wake with the track pad.

Change-Id: Ia1b6e4c8cb4b012d76ad27a2158e28d183581025
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/183598
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2014-01-25 02:03:17 +00:00
Aaron Durbin
78775098a8 baytrail: ACPI_ENABLE_WAKE_SUS_GPIO macro for ACPI
The _PRW method needs to specifcy a bit number within
the GPE block to enable wake events associated with a
given device. Therefore, add ACPI_ENABLE_WAKE_SUS_GPIO()
macro for the mainboards' convenience.

BUG=chrome-os-partner:25251
BRANCH=baytrail
TEST=On rambi used macros for touch pad and screen. Noted
     the appropriate bit was enabled for wake. Also was
     able to wake with the track pad.

Change-Id: I98d7c005997bdcaa3646fabec5199fbe013ca52c
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/183597
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2014-01-25 02:03:14 +00:00
Ronald G. Minnich
6cccf5830b Add section header parsing and use it in the mk-payload step
This completes the improvements to the ELF file parsing code.  We can
now parse section headers too, across all 4 combinations of word size
and endianness. I had hoped to completely remove the use of htonl
until I found it in cbfs_image.c. That's a battle for another day.

There's now a handy macro to create magic numbers in host byte order.
I'm using it for all the PAYLOAD_SEGMENT_* constants and maybe
we can use it for the others too, but this is sensitive code and
I'd rather change one thing at a time.

To maximize the ease of use for users, elf parsing is accomplished with
just one function:

int
elf_headers(const struct buffer *pinput,
	    Elf64_Ehdr *ehdr,
	    Elf64_Phdr **pphdr,
	    Elf64_Shdr **pshdr)

which requires the ehdr and pphdr pointers to be non-NULL, but allows
the pshdr to be NULL. If pshdr is NULL, the code will not try to read
in section headers.

BUG=None
TEST=Build a peppy image (known to boot) with old and new versions and verify they are bit-for-bit the same
BRANCH=None

Change-Id: I54dad887d922428b6175fdb6a9cdfadd8a6bb889
Signed-off-by: Ronald G. Minnich <rminnich@google.com>
Reviewed-on: https://chromium-review.googlesource.com/181272
Reviewed-by: Ronald Minnich <rminnich@chromium.org>
Commit-Queue: Ronald Minnich <rminnich@chromium.org>
Tested-by: Ronald Minnich <rminnich@chromium.org>
2014-01-24 23:51:48 +00:00
Aaron Durbin
753fadb6b9 rambi: disable slp_x stretching after sus fail
In order to boot from G3 quickly disable the
slp_x stretching policy.

BUG=chrome-os-partner:25269
BRANCH=baytrail
TEST=Manual. Put board in G3. Pressed power button
     and noted startup time on the EC console.

Change-Id: I039de7990cc6ff519d873d64756c8d119b131165
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/183588
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2014-01-24 23:35:13 +00:00
Aaron Durbin
f99804c264 baytrail: add config option for disabling slp_x stretching
Provide an option for the mainboard to set in its devicetree
to disable slp_x stretching on SUS power well failure. This
will allow for fast G3->S0 transition instead of waiting for
1-4 seconds.

BUG=chrome-os-partner:25269
BRANCH=baytrail
TEST=Manual. Enabled option. Put board in G3. Pressed power button
     and noted startup time on the EC console.

Change-Id: I213525b3ad44fe4c95bfd014b614bbc80623cbb8
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/183587
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2014-01-24 23:35:10 +00:00
Aaron Durbin
821ce0e72c rambi: enable PS2 mode for VNN and VCC
Enable the PS2 mode for the VNN and VCC's
voltage regulator. It only gets enabled on
C0 and later parts.

BUG=chrome-os-partner:24542
BRANCH=baytrail
TEST=Built and booted b3.

Change-Id: Id96b5527227ec31da1e5cd106791fe45576b063b
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/183596
2014-01-24 23:35:07 +00:00
Aaron Durbin
c92db75de5 baytrail: add option for enabling PS2 mode
The VNN and VCC regulator for baytrail can enter
into PS2 mode under low power conditions to save
regulator power. This is available for >C0 parts.
Add a device tree option to enable PS2 for the
VCC and VNN rails.

BUG=chrome-os-partner:24542
BRANCH=baytrail
TEST=Built and booted b3.

Change-Id: Iea952b17ca77ac42f34285b2d171e566b755e002
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/183595
2014-01-24 23:35:03 +00:00
Aaron Durbin
8ad02684b2 baytrail: add in C0 stepping idenitification support.
The C0 cpuid's were added as well as the microcode, but we
weren't making C0 a first class citizen in the pattrs.

BUG=chrome-os-partner:24542
BRANCH=baytrail
TEST=Built and booted b3.

Change-Id: Ie23f8ce867f339eab3b55b8c5f49ab822f23eebb
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/183594
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2014-01-24 19:38:37 +00:00
Hung-Te Lin
8e3bb34d4a tegra124: Never touch MEM(MC)/EMC clocks in ramstage.
The clocks for MEM(MC)/EMC should be either initialized by BootROM, or in the
step of SDRAM initialization. Changing their states in ramstage may cause
unexpected results (note MC even always ignores RESET states).

To make it clear, we should remove MEM/EMC from the clock initialization list.

BUG=none
TEST=emerge-nyan chromeos-coreboot-nyan # boots successfully.

Change-Id: Icff9f78810ed5bd693b48d7b6d436ce2db919a5e
Reviewed-on: https://chromium-review.googlesource.com/183623
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2014-01-24 19:38:30 +00:00
Hung-Te Lin
67a8e5c7e8 tegra124: Add EMC registers definition.
The EMC registers are required for memory initialization.

BUG=none
TEST=emerge-nyan chromeos-coreboot-nyan

Change-Id: Ibfb35d5b3f44c97c2c36135110fa44996447734c
Reviewed-on: https://chromium-review.googlesource.com/183622
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2014-01-24 19:38:26 +00:00
Hung-Te Lin
587c896929 tegra124: Fix EMC base address.
The EMC address was wrong and may cause memory initialization to fail.

BUG=none
TEST=emerge-nyan chromeos-coreboot-nyan

Change-Id: Iaa8f21a6ba2d3850495da9a85711cf7fb7b09ad4
Reviewed-on: https://chromium-review.googlesource.com/183602
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
2014-01-24 19:38:22 +00:00
Duncan Laurie
328b5d6265 VBOOT: Set virtual recovery switch based on EC Software Sync
The Virtual Recovery switch flag needs to be set in coreboot since
it is passed through directly to VBOOT layer by depthcharge.

Rather than add a new config option we can assume that devices with
EC Software Sync also have a virtual recovery switch and set the
flag appropriately.

BUG=chrome-os-partner:25250
BRANCH=all
TEST=build and boot on rambi, successfully enter developer mode

Change-Id: Id067eacbc48bc25a86887bce8395fa3a9b85e9f2
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/183672
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-01-23 19:32:35 +00:00
Aaron Durbin
95a79aff57 baytrail: allow configuration of io hole size
The updated MRC wrapper allow the IO hole size to be
configured from the coreboot side of things.

BUG=None
BRANCH=baytrail
CQ-DEPEND=CL:*152595
TEST=Built and booted. Also changed io hole size from mainboard as test.

Change-Id: I7a626764aecce94bbaf35d884606480f22a9aa84
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/183269
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2014-01-23 17:50:33 +00:00
Duncan Laurie
a6b85ad950 baytrail: Add basic support for ACPI System Wake Source
This adds the very basic top-level support for determining the
system wake source from ACPI.  It only implements the _SWS method
in the _SB scope which just returns a bit index into the PM1
status register for the first fixed functional block.

This can be used to determine wake source of RTC or Power Button
but does not help determine wake source for USB or GPIO.

The ACPI spec says to return -1 if no source can be determined
from PM1 status register.

BUG=chrome-os-partner:8127
BRANCH=baytrail
TEST=build and boot on rambi

1) Test resume from S3 by RTC:
ACPI System Wake Source is PM1 Index 10
(bit 10 is RTC_STS in ACPI spec, ACPI_EVENT_RTC in kernel)

2) Test resume from S3 by power button:
ACPI System Wake Source is PM1 Index 8
(bit 8 is PWRBTN_STS in ACPI spec, ACPI_EVENT_POWER_BUTTON in kernel)

3) Test resume from S3 by USB:
ACPI System Wake Source is PM1 Index -1

Change-Id: Ifc5c0867f82cf291af157537b8c13fe44923d8f5
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/183333
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-01-22 23:36:46 +00:00
Duncan Laurie
969dffda1d baytrail: Add a shared GNVS init function
There are several things in GNVS being initialized in the
mainboard ACPI table creation step that are shared across all
boards using the chipset.

Move the init that is not board specific into a shared function
and call it from the table creation step.

BUG=chrome-os-partner:8127
BRANCH=baytrail
TEST=build and boot on rambi device

Change-Id: I178193d7fe298ec26247402370a1af9280bb09c1
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/183332
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-01-22 23:36:44 +00:00
Aaron Durbin
8ed0ef4c3b baytrail: update to version 809 microcode for c0
Update the microcode for c0 parts to 809.

BUG=None
BRANCH=baytrail
TEST=Built and booted on B3.

Change-Id: I733ce8eeae0b0eafe4a3a2dbeb09feba051c496a
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/183256
Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org>
2014-01-22 23:36:39 +00:00