Commit Graph

18165 Commits

Author SHA1 Message Date
Aaron Durbin 9acd39d95e console/post: be explicit about conditional cmos_post_log() compiling
The current code was using !__PRE_RAM__ as a proxy for ramstage
conditional compilation. In the face of postcar stage not defining
__PRE_RAM__ (because it's after RAM is up) these code paths
can fail to compile with a __SIMPLE_DEVICE__ defined for the entire
stage. Remedy the current situation by just compiling explicity for
ramstage because that was the original intent. In the future,
the __SIMPLE_DEVICE__ selection for postcar can also be re-evaluated.

Change-Id: I0f887f1e45f0cf5c235ae5144eaa227921e7119b
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/14958
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan@google.com>
2016-05-25 18:04:11 +02:00
Lee Leahy 277279343f mainboard/intel/galileo: Enable USB device support
Turn on the USB device port.

TEST=Build and run on Galileo Gen2

Change-Id: Ic1fbb2cd51414ce927f2b408ccd27c7edf978744
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/14943
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-05-25 00:17:52 +02:00
Lee Leahy fd45658a68 soc/intel/quark: Add USB device port support
Add initialization for the USB device port.

TEST=Build and run on Galileo Gen2

Change-Id: Icf83747f778f6e1ac976cd448a94311030e79e4f
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/14941
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-05-25 00:17:34 +02:00
Julius Werner 2c51572435 arm64: Add stack dump to exception handler
Some exceptions (like from calling a NULL function pointer) are easier
to narrow down with a dump of the call stack. Let's take a page out of
ARM32's book and add that feature to ARM64 as well. Also change the
output format to two register columns, to make it easier to fit a whole
exception dump on one screen.

Applying to both coreboot and libpayload and syncing the output format
between both back up.

Change-Id: I19768d13d8fa8adb84f0edda2af12f20508eb2db
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/14931
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-24 20:51:28 +02:00
Jagadish Krishnamoorthy c123ccfa12 intel/amenia: Configure Trackpad IC_SDA_HOLD time
Elan trackpad needs greater sda hold time.
Configure IC_SDA_HOLD register to increase
the i2c sda hold time by 0.3us.

Change-Id: I3d966eed62a059ecb6a0a88e9f4e6b4ba7a925e4
Signed-off-by: Jagadish Krishnamoorthy <jagadish.krishnamoorthy@intel.com>
Reviewed-on: https://review.coreboot.org/14922
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-24 20:30:31 +02:00
Jagadish Krishnamoorthy e2e561d31f vendorcode/chromeos/vbnv: Add CMOS init function
Add cmos init helper function.
This function saves the Vboot NV data, calls cmos init
and restores the Vboot NV data.

Change-Id: I8475f23d849fb5b5a2d16738b4d5e99f112883da
Signed-off-by: Jagadish Krishnamoorthy <jagadish.krishnamoorthy@intel.com>
Reviewed-on: https://review.coreboot.org/14898
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-05-24 20:28:48 +02:00
Lee Leahy f8841120b2 soc/intel/quark: Add EHCI errata
Move the EHCI errata from QuarkFSP into coreboot.

TEST=Build and run on Galileo Gen2

Change-Id: I424ffd81643fbba9c820b5a8a6809b9412965f8d
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/14940
Tested-by: build bot (Jenkins)
Reviewed-by: Duncan Laurie <dlaurie@google.com>
2016-05-23 20:43:44 +02:00
Lee Leahy 6923e8c40d soc/intel/quark: Rename usb.c to ehci.c
Rename usb.c to ehci.c since it contains EHCI specific content.

TEST=Build and run on Galileo Gen2

Change-Id: Ifdb7cd937b1dffda1959b76e1c911ffd93f53cb6
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/14939
Tested-by: build bot (Jenkins)
Reviewed-by: Duncan Laurie <dlaurie@google.com>
2016-05-23 20:35:49 +02:00
Lee Leahy e1bff02ebe soc/intel/quark: Switch reference from uart_dev to uart_bdf
Switch from using uart_dev to uart_bdf to better describe the value
in use.

TEST=Build and run on Galileo Gen2

Change-Id: If5066b93ea8ccce4a5b89ee3984c7413d5358e71
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/14938
Tested-by: build bot (Jenkins)
Reviewed-by: Duncan Laurie <dlaurie@google.com>
2016-05-23 20:34:07 +02:00
Aaron Durbin 9f444c351c soc/intel/apollolake: add support for writing logical boot partition 2
On apollolake the boot media layout is different in that the
traditional "BIOS" region contains another data structure with
the boot assets such as CSE firmware, PMC microcode,
CPU microcode, and boot firmware to name a few. There's also a
sort of recovery mechanism where there is a second data structure
with similar contents halfway through the "BIOS" region. This
second structure is referred as the logical boot partition 2 (LBP2),
and it's optionally employed.

Add support for writing the LBP2 to a specified FMAP region to
accommodate platforms which require it.

Change-Id: I1959a790f763b409238dea6b62408b42122e590e
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/14924
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Andrey Petrov <andrey.petrov@intel.com>
2016-05-23 17:37:11 +02:00
Stefan Reinauer f6b1039f86 program.ld: Don't exclude sbe region from verstage
This fixes compilation of coreboot on Glados

Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
BRANCH=none
TEST=emerge-glados coreboot works again
BUG=none

Change-Id: Ibaae68192a3dc070c6ecf79223da4a1e1f18b352
Reviewed-on: https://chromium-review.googlesource.com/346198
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Commit-Queue: Stefan Reinauer <reinauer@google.com>
Tested-by: Stefan Reinauer <reinauer@google.com>
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
(cherry picked from commit d7c2c72698e81b1410f9839c77be2e77b8ed83d6)
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14930
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: Duncan Laurie <dlaurie@google.com>
2016-05-21 06:04:32 +02:00
Duncan Laurie 2e63c2a566 apollolake: Add handler for finding ACPI path for GPIO
Add a handler for soc/intel/apollolake to return the ACPI path for
GPIOs.  There are 4 GPIO "communities" on apollolake that each have a
different ACPI device so return the appropriate name for the different
communities.

Change-Id: I596c178b7813ac6aaeb4f2685bb916f5b78e049b
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14859
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-21 06:03:22 +02:00
Duncan Laurie 66bd65d0f7 skylake: Add handler for finding ACPI path for GPIO
Add a handler for the Intel Skylake SOC to return the ACPI path for
GPIOs.  Since all GPIOs are handled by the same controller they all
have the same ACPI path and this is a simple handler that just returns
a pointer to the GPIO device that is defined in the DSDT.

Change-Id: I24ff3a6f2479d9e7eeace65d49e2f6c2e070f3e9
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14843
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
2016-05-21 06:02:11 +02:00
Duncan Laurie 3a39f44fc4 gpio: Add a function to map GPIO to ACPI path
Add a new function "gpio_acpi_path()" that can be implemented by
SoC/board code to provide a mapping from a "gpio_t" pin to a
controller by returning the ACPI path for the controller that owns
this particular GPIO.

This is implemented separately from the "acpi_name" handler as many
SOCs do not have a specific device that handles GPIOs (or may have
many devices and the only way to know which is the opaque gpio_t)
and the current GPIO library does not have any association with the
device tree.

If not implemented (many SoCs do not implement the GPIO library
abstraction at all in coreboot) then the default handler will return
NULL and the caller knows it cannot determine this reliably.

Change-Id: Iaa0ff6c8c058f00cddf0909c4b7405a0660d4cfb
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14842
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
2016-05-21 06:01:34 +02:00
Duncan Laurie 2f6fb9f5f9 skylake: Add ACPI device name handler
Add a global ACPI device name handler for the Skylake SOC that will
translate skylake device paths into an ACPI path that matches the
device objects delcared in the DSDT at soc/intel/skylake/acpi/*.

The skylake implementation uses a global acpi_name handler for the
SOC and it is not necessary to add a function to every device.

This function is used by device drivers calling acpi_device_name()
and acpi_device_path() to generate ACPI AML in the SSDT.

Change-Id: I31cecf7905a51224e7bfc40c6c4ad2487f039097
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14841
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
2016-05-21 06:00:38 +02:00
Duncan Laurie d9af3cecae device: Add an ACPI device name and path concept to devices
Add a function to "struct device_operations" to return the ACPI name
for the device, and helper functions to find this name (either from
the device or its parent) and to build a fully qualified ACPI path
from the root device.

This addition will allow device drivers to generate their ACPI AML in
the SSDT at boot, with customization supplied by devicetree.cb,
instead of needing custom DSDT ASL for every mainboard.

The root device acpi_name is defined as "\\_SB" and is used to start
the path when building a fully qualified name.

This requires SOC support to provide handlers for returning the ACPI
name for devices that it owns, and those names must match the objects
declared in the DSDT.  The handler can be done either in each device
driver or with a global handler for the entire SOC.

Simplified example of how this can be used for an i2c device declared
in devicetree.cb with:

  chip soc/intel/skylake          # "\_SB" (from root device)
    device domain 0 on            # "PCI0"
      device pci 19.2 on          # "I2C4"
        chip drivers/i2c/test0
          device i2c 1a.0 on end  # "TST0"
        end
      end
    end
  end

And basic SSDT generating code in the device driver:

  acpigen_write_scope(acpi_device_scope(dev));
  acpigen_write_device(acpi_device_name(dev));
  acpigen_write_string("_HID", "TEST0000");
  acpigen_write_byte("_UID", 0);
  acpigen_pop_len(); /* device */
  acpigen_pop_len(); /* scope */

Will produce this ACPI code:

  Scope (\_SB.PCI0.I2C4) {
    Device (TST0) {
      Name (_HID, "TEST0000")
      Name (_UID, 0)
    }
  }

Change-Id: Ie149595aeab96266fa5f006e7934339f0119ac54
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14840
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-21 05:59:52 +02:00
Duncan Laurie 3829f238fa acpigen: Add function to generate ToUUID() from a string
acpigen_write_uuid() will generate a ToUUID() 128-bit buffer object for a
common universally unique identifier that is passed as a string.  The
resulting buffer is the UUID in byte format with a specific order of the
bytes as described in the ACPI specification:

  ToUUID (uuid)

Compiles to:

  Buffer (16) { uuid[3], uuid[2], uuid[1], uuid[0], uuid[5], uuid[4],
                uuid[7], uuid[6], uuid[8], uuid[9], uuid[10], uuid[11],
                uuid[12], uuid[13], uuid[14], uuid[15] }

Change-Id: Ibbeff926883532dd78477aaa2d26ffffb6ef30c0
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14838
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-21 05:59:01 +02:00
Duncan Laurie b9552841bf hexstrtobin: Add a library function to decode ASCII hex into binary
This function will turn a string of ASCII hex characters into an array
of bytes.  It will ignore any non-ASCII-hex characters in the input
string and decode up to len bytes of data from it.

This can be used for turning MAC addresses or UUID strings into binary
for storage or further processing.

Sample usage:
  uint8_t buf[6];
  hexstrtobin("00:0e:c6:81:72:01", buf, sizeof(buf));
  acpigen_emit_stream(buf, sizeof(buf));

Change-Id: I2de9bd28ae8c42cdca09eec11a3bba497a52988c
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14837
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-21 05:58:51 +02:00
Timothy Pearson 9891b4a28b sio/winbond: Expose enter/exit configuration state functions
Certain mainboards, e.g. the ASUS KGPE-D16/KCMA-D8, require
board-specific configuration changes to the SuperIO.  Expose
the functions needed to enter and exit configuration mode
on Winbond devices.

Change-Id: Ic86651872ecafcfe1398201be2b0768bbe460975
Signed-off-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
Reviewed-on: https://review.coreboot.org/14891
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-05-20 04:11:58 +02:00
Martin Roth 09210a1487 src/Kconfig: Move acpi Kconfig below chipset Kconfigs
The src/acpi/Kconfig was being sourced close to the top of the Kconfig
tree, which doesn't allow it to be overridden by mainboards or chipsets.

Moving it lower in the tree allows for the defaults to be overridden.

Change-Id: I0b100f5535c5f383e8c6db74d0024c5ff2e8c08d
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/14878
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-05-19 19:29:59 +02:00
Andrey Petrov 79091db72b soc/intel/apollolake: Relocate FSP-M during insertion in CBFS
Since FSP-M is run in CAR (as opposed to XIP), its default link
address may need to be changed. Since cbfstool can relocate FSP
blobs, take advantage of that feature.

Change-Id: I4353fe09d785c090843ce25ff4e654d45c64c381
Signed-off-by: Andrey Petrov <andrey.petrov@intel.com>
Reviewed-on: https://review.coreboot.org/14866
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-19 18:45:16 +02:00
Alexandru Gagniuc eaa0a17ac2 soc/apollolake/romstage: Add a timestamp at the start of romstage
Change-Id: Idcfaba08e4705c6219a46dd615ae8b456a8ab5b4
Signed-off-by: Alexandru Gagniuc <alexandrux.gagniuc@intel.com>
Reviewed-on: https://review.coreboot.org/14865
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-05-19 18:31:07 +02:00
Alexandru Gagniuc 766ba779bd soc/apollolake/romstage: Call console_init before any printk()
Follow the convention used on all other platforms and explicitly call
console_init() before any printk(). This call was most likely ommitted
by accident during rebase.
Also remove the "Starting romstage..." message, as console_init() will
print a standardized message. I don't have details on how this message
originally appeared.

Change-Id: Id91f0fc15ecbd3635d67a261907f4c6af9a499ab
Signed-off-by: Alexandru Gagniuc <alexandrux.gagniuc@intel.com>
Reviewed-on: https://review.coreboot.org/14864
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-05-19 18:29:40 +02:00
Alexandru Gagniuc f5babed62f soc/apollolake: Pass earliest timestamp to timestamp_init
We have a timestamp from before cache-as-ram setup saved in the MMX
registers. Recover that timestamp, and use it as the base timestamp
rather than letting lib/bootblock.c use a late timestamp.

This allows more accurate profiling of the boot flow, since CAR setup
time is no longer excluded from the timing information.

Change-Id: I055092c600438c5260ab67509434a38f1eb77fe4
Signed-off-by: Alexandru Gagniuc <alexandrux.gagniuc@intel.com>
Reviewed-on: https://review.coreboot.org/14863
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-19 18:28:07 +02:00
Alexandru Gagniuc ff196b6227 lib/bootblock: Provide mechanism to pass in an early timestamp
This is useful, for example, in the bootblock, when a timestamp is
available which predates the call to main() in lib/bootblock.c

Change-Id: I17bb0add9f2d8721504b2e534dd6904d1201989c
Signed-off-by: Alexandru Gagniuc <alexandrux.gagniuc@intel.com>
Reviewed-on: https://review.coreboot.org/14862
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2016-05-19 18:26:42 +02:00
Alexandru Gagniuc 63e7b5b8a7 lib/timestamp: Do not initialize cache in timestamp_cache_get()
timestamp_cache_get() would call timestamp_cache_init() whenever it
found a timestamp cache in the TIMESTAMP_CACHE_UNINITIALIZED state.
That means that timestamp_cache_get() will never reurn a cache in the
uninitialized state.

However, timestamp_init() checks against the uninitialized state, as
it does not expect timestamp_cache_get() to perform any initialization.
As a result, the conditional branch can never be reached.

Simply remove the timestamp_cache_init() call from timestamp_cache_get().

Change-Id: I573ffbf948b69948a3b383fa3bc94382f205b8f8
Signed-off-by: Alexandru Gagniuc <alexandrux.gagniuc@intel.com>
Reviewed-on: https://review.coreboot.org/14861
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
2016-05-19 18:26:17 +02:00
Alexandru Gagniuc 87c6097c8f arch/x86: Include timestamp.c in all stages
timestamp.c was not included in bootblock and postcar. This means that
these two stages would use the weak implementation in lib/timestamp.c
instead of the arch-specific implementation based on rdtsc.

This resulted in using timer_monotonic_get() which resets the
timestamps from 0. timer_monotonic_get() only provides per-stage
incrementing semantics on x86 because lapic implementation has
counting down values. A globally incrementing counter like rdtsc
provides the semantics like every other non-x86.

On the test configuration, the weak implementation of timestamp_get()
returned zero, resulting in wrong timestamps coming from the bootblock,
while romstage and ramstage used the arch implementation and returned
correct timestamps.

This is a great example of why weak functions are dangerous, and how
easy it is to miss subtle yet strong interactions between subsystems
and the coreboot buildsystem.

Change-Id: I656f9bd58a6fc179d9dbbc496c5b684ea9288eb5
Signed-off-by: Alexandru Gagniuc <alexandrux.gagniuc@intel.com>
Reviewed-on: https://review.coreboot.org/14860
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-19 18:25:59 +02:00
Aaron Durbin bea930d7e4 soc/intel/apollolake: clear up ACPI timer emulation magic constant
The timer emulation works by deriving a frequency based off the
Common Timer Copy with a frequency of 19.2MHz.
The desired frequency = (19.2MHz * multiplier) >> 32;
With that knowledge update the code to let the compiler perform
the necessary math based on target frequency.

Change-Id: I716c7980f0456a7c6072bbaaddd6b7fcd8cd5b37
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/14889
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Andrey Petrov <andrey.petrov@intel.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-05-19 17:11:33 +02:00
Zhao, Lijian 0f7885722e soc/apollolake/lpc_lib: Make cros compile pass
The print of size_t can pass upstream jenkins, but fails with CROS_SDK
enviornment, "%z" fits for size_t anyway.

Change-Id: Ic8dbab240463f2e484b73d55e21985fae2b0d9b7
Signed-off-by: Lijian Zhao <lijian.zhao@intel.com>
Reviewed-on: https://review.coreboot.org/14835
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
2016-05-19 03:47:08 +02:00
Jonathan Neuschäfer d4d3ecb551 jenkins: Run the romcc test suite
Change-Id: I467c56ffc632f58338cb3dbafade15acab5ee016
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/14540
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-05-19 00:14:15 +02:00
Shunqian Zheng 462e14139e rockchip: rk3399: enable sdhci clk for emmc
If booting from sdcard/usb, kernel can't recognize the
/dev/mmcblk0.
Before kernel find it's root cause, we add this workaround
patch to enable clk for emmc.

BRANCH=none
BUG=chrome-os-partner:52873
TEST=boot from sdcard and check the /dev/mmcblk0 exists

Change-Id: Ie36cc6fdbc24db8c30984c02ccfe2f8aaaf30cd2
Signed-off-by: Martin Roth <martinroth@google.com>
Original-Commit-Id: 39b87ec3c73d6f56efc8c3f52b7ed759e548ee85
Original-Change-Id: I88a9cc2e3ea5a56aadfdbd94ef910daaf92a7eb7
Original-Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/341632
Original-Commit-Ready: Vadim Bendebury <vbendeb@chromium.org>
Original-Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Original-Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://review.coreboot.org/14856
Tested-by: build bot (Jenkins)
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-05-18 20:23:42 +02:00
Lin Huang 2f7ed8d775 rockchip: rk3399: configure emmc clk
Select aclk_emmc and clk_emmc source from GPLL, and both to 198MHz,
that is GPLL(594MHz) divided by 3.

BRANCH=none
BUG=chrome-os-partner:51537
TEST=boot kevin rev1 to chromeos prompt from both emmc and sdcard
TEST=LoadKernel faster, more than twice as I measured manually.

Change-Id: I2580c43b8c79049c3fe16bbf60bfa1a8e0559948
Signed-off-by: Martin Roth <martinroth@google.com>
Original-Commit-Id: 5fd37b66dcce77354e1cafab0d6e806d832c08d2
Original-Change-Id: Id22815b302af3204e0e5537af99c1577b09b0877
Original-Signed-off-by: Lin Huang <hl@rock-chips.com>
Original-Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/339152
Original-Commit-Ready: Vadim Bendebury <vbendeb@chromium.org>
Original-Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Original-Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://review.coreboot.org/14855
Tested-by: build bot (Jenkins)
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-05-18 20:23:18 +02:00
Gwendal Grignou 95b7a6c6db ec/google/chromeec/acpi: Add MKBP support
Allow EC to send an interrupt using ACPI SMI when a MKBP event
is available. This will be used by the sensor stack.

Update all ACPI branch except those without sensors with:
for i in $(find . -name ec.h -exec grep -l MAINBOARD_EC_SCI_EVENTS {} \+
| cut -d '/' -f 2 | grep -v -e cyan -e lars); do
  echo $i
  cd $i
  git diff ../lars/ec.h | patch -p 5
  cd -
done

BUG=b:27849483
BRANCH=none
TEST=Compile on Samus. Tested in Cyan branch.

Change-Id: I4766d1d56c3b075bb2990b6d6f59b28c91415776
Signed-off-by: Martin Roth <martinroth@google.com>
Original-Commit-Id: d3b9f76a26397ff619f630c5e3d043a7be1a5890
Original-Change-Id: I56c46ee17baee109b9b778982ab35542084cbd69
Original-Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/342364
Original-Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14854
Tested-by: build bot (Jenkins)
Reviewed-by: Duncan Laurie <dlaurie@google.com>
2016-05-18 20:22:38 +02:00
Vadim Bendebury ad6ee02146 rk3399: set proper configuration of SDMMC interface
For proper interface operation the drive strength on all pins is set
to 8 mA and all pull ups/pull downs disabled, this matches the current
kernel configuration.

BRANCH=none
BUG=chrome-os-partner:53257
TEST=it is possible to boot Chrome OS on Gru from various micro SD
     cards which were failing to boot before.

Change-Id: Ie43e52a52cd0513d48d0ecc8ac02fbb100baf9a4
Signed-off-by: Martin Roth <martinroth@google.com>
Original-Commit-Id: 6bb0549ed728ac3c5faab6cbe16e2487400e67ed
Original-Change-Id: I5180537d3ceb74a9a2f7b3982ca94d3e2daf0369
Original-Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/344491
Original-Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/14853
Tested-by: build bot (Jenkins)
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-05-18 20:21:32 +02:00
Vadim Bendebury a9cd4a2f11 rk3399: add GPIO register definitions for SDMMC0
The code needs to be able to set drive strength for the pins used for
SDMMC0 interface. This patch adds the definitions for the two
registers, as per page 378 of the RK3399 TRM Part 1.

Instead of calculation of the reserved range size just use known
offsets of the registers included in the structure.

BRANCH=none
BUG=chrome-os-partner:53257
TEST=with the upcoming driver change it is possible to boot chrome OS
     on Gru from various micro SD cards which were failing before.

Change-Id: I63bf37432ec7f3bdf7e9c6a79d51c31de122dae9
Signed-off-by: Martin Roth <martinroth@google.com>
Original-Commit-Id: c6d6dc5e5e6cc81c173603d4eb21ae803a47815d
Original-Change-Id: Ibe7584e77b446435ab1264dcf8fc8bfe0c50438e
Original-Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/344490
Original-Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/14852
Tested-by: build bot (Jenkins)
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-05-18 20:21:03 +02:00
Vadim Bendebury 2832c4125b gru: set correct gpio for SD card detect
The only outlier at this time is Kevin rev 0, treat it specially, the
rest of the targets use the same GPIO.

BRANCH=none
BUG=none
TEST=gru still boots off SD card just fine

Change-Id: Ic603093a990d27166b16175db3303f155b4775aa
Signed-off-by: Martin Roth <martinroth@google.com>
Original-Commit-Id: 5788c5add1d1f803e7b22fb53215b6003ac04d03
Original-Change-Id: Ic5183f08dd1119f9588f243bd9e9c080d84687f9
Original-Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/344151
Original-Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/14851
Tested-by: build bot (Jenkins)
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-05-18 20:20:30 +02:00
Lin Huang 728fffd33c Gru: support 4GB sdram on gru
now we use 4GB sdram on gru board, enable it.

BRANCH=none
BUG=chrome-os-partner:51537
TEST=boot from kevin board

Change-Id: Icc483a8ba91c5deea85e6e4009a8a132851b1853
Signed-off-by: Martin Roth <martinroth@google.com>
Original-Commit-Id: efa94aee02bedf51d73c91059b06afcbb1320282
Original-Change-Id: I26f77ff4ad9b2aa35ab5ff50f23984796f4f06bc
Original-Signed-off-by: Lin Huang <hl@rock-chips.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/342585
Original-Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Original-Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Original-Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://review.coreboot.org/14850
Tested-by: build bot (Jenkins)
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-05-18 20:20:03 +02:00
Lin Huang 4b9cd535e4 rockchip: rk3399: improve sdram driver
improve rk3399 sdram drvier, so we can support DDR3,
and check the cs training result, so we make sdram
work more stable.

BRANCH=none
BUG=chrome-os-partner:51537
TEST=boot from kevin, do memtester in kernel and pass

Change-Id: I508bf26fb8163bab2d725a91ead929df585e04a7
Signed-off-by: Martin Roth <martinroth@google.com>
Original-Commit-Id: 4d83a87c459167145b7260f9af5c0380caddc056
Original-Change-Id: Id385f1343804a829b6589f89f4cfbb6565d41417
Original-Signed-off-by: Lin Huang <hl@rock-chips.com>
Original-Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/342664
Original-Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/14849
Tested-by: build bot (Jenkins)
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-05-18 20:19:44 +02:00
Shunqian Zheng f4181ce3b3 rockchip: rk3399: add tsadc driver
This patch configures clock for tsadc and then
makes it in automatic mode to generate TSHUT when
CPU temperature is higer than 120 degree Celsius.

BRANCH=none
BUG=chrome-os-partner:52382,chrome-os-partner:51537
TEST=Set a lower tshut threshold(45C), run coreboot and check
     that coreboot reboot again and again.

Change-Id: I0b070a059d2941f12d31fc3002e78ea083e70b13
Signed-off-by: Martin Roth <martinroth@google.com>
Original-Commit-Id: 05107bd6a3430e31db216c247ff0213e12373390
Original-Change-Id: Iffe54d3b09080d0f1ff31e8b3020d69510f07c95
Original-Signed-off-by: Lin Huang <hl@rock-chips.com>
Original-Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/342797
Original-Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Original-Reviewed-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://review.coreboot.org/14848
Tested-by: build bot (Jenkins)
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-05-18 20:19:29 +02:00
Shunqian Zheng 307ca379d1 rockchip: revert the common tsadc header
The tsadc of rk3288 and rk3399 are similar but not enough
to share the same common driver, and we also decide to add a
polarity setting for mainboards on rk3399 tsadc header.
So we'd better split the tsadc header for each SoC.

BRANCH=none
BUG=chrome-os-partner:51537
TEST=build veyron_jerry

Change-Id: I41f08965e6d7ce16da1754d4d2512c826cf8aff5
Signed-off-by: Martin Roth <martinroth@google.com>
Original-Commit-Id: b36ee54c4146623bcacd83fe7d55a4fc78bae792
Original-Change-Id: I629599f9e30d863cabf764e1372c38f0f39d5480
Original-Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/342796
Original-Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Original-Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://review.coreboot.org/14847
Tested-by: build bot (Jenkins)
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-05-18 20:14:39 +02:00
Shunqian Zheng c7f32a5bb4 rockchip: rk3399: add routines to set vop clocks
Let vop aclk sources from CPLL, and vop dclk from NPLL.

The dclk freq is decided by the edid mode pixel_clock which
may require high accuracy like 252750KHz. The pll_para_config()
can calculate the dividers for PLL to output desired clock.

BRANCH=none
BUG=chrome-os-partner:51537
TEST=check display with the other patches

Change-Id: I12cf27d3d1177a8b1c4cfbd7c0be10204e3d3142
Signed-off-by: Martin Roth <martinroth@google.com>
Original-Commit-Id: 0f019b055fffebe9ea3928aae1e25b0ad4feef81
Original-Change-Id: Icef58f87041905961772b69c6b8170d5a866a531
Original-Signed-off-by: Lin Huang <hl@rock-chips.com>
Original-Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/342335
Original-Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Original-Reviewed-by: Vadim Bendebury <vbendeb@google.com>
Reviewed-on: https://review.coreboot.org/14846
Tested-by: build bot (Jenkins)
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-05-18 20:14:21 +02:00
Lee Leahy 2d96be6484 Documentation/Intel: Update the documentation
index.html:
* Separate the sections on the main page
* Move the documentation links to the main page
* Add links for FSP 1.0 and 2.0 specifications
* Add link for UEFI specifications
* Add link to MinnowBoard MAX coreboot

fsp1_1.html:
* Use Integration instead of Documentation

SoC/quark.html:
* Move documentation to main page
* Update build instructions for CorebootPayloadPkg
* Remove FatPkg since it is now part of edk2 tree
* Add source location for QuarkFspPkg
* Add build instructions for QuarkFspPkg

TEST=None

Change-Id: I48bd1bf98a6d8bc43bdd3b4c51dfd119a1e0f61b
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/14882
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-05-18 19:47:16 +02:00
Kyösti Mälkki 08311f5033 AGESA vendorcode: Build a common amdlib
Having CFLAGS with -Os disables -falign-function, for
unlucky builds this may delay entry to ramstage by 600ms.
Build the low-level IO functions aligned with -O2 instead.

Change-Id: Ice6781666a0834f1e8e60a0c93048ac8472f27d9
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/14414
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-18 10:44:43 +02:00
Kyösti Mälkki 82171ea0ff AGESA vendorcode: Move compiler class definition
Change-Id: Ia4cef7d584e43f1911db2f81d8b86ed406b75aad
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/14786
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-05-18 10:44:22 +02:00
Andrey Petrov f87275f821 soc/intel/apollolake: Enable ACPI PM1 timer emulation
Enable emulation for ACPI PM1 timer. This is needed by FSP-M
MemoryInit.

Change-Id: I7a441f5f1673e6430697615ae7251da948e77548
Signed-off-by: Andrey Petrov <andrey.petrov@intel.com>
Reviewed-on: https://review.coreboot.org/14821
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-18 07:06:39 +02:00
Andrey Petrov 664d585882 soc/intel/apollolake: Remove hardcode for TCO watchdog timer
Change-Id: Ie528b0ee3d447dcb819ccb7c0f832885da0f4257
Signed-off-by: Andrey Petrov <andrey.petrov@intel.com>
Reviewed-on: https://review.coreboot.org/14820
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-05-18 07:05:32 +02:00
Andrey Petrov 0e46307574 soc/intel/apollolake: Work around FSP-M CAR layout
As of now FSP-M can not be relocated and it can not be instructed
to use a specific resource for temporary memory. As result coreboot
is forced to use CAR layout dictated by default FSP-M configuration.

Change CAR size to 1MiB, link romstage at such CAR address so it
doesn't overlap with FSP-M's default heap/stack.

Change-Id: I56f78f043099dc835e294dbc081d7506bfad280d
Signed-off-by: Andrey Petrov <andrey.petrov@intel.com>
Reviewed-on: https://review.coreboot.org/14804
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-05-18 07:05:00 +02:00
Andrey Petrov 5ede3d8cce soc/intel/apollolake: Do not use StackBase FSP-M parameter
Currently, StackBase field doesn't work and changing it from default
value leads to crash.

Change-Id: Id3f3ea9a834d0c04a8381938535109d6a729cca2
Signed-off-by: Andrey Petrov <andrey.petrov@intel.com>
Reviewed-on: https://review.coreboot.org/14803
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-18 07:04:36 +02:00
Andrey Petrov 9be1a115f1 drivers/intel/fsp2_0: Add recipes for FSP blobs in CBFS
Add recipes that insert FSP blobs into CBFS and get rid of
CBFS names hardcoding.

Change-Id: I350abeffc4d23e45e339464d036716ecdb2ba83a
Signed-off-by: Andrey Petrov <andrey.petrov@intel.com>
Reviewed-on: https://review.coreboot.org/14818
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
2016-05-18 07:04:10 +02:00
Andrey Petrov 868679fe96 soc/intel/apollolake: Take advantage of common opregion code
Change-Id: I2d16336513bcd5a0544a6b68b609e40dd7c141fb
Signed-off-by: Andrey Petrov <andrey.petrov@intel.com>
Reviewed-on: https://review.coreboot.org/14807
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-18 07:03:44 +02:00