Commit Graph

17531 Commits

Author SHA1 Message Date
Andrey Petrov 842dfe8d63 MAINTAINERS: Add myself for Apollolake SoC, FSP2.0, and Amenia mb
Change-Id: I9931263f0f51d6c726bd7c72042fae1155affb6e
Signed-off-by: Andrey Petrov <andrey.petrov@intel.com>
Reviewed-on: https://review.coreboot.org/14963
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-05-26 23:52:57 +02:00
Jagadish Krishnamoorthy b6b233a6e5 soc/intel/apollolake: enable RTC
BUG=none
TEST=Boot to OS and verfiy if rtc0 device is created
under /sys/class/rtc/

Change-Id: Idec569255859816fda467bb42a215c00f7c0e16e
Signed-off-by: Jagadish Krishnamoorthy <jagadish.krishnamoorthy@intel.com>
Reviewed-on: https://review.coreboot.org/14883
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-26 23:52:25 +02:00
Furquan Shaikh 1ac194e14a cbfstool: Move cbfs_file_get_header to fit.c
Since fit.c is the only caller of this function move it out of common.c
and into fit.c.

Change-Id: I64cc31a6d89ee425c5b07745ea5ca9437e2f3fcf
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/14949
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-05-26 23:51:08 +02:00
Alexandru Gagniuc c4ea8f7d3f drivers/intel/fsp2_0: Send post codes around calls to the blobs
By design, FSP will send POST codes to port 80. In this case we have
both coreboot and FSP pushing post codes, which may make debugging
harder. In order to get a clear picture of where FSP execution begins
and ends, send post codes before and after any call to the FSP blobs.

Note that sending a post code both before and after is mostly useful
on chromeec enabled boards, where the EC console will provide a
historic list of post codes.

Change-Id: Icfd22b4f6d9e91b01138f97efd711d9204028eb1
Signed-off-by: Alexandru Gagniuc <alexandrux.gagniuc@intel.com>
Reviewed-on: https://review.coreboot.org/14951
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-05-26 23:50:02 +02:00
zbao c16918ac11 splash: Put the suffix of splash file to CBFS name
The previous code harded the suffix of splash file as
"jpg". Actually, SeaBIOS supports both jpg and bmp.

Change-Id: I06c4b14aae7f75be3406652a94612b5f30ce91c2
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/14932
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2016-05-26 23:48:02 +02:00
Alexandru Gagniuc 944655dada soc/apollolake: Use simpler macros for the northbridge PCI device
The NB_DEV_ROOT macro, is almost unreadable, as it depends on other
stringified macros, and acts differently depending on the coreboot
stage. For ramstage, it also hides a function call.
Rewrite the macro in terms of more basic and readable macros.

Change-Id: I9b7071d67c8d58926e9b01fadaa239db1120448c
Signed-off-by: Alexandru Gagniuc <alexandrux.gagniuc@intel.com>
Reviewed-on: https://review.coreboot.org/14890
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-26 23:46:59 +02:00
Alexandru Gagniuc bbac5ace53 soc/apollolake/memmap: Switch to SIMPLE_DEVICE API
memmap.c functionality is designed to be used in more than ramstage.
Therefore, it cannot use ramstage-specific APIs. In this case, the
SIMPLE_DEVICE API offers a more consistent behavior across stages.

Change-Id: Ic381fe1eb773fb0a5fb5887eb67d2228d2f0817d
Signed-off-by: Alexandru Gagniuc <alexandrux.gagniuc@intel.com>
Reviewed-on: https://review.coreboot.org/14953
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-26 23:46:25 +02:00
Abhay Kumar 1285598a99 mainboard/intel/amenia: Configure DDI0, DDI1 HPD GPIO lines.
1. Configure GPIO_199 and GPIO_200 as NF2 to work as HPD.
2. Make 20k Pullup and remove duplicate code.

Change-Id: I8c78d867b03d5f2a6f02165c20777ae25e352ce7
Signed-off-by: Abhay Kumar <abhay.kumar@intel.com>
Reviewed-on: https://review.coreboot.org/14899
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-05-26 17:26:23 +02:00
Hannah Williams 988b3fd2ee mainboard/intel/amenia: Disable Integrated Sensor Hub
Providing an option to enable or disable ISH interface. Leaving it
disabled for now.

Change-Id: Id4e71d60a6c2da6c6c070d41f66f6c161de38595
Signed-off-by: Hannah Williams <hannah.williams@intel.com>
Reviewed-on: https://review.coreboot.org/14895
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-26 17:25:13 +02:00
Hannah Williams 483004f6d7 soc/apollolake: Add ish_enable in soc_intel_apollolake_config
Also initialize IshEnable in Silicon Init UPD with the value from
devicetree.cb

Signed-off-by: Hannah Williams <hannah.williams@intel.com>
Change-Id: I8f57a7353471cc3efa21c7011cdd0b369d25275d
Reviewed-on: https://review.coreboot.org/14894
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-05-26 17:23:01 +02:00
Roberto Muñoz Gómez 15a53c6329 superiotool: Add support for chip NCT6102D / NCT6106D
Add support for chip NCT6102D / NCT6106D in superiotool

Change-Id: I689ff8e796f43a5aac144e9898df750407588b1f
Signed-off-by: Roberto Muñoz Gómez <munoz.roberto@gmail.com>
Reviewed-on: https://review.coreboot.org/14206
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins)
2016-05-26 01:05:25 +02:00
Bora Guvendik b2b425b05b intel/amenia: Extend IFD size by 512 KB
Increase BIOS region size by 512KB since device extension size
is reduced from 1MB to 512KB

BUG=chrome-os-partner:52589
TEST=Build Coreboot and boots
CQ-DEPEND=CL:*259448,CL:345642,CL:*259445

Change-Id: Ib81b117a3afe730aafa54b4ef31b1e9ab1f67111
Signed-off-by: Bora Guvendik <bora.guvendik@intel.com>
Reviewed-on: https://review.coreboot.org/14929
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-25 19:36:57 +02:00
Hannah Williams 1cdce27cad soc/apollolake: Enable Wake from USB devices
Change-Id: Ib0b30a5779681488e80000a2570fc2fd4c69e908
Signed-off-by: Hannah Williams <hannah.williams@intel.com>
Reviewed-on: https://review.coreboot.org/14893
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-25 19:10:04 +02:00
Hannah Williams d9c84ca7ef soc/apollolake: SOC specific SMM code
Add SMI handlers that map to SOC specific SMI events
Update relocation_handler in mp_ops

Change-Id: Idefddaf41cf28240f5f8172b00462a7f893889e7
Signed-off-by: Hannah Williams <hannah.williams@intel.com>
Reviewed-on: https://review.coreboot.org/14808
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-25 19:09:21 +02:00
Hannah Williams ba0fc470dd soc/intel/common: Add common smihandler code
Provide default handler for some SMI events. Provide the framework for
extracting data from SMM Save State area for processors with SMM revision
30100 and 30101.
The SOC specific code should initialize southbridge_smi with event
handlers. For SMM Save state handling, SOC code should implement
get_smm_save_state_ops which initializes the SOC specific ops for SMM Save
State handling.

Change-Id: I0aefb6dbb2b1cac5961f9e43f4752b5929235df3
Signed-off-by: Hannah Williams <hannah.williams@intel.com>
Reviewed-on: https://review.coreboot.org/14615
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-25 19:09:00 +02:00
Aaron Durbin e6dcafbc1a vendorcode/google/chromeos/vboot2: use cbmem for postcar region selection
When the vboot cbfs selection runs in postcar stage it should be
utilizing cbmem to locate the vboot selected region.

Change-Id: I027ba19438468bd690d74ae55007393f051fde42
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/14959
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan@google.com>
2016-05-25 18:04:30 +02:00
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