Commit graph

17778 commits

Author SHA1 Message Date
Werner Zeh
c7358ae418 UPSTREAM: flashmap: Use CONFIG_ROM_SIZE as flash size in flashmap
Currently there are two sources for the final size of the
flash image. One is defined as a Kconfig variable
(ROM_SIZE) and the other can be provided in a user defined
flashmap.fmd. This patch will enable the usage of CONFIG_ROM_SIZE
in flashmap.fmd to define the flash size. In this way, the
Kconfig variable is the only source of information for the
flash image size. This way is optional.

Change-Id: Id5298e06d360aaa6d94f2b5a2ffa65e45919853e
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/15219
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354987
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
2016-06-22 10:41:04 -07:00
Julius Werner
58802e9403 UPSTREAM: fmaptool: Make base offsets absolute in fmap_config.h
fmaptool generates a header file used to hardcode certain values from
the FMAP in coreboot's binaries, to avoid having to find and parse the
FMAP manually for every access. For the offset of the FMAP itself this
has already been using the absolute offset from the base of the whole
ROM, but for individual CBFS sections it only used the offset from the
immediate parent FMAP region. Since the code using it intentionally has
no knowledge of the whole section tree, this causes problems as soon as
the CBFS is a child section of something not at absolute offset 0 (as is
the case for most x86 Chromebooks).

Change-Id: If0c516083949fe5ac8cdae85e00a4461dcbdf853
Reported-by: Rolf Evers-Fischer <embedded24@evers-fischer.de>
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/15273
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: https://chromium-review.googlesource.com/354986
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
2016-06-22 10:41:02 -07:00
Freddy Paul
dfe61beee3 UPSTREAM: google/reef: Add ACPI code for trackpad
This patch enlists ELAN trackpad on I2C4 for reef board.

BUG=None
TEST=Build and boot to OS.
     Ensure ELAN trackpad is working with ELAN trackpad driver enabled
     in kernel.

Change-Id: I788600f16dea9fac0e089cb82ccfc38a960157f9
Signed-off-by: Freddy Paul <freddy.paul@intel.com>
Reviewed-on: https://review.coreboot.org/15213
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354985
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
2016-06-22 10:40:59 -07:00
Freddy Paul
2e0ff9de18 UPSTREAM: soc/intel/apollolake: make gpo.h ACPI compatible
BUG=None
TEST=Build with <soc/gpio.h> included in mainboard.asl

Change-Id: Id6fdc50d09c014f930fdfd5c2fde0df827ad5181
Signed-off-by: Freddy Paul <freddy.paul@intel.com>
Reviewed-on: https://review.coreboot.org/15272
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
Reviewed-on: https://chromium-review.googlesource.com/354984
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
2016-06-22 10:40:57 -07:00
Kyösti Mälkki
20f4a00f87 UPSTREAM: intel/model_6ex: Prepare for dynamic CONFIG_RAMTOP
Change-Id: I9bfaa53f8d09962d36df1e86a0edcf100bb08403
Signed-off-by: Kysti Mlkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/15229
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354983
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
2016-06-22 10:40:55 -07:00
Gabe Black
62e63795c5 UPSTREAM: beaglebone: Update bootblock.c to use new structs/code
New structures and functions have been added to make it easier and
clearer to talk to GPIOs, configure the clock module, and toggle the
LEDs. Use that code in bootblock.c instead of doing those things
manually with hardcoded addresses.

Change-Id: If41db0220de4bc95a6c99945ec402e3026cb4eeb
Signed-off-by: Gabe Black <gabeblack@chromium.org>
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-on: https://review.coreboot.org/3944
Tested-by: build bot (Jenkins)
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354982
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-22 10:40:52 -07:00
Matt DeVillier
6fa4b6b19f UPSTREAM: mb/google: remove superfluous header includes in bdw chromeboxes
Change-Id: I71443c7547a113bf9b64d48fe5a85c6e2302c8aa
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/15208
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-on: https://chromium-review.googlesource.com/354981
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-22 10:40:50 -07:00
Kyösti Mälkki
aa851a8c65 UPSTREAM: intel/car/cache_as_ram_ht.inc: Prepare for dynamic CONFIG_RAMTOP
Change-Id: Idb0f621553e76e771a5d6f2d492675ccd989d947
Signed-off-by: Kysti Mlkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/15228
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354980
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
2016-06-22 10:40:47 -07:00
Kyösti Mälkki
836986343d UPSTREAM: intel/car/cache_as_ram.inc: Prepare for dynamic CONFIG_RAMTOP
Change-Id: I02881ce465cb3835a6fa7c06b718aa42d0d327ec
Signed-off-by: Kysti Mlkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/15227
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
Reviewed-on: https://chromium-review.googlesource.com/354699
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
2016-06-22 10:40:45 -07:00
Gerd Hoffmann
c0efa44fe2 UPSTREAM: qemu/x86: car: drop pointless code, move stack out of the way
RAM doesn't need any initialization on qemu, so we can simply use it
right away.  No need to try using the cache as ram in the first place.

We also can place the stack in normal ram right from start and we
don't have to switch it to another place later on.  Place the stack
in real mode memory which isn't used for something else.

Change-Id: Ib7a3f58a846d139f7babea5f43722a30fe0fe962
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-on: https://review.coreboot.org/15214
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-by: Kysti Mlkki <kyosti.malkki@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/354698
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-22 10:40:43 -07:00
Jonathan Neuschäfer
15818d5e89 UPSTREAM: riscv-spike: Move coreboot to 0x80000000 (2GiB)
This is where the RAM is (now), on RISC-V.

We need to put coreboot.rom in RAM because Spike (at the moment) only
supports loading code into the RAM, not into the boot ROM.

Change-Id: I6c9b7cffe5fa414825491ee4ac0d2dad59a2d75c
Signed-off-by: Jonathan Neuschfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/15149
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354697
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
2016-06-22 10:40:41 -07:00
Jonathan Neuschäfer
556317cca0 UPSTREAM: util/riscvtools: Add script that turns coreboot.rom into an ELF
This is required because SPIKE doesn't support loading flat files yet.

Change-Id: If745d78712ca8108b5dcc21591201bc2d3f70b86
Signed-off-by: Jonathan Neuschfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/14964
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354696
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
2016-06-22 10:40:38 -07:00
Hannah Williams
670f907f56 UPSTREAM: soc/apollolake: Include PCI _OSC method
Change-Id: I2545fc184ebfaa006a75783bf3d55f009066eed3
Signed-off-by: Hannah Williams <hannah.williams@intel.com>
Reviewed-on: https://review.coreboot.org/15110
Tested-by: build bot (Jenkins)
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: https://chromium-review.googlesource.com/354695
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-22 10:40:36 -07:00
Ryan Salsamendi
43383411a8 UPSTREAM: Update SeaBIOS URL to https
Change-Id: If1c37bf2bb7df35d5e5ec37cefb9bb92a251f93b
Signed-off-by: Ryan Salsamendi <rsalsamendi@hotmail.com>
Reviewed-on: https://review.coreboot.org/15206
Tested-by: build bot (Jenkins)
Reviewed-by: Jonathan Neuschfer <j.neuschaefer@gmx.net>
Reviewed-by: Antonello Dettori <dev@dettori.io>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: https://chromium-review.googlesource.com/354694
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-22 10:40:34 -07:00
Kyösti Mälkki
9b3812e9ee UPSTREAM: ACPI S3: Cleanup RSDP reference
Variable name shadows parameter name used on other functions,
and it can be local anyway after function removal.

Change-Id: I3164b15b33d877fef139f48ab2091e60e3124c3b
Original-Signed-off-by: Kysti Mlkki <kyosti.malkki@gmail.com>
Original-Reviewed-on: https://review.coreboot.org/15240
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Nico Huber <nico.h@gmx.de>
(cherry-picked from commit 072d436b3f)
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354201
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-21 17:14:04 -07:00
Hannah Williams
25de292ff0 UPSTREAM: soc/intel/common: Add _OSC method
Not masking any bits in Operating System Capabilities, which means we
support all the capabilities that OS passed in Arg3

Change-Id: Ib87915e18e305db41b52891ac5430201dda64bb5
Original-Signed-off-by: Hannah Williams <hannah.williams@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15021
Original-Reviewed-by: Martin Roth <martinroth@google.com>
(cherry-picked from commit f2a50d1231)
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354200
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-21 17:14:02 -07:00
Patrick Rudolph
9eabcc0653 UPSTREAM: nb/intel/sandybridge/raminit: Use supported CAS
Instead of programming unsupported CAS use the highest supported
value. Start at DDR3 maximum of CAS 18T.
Increase error message verbosity level.

Useful for overclocking.

Tested on Lenovo T520 and DDR3-1600 DIMM (RMT3170eb86e9w16).
Allows to run a DDR3-1600 DIMM at 933Mhz.

Change-Id: I2e8aadd541f06fa032ad7095c9a2d5e3bb7613f3
Original-Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Original-Reviewed-on: https://review.coreboot.org/15217
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
(cherry-picked from commit 55409ebbb6)
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354199
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-21 17:13:59 -07:00
Patrick Rudolph
e31bcefad7 UPSTREAM: nb/intel/sandybridge/raminit: Do code cleanup
Calculate the value from current DDR frequency.

Tested on Lenovo T520 and DDR3-1600 DIMM (RMT3170eb86e9w16).

Change-Id: I57ffbfeb291fc2fede278d18527993e7432e9bd8
Original-Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Original-Reviewed-on: https://review.coreboot.org/15184
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
(cherry-picked from commit d4c53e3fdd)
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354198
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-21 17:13:57 -07:00
Patrick Rudolph
89f3084f74 UPSTREAM: arch/x86/smbios: Add DRAM manufacturer
Add Ramaxel DRAM manufacturer id.

Tested on Lenovo T520 and DDR3-1600 DIMM (RMT3170eb86e9w16).
The manufacturer name shows up in dmidecode.

Change-Id: I14cdc82c09f0f990e2ba18083748d11d79e53874
Original-Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Original-Reviewed-on: https://review.coreboot.org/15183
Original-Reviewed-by: Kysti Mlkki <kyosti.malkki@gmail.com>
Original-Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
(cherry-picked from commit 4307835d26)
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354197
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-21 17:13:55 -07:00
Patrick Rudolph
e5d40a545d UPSTREAM: include/device/dram/ddr3: Add additional frequencies
IvyBridge memory controller supports more frequencies than SandyBridge.
Required for future patches.

Change-Id: I0bcb670c20407ec0aec20bae85c4cbe6ccc44b16
Original-Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Original-Reviewed-on: https://review.coreboot.org/15182
Original-Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
Original-Reviewed-by: Kysti Mlkki <kyosti.malkki@gmail.com>
(cherry-picked from commit 577aad6f13)
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354196
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-21 17:13:52 -07:00
Patrick Rudolph
8fc1e4b098 UPSTREAM: nb/intel/sandybridge/raminit: Do code cleanup
Simplify calculation of value.

Tested on Lenovo T520 and DDR3-1600 DIMM (RMT3170eb86e9w16).

Change-Id: I3ecd12c431b46a8d2218f33d7eb3e10de3bcd61d
Original-Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Original-Reviewed-on: https://review.coreboot.org/15181
Original-Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
(cherry-picked from commit b7b1b2884f)
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354195
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-21 17:13:50 -07:00
Patrick Rudolph
45ee684308 UPSTREAM: nb/intel/sandybridge/raminit: Allow 933Mhz on Lenovo devices
Set max_mem_clock_mhz in devicetree to 933Mhz.
Allows to run the memory at up to DDR3-1866.

The same frequency was allowed within the first vendor bios,
but Lenovo than decided to limit it to DDR3-1333.

Tested on Lenovo T520 and DDR3-1600 DIMM (RMT3170eb86e9w16).

The RAM is now running at DDR3-1600 instead of DDR3-1333.
This gives about 4% performance increase in glmark2 using the
Intel GPU.

Change-Id: If15be497402d84a2778f0434b6381a64eda832d6
Original-Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Original-Reviewed-on: https://review.coreboot.org/15158
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Martin Roth <martinroth@google.com>
(cherry-picked from commit 7bddd30e94)
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354194
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-21 17:13:48 -07:00
Arthur Heymans
66173b06c8 UPSTREAM: amd/fam_10h-fam_15h: allow building without microcode updates
CPU_MICROCODE_MULTIPLE_FILES relies on SUPPORT_CPU_MICROCODE_CBFS,
which is not set if CPU_MICROCODE_CBFS_NONE is set.
This makes selecting CPU_MICROCODE_MULTIPLE_FILES conditional.

Change-Id: I0c28f99a1b868bbf90a6f048cce3bea4ff849f76
Original-Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Original-Reviewed-on: https://review.coreboot.org/15259
Original-Reviewed-by: Timothy Pearson <tpearson@raptorengineering.com>
(cherry-picked from commit 4089a17cb9)
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354193
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-21 17:13:45 -07:00
Kyösti Mälkki
3553ffa376 UPSTREAM: amd/geode: Fix comment about ACPI S3
As RAMTOP gets removed, comment becomes inaccurate.

Change-Id: Iaf25b88a4065d15c0c0682425b1d033e4a36590f
Original-Signed-off-by: Kysti Mlkki <kyosti.malkki@gmail.com>
Original-Reviewed-on: https://review.coreboot.org/15237
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
(cherry-picked from commit e6bab8fb91)
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354192
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-21 17:13:43 -07:00
Kyösti Mälkki
4eeefb31ed UPSTREAM: VIA C7 NANO: Fix early MTRR setting
It would not be possible to set MTRR for range 1MiB to 4MiB.
Our RAMTOP is power of 2 and enabling cache for bottom
1MiB should cause no problems.

Change-Id: I3619bc25be60f42b68615bfcdf36f02d66796e02
Original-Signed-off-by: Kysti Mlkki <kyosti.malkki@gmail.com>
Original-Reviewed-on: https://review.coreboot.org/15238
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
(cherry-picked from commit d71cfd2041)
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354191
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-21 17:13:41 -07:00
Kyösti Mälkki
dad8bccd5a UPSTREAM: intel/broadwell: Remove old USBDEBUG backup store in CAR
Required EHCI state is maintained as a CAR_GLOBAL to have it
properly migrated.

Change-Id: I8df413bec6faae4952670710c8ac804e0331c966
Original-Signed-off-by: Kysti Mlkki <kyosti.malkki@gmail.com>
Original-Reviewed-on: https://review.coreboot.org/15236
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
(cherry-picked from commit 4b86314495)
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354190
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-21 17:13:38 -07:00
Kyösti Mälkki
3c30e68296 UPSTREAM: emulation/qemu-i440fx qemu-q35: Asmlinkage for romstage main()
Change-Id: I66238525c5c4d97313a589373144741f1be97483
Original-Signed-off-by: Kysti Mlkki <kyosti.malkki@gmail.com>
Original-Reviewed-on: https://review.coreboot.org/15226
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
(cherry-picked from commit c6986fac77)
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354189
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-21 17:13:36 -07:00
Kyösti Mälkki
e1e658ad29 UPSTREAM: intel: Fix romstage main() with asmlinkage
Backport from haswell.

Change-Id: I585639f8af47bd1d8c606789ca026c6d2d0cc785
Original-Signed-off-by: Kysti Mlkki <kyosti.malkki@gmail.com>
Original-Reviewed-on: https://review.coreboot.org/15225
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
(cherry-picked from commit e325b223a2)
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354188
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-21 17:13:34 -07:00
Kyösti Mälkki
4fa62ae8f6 UPSTREAM: AMD boards: Fix romstage main() declaration
Boards incorrectly used intel include file for AMD board.

Change-Id: I6d3172d1aa5c91c989a6ef63066a7cd6f70013f5
Original-Signed-off-by: Kysti Mlkki <kyosti.malkki@gmail.com>
Original-Reviewed-on: https://review.coreboot.org/15232
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
(cherry-picked from commit 5276941c8b)
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354187
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-21 17:13:32 -07:00
Kyösti Mälkki
a1f7412c0d UPSTREAM: dmp/vortex86ex: Drop excessive include
Change-Id: Ieeae96d53627768de98006074c8c8e826b1741fc
Original-Signed-off-by: Kysti Mlkki <kyosti.malkki@gmail.com>
Original-Reviewed-on: https://review.coreboot.org/15233
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
(cherry-picked from commit e93e7102cf)
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354186
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-21 17:13:29 -07:00
Zhao, Lijian
49d3e1e27a UPSTREAM: google/reef: Update EMMC DLL setting in all mode
Update tuned DLL setting on all other mode, including SDR12
SDR25 and DDR50.

BUG=None
BRANCH=None
TEST=None

Change-Id: I1eb85ac6080fd78f63816d3fa9ef482484bd9f94
Original-Signed-off-by: Zhao, Lijian <lijian.zhao@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15210
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-by: Furquan Shaikh <furquan@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354172
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-21 14:48:38 -07:00
Antonello Dettori
79a9221d25 UPSTREAM: cbfstool: Extract payload in ELF
Implement function that automatically converts a SELF payload,
extracted from the CBFS, into an ELF file.

The code has been tested on the following payloads:
Working: GRUB, FILO, SeaBIOS, nvramcui, coreinfo and tint
Currently not working: none

CQ-DEPEND=CL:354166
BUG=None
BRANCH=None
TEST=None

Change-Id: I51599e65419bfa4ada8fe24b119acb20c9936227
Original-Signed-off-by: Antonello Dettori <dettori.an@gmail.com>
Original-Reviewed-on: https://review.coreboot.org/15139
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/354171
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-21 14:48:34 -07:00
Antonello Dettori
a61b11b2b3 UPSTREAM: elfwriter: Fix multi-phdrs ELFs parsing
Allow to write multiple phdrs, one for each non-consecutive section
of the ELF.
Previously it only worked for ELFs contaning a single
program header.

BUG=None
BRANCH=None
TEST=None

Change-Id: If6f95e999373a0cab4414b811e8ced4c93c67c30
Original-Signed-off-by: Antonello Dettori <dev@dettori.io>
Original-Reviewed-on: https://review.coreboot.org/15215
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354170
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-21 10:40:07 -07:00
Lin Huang
ef5e4551b7 rockchip: rk3399: provide multiple SDRAM configuratinons
We want to be able to easily change SDRAM clock rate for debugging
purposes. This patch adds configurations for 4 different clock rates.

Same configs are used for all rk3399 boards at 200, 666 and 800 MHz.
Kevin board does not run reliably at 666 MHz, an option for it is
added to run at 300 MHz, this option is available to Kevin only.

There is not much room left in the coreboot romstage section, this is
why the config file for 928 MHz is being added with this patch but is
not included in the code, one of the lower frequency options will have
to be dropped for the higher frequency option to be added.

BRANCH=none
BUG=chrome-os-partner:54144
TEST=run "stressapptest -M 1024 -s 3600" and pass on both kevin and
     gru. Verified that on Kevin the firmware reports starting up
     SDRAM at 300 MHz and on Gru - at 800 MHz.

Change-Id: I08bccd40147ad89d851b995a8aab4d2b6da8258a
Signed-off-by: Lin Huang <hl@rock-chips.com>
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/353493
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
2016-06-20 23:14:43 -07:00
Vadim Bendebury
eb8043f964 rk3399: clean up sdram controller initialization code
This is a purely cosmetic change replacing some of the more prominent
copy and paste sections of the code with compressed versions of the
same.

BRANCH=none
BUG=none
TEST=with the rest of the patches applied stressapptest still runs for
     an hour on both Kevin and Gru.

Change-Id: I362e0e261209ae4d4890ecb0e08bb1956c172ffd
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/353774
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
2016-06-20 23:14:41 -07:00
Lin Huang
9de93beae0 rockchip: rk3399: correct sdram inc file DENALI_CTL_217_DATA value
for per cs training, there should be more cycles to switch delay line.
so increase W2W_DIFFCS_DLY_F0 value from 0x1 to 0x5.

BRANCH=none
BUG=chrome-os-partner:54144
TEST=run "stressapptest -M 1024 -s 1000" and pass

Change-Id: Ide23fff04fd63fb0afc538b610b7685756f79f8d
Signed-off-by: Lin Huang <hl@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/352953
Commit-Ready: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
2016-06-20 23:14:38 -07:00
Simon Glass
e4e9823d8c gru: Add elog support
Add code to start up elog. This uses the EC RTC to obtain the timestamp.

BUG=chrome-os-partner:52220
BRANCH=none
TEST=boot on gru with CONFIG_ELOG_DEBUG enabled and see elog messages

Change-Id: I0fcf55b3feccf9a0ad915deb6d323b65bf2e9811
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/353822
Commit-Ready: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-06-20 23:14:21 -07:00
Simon Glass
ffc7a7e0e7 gru: Add get_developer_mode_switch()
Add this function and make it return 0, as there is no physical dev switch
(at least I think this is what we are supposed to do).

This is needed for elog to work, which is needed so we can test RTC
properly.

BUG=chrome-os-partner:52220
BRANCH=none
TEST=boot on gru with CONFIG_ELOG_DEBUG enabled and see elog messages:
elog_init()
SF: Detected W25Q64 with sector size 0x1000, total 0x800000
elog_find_flash()
FMAP: area RW_ELOG found @ 5d8000 (32768 bytes)
elog_scan_flash()
elog_is_buffer_clear(base=0x000000000031d668 size=4096)
ELOG: flash area invalid
elog_flash_erase(address=0x000000000031d668 offset=0x005d8000 size=4096)
SF: Successfully erased 4096 bytes @ 0x5d8000
elog_prepare_empty()
elog_flash_write(address=0x000000000031d668 offset=0x005d8000 size=8)
elog_scan_flash()
elog_is_buffer_clear(base=0x000000000031d668 size=4096)
elog_is_header_valid()
elog_update_event_buffer_state()
elog_is_buffer_clear(base=0x000000000031d670 size=4088)
elog_is_area_valid()
ELOG: FLASH @0x000000000031d668 [SPI 0x005d8000]
ELOG: area is 4096 bytes, full threshold 3834, shrink size 1024
elog_add_event_raw(type=16)
out: cmd=0x44: 03 b9 44 00 00 00 00 00
in-header: 03 3f 00 00 04 00 00 00
in-data: 6e 4c 00 00
elog_flash_write(address=0x000000000031d670 offset=0x005d8008 size=11)
ELOG: Event(16) added with size 11
elog_add_event_raw(type=17)
out: cmd=0x44: 03 b9 44 00 00 00 00 00
in-header: 03 3f 00 00 04 00 00 00
in-data: 6e 4c 00 00
elog_flash_write(address=0x000000000031d67b offset=0x005d8013 size=13)
ELOG: Event(17) added with size 13
elog_add_event_raw(type=A0)
out: cmd=0x44: 03 b9 44 00 00 00 00 00
in-header: 03 3f 00 00 04 00 00 00
in-data: 6e 4c 00 00
elog_flash_write(address=0x000000000031d688 offset=0x005d8020 size=9)
ELOG: Event(A0) added with size 9
elog_add_boot_reason: Logged dev mode boot

I can't actually see the timestamp, but the EC traffic is visible.

Change-Id: I1489c6b874cc49495635aec0bf303f7098455716
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/353821
Commit-Ready: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@google.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-06-20 23:14:19 -07:00
Simon Glass
d0361193e0 gru: Show the current time on start-up
Display the current time from the EC.

BUG=chrome-os-partner:52220
BRANCH=none
TEST=(partial) boot on gru and see output:
Date: 1970-01-17 (Saturday)  Time:  1:42:44

Then reboot ~10 seconds later and see output:
Date: 1970-01-17 (Saturday)  Time:  1:42:53

Change-Id: I04a072c788ba3fc915e6d73703f966955bbd3e7e
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351783
Commit-Ready: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-06-20 23:14:17 -07:00
Simon Glass
348e9373b0 gru: Enable EC-based RTC
Obtain the real-time clock value from the EC on start-up and show the
current time.

BUG=chrome-os-partner:52220
BRANCH=none
TEST=(partial) with future commits and EC clock set, boot on gru into
      Linux shell and check the firmware log:

      localhost ~ # grep Date: /sys/firmware/log
      Date: 2016-06-20 (Monday)  Time: 18:09:16

Change-Id: Iff43b16a86d9fee483420ee2eff5ff3d276716a3
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351781
Commit-Ready: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-06-20 23:14:14 -07:00
Simon Glass
4a4a26da37 Add support for the EC 'get time' function
Some platforms have an RTC provided by the Chrome OS EC. Allow the EC to
implement rtc_get() so that this can be plumbed in.

BUG=chrome-os-partner:52220
BRANCH=none
TEST=(partial) with future commits, boot on gru and see output:
Date: 1970-01-17 (Saturday)  Time:  1:42:44

Then reboot ~10 seconds later and see output:
Date: 1970-01-17 (Saturday)  Time:  1:42:53

Change-Id: Icaa381d32517dfed8d3b7927495b67a027d5ceea
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351780
Commit-Ready: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-06-20 23:14:12 -07:00
Simon Glass
3b02dbcd7d Add common real-time-clock functions
Add functions to convert between seconds and a struct rtc_time. Also
add a function that can display the time on the console.

BUG=chrome-os-partner:52220
BRANCH=none
TEST=(partial) with future commits and after setting RTC on the EC:
  boot on gru into linux shell, check firmware log:

  localhost ~ # grep Date: /sys/firmware/log
  Date: 2016-06-20 (Monday)  Time: 18:01:44

  Then reboot ~10 seconds and check again:

  localhost ~ # grep Date: /sys/firmware/log
  Date: 2016-06-20 (Monday)  Time: 18:01:54

Change-Id: I344c385e2e4cb995d3a374025c205f01c38b660d
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351782
Commit-Ready: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-06-20 20:10:36 -07:00
Kyösti Mälkki
3d00092a46 UPSTREAM: intel/cache_as_ram_ht.inc: Fix include
Reference to CACHE_AS_RAM was from the days we had
romcc boards using socket_mPGA605.

Change-Id: If397db83a01adeda4dd18d8b4c6e89bf0984264a
Original-Signed-off-by: Kysti Mlkki <kyosti.malkki@gmail.com>
Original-Reviewed-on: https://review.coreboot.org/15224
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
(cherry-picked from commit 831a7ef541)
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354185
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-20 20:09:57 -07:00
Kyösti Mälkki
b979b55040 UPSTREAM: intel cache_as_ram: Fix typo in comment
Change-Id: I2539e490e160e01cab2ad8d2086d2f242a88c640
Original-Signed-off-by: Kysti Mlkki <kyosti.malkki@gmail.com>
Original-Reviewed-on: https://review.coreboot.org/15223
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
(cherry-picked from commit 9d2762ca6f)
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354184
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-20 20:09:55 -07:00
Kyösti Mälkki
f823645e6c UPSTREAM: intel/model_206ax: Move platform specific defines
Change-Id: I3c517fc55dd333b1a457324f1d69aeb6f70acec2
Original-Signed-off-by: Kysti Mlkki <kyosti.malkki@gmail.com>
Original-Reviewed-on: https://review.coreboot.org/15197
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
(cherry-picked from commit d72cc4111b)
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354183
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-20 20:09:52 -07:00
Kyösti Mälkki
d6e187e8a6 UPSTREAM: Move definitions of HIGH_MEMORY_SAVE
This is more of ACPI S3 resume and x86 definition than CBMEM.

Change-Id: Iffbfb2e30ab5ea0b736e5626f51c86c7452f3129
Original-Signed-off-by: Kysti Mlkki <kyosti.malkki@gmail.com>
Original-Reviewed-on: https://review.coreboot.org/15190
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
(cherry-picked from commit a969ed34db)
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354182
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-20 20:09:50 -07:00
Kyösti Mälkki
61af289964 UPSTREAM: Fix some cbmem.h includes
Change-Id: I36056af9f2313eff835be805c8479e81d0b742bf
Original-Signed-off-by: Kysti Mlkki <kyosti.malkki@gmail.com>
Original-Reviewed-on: https://review.coreboot.org/15196
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
(cherry-picked from commit 465eff61f4)
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354181
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-20 20:09:48 -07:00
Kyösti Mälkki
f5c6ca528e UPSTREAM: Define RAMTOP for x86 only
This Kconfig is deprecated, new platforms need to locate
ramstage stack in CBMEM instead.

Change-Id: I20ece297302321337cc2ce17fdef0c55242a4fc3
Original-Signed-off-by: Kysti Mlkki <kyosti.malkki@gmail.com>
Original-Reviewed-on: https://review.coreboot.org/15189
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Original-Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
(cherry-picked from commit bec853e9ad)
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/354180
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-20 20:09:45 -07:00
Lin Huang
717cbac97b rockchip: rk3399: fix sdram training issue
After write leveling for all ranks, check the
PHY_CLK_WRDQS_SLAVE_DELAY result, if the two ranks in one slice both
meet (0x200-PHY_CLK_WRDQS_SLAVE_DELAY < 0x20) or
(0x200-PHY_CLK_WRDQS_SLAVE > 0x1E0), enable PHY_WRLVL_EARLY_FORCE_ZERO
for this slice, and trigger write leveling again.

BRANCH=none
BUG=chrome-os-partner:54144
TEST=run "stressapptest -M 1024 -s 1000" and pass

Change-Id: Ic0d7c59404e870a7108ed64bbf3215fcc2d0973e
Signed-off-by: Lin Huang <hl@rock-chips.com>
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351825
2016-06-20 13:13:43 -07:00
Vadim Bendebury
88862912d4 kconfig: add missing SPI TPM CS config definition
To fully define TPM attachment to a SPI interface both bus and CS
(chip select) settings are required. Add the missing CS configuration
option.

BRANCH=none
BUG=chrome-os-partner:50645
TEST=with the rest of the patches applied it is possible to compile in
     and run TPM2 SPI driver.

Change-Id: If297df8e5b9526f156ed1414eb9db317d6af5b33
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/353913
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-20 11:16:07 -07:00