Commit graph

17972 commits

Author SHA1 Message Date
Daisuke Nojiri
201a82311b Increase RO coreboot size on flash
Bitmap images will be moved to CBFS from GBB. This patch adjust the flash
map accordingly for rambi, samus, peppy, parrot, falco, panther, auron,
strago.

BUG=chromium:622501
BRANCH=tot
TEST=emerge-{samus,falco} chromeos-bootimage
CQ-DEPEND=CL:354710,CL:355100

Change-Id: I0b82285186540aa27757e312e7bd02957f9962ec
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/355040
2016-07-11 10:23:07 -07:00
Derek Basehore
3e93461b96 rockchip/rk3399: Remove empty function in sdram.c
This removes an empty function for sdram training. If it's needed
later, we can always add it back.

BRANCH=none
BUG=none
TEST=build and boot firmware for kevin/gru

Change-Id: I6bf77d2f81719c68cd78722c3fe9ae547ea1e79c
Signed-off-by: Derek Basehore <dbasehore@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354164
Reviewed-by: Martin Roth <martinroth@chromium.org>
2016-07-09 01:40:26 -07:00
Derek Basehore
e0342e5c01 rockchip/rk3399: Change copy_to_reg arg type
This changes the src arg for copy_to_reg to a const u32 * instead of a
u32 * in sdram.c.

BRANCH=none
BUG=none
TEST=emerge-gru coreboot

Change-Id: I362727f1dbe6726bf3240f9219c394786162a1a0
Signed-off-by: Derek Basehore <dbasehore@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354163
Reviewed-by: Martin Roth <martinroth@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-07-09 01:40:23 -07:00
Derek Basehore
5c17449fcd rockchip/rk3399: Directly access variables in sdram.c
This simplifies some of the code with better variable declaractions
which removes a lot of line continuations. Instead of declaring a
pointer to the container of the needed struct or array, this retrieves
a pointer to the struct or array instead.

BRANCH=none
BUG=none
TEST=check that gru and kevin still build and boot properly followed
by running "stressapptest -M 1024 -s 1000" and making sure it passes

Change-Id: If4e386d4029f17d811fa3ce83e5be89e661a7b11
Signed-off-by: Derek Basehore <dbasehore@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354162
Reviewed-by: Martin Roth <martinroth@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@google.com>
2016-07-09 01:40:21 -07:00
Derek Basehore
a79bbbc83d rockchip/rk3399: cleanup variables in dram_all_config
This removes a variable that was only used once and makes variable
declarations consistent by moving those only used in one block of code
into that block.

BRANCH=none
BUG=none
TEST=on kevin/gru, run "stressapptest -M 1024 -s 3600"

Change-Id: Id0ff0c45189c292ab40e1c4aa27929fb7780e864
Signed-off-by: Derek Basehore <dbasehore@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/355667
Reviewed-by: Martin Roth <martinroth@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-07-09 01:40:19 -07:00
Derek Basehore
b7d1135c65 rockchip/rk3399: add/remove local variables to sdram_init
This adds two local variables for dramtype and ddr_freq to sdram_init
since those two values are commonly used in the function. It also
removes a variable that is just used once and directly uses the value
for a function call instead.

BRANCH=none
BUG=none
TEST=on kevin/gru, run "stressapptest -M 1024 -s 3600" and check that
it passes

Change-Id: I4e1a1a4a8848d0eab07475a336c24bda90b2c9f8
Signed-off-by: Derek Basehore <dbasehore@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/355666
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-07-09 01:40:16 -07:00
Lee Leahy
4dfaac71f1 UPSTREAM: soc/intel/quark: Pass in the memory initialization parameters
Specify the memory initialization parameters in
mainboard/intel/galileo/devicetree.cb. Pass these values into FSP to
initialize memory.

TEST=Build and run on Galileo Gen2

BUG=None
BRANCH=None
TEST=None

Change-Id: I83ee196f5fb825118a3a74b61f73f3728a1a1dc6
Original-Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15260
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/359317
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-09 01:40:13 -07:00
Lee Leahy
4b65a4333f UPSTREAM: mainboard/intel/galileo: Gen1 - Set correct I2C scripts
Switch the I2C scripts to properly match the I2C address selection for
the Galileo Gen1 board.

TEST=Build an run on Galileo Gen1

BUG=None
BRANCH=None
TEST=None

Change-Id: I9fc8b59a3a719abb474c99a83e0d538794626da9
Original-Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15258
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/359316
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-09 01:40:11 -07:00
Lee Leahy
024de611e6 UPSTREAM: Documentation/Intel: Add feature documentation table
Add table containing feature documentation:
* Feature name with link to specification or documentation
* Linux utility name with link to utility documentation
* EDK-II utility name with link to utility documentation

BUG=None
BRANCH=None
TEST=None

Change-Id: Ie33d8563320697c12b34974286bffcadf92c016e
Original-Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15256
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/359315
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-09 01:40:09 -07:00
Lee Leahy
b40baa0e84 UPSTREAM: Documentation: Add index.html
Add the initial index.html file. The web server is currently not
converting .md files into html. Instead they are being downloaded in
their raw .md file format. Use the index.html file to enable the
web server to find and process the file.

TEST=None

BUG=None
BRANCH=None
TEST=None

Change-Id: I27334ccacdb34b56946a9061132acf2808d32175
Original-Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15218
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/359314
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-09 01:40:06 -07:00
Lee Leahy
5f29ea3dfa UPSTREAM: soc/intel/quark: Remove use of PDAT.bin file
Remove the unused Kconfig values which specify the PDAT file, its
location and inclusion into the coreboot file system. Remove the code
in romstage which locates the pdat.bin file.

TEST=Build and run on Galileo Gen2

BUG=None
BRANCH=None
TEST=None

Change-Id: I397aa22ada6c073c60485a735d6e2cb42bfd40ab
Original-Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15205
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/359313
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-09 01:40:04 -07:00
Harsha Priya
0f1b1029ae UPSTREAM: soc/intel/apollolake: Include gpio_defs header
Add the gpio_defs.h reference in chip.h to enable
reef and amenia devicetree.cb to use the definitions from gpio_defs.h.

BUG=None
BRANCH=None
TEST=None

Change-Id: I333d4e810e42309ac76dd90c19f05cf3e3a517b1
Original-Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15550
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/359312
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-09 01:40:02 -07:00
Duncan Laurie
48534884e0 UPSTREAM: mainboard/google/reef: Use device driver for DA7219 configuration
Use the device driver for DA7219 device configuration in the SSDT and
remove the static copy in the DSDT.

Tested on reef to ensure that the generated SSDT contents are
equivalent to the current DSDT contents.

BUG=None
BRANCH=None
TEST=None

Change-Id: I288eb05d0cb3f5310c4dca4aa1eab5a029f216af
Original-Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/15539
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/359311
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-09 01:39:59 -07:00
Duncan Laurie
89ab7a8583 UPSTREAM: drivers/i2c/da7219: Add driver for generating device in SSDT
Add a device driver to generate the device and required properties
into the SSDT.

This driver uses the ACPI Device Property interface to generate the
required parameters into the _DSD table format expected by the kernel.

This was tested on the reef mainboard to ensure that the SSDT contained
the equivalent parameters that are provided by the current DSDT object.

BUG=None
BRANCH=None
TEST=None

Change-Id: Ia809e953932a7e127352a7ef193974d95e511565
Original-Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/15538
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/359310
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-09 01:39:57 -07:00
Duncan Laurie
d0b6f0bc2c UPSTREAM: acpi: Change device properties to work as a tree
There is a second ACPI _DSD document from the UEFI Forum that details
how _DSD style tables can be nested, creating a tree of similarly
formatted tables. This document is linked from acpi_device.h.

In order to support this the device property interface needs to be
more flexible and build up a tree of properties to write all entries
at once instead of writing each entry as it is generated.

In the end this is a more flexible solution that can support drivers
that need child tables like the DA7219 codec, while only requiring
minor changes to the existing drivers that use the device property
interface.

This was tested on reef (apollolake) and chell (skylake) boards to
ensure that there was no change in the generated SSDT AML.

BUG=None
BRANCH=None
TEST=None

Change-Id: Ia22e3a5fd3982ffa7c324bee1a8d190d49f853dd
Original-Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/15537
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358959
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-09 01:39:55 -07:00
Harsha Priya
b26cf4701a UPSTREAM: google/reef: Add Maxim98357a support
Adds Maxim98357a support for reef using the generic driver
in drivers/generic/max98357

BUG=None
BRANCH=None
TEST=None

Change-Id: I333d4e810e42309ac76dd90c19f05cf3e3a517e0
Original-Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15435
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358958
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-09 01:39:52 -07:00
Werner Zeh
ec075eee3b UPSTREAM: siemens/mc_bdx1: Move SCI to IRQ 10
IRQ 9 is used for different purpose on this board so move
SCI away to IRQ10.

BUG=None
BRANCH=None
TEST=None

Change-Id: I107bfb5ec8cd05f844ee75550779be7746e77a88
Original-Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Original-Reviewed-on: https://review.coreboot.org/15563
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Kysti Mlkki <kyosti.malkki@gmail.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358957
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-09 01:39:50 -07:00
Vadim Bendebury
73388139db tpm2: implement and use pcr_extend command
TPM PCRs are used in Chrome OS for two purposes: to communicate
crucial information from RO firmware and to protect FW and kernel
rollback counters from being deleted.

As implemented in TPM1 compatible way, the PCR extension command
requires a prebuilt digest to calculate a new PCR value.

TPM2 specification introduces a PCR_Event command, where the TPM
itself calculates the digest of an arbitrary length string, and then
uses the calculated digest for PCR extension. PCR_Event could be a
better option for Chrome OS, this needs to be investigated separately.

BRANCH=none
BUG=chrome-os-partner:50645
TEST=verified that the two PCRs are successfully extended before the
     RW firmware is called.

Change-Id: I1a9bab7396fdb652e2e3bc8529b828ea3423d851
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358098
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Darren Krahn <dkrahn@chromium.org>
2016-07-07 22:14:28 -07:00
Vadim Bendebury
2f859335df tpm2: implement locking firmware rollback counter
TPM1.2 is using the somewhat misnamed tlcl_set_global_lock() command
function to lock the hardware rollback counter. For TPM2 let's
implement and use the TPM2 command to lock an NV Ram location
(TPM2_NV_WriteLock).

BRANCH=none
BUG=chrome-os-partner:50645
TEST=verified that TPM2_NV_WriteLock command is invoked before RO
     firmware starts RW, and succeeds.

Change-Id: I62f22b9991522d4309cccc44180a5ebd4dca488d
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358097
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Darren Krahn <dkrahn@chromium.org>
2016-07-07 22:14:26 -07:00
Vadim Bendebury
8f4d6185e1 tpm2: fix tpm_write() error reporting
The code misses the cases when a response was received but the command
failed. This patch fixes the problem.

BRANCH=none
BUG=chrome-os-partner:50645
TEST=none

Change-Id: I914ab6509d3ab2082152652205802201a6637fcc
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358096
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-07-07 22:14:23 -07:00
Vadim Bendebury
347ff17b97 tpm2: implement tlcl_force_clear and use it before factory initialization
tlcl_force_clear() needs to be issued each time when the device mode
switches between normal/development/recovery.

This patch adds command implementation using TPM_Clear TPM2 command,
and also invokes it before factory initialization.

BRANCH=none
BUG=chrome-os-partner:50645
TEST=verified that TPM_Clear command succeeds at factory startup and
     the boot proceeds normally.

Change-Id: I2a0e62527ad46f9dd060afe5e75c7e4d56752849
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358095
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Darren Krahn <dkrahn@chromium.org>
2016-07-07 22:14:21 -07:00
Vadim Bendebury
36317f5e85 tpm2: use pcr0 dependent nvram define space policy
The TPM2 specification allows defining NV ram spaces in such manner,
that it is impossible to remove the space, unless a certain PCR is in
a certain state.

This comes in handy when defining spaces for rollback counters: make
their removal depend on PCR0 being in the default state. Then extend
PCR0 to any value. This will guarantee that the spaces can not be
deleted.

Also, there is no need in creating firmware and kernel rollback spaces
with different privileges: they both can be created with the same set of
properties, the firmware space could be locked by the RO firmware, and
the kernel space could be locked by the RW firmware thus providing
necessary privilege levels.

BRANCH=none
BUG=chrome-os-partner:50645, chrome-os-partner:55063
TEST=with the rest of the patches applied it is possible to boot into
      Chrome OS maintaining two rollback counter spaces in the TPM NV
      ram locked at different phases of the boot process.

Change-Id: I69e5ada65a5f15a8c04be9def92a8e1f4b753d9a
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358094
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2016-07-07 22:14:19 -07:00
Vadim Bendebury
503ad5e72f tpm2: add TPM_Clear command processing
The command is sent in session mode, but has no parameters associated
with it.

BRANCH=none
BUG=chrome-os-partner:50645
TEST=with the following patches verified that TPM_Clear command is
     handled successfully by the TPM.

Change-Id: Ida19e75166e1282732810cf45be21e59515d88e2
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/357973
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-07-07 22:14:16 -07:00
Vadim Bendebury
a97a7fa16c tpm2: refactor session header marshaling
For coreboot TPM2 use case session header is always of the minimal
possible size, the only difference is that some commands require one
and some - two handles.

Let's refactor common session header marshaling code into a separate
function, it will be useful when more commands marshaling code is
added.

BRANCH=none
BUG=chrome-os-partner:50645
TEST=flashed the TPM and rebooted the device a few times, it
     successfully loaded chrome os on every attempt.

Change-Id: I86e6426be5200f28ebb2174b418254018e81da8e
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/357972
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-07-07 19:30:13 -07:00
Vadim Bendebury
3cf02c365d tpm2: clean up tpm_marshal_command()
The function is reusing some variables which confuses the reader as
the variable names do not match their second function.

This patch edits the code for readability without changing
functionality.

BRANCH=None
BUG=chrome-os-partner:50465
TEST=with the rest of the patches applied Kevin still boots into
     chrome OS.

Change-Id: I95a07945d9d2b00a69d514014f848802b82dd90f
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358915
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-07-07 19:30:11 -07:00
Vadim Bendebury
b1e862c2a6 tpm2: avoid comparison between signed and unsigned ints
The marshaling/unmarshaling code is using integer values to represent
room left in the buffer, to be able to communicate three conditions:
positive number means there is room left in the buffer, zero means
that the exact amount of data in the buffer was unmarshaled and
negative value means that the result of the operation did not fit into
the buffer.

The implementation is wrong though, as it compares directly signed and
unsigned values, which is illegal, as signed values get promoted to
unsigned by the compiler.

This patch changes the marshaling code to use size_t for the size, and
use zero as marshaling failure indication - after all the buffer where
the data is marshaled to should definitely be large enough, and it is
reasonable to expect at least some room left in it after marshaling.

The unmarshaling situation is different: we sure want to communicate
errors to the caller, but do not want to propagate error return values
through multiple layers. This patch keeps the size value in int, but
checks if it is negative separately, before comparing with positive
values.

BRANCH=none
BUG=chrome-os-partner:50645
TEST=with the rest of the patches applied kevin successfully boots up.

Change-Id: Ie7552b333afaff9a1234c948caf9d9a64447b2e1
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358772
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-07-07 19:30:09 -07:00
Aaron Durbin
8dc56e1ce6 UPSTREAM: mainboard/google/reef: apply EVT board changes
Based on the board revision apply the correct GPIO changes.
The only differences are the addition of 2 peripheral wake signals
and a dedicated peripheral reset line.

BUG=chrome-os-partner:54959,chrome-os-partner:54960,chrome-os-partner:54961
BRANCH=None
TEST=Built and tested on reef.

BUG=None
BRANCH=None
TEST=None

Change-Id: I9cac82158e70e0af1b454ec4581c2e4622b95b4b
Original-Signed-off-by: Aaron Durbin <adurbin@chromuim.org>
Original-Reviewed-on: https://review.coreboot.org/15562
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Furquan Shaikh <furquan@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358897
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-07 19:29:36 -07:00
Aaron Durbin
8268395641 UPSTREAM: mainboard/google/reef: add board_id() support
The board build version is provided by the EC on reef.
Provide the necessary functional support for coreboot
to differentiate the board versions.

BUG=chrome-os-partner:54959,chrome-os-partner:54960,chrome-os-partner:54961
BRANCH=None
TEST=Built and tested on reef.

BUG=None
BRANCH=None
TEST=None

Change-Id: I1b7e8b2f4142753cde736148ca9495bcc625f318
Original-Signed-off-by: Aaron Durbin <adurbin@chromuim.org>
Original-Reviewed-on: https://review.coreboot.org/15561
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Furquan Shaikh <furquan@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358896
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-07 19:29:33 -07:00
Aaron Durbin
c195e78f39 UPSTREAM: mainboard/google/reef: add memory SKU id support
While the proto boards didn't have a memory SKU notion the
EVT boards do. Therefore, provide support for selecting the
proper memory SKU information based on the memory id straps.

This works on EVT boards because the pins used for the
strapping weren't used on proto. However, internal pullups
need to be enabled so that proto boards read the correct
id.

BUG=chrome-os-partner:54949
BRANCH=None
TEST=Built and used on reef for memory config.

BUG=None
BRANCH=None
TEST=None

Change-Id: I8653260e5d1b9adc83b78ea2770c683b72535e11
Original-Signed-off-by: Aaron Durbin <adurbin@chromuim.org>
Original-Reviewed-on: https://review.coreboot.org/15560
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Furquan Shaikh <furquan@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358895
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-07 19:29:31 -07:00
Aaron Durbin
531c4a32ca UPSTREAM: soc/intel/apollolake: add LPDDR4 sku selection support
Instead of having all the mainboards put similar logic
into their own code provide common mechanism for memory
SKU selection. A function, meminit_lpddr4_by_sku(), is
added that selects the proper configuration based on the
SKU id and configuration passed in. LPDDR4 speed as well
as DRAM device density configuration is associated for
each logical channel per SKU id.

BUG=chrome-os-partner:54949
BRANCH=None
TEST=Built and used on reef for memory config.

BUG=None
BRANCH=None
TEST=None

Change-Id: Ifc6a734040bb61a58bc3d4c128a6420a71245c6c
Original-Signed-off-by: Aaron Durbin <adurbin@chromuim.org>
Original-Reviewed-on: https://review.coreboot.org/15559
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Furquan Shaikh <furquan@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358894
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-07 19:29:29 -07:00
Aaron Durbin
07081c5c67 UPSTREAM: soc/intel/apollolake: make internal pulls weak for gpio inputs
The internal pulls for gpio_input_pullup() and gpio_input_pulldown()
were using fairly strong pulls. Weaken them so that external pulls
can override the internal ones. This matches the current assumptions
of lib/gpio.c.

BUG=chrome-os-partner:54949
BRANCH=None
TEST=Built and used on reef for memory config.

BUG=None
BRANCH=None
TEST=None

Change-Id: Ifda1d04d40141325f78db277eb0bd55574994abf
Original-Signed-off-by: Aaron Durbin <adurbin@chromuim.org>
Original-Reviewed-on: https://review.coreboot.org/15558
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Andrey Petrov <andrey.petrov@intel.com>
Original-Reviewed-by: Furquan Shaikh <furquan@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358893
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-07 19:29:26 -07:00
Aaron Durbin
b15383d89b UPSTREAM: lib/gpio: add pullup & pulldown gpio_base2_value() variants
Provide common implementations for gpio_base2_value() variants
which configure the gpio for internal pullups and pulldowns.

BUG=chrome-os-partner:54949
BRANCH=None
TEST=Built and used on reef for memory config.

BUG=None
BRANCH=None
TEST=None

Change-Id: I9be8813328e99d28eb4145501450caab25d51f37
Original-Signed-off-by: Aaron Durbin <adurbin@chromuim.org>
Original-Reviewed-on: https://review.coreboot.org/15557
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Furquan Shaikh <furquan@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358892
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-07 19:29:24 -07:00
Duncan Laurie
93c4a3e0ab UPSTREAM: acpigen_write_package: Return pointer to package element counter
Have acpigen_write_package() return a pointer to the package element
counter so it can be used for dynamic package generation where needed.

BUG=None
BRANCH=None
TEST=None

Change-Id: Id7f6dd03511069211ba3ee3eb29a6ca1742de847
Original-Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/15536
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358891
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-07 19:29:22 -07:00
Paul Menzel
3080856843 UPSTREAM: soc: Remove newline from CHIP_NAME
The name must not terminated with a newline character `n` as it would
make it hard to use it strings. So, remove the newline from the two SoCs
with it.

BUG=None
BRANCH=None
TEST=None

Change-Id: I7570442b38a455e7c497d7f461c208fb0a88296d
Original-Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-on: https://review.coreboot.org/15540
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Kysti Mlkki <kyosti.malkki@gmail.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358890
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-07 19:29:19 -07:00
Alexander Couzens
5cfc38ffb4 UPSTREAM: lenovo/t530: Don't enforce native gfx init
BUG=None
BRANCH=None
TEST=None

Change-Id: I6d51f46240c62fcd6089411e8681e0b6e7d5bfe4
Original-Signed-off-by: Philipp Deppenwiese <zaolin@das-labor.org>
Original-Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Original-Reviewed-on: https://review.coreboot.org/15222
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Nico Huber <nico.h@gmx.de>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358839
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-07 19:29:17 -07:00
Alexander Couzens
59616b206d UPSTREAM: lenovo/t530: add VGA device ID 8086,0106
BUG=None
BRANCH=None
TEST=None

Change-Id: I3cffe9d832edbbea79cabca639d9d920b7ffcf9a
Original-Signed-off-by: Philipp Deppenwiese <zaolin@das-labor.org>
Original-Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Original-Reviewed-on: https://review.coreboot.org/8178
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Nico Huber <nico.h@gmx.de>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358838
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-07 19:29:15 -07:00
Paul Kocialkowski
f3fbfdcb19 UPSTREAM: nyan: Avoid running early_mainboard_init twice in vboot context
A call to early_mainboard_init is already present in verstage, thus it
is only necessary to call it from romstage when not in vboot context.

BUG=None
BRANCH=None
TEST=None

Change-Id: I2e0b5a369c5fb24efae4ac40d83a31f5cf4a078d
Original-Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Original-Reviewed-on: https://review.coreboot.org/15450
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Original-Reviewed-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358837
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-07 19:29:12 -07:00
Paul Kocialkowski
6f66c38e04 UPSTREAM: tegra124: Build verstage when CHROMEOS is selected
This includes the proper Kconfig options (based on the chromium os
coreboot configuration) for setting up verstage on tegra124 devices.

BUG=None
BRANCH=None
TEST=None

Change-Id: I4a1976ff684a417cae6fa718ef53cad763cee47d
Original-Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Original-Reviewed-on: https://review.coreboot.org/15451
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Julius Werner <jwerner@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358836
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-07 19:29:10 -07:00
Ryan Salsamendi
83090b3cdf UPSTREAM: intel/sandybridge: read correct leaf for cpu family
Reading cpuid leaf 0 is incorrect for testing cpu family.
Use leaf 1 instead. See Intel SDM 2a Table 3-17.

BUG=None
BRANCH=None
TEST=None

Change-Id: Ib2c95cdd1fb93db06a08ecd7266f6b88700caf83
Original-Signed-off-by: Ryan Salsamendi <rsalsamendi@hotmail.com>
Original-Reviewed-on: https://review.coreboot.org/15346
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Original-Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358835
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-07 19:29:08 -07:00
Philipp Deppenwiese
eb561ae6a9 UPSTREAM: MAINTAINERS: Add myself as tpm support maintainer.
The tpm software stack, drivers and trustedboot
needs to be maintained.

BUG=None
BRANCH=None
TEST=None

Change-Id: I7b9ff9c4d7504c861de98ef3d8fcda53b20657c4
Original-Signed-off-by: Philipp Deppenwiese <zaolin@das-labor.org>
Original-Reviewed-on: https://review.coreboot.org/15312
Original-Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Original-Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
Original-Tested-by: build bot (Jenkins)
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358834
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-07 19:29:05 -07:00
Hannah Williams
46f5ad8c3a UPSTREAM: board/intel/amenia: Enable LPSS S0ix
This setting will enable S0ix for LPSS

BUG=None
BRANCH=None
TEST=None

Change-Id: Ie07cb8437d0cee61a03638aa980fd3322fef0c4e
Original-Signed-off-by: Hannah Williams <hannah.williams@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15056
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Tested-by: build bot (Jenkins)
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358833
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-07 19:29:03 -07:00
Werner Zeh
04ebdf4e4e UPSTREAM: siemens/mc_bdx1: Set up opcode menu for SPI controller
Since SPI controller opcode registers are locked by FSP, they need to be
initialized to a known good state before ReadyToBoot event and after
every SPI flash access (e.g. for MRC cache) has been finished in order
to enable the OS to use SPI controller without constraints.

BUG=None
BRANCH=None
TEST=None

Change-Id: I0a66344cd44e036c3999ae98d539072299cf5112
Original-Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Original-Reviewed-on: https://review.coreboot.org/15547
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358832
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-07 19:29:01 -07:00
Werner Zeh
b2db16258d UPSTREAM: intel/fsp_broadwell_de: Do not use hard coded SCI IRQ for ACPI
The SCI interrupt can be routed to different IRQs using ACPI control
register. Instead of using hard coded IRQ9 for ACPI table generation
read back the register and return the used IRQ number. This way SCI IRQ
can be modified (e.g. for a given mainboard) and ACPI tables will
remain consistent.

BUG=None
BRANCH=None
TEST=None

Change-Id: I534fc69eb1df28cd8d733d1ac6b2081d2dcf7511
Original-Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Original-Reviewed-on: https://review.coreboot.org/15548
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Original-Reviewed-by: York Yang <york.yang@intel.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358831
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-07-07 19:28:58 -07:00
Vadim Bendebury
02b2909b18 tpm2: remove unused buffer size definition
TPM2 structure definitions use pointers instead of buffers where
possible. One structure was left behind, replace buffer definition
with a pointer to be consistent.

BRANCH=none
BUG=chrome-os-partner:50645
TEST=compilation succeeds, the code using the changed structure in the
     upcoming patches allows to successfully boot chrome OS on Kevin

Change-Id: I9856ac516be13f5892ba8af0526708409a297033
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358771
Reviewed-by: Douglas Anderson <dianders@chromium.org>
2016-07-07 18:46:38 +00:00
Werner Zeh
0193d4f4bd UPSTREAM: siemens/mc_bdx1: Add usage of Siemens NC FPGA driver
Enable NC FPGA driver for this mainboard.

BUG=None
BRANCH=None
TEST=None

Change-Id: I87b6b10038f3d161a25b2008b7ea44b5627cca43
Original-Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Original-Reviewed-on: https://review.coreboot.org/15545
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Kysti Mlkki <kyosti.malkki@gmail.com>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358605
Reviewed-by: Martin Roth <martinroth@chromium.org>
2016-07-07 01:09:53 -07:00
Werner Zeh
e46db688bc UPSTREAM: siemens/nc_fpga: Add driver for Siemens NC FPGA
Add driver code to initialize Siemens NC FPGA as PCI device.
Beside some glue logic it contains a FAN controller and
temperature monitor.

BUG=None
BRANCH=None
TEST=None

Change-Id: I2cb722a60081028ee5a8251f51125f12ed38d824
Original-Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Original-Reviewed-on: https://review.coreboot.org/15543
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Kysti Mlkki <kyosti.malkki@gmail.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358604
Reviewed-by: Martin Roth <martinroth@chromium.org>
2016-07-07 01:09:51 -07:00
Werner Zeh
e18f2075ac UPSTREAM: PCI: Use PCI_DEVFN macro instead of DEV_FUNC
There are several different macros available to convert a PCI device and
function to a single 8 bit value. One is PCI_DEVFN and is defined in
device/pci_def.h. The other is DEV_FUNC and is defined in several intel
fsp based chipset implementations. In fsp_broadwell_de DEV_FUNC is even
used without being defined at all. This patch unifies the situation so
that only PCI_DEVFN is used.

BUG=None
BRANCH=None
TEST=None

Change-Id: Ia1c6d7f3683badc66d15053846936d88aa836632
Original-Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Original-Reviewed-on: https://review.coreboot.org/15546
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358603
Reviewed-by: Martin Roth <martinroth@chromium.org>
2016-07-07 01:09:48 -07:00
Nico Huber
9718834ac5 UPSTREAM: buildgcc: Add option to bootstrap a host gcc
Bootstrapping gcc is the recommended way if your host gcc's version
doesn't match the gcc version you're going to build. While a build
with an outdated host gcc usually succeeds, an outdated gnat seems
to be a bigger issue.

v3: Some library controversy: gcc likes the libraries it ships with
most but we don't want to install shared libraries. So we build
them static --disable-shared) and install only the minimum
(libgcc, libada, libstdc++). However, as the code of these
libraries might be used to build a shared library we have to
compile them with `-fPIC`.

v4: o Updated getopt strings.
o The workaround for clang (-fbracket-depth=1024) isn't needed
for bootstrapping and also breaks the build, as clang is only
used for the first stage in that case and gcc doesn't know
that option.

So far build tested with `make BUILDGCC_OPTIONS="-b -l c,ada"` on
o Ubuntu 14.04 "Trusty Tahr" (i386)
o Debian 8 "Jessie" (x86_64) (building python (-S) works too)
o current Arch Linux (x86_64)
o FreeBSD 10.3 (x86_64) (with gcc-aux package)

and with clang host compiler, thus C only: `make BUILDGCC_OPTIONS="-b"`
on
o Debian 8 "Jessie" (x86_64)
o FreeBSD 10.3 (x86_64)

v5: Rebased after toolchain updates to GCC 5.3.0 etc.

Build tested with `make BUILDGCC_OPTIONS="-b -l c,ada"` on
o Debian 8 "Jessie" (x86_64)

BUG=None
BRANCH=None
TEST=None

Change-Id: Icb47d3e9dbafc55737fbc3ce62a084fb9d5f359a
Original-Signed-off-by: Nico Huber <nico.huber@secunet.com>
Original-Reviewed-on: https://review.coreboot.org/13473
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358602
Reviewed-by: Martin Roth <martinroth@chromium.org>
2016-07-07 01:09:46 -07:00
Nico Huber
26cca5a651 UPSTREAM: buildgcc: Make package build() function more versatile
Refactor build() to make things more flexible:

Add a parameter that tells if we build a package for the host or for a
target architecture. This is just passed to the build_$package()
function and can be used later to take different steps in each case
(e.g. for bootstrapping a host gcc).

Move .success files into the destination directory. That way we can tell
that a package has been built even if the package build directory has
been removed.

BUG=None
BRANCH=None
TEST=None

Change-Id: I52a7245714a040d11f6e1ac8bdbff8057bb7f0a1
Original-Signed-off-by: Nico Huber <nico.huber@secunet.com>
Original-Reviewed-on: https://review.coreboot.org/13471
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358601
Reviewed-by: Martin Roth <martinroth@chromium.org>
2016-07-07 01:09:44 -07:00
Werner Zeh
174a61286b UPSTREAM: siemens/mc_bdx1: Set up MAC address for available i210 MACs
Enable the usage of DRIVER_INTEL_I210 and provide a function to search
for a valid MAC address for all i210 devices using hwilib.

BUG=None
BRANCH=None
TEST=None

Change-Id: Ic0f4f1579364cf5b0111334a05a8a0926785318b
Original-Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Original-Reviewed-on: https://review.coreboot.org/15517
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Kysti Mlkki <kyosti.malkki@gmail.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/358600
Reviewed-by: Martin Roth <martinroth@chromium.org>
2016-07-07 01:09:42 -07:00