Commit Graph

13698 Commits

Author SHA1 Message Date
Zhao, Lijian 1c6c5836bd Intel/amenia: Make the device address more readable
Use central header file to include device address and interrupt
line to avoid confusion.

Change-Id: I9560031d9f6e12c665c8ae12f7028a67b6c8c904
Signed-off-by: Zhao, Lijian <lijian.zhao@intel.com>
Signed-off-by: Rohit Ainapure <rohit.m.ainapure@intel.com>
Reviewed-on: https://chromium.devtools.intel.com/7248
Tested-by: N, Harshapriya <harshapriya.n@intel.com>
Reviewed-by: Petrov, Andrey <andrey.petrov@intel.com>
Reviewed-on: https://chromium.devtools.intel.com/7580
Reviewed-by: N, Harshapriya <harshapriya.n@intel.com>
Tested-by: Petrov, Andrey <andrey.petrov@intel.com>
Reviewed-on: https://review.coreboot.org/15083
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-08 22:23:53 +02:00
Chris Ching b14693193c adi/rc-dff: Add Initial implementaion
* Add ADI vendor

Copy Intel Mohon Peak mainboard to ADI vendor. No functional changes,
only string and ifdef names changed.

Change-Id: I25a6d0ec549c79a8ff149d39f72648f625dc36fe
Signed-off-by: Chris Ching <chingcodes@google.com>
Reviewed-on: https://review.coreboot.org/14778
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-06-08 18:49:52 +02:00
Jan Tatje b8743080d8 mainboard/lenovo/x220: Clean up code
thermal.h still has references to X230 in include guard since it
seems to have been copied from that port. Code formatting changes
in romstage.c.

Change-Id: Id8bd931bed127036e8bb4ab604d9d6145f767e56
signed-off-by: Jan Tatje <jan@jnt.io>
Reviewed-on: https://review.coreboot.org/15071
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
2016-06-08 18:49:16 +02:00
Jagadish Krishnamoorthy 00f21c7724 mainboard/google/reef: Configure sd card pins
Since the sd card cmd, data, cd lines are configured
as native mode, allow the native controller to control
the termination.
Configure SDCARD_CLK_FB which is used for calibrating the
timing of the actual clock buffer.

BUG==chrome-os-partner:53747
TEST=verify sd card detection

Change-Id: I56611826afb4fb32fefa7f1e4ba19ca4f30ba578
Signed-off-by: Abhay Kumar <abhay.kumar@intel.com>
Signed-off-by: Jagadish Krishnamoorthy <jagadish.krishnamoorthy@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/348377
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/15096
Reviewed-by: Furquan Shaikh <furquan@google.com>
Tested-by: build bot (Jenkins)
2016-06-08 16:11:54 +02:00
Arthur Heymans 7d38fafd96 lenovo/x60: add hda_verb.c
This creates a config for the x60 audio based
on values taken from vendor bios.

The pin config is stored in (for linux 4.5 at least):
/sys/class/sound/card0/hw*/init_pin_configs
In the left column there is the pin number.
In the right column there is the default configuration of that pin.
(This has to be done while running the proprietary bios)

More information on the sound card can be found in:
/proc/asound/card0/codec#*
This also hold the information of /sys/class/sound/

What is improved:
- internal microphone is chosen by default
- when jack is inserted it is chosen instead of internal speaker

Before this had to be done manually in alsa or pulseaudio.

TEST= check if internal microphone is used by default in
pavucontrol if you are using pulseaudio.
Plug in a jack with headphones and check if there
is sound output through these and not the build-in
speaker.

Change-Id: Id3b700fd84905a72cc1f69e7d8bfa6145f231756
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/15063
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-06-08 14:10:32 +02:00
Shaunak Saha f7f1244bc6 intel/amenia: Add asl code to enable google ChromeEC
This patch adds asl code to include support for Google ChromeEC.
We need this to show the battery icon and notifications like charger
connect/disconnect etc.

BUG = 53096
TEST = Plug/Unplug AC Adapter multiple times and make sure the battery
       connected is charging properly.

Change-Id: Id908f145789402573ea54fc4f15cf7a0e651ebf4
Signed-off-by: Shaunak Saha <shaunak.saha@intel.com>
Reviewed-on: https://review.coreboot.org/14987
Tested-by: build bot (Jenkins)
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-06-07 19:39:50 +02:00
Shaunak Saha f6118c62a4 google/reef: Add asl code to enable google ChromeEC
This patch adds asl code to include support for Google ChromeEC.
We need this to show the battery icon and notifications like charger
connect/disconnect etc.

BUG = 53096
TEST = Plug/Unplug AC Adapter multiple times and make sure the battery
       connected is charging properly.

Change-Id: I06f48eda894418514c8ed0136500fff0efd12a35
Signed-off-by: Shaunak Saha <shaunak.saha@intel.com>
Reviewed-on: https://review.coreboot.org/15069
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-06-07 18:31:20 +02:00
jongpil19.jung d841da8512 Kevin/Gru : Update Board ID table.
Add board id table as kevin/gru configuration.

BUG=chrome-os-partner:53519
BRANCH=chromeos-2016.02
TEST=check boot on Kevin board.

Change-Id: I30c16916f3cda0ac88d2ce5a922e936a405fcc89
Signed-off-by: Martin Roth <martinroth@chromium.org>
Original-Commit-Id: 16c7b5486befd73c3e31624970ba1c97e526676f
Original-Change-Id: Ib69ed9dad8e1a9e08717545c6be19a90e0298c43
Original-Signed-off-by: jongpil19.jung <jongpil19.jung@samsung.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/345736
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/15028
Tested-by: build bot (Jenkins)
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
2016-06-07 16:59:07 +02:00
Andrey Petrov e3a8f46c0e soc/intel/apollolake: Add missing DRAM density constants
Add missing constants for DRAM density. This resolves boot issue,
because misconfigured density results in incorrect memory mapping.

Change-Id: I3bad911bf406bfc5677059490d0e89fcbf735b70
Signed-off-by: Andrey Petrov <andrey.petrov@intel.com>
Reviewed-on: https://review.coreboot.org/15059
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
2016-06-07 16:27:17 +02:00
Shunqian Zheng 0d9839b333 rockchip: gru: update the hynix lpddr3 config to run at 928MHz
Update the DDR config and DRAM driver to allow running at up to
928MHz. Kevin config/clock rate are not being changed, but Gru now
runs at 928 MHz.

BRANCH=none
BUG=chrome-os-partner:51537
TEST=booted Kevin and Gru to Linux prompt. Ran stressapptest for 10 min on Gru,

Change-Id: I66c1a171d5c7d05b2878c7bc5eaa0d436c7a1be2
Signed-off-by: Martin Roth <martinroth@chromium.org>
Original-Commit-Id: 8baf0d82816a7ea1c4428e15caeefa2795d001f9
Original-Change-Id: I5e1d6d1025f10203da8f11afc3bbdf95f133c586
Original-Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
Original-Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/343984
Original-Reviewed-by: Stephen Barber <smbarber@chromium.org>
Reviewed-on: https://review.coreboot.org/15027
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan@google.com>
2016-06-07 16:14:05 +02:00
Julius Werner 6724b1b6b4 rk3288: Remove duplicate timestamp_init()
Fix bug introduced by merging http://review.coreboot.org/9606 and
http://review.coreboot.org/10740 in the wrong order.

Change-Id: I75dd22cd0cf30c7d91e4fa5171cb482a80eb64ca
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/15070
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-06-06 21:54:34 +02:00
Paul Menzel 517aa8b065 intel/skylake: Fix typo in comment
Correct the spelling of *firmware* in a comment.

Change-Id: I44bcd95f754ff839d582dc2150e1883a6315da9e
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: https://review.coreboot.org/15078
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-06 21:41:08 +02:00
Kyösti Mälkki 9aba60ed6e pcengines/apu1: Add SMBIOS SKU field
Just the memory size, there is no strap to identify PCB revision.

Change-Id: I65b2f5b0ac6930bead60ea0a551f13a6bcab24c7
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/14997
Tested-by: build bot (Jenkins)
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2016-06-05 10:06:37 +02:00
Hannah Williams 5d9cc7866f soc/apollolake: Put CSE to low power state
fsp_notify(END_OF_FIRMWARE) should be sent to FSP to enable putting CSE
in low power state

Change-Id: I76b8e85ccf077032616ba8e4a333d9264dc65ed2
Signed-off-by: Hannah Williams <hannah.williams@intel.com>
Reviewed-on: https://review.coreboot.org/15054
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-04 23:48:21 +02:00
Alexandru Gagniuc a942bd4952 soc/apollolake/pmc: Store the ACPI bar during set_resources stage
Because the resource for the ACPI BAR is fixed, pci_dev_set_resources
does not store it to the device. This means we need to do part of the
dance to get the ACPI IO region to work after coreboot.

Of course, this BAR can be destroyed later by the OS probing it, but
at least we try to get it working out of coreboot.

Change-Id: Ibff18d30936f94d4f149a89313254531365f43e6
Signed-off-by: Alexandru Gagniuc <alexandrux.gagniuc@intel.com>
Reviewed-on: https://review.coreboot.org/15048
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-04 23:46:44 +02:00
Damien Zammit 68e1dcfdd9 nb/intel/x4x: Fix unpopulated value
Previously, 0x0 was the value being used for an unpopulated dimm
on spd[62], however some DDR2 dimms have 0x0 as a valid value.
Now use 0xff which is an unused value even on DDR2/DDR3.

Change-Id: I55a91a6c3fe3733a7bb2abc45ca352c955c07c99
Signed-off-by: Damien Zammit <damien@zamaudio.com>
Reviewed-on: https://review.coreboot.org/15058
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2016-06-04 23:46:05 +02:00
Kyösti Mälkki 062ef1cca6 AGESA boards: Split dispatcher to romstage and ramstage
The way dispatcher table is set up prevents linker from
optimizing unused code away, we currently have raminit in ramstage.

Optimize this manually by configuring AGESA_ENTRY booleans for
romstage and ramstage separately. This will remove references in
FuncParamsInfo and DispatchTable -arrays.

All boards now include multi-core dispatcher, it has minimal footprint:
  AGESA_ENTRY_LATE_RUN_AP_TASK

ACPI S3 support depends on HAVE_ACPI_RESUME being enabled:
  AGESA_ENTRY_INIT_RESUME
  AGESA_ENTRY_INIT_LATE_RESTORE
  AGESA_ENTRY_INIT_S3SAVE

Disabled for all boards as it was not used:
  AGESA_ENTRY_INIT_GENERAL_SERVICES

Change-Id: I7ec36a5819a8e526cbeb87b04dce4227a1689285
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/14417
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-06-04 23:44:33 +02:00
Arthur Heymans 7afcfe0f9f gm45: enable setting all vram sizes from cmos
Setting the size of the preallocated memory for the igd is done
using a cmos parameter, gfx_uma_size. This was limited to a subset of
all available sizes, that were already implemented elsewhere
in the northbridge code.

What this does is change the cmos parameter to 4 bits instead
of 3 bits to accomodate all vram sizes.
It also adds a sane default of 32mb that already was in place.
The northbridge code that reads this cmos parameter is
also changed for this new cmos settings.

352M is disabled since it causes issues on systems with 4GB or more ram.

TEST: Build, flash target. Clear cmos by corrupting
the checksum (nvramtool -c something).
Set a desired value in gfx_uma_size using nvramtool.
"dmesg | grep stolen" to see what is actually allocated.

Change-Id: Ia6479d03f1abe6d0c94bd7264365505e8f8eaeec
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/14900
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
2016-06-04 23:40:24 +02:00
Kyösti Mälkki 90e63deeba AGESA f12 f15: Add OEM customisation
Follow-up on commits a5d72a3 and 53052fe for f12 and f15.
OEM Hooks are not BiosCallOuts.

Change-Id: Iab22b0d73282a5a1a5d1344397b4430c0ebb81b5
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/14888
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-06-04 11:11:08 +02:00
Kyösti Mälkki 5003632407 AGESA: Fix invalid use of CFG_ declarations
The declarations of CFG_ evaluate to correct values only when
included after the definitions of BLDCFG_ in buildOpts.c.
So we never have CFG_PLAT_NUM_IO_APICS defined here.

Change-Id: I94b3dee5a3207b37921eb24a0bcd73b5a217b2d3
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/14887
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-06-04 11:09:22 +02:00
Kyösti Mälkki 206e157cc1 AGESA: Fix invalid BLDCFG_ and CFG_ use
The definitions of CFG_ would evaluate to incorrect values
when Options.h is included outside buildOpts.c, where all
BLDCFG_ values are defined.

Already done for f16kb.

Change-Id: I5d725b9306027c7c46c6450ab17b692fa948cf5b
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/14886
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2016-06-04 11:08:13 +02:00
Kyösti Mälkki b97dc871d9 AGESA: Drop unused assembly files
Change-Id: I0a452b6234b02222be82ca8694868e1ffbfceaee
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/14396
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2016-06-04 11:03:16 +02:00
Kyösti Mälkki 6de9795143 AGESA: Remove unused platform configuration files
Change-Id: Ie6effa802f6971c59b5c4e07ca7d98736e27859f
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/14885
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2016-06-04 11:02:24 +02:00
Kyösti Mälkki db1b344207 AGESA f10: Pick sample platform configuration
Tree does not have any AGESA f10 boards. Keep the Danube platform
as a sample configuration file for unlikely future use.

Change-Id: I025aff48fcd0884b45e2a0a993d82f317ede48be
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/14884
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2016-06-04 11:02:06 +02:00
Kyösti Mälkki 11f3443db6 AMD boards: Drop comment on include file
The included file does not declare pm_ioread(), and the
modified file does not call it either.

Change-Id: I9723caf1062db23b4a3648e07c2dc4c02f862619
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/14968
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-06-03 20:12:30 +02:00
Kyösti Mälkki b62c5e8949 aopen/dxplplusu: Disable HW scrubber
See initialize_ecc() for the awful hack that got us around cache-as-ram
being invalidated as we do ECC HW scrubbing. It once worked, but
compiler nowadays puts more registers on the stack.

Not much interest to try fix ECC for this particular board.

Change-Id: Ie6a09e28b0af5bbf2d68af72f5d98c03df33c402
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/15014
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2016-06-03 20:10:00 +02:00
Lin Huang b497b48027 rockchip: gru: enable eDP display
This patch enables eDP display by:
o. setting HPD pinmux, backlight, vdd for eDP
o. setting vop mode
o. enabling VGA configs for edid

BRANCH=none
BUG=chrome-os-partner:51537
TEST=The dev screen is shown on kevin board

Change-Id: If8b07307454daa88727d317cc208d6c97de07ad7
Signed-off-by: Martin Roth <martinroth@google.com>
Original-Commit-Id: b1ad9337510f5437f691153dc68883edf273e4c7
Original-Change-Id: Id7006619b5be638b286a5402d892a5361ac1e430
Original-Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/340026
Original-Reviewed-by: Shunqian Zheng <zhengsq@rock-chips.com>
Reviewed-on: https://review.coreboot.org/14858
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan@google.com>
2016-06-03 18:08:27 +02:00
Shunqian Zheng d1cec75ce8 rockchip: rk3399: initialize display for eDP
This patch adds functions to init the display. To set up the display,
initialize the eDP and read the EDID.  Based on these, we then
set the clock for VOP, and finally enable VOP and backlight.

For a mainboard, it should set the vop_id, vop_mode and
framebuffer_bits_per_pixel in devicetree.cb.

For VOP_MODE_AUTO_DETECT, it will try eDP first and then
HDMI (which is not supported yet).

EDIT: Updated Makefile to only build in new files if
MAINBOARD_DO_NATIVE_VGA_INIT is enabled. All of these
platforms should have it enabled, so this shouldn't make
any difference except now, before the platform code is
in place.

BRANCH=none
BUG=chrome-os-partner:51537
TEST=test with the other patch

Change-Id: If935415026c945ab6ee128bd6bbdd792890aa24a
Signed-off-by: Martin Roth <martinroth@google.com>
Original-Commit-Id: c1020cc806775629f4d5dc57bd805a9a12169386
Original-Change-Id: Ic32d0a251cb8e08aa5f0b15b2c06c4e02c08a761
Original-Signed-off-by: Lin Huang <hl@rock-chips.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/342336
Original-Commit-Ready: Vadim Bendebury <vbendeb@chromium.org>
Original-Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Original-Reviewed-by: Shunqian Zheng <zhengsq@rock-chips.com>
Original-Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://review.coreboot.org/14857
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan@google.com>
2016-06-03 18:08:10 +02:00
Lee Leahy e747b7473e drivers/intel/fsp1_1: Make weak routines quiet
Now that there is a better way of finding optional routines, make the
weak routines quiet so that it may be used for the optional
implementation.

TEST=Build and run on Galileo Gen2

Change-Id: Ic58c7de216394f80aee3a78dd08bd4682783be42
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/15043
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-03 17:30:34 +02:00
Lee Leahy 287cd7563e mainboard/intel/galileo: Add CREATE_BOARD_CHECKLIST
Select CREATE_BOARD_CHECKLIST to create the checklist for the Quark SOC
and Galileo board.

TEST=Build and run on Galileo Gen2.

Change-Id: Ieb3e9a5a4c149cf160e11d44a515591b57fe5c83
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/15004
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-06-03 17:30:05 +02:00
Lee Leahy fc3741f379 Add Board Checklist Support
Build the <board>_checklist.html file which contains a checklist table
for each stage of coreboot.  This processing builds a set of implemented
(done) routines which are marked green in the table.  The remaining
required routines (work-to-do) are marked red in the table and the
optional routines are marked yellow in the table.  The table heading
for each stage contains a completion percentage in terms of count of
routines (done .vs. required).

Add some Kconfig values:
*  CREATE_BOARD_CHECKLIST - When selected creates the checklist file
*  MAKE_CHECKLIST_PUBLIC - Copies the checklist file into the
   Documenation directory
*  CHECKLIST_DATA_FILE_LOCATION - Location of the checklist data files:
   *  <stage>_complete.dat - Lists all of the weak routines
   *  <stage>_optional.dat - Lists weak routines which may be optionally
      implemented

TEST=Build with Galileo Gen2.

Change-Id: Ie056f8bb6d45ff7f3bc6390b5630b5063f54c527
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/15011
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-06-03 17:29:13 +02:00
Lee Leahy eb0e7bc976 mainboard/intel/galileo: Set board version
Return the correct board version in SMBIOS.

TEST=Build and run on Galileo Gen2

Change-Id: I97ec7bcd475142eb90930152da0244a3c5d09634
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/15041
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-06-03 17:28:23 +02:00
Julius Werner 8e97d00755 chromeec: Move EC image hash to separate file in CBFS
The Chrome OS bootloader is changing its EC software sync mechanism to
look for the hash of an EC image in a separate CBFS file, rather than
using the CBFS hash attribute of the image itself (see
http://crosreview.com/348061). This patch makes coreboot generate
appropriate hash files for the new format when it builds and bundles a
Chrome EC image. This also allows us to compress the EC image itself.

Change-Id: I9aee6b8d24cdf41cb540db86a7569038fc7d9937
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/15039
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-03 17:24:26 +02:00
Kyösti Mälkki 3fa4350d6a AGESA boards: Drop unused include
These files do not use definitions from OptionsIds.h. Also those
definitions are required and already included for Ids.h.

Change-Id: I149fcfe2ad72fe3d7390ee2043a86432aeae3f08
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/14980
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-06-03 04:57:37 +02:00
Ben Gardner 44bb9bdec8 intel/fsp_baytrail/i2c: mask i2c interrupts in i2c_init()
i2c_init() leaves the I2C device enabled. Combined with the default
interrupt mask (0x8ff) and the fact that the interrupt line is shared,
this leads to an interrupt storm in the OS until a proper I2C driver
is loaded.

This change clears the interrupt mask to prevent the interrupt storm.

Change-Id: I0424a00753d06e26639750f065a7a08a710bfaba
Signed-off-by: Ben Gardner <gardner.ben@gmail.com>
Reviewed-on: https://review.coreboot.org/15047
Tested-by: build bot (Jenkins)
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
2016-06-03 04:54:32 +02:00
Furquan Shaikh e3a692d7da intel/apollolake: Clear TSEG reg early in bootblock
TSEG register comes out of reset with a non-zero default value. This
causes issues when cbmem_top returns non-zero value based on TSEG read
before DRAM is initialized. Thus, clear TSEG reg early in bootblock to
avoid unwanted side-effects.

Change-Id: Id3c6c270774108e4caf56e2a07c5072edc65bb58
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/15049
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
2016-06-03 04:53:58 +02:00
Furquan Shaikh b54a2d1d76 intel/apollolake: Add car.c to verstage
Verstage on apollolake requires the functions defined in car.c to
perform flush of l1d to l2 on loading romstage into CAR.

Change-Id: I6d9a0b9dfb58c2126ad70172846e90663e588857
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/15046
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-02 17:22:01 +02:00
Furquan Shaikh d5583a5e61 cbfs: Use NO_XIP_EARLY_STAGES to decide if stage is XIP
Modern platforms like Apollolake do not use XIP for early stages. In
such cases, cbfs_prog_stage_load should check for NO_XIP_EARLY_STAGES
instead of relying on ARCH_X86 to decide if a stage is XIP.

Change-Id: I1729ce82b5f678ce8c37256090fcf353cc22b1ec
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/15045
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-02 17:21:39 +02:00
Furquan Shaikh ab90f96ba5 google/reef: Select UART_FOR_CONSOLE for reef
Change-Id: I714af8ab552dc1923a1b64e0c502d6c7b96dd444
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/15044
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-02 17:21:17 +02:00
Iru Cai 0bca3c914e lenovo/t420: correct the eSATA port
The eSATA port of Lenovo T420 is port 3. I've checked it on an iGPU
model and a dGPU model.

Change-Id: I64bcc887140c1634dd1475d29e97780a5128d0be
Signed-off-by: Iru Cai <mytbk920423@gmail.com>
Reviewed-on: https://review.coreboot.org/14632
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Nicolas Reinecke <nr@das-labor.org>
2016-06-02 17:20:29 +02:00
Lee Leahy d52f2580e7 drivers/intel/fsp1_1: Update weak MRC cache routines
Update the weak functions for the MRC cache.

TEST=Build and run on Galileo Gen2

Change-Id: I54a1252cfff1a2f68b163f0feb65e2bceb37f6a9
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/15042
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-02 17:15:41 +02:00
Kyösti Mälkki c5b758bec8 SMBIOS: Implement SKU field
Leave it for the platform to fill in the string.

Change-Id: I7b4fe585f8d1efc8c9743f0d8b38de1f98124aab
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/14996
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@googlemail.com>
2016-06-02 06:24:24 +02:00
Duncan Laurie 7db15094c2 generic: Add a Maxim 98357A codec driver
The Maxim Integrated 98357A codec is an I2S slave device that has no
control channel for configuration and instead provides a GPIO that is
used for channel selection and power down.  This means it does not fit
into a bus hierarchy easily and is instead represented as a generic
device and found with a static bus scan using the devicetree.

This driver provides configuration options for passing the "sdmode" GPIO
descriptor as well as a second option for "sdmode delay" which can
configure the timing of the sdmode toggling in relation to the I2S
channel output.

In addition an GPIO can be provided to indicate to the driver whether
this device is present or not.  This can be used for board designs that
may have different codec possibilities that are selected by HW strap.

Sample usage for this device driver:

device pci 1f.3 on
  chip drivers/generic/max98357a
    register "sdmode_gpio" = "ACPI_GPIO_OUTPUT(GPP_C6)"
    register "sdmode_delay" = "100"
    device generic 0 on end
  end
end

Will result in the following code in the SSDT:

Scope (\_SB.PCI0.HDAS) {
  Device (MAXM) {
    Name (_HID, "MX98357A")
    Name (_UID, Zero)
    Name (_DDN, "Maxim Integrated 98357A Amplifier")
    Method (_STA) { Return (0xF) }
    Name (_CRS, ResourceTemplate () {
      GpioIo (Exclusive, PullDefault, 0, 0, IoRestrictionOutputOnly,
              "\\_SB.PCI0.GPIO", 0, ResourceConsumer)
    })
    Name (_DSD, Package () {
      ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
      Package () {
        Package () { "maxim,sdmode-gpio", \_SB.PCI0.HDAS.MAXM, 0, 0, 0 }
        Package () { "maxim,sdmode-delay", 100 }
        Package () { "sdmode-delay", 100 }
      }
    })
  }
}

Change-Id: Ia0bafe49bea9bbe4a3cc0f9f9cdb6f6390da57b5
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/15017
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-02 05:37:07 +02:00
Duncan Laurie 21a097aedc i2c: Add a generic i2c driver
This adds a generic I2C driver that can be described in the devicetree
and used to generate ACPI objects in the SSDT based on the information
provided in the config registers.

The I2C bus can be configured and the device can provide an interrupt and
wake capability to the OS.  A configuration option allows for a GPIO to
be provided that will be checked to determine if the device is preset on
the board before including it in the generated SSDT.

The driver is generic enough to be used for basic I2C devices that do
not have special configuration needs such as touchpads, touchscreens,
sensors, some audio codec/amplifiers, etc.

Sample usage for a touchpad device:

device pci 15.1 on
  chip drivers/i2c/generic
    register "hid" = ""ELAN0000""
    register "desc" = "ELAN Touchpad"
    register "irq" = "IRQ_EDGE_LOW(GPP_B3_IRQ)"
    register "wake" = "GPE0_DW0_05"
    device i2c 15.0 on end
  end
end

Will result in the following code in the SSDT:

Scope (\_SB.PCI0.I2C1) {
  Device (D015) {
    Name (_HID, "ELAN0000")
    Name (_UID, 0)
    Name (_S0W, 4)
    Name (_PRW, Package () { 5, 3 })
    Method (_STA) { Return (0x0f) }
    Name (_CRS, ResourceTemplate () {
      I2cSerialBus (0x15, ControllerInitiated, 400000, AddressingMode7Bit,
                    "\\_S.PCI0.I2C1", 0, ResourceConsumer)
      Interrupt (ResourceConsumer, Edge, ActiveLow) { 51 }
    })
  }
}

Change-Id: Ib32055720835b70e91ede5e4028ecd91894d70d5
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/15016
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-02 05:36:41 +02:00
Duncan Laurie 5c026445f0 drivers/intel/wifi: Add support for generating SSDT table
Intel WiFi devices that support wake-on-wifi need to declare a Power
Resource for this wake pin.  Typically this has been done with a
static declaration in the DSDT for each mainboard.  By adding it to
the existing intel/wifi driver it can be done based on a
configuration register in the devicetree.

Additionally the WiFi regulatory domain can be set in the SSDT
directly instead of needing to use NVS to pass the value to the DSDT.

Also add device IDs for Wilkins Peak 2 and Stone Peak 2 devices that
are found on Chromebooks, and clean up a long line and some comment
formatting.

This was tested by booting on an HP Chromebook 13 device and comparing
that the output in the SSDT matches what used to be in the DSDT.  The
WRDD value is read from VPD, if present, not from devicetree.cb.

Additionally the case where CONFIG_DRIVERS_INTEL_WIFI is enabled but
the wifi device is not described in devicetree.cb is tested to ensure
it still generates the AML but does not include the _PRW wake pin.

Example:

devicetree.cb:
  device pci 1c.0 on
    chip drivers/intel/wifi
      register "wake" = "GPE0_DW0_16"
      device pci 00.0 on end
    end
  end

VPD:
  "region"="us"

SSDT.dsl:
  Scope (\_SB.PCI0.RP01) {
    Device (WIFI) {
      Name (_UID, Zero)
      Name (_DDN, "Intel WiFi")
      Name (_ADR, 0x00000000)
      Name (_PRW, Package () { 16, 3 })
      Name (WRDD, Package () {
        Zero,
        Package () {
          0x00000007,
          0x00004150
        }
      })
    }
  }

Change-Id: I8b5c916f1a04742507dc1ecc9a20c19d3822b18c
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/15019
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-02 05:36:08 +02:00
Duncan Laurie 9fed935f5a wrdd: Export WRDD info in the header
Export the WRDD spec revision and WiFi domain type in the header
file so it can be used to generate ACPI tables by wifi drivers.

Change-Id: I3222eca723c52fe74a004aa7bac7167264249fd1
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/15018
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-02 05:34:17 +02:00
Kan Yan 1bfcc843ff Gale board: Move TPM setup function to verstage.c
TPM should be only be reset once in verstage.

BUG=chrome-os-partner:51096
TEST=Depthcharge no longer shows TPM error.
BRANCH=None

Original-Signed-off-by: Kan Yan <kyan@google.com>
Original-Commit-Id: 911bdaa83a05fa5c8ea82656be0ddc74e19064c3
Original-Change-Id: I52ee6f2c2953e95d617d16f75c8831ecf4f014f9
Original-Reviewed-on: https://chromium-review.googlesource.com/343537
Original-Commit-Ready: Kan Yan <kyan@google.com>
Original-Tested-by: Kan Yan <kyan@google.com>
Original-Reviewed-by: David Hendricks <dhendrix@chromium.org>
Change-Id: I8047b7ba44c604d97a662dbf400efc9eea2c7719
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/14845
Tested-by: build bot (Jenkins)
Reviewed-by: David Hendricks <dhendrix@chromium.org>
2016-06-02 00:19:11 +02:00
Patrick Rudolph 830fdc77cb mb/lenovo/T4xx: enable PEG device
Enable the PEG device in devicetree to expose the
device if any. This is already default behaviour
for T5xx series.

Change-Id: I16bd253ca96c4cdaad8a829f6490cec9e2599b5f
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-on: https://review.coreboot.org/14448
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@googlemail.com>
2016-06-01 23:22:19 +02:00
Patrick Rudolph 5919ba42ed drivers/lenovo: Add hybrid graphics driver
Add a universal hybrid graphics driver compatible with
all supported lenovo devices.
Hybrid graphics allows to connect the display panel to
either of one GPUs.
As there are only two GPUs one GPIO needs to be toggled.
In case the discrete GPU is activated the panel is routed to it.
On deactivation the panel is routed to the integrated
GPU.
On lenovo laptops the dGPU is always connected to PEG10 and it is
save to disable the PEG slot on dGPU deactivation.

Use common gpio.c for southbridge I82801IX.

Tested on Lenovo T520 using Nvidia NVS 5200m.

Removed Lenovo T430s from the list of supported devices,
as the T430s only supports "muxless Optimus".

Depends on change id:
Iccc6d254bafb927b6470704cec7c9dd7528e2c68
Ibb54c03fd83a529d1ceccfb2c33190e7d42224d8
I8bd981c4696c174152cf41caefa6c083650d283a
Iaf0c2f941f2625a5547f9cba79da1b173da6f295
I994114734fa931926c34ed04305cddfbeb429b62

Change-Id: I9b80b31a7749bdf893ed3b772a6505c9f29a56d1
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-on: https://review.coreboot.org/12896
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@googlemail.com>
2016-06-01 23:22:01 +02:00
Patrick Rudolph 14d1a93e44 Revert "mainboard/lenovo/t400: Add initial hybrid graphics support"
This reverts commit 59597ead1f.
Will be replaced by lenovo common hybrid driver.

Change-Id: I994114734fa931926c34ed04305cddfbeb429b62
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-on: https://review.coreboot.org/12895
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@googlemail.com>
2016-06-01 23:06:49 +02:00
Duncan Laurie 7522dc3c07 nau8825: Add driver for I2C codec
The Nuvoton NAU8825 audio codec is an I2C device that has a number of
tunable parameters that can be provided to the kernel device driver for
basic configuration and optimal operation.

The configuration options are exposed to devicetree as registers and then
presented as Device Properties via ACPI to the operation system.

This sample configuration in devicetree:

device pci 19.2 on
  chip drivers/i2c/nau8825
    register "irq" = "IRQ_LEVEL_LOW(GPP_F10_IRQ)"
    register "jkdet_enable" = "1"
    register "sar_threshold_num" = "2"
    register "sar_threshold[0]" = "0x0c"
    register "sar_threshold[1]" = "0x1c"
    device i2c 1a on end
  end
end

Will generate the following code in the SSDT, trimmed for this commit
message as there are more properties that can be configured:

Scope (\_SB.PCI0.I2C4)
{
  Name (_HID, "10508825")
  Name (_UID, Zero)
  Name (_DDN, "Nuvoton NAU8825 Codec")
  Method (_STA) { Return (0xF) }
  Name (_CRS, ResourceTemplate () {
    I2cSerialBus (0x1A, ControllerInitiated, 0x61A80, AddressingMode7Bit,
                  "\_SB.PCI0.I2C4", 0, ResourceConsumer)
    Interrupt (ResourceConsumer, Level, ActiveLow) { 0x3A }
  })
  Name (_DSD, Package () {
    ToUUID ("daffd814-6eba-4d8c-8a91-bc9bff4aa301"),
    Package () {
      Package () { "nuvoton,jkdet-enable", 1 },
      Package () { "nuvoton,sar-threshold-num", 2 },
      Package () { "nuvoton,sar-threshold", Package () { 0x0c, 0x1c } }
    }
  })
}

Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Change-Id: I480d72daf5ac3dded9b1cbb5fbc737b9dfde3834
Reviewed-on: https://review.coreboot.org/15015
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-01 22:28:29 +02:00
Hannah Williams 16f3d3d35f intel/fsp2.0: Add END_OF_FIRMWARE in enum fsp_notify_phase
Change-Id: Ib39e828c6e3145957ecc2dacc1f72de793165514
Signed-off-by: Hannah Williams <hannah.williams@intel.com>
Reviewed-on: https://review.coreboot.org/15020
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-01 22:27:54 +02:00
Hannah Williams 85e3c77226 soc/apollolake: remove _RMV and _DSW methods from xhci.asl
Change-Id: Ic314656f34fda10e58e55bdefeb0a1f0c6ab5ae2
Signed-off-by: Hannah Williams <hannah.williams@intel.com>
Reviewed-on: https://review.coreboot.org/14966
Tested-by: build bot (Jenkins)
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-06-01 22:27:05 +02:00
Shaunak Saha d6463dd42c intel/apollolake: Add support to enable google ChromeEC
ChromeEC is needed for EC controlled features to work properly.
This patch adds neccessary support in soc/intel so that mainboard
asl files can include the ChromeEC e.g. PNOT method and
LPCB and also the nvs fields.

BUG = 53096
TEST = This patch is needed by the mainboard specific ASL change to include
       src/ec/google/chromeec/acpi/ec.asl

Change-Id: Icecc437df05cd3efb41579317a353fd22526e0c9
Signed-off-by: Shaunak Saha <shaunak.saha@intel.com>
Reviewed-on: https://review.coreboot.org/14967
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-01 22:26:21 +02:00
Furquan Shaikh 7043bf353a soc/intel/apollolake: add support for IFWI region
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. This region is referred to as the IFWI. Add support for writing
the IFWI to a specified FMAP region to accommodate such platforms.

Change-Id: Ia61f12a77893c3dd3256a9bd4e0f5eca0065de26
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/14999
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-01 21:17:20 +02:00
Furquan Shaikh 989842c972 mainboard/google/reef: Add IFWI region to chromeos.fmd
IFWI region holds different components required for booting including
CSE firmware, PMC firmware, CPU microcode as well as the bootblock. Add
section for IFWI in chromeos.fmd

Change-Id: Ic97980ff222ad7cbd7a2970417b79150256a7a16
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/15000
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-01 17:17:15 +02:00
Lee Leahy bc518d5cab quark: Enable HSUART0 as console
The use of HSUART0 on galileo requires early initialization of the I2C
GPIO expanders to direct the RXD and TXD signals to DIGITAL 0 and 1
on the expansion connector.

TEST=None

Change-Id: I11195d79e954c1f6bc91eafe257d7ddc1310b2e7
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/15010
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-05-31 22:11:51 +02:00
Lee Leahy ac78db3a53 soc/intel/quark: Move UART init into romstage.c
Move UART initialization into romstage.c and eliminate uart.c.

TEST=Build and run on Galileo Gen2

Change-Id: I5f2c9b4c566008000c2201c422a0bba63da64487
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/15009
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-05-31 22:10:56 +02:00
Lee Leahy fd91dee420 mainboard/intel/quark: Enable reg_access during romstage
Turn on reg_access during romstage.

TEST=Build and run on Galileo Gen2

Change-Id: Iff1616836d6031f43d7741693febefa0bf26b948
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/15008
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-05-31 22:10:03 +02:00
Lee Leahy a5258cba6f soc/intel/quark: Split I2C out from driver
Split out the I2C code to allow I2C transactions during early romstage.

TEST=Build and run on Galileo Gen2

Change-Id: I87ceb0a8cf660e4337738b3bcde9d4fdeae0159d
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/15007
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-05-31 22:07:49 +02:00
Lee Leahy 56c99f2850 soc/intel/quark: Set temporary I2C base address
Set a temporary I2C base address during romstage.

TEST=Build and run on Galileo Gen2

Change-Id: I4b427c66a4e7e6d30cc611d4d3c40bb0ea36066d
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/15006
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-05-31 22:03:39 +02:00
Lee Leahy ca65bb7b4e mainboard/intel/galileo: Use HSUART1 for console
Select HSUART1 for console.

TEST=Build and run on Galileo Gen2

Change-Id: I4425af4dc8b3730b3fa2108d6cc2941bc22c2cdb
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/15005
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-05-31 22:02:52 +02:00
Lee Leahy d5493683ea soc/intel/quark: Conditionally define BIT names
Only define BIT names if they are not already defined.

TEST=Build and run on Galileo Gen2

Change-Id: Ief4c4bb7a42a1bb2a7f46f13dc9b8bbb4d233e3c
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/15002
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-05-31 22:01:27 +02:00
Lee Leahy 5e808cb811 mainboard/intel/galileo: Split out enabling FSP1_1
Split out enabling FSP 1.1 support to prepare for enabling FSP 2.0
support.

TEST=Build and run on Galileo Gen2.

Change-Id: Ic4e814bcf61f9480f98e2d7bc7a1648dec43a07d
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/15001
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-05-31 22:00:30 +02:00
Lee Leahy 6b24dfce74 soc/intel/quark: Fix reg_script display
Remove extra ": " following reigster type.

TEST=Build and run on Galileo Gen2

Change-Id: I57dd40a540d7b5371a6c45174f47a311b83a2aab
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/14948
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-05-31 21:59:47 +02:00
Lee Leahy 7f4b053980 soc/intel/quark: Clear SMI interrupts and wake events
Migrate the clearing of the SMI interrupts and wake events from FSP into
coreboot.

TEST=Build and run on Galileo Gen2

Change-Id: Ia369801da87a16bc00fb2c05475831ebe8a315f8
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/14945
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-05-31 21:57:55 +02:00
Lee Leahy 773ee2bb17 soc/intel/quark: Rename pmc.c to lpc.c
Rename the file pmc.c to lpc.c to prepare for further additions.

TEST=Build and run on Galileo Gen2

Change-Id: If98825d72878f0601f77bff8c766276dbda8a9ae
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/14946
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-05-31 21:56:08 +02:00
Lee Leahy 5ef051a53a soc/intel/quark: Add PCIe reset support
Migrate PCIe reset from PlatformPciHelperLib in QuarkFspPkg into
coreboot.

Change-Id: I1c33fa16b0323091e8f9bd503bbfdb8a253a76d4
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/14944
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-05-31 21:50:31 +02:00
Matt DeVillier a87fcabd2e google/ninja: Upstream AOpen Chromebox Commerical
Migrate google/ninja (AOpen Chromebox Commerical) from Chromium tree to
upstream, using google/rambi as a reference.

original source:
branch firmware-ninja-5216.383.B
commit 582a393 [Ninja, Sumo: Add SPD source for Hynix H5TC4G63CFR-PBA]

TEST=built and booted Linux on ninja with full functionality

blobs required for working image:
VGA BIOS (vgabios.bin)
firmware descriptor (ifd.bin)
Intel ME firmware (me.bin)
MRC (mrc.elf)
external reference code (refcode.elf)

Change-Id: I0f1892c24c08fa2d53185b2cf8b6f5a9001b2397
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/14950
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-31 21:15:27 +02:00
Jonathan Neuschäfer 4acb0e7742 commonlib/lz4: Avoid unaligned memory access on RISC-V
From the User-Level ISA Specification v2.0:

   "We do not mandate atomicity for misaligned accesses so simple
    implementations can just use a machine trap and software handler to
    handle misaligned accesses." (— http://riscv.org/specifications/)

Spike traps on unaligned accesses.

Change-Id: Ia57786916f4076cc08513f4e331c2deec9cfa785
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/14983
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-31 21:07:03 +02:00
Jonathan Neuschäfer 0a54fb533d lib/hardwaremain: Add \n to "Boot failed" message
Change-Id: I106fccd725a5c944f4e8e0f196b31c9344f588c7
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/14984
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-31 20:20:44 +02:00
Andrey Petrov 204af8157d soc/intel/apollolake: Update SPI memory mapping constraints
MMIO region of 256 KiB under 4 GiB is not decoded by SPI controller
by hardware design. Current code incorrectly specifies size of that
region to be 128 KiB. This change corrects the value to 256 KiB.

Change-Id: Idcc67eb3565b800d835e75c0b765dd49d1656938
Signed-off-by: Andrey Petrov <andrey.petrov@intel.com>
Reviewed-on: https://review.coreboot.org/14979
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
2016-05-31 20:06:29 +02:00
Damien Zammit b28a411362 mb/gigabyte/ga-g41m-es2l: Update board_info.txt and add item to Kconfig
This adds the website URL to the board info and also enables
the realtek nic reset function as per a previous patch.

Change-Id: I2cda120c59b55f0dd2ffa78d397b16beb13d6843
Signed-off-by: Damien Zammit <damien@zamaudio.com>
Reviewed-on: https://review.coreboot.org/14954
Tested-by: build bot (Jenkins)
Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-by: Martin Roth <martinroth@google.com>
2016-05-31 20:04:14 +02:00
Damien Zammit e983f0cb4b drivers/net/r8168: Add driver for realtek nic
One thing that is vital to this patch is the MAC address setting
in case the EEPROM/efuse is unconfigured.
Linux now recognises the default MAC address on GA-G41M-ES2L which
does rely on the default bios settings for the MAC address.

Change-Id: I32e070b545b4c6369686a7087b7ff838d00764e3
Signed-off-by: Damien Zammit <damien@zamaudio.com>
Reviewed-on: https://review.coreboot.org/14927
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-05-31 20:03:39 +02:00
Damien Zammit 2abd3f9e1c mb/gigabyte/ga-g41m-es2l: Use x4x_late_init()
This patch adds DMI/EP init to the board and fixes
a couple of minor things.

Change-Id: I10d0f6ce747b60499680e4dc229b7fcbb16cc039
Signed-off-by: Damien Zammit <damien@zamaudio.com>
Reviewed-on: https://review.coreboot.org/14926
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-05-31 20:02:55 +02:00
Damien Zammit a090ae04c2 nb/intel/x4x: Add DMI/EP init
The values were obtained from vendor bios at runtime.
I am not 100% sure of the sequence required to initiate them,
but guessed from the gm45 code.  There may be some status bytes
needed to be polled during the sequence that is missing,
but as I don't have bios writer's datasheet it's very hard
for me to know.

Change-Id: Idd205e0bab5f75e01c6e3a5dc320c08639f52db8
Signed-off-by: Damien Zammit <damien@zamaudio.com>
Reviewed-on: https://review.coreboot.org/14925
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-05-31 20:02:09 +02:00
Damien Zammit 2b2f465fcb mb/gigabyte/ga-g41m-es2l: Fix ACPI IRQ settings for SATA
Previously, due to a bug in devicetree and incorrect IRQ
settings in ACPI, SATA controller would not initialize
any HDDs in the OS, even though it worked in SeaBIOS.
The devicetree setting is not needed because SATA must
function in "plain" mode on this board, as "combined" mode
does not work at all.

Change-Id: I0036c4734de00b84cc3d64f38e4b1fd80fd1a25d
Signed-off-by: Damien Zammit <damien@zamaudio.com>
Reviewed-on: https://review.coreboot.org/14776
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-05-31 20:01:41 +02:00
Duncan Laurie b25a45ca46 skylake: Add SD card device to configure card detect GPIO
Add a PCI driver for the skylake SD card device and have it generate
an entry in the SSDT for the card detect GPIO if it is provided by the
mainboard in devicetree.

This sets up a card detect GPIO configuration that will trigger an
interrupt on both edges with a 100ms debounce timeout and can wake the
SD controller from D3 state.

The GpioInt() entry is bound to the "cd-gpio" device property which will
be consumed by the kernel driver.

The resulting ACPI output in the SSDT will be combined with the SDXC
device declaration in the DSDT.

Example:

Scope (\_SB.PCI0.SDXC)
{
  Name (_CRS, ResourceTemplate () {
    GpioInt (Edge, ActiveBoth, SharedAndWake, PullNone, 10000,
             "\\_SB.PCI0.GPIO", 0, ResourceConsumer) { 35 }
  })
  Name (_DSD, Package () {
    ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
    Package () {
      Package () { "cd-gpio", Package () { \_SB.PCI0.SDXC, 0, 0, 1 } }
    }
  })
}

Change-Id: Ie4c1bfadd962cf55a987edb9ef86e92174205770
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14995
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-31 18:46:39 +02:00
Duncan Laurie 98d69c0627 skylake: Cleanup formatting in pci_devs.h
Minor cleanups in pci_devs.h for indentation and newlines to be
consistent throughout the file.

Change-Id: I522df141a6b33d918cfb3de1b9019c0c4a73e3e5
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14994
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-31 18:45:40 +02:00
Duncan Laurie 026003e621 skylake: Add Audio DSP device
Add the Audio DSP device for skylake as a PCI driver with a static
scan_bus handler so generic devices can be declared under it.

This is for devices like the Maxim 98357A which is connected on the
I2S bus for data but has no control channel bus and instead just has
a GPIO for channel selection and power down control and needs to
describe that GPIO connection to the OS via ACPI.

Change-Id: Iae02132ff9c510562483108ab280323f78873afd
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14993
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-31 18:45:15 +02:00
Duncan Laurie 0d8bb7427b skylake: Add I2C devices
Add the I2C devices to skylake with the scan_bus handler for SMBUS
devices so that I2C-based devices can be declared in devicetree.cb
and get initialized properly during ramstage.

This does not yet provide the I2C driver, but it allows for devices
that are declared in devicetree.cb to provide ACPI tables to the OS.

Change-Id: I9dfe4a06a8b0bc549a2b0e2d7c033c895188ba30
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14992
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-31 18:43:55 +02:00
Duncan Laurie 011533e4c3 skylake: Add GPE header file to chip.h
Add the GPE header file to skylake chip.h so the SOC-defined macros
for the various GPE values can be used in devicetree directly.

For example:
  chip drivers/i2c/touchpad
    register "wake" = "GPE0_DW0_05"
    device i2c 15.0 on end
  end

Change-Id: Ic322108561b34aa34a24a4daba6ba7a4f7a3f9a4
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14991
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-31 18:43:39 +02:00
Kyösti Mälkki 8f3aaa8a4c Fix leaking CONFIG_VGA=y
Items under DEVICE_SPECIFIC_OPTIONS got selected without
the driver being selected.

Change-Id: I1797fa6175620a9291873559a6308eaea85a090e
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/14823
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-31 17:18:59 +02:00
Timothy Pearson ca543396a7 mainboard/asus/[kgpe-d16|kcma-d8]: Enable secondary serial port header
The ASUS KGPE-D16/KCMA-D8 have an on-board header for a second RS-232
serial port, however it is disabled by default due to the SuperIO
default pin mux settings.  Enable the secondary serial port early
in romstage to allow use during / after initial boot.

Change-Id: I5b83659dd8b0d6af559c9ceccee55c4cc2f17165
Signed-off-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
Reviewed-on: https://review.coreboot.org/14892
Tested-by: build bot (Jenkins)
Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
2016-05-31 08:42:23 +02:00
Furquan Shaikh 97d56fa1a2 reef: Remove si-all region from chromeos.fmd
This matches the change in depthcharge fmap.dts to remove si-all
region and mark si-desc as ifd.

CQ-DEPEND=CL:347986
BUG=chrome-os-partner:53689
BRANCH=None
TEST=Compiles successfully

Change-Id: Ic7ed94fcdfb9a79bd6ceb960830f67678b0291b6
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/14990
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-30 23:50:06 +02:00
Kyösti Mälkki 1716375507 pcengines/apu1: Rename Kconfig variables for pinmux
Add APU1 prefix because Kconfig throws errors if we try to
define the same variables as choice-entry for APU2 board.

Change-Id: Ic071600dd88e391a8a278d63aad13abd01fd3c9d
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/14988
Tested-by: build bot (Jenkins)
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2016-05-30 15:15:24 +02:00
zbao e0849350aa AMD/spi: Do not reset fifo after skipping the sent bytes
After we skip the bytes we send, the fifo pointer is at
right position. Reseting the fifo will change it to a
wrong place.

Please view the flashrom code, which tells the same thing.
https://code.coreboot.org/p/flashrom/source/tree/HEAD/trunk/sb600spi.c#L257

Change-Id: I31d487ce32c0d7ca3dead36d2b14611e73b1ad60
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/14955
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
2016-05-30 06:09:21 +02:00
Timothy Pearson 69088c2825 sio/winbond/w83667hg-a: Add pinmux defines for UART B
Change-Id: Ib98c69de781d2b651ec168d03250cacc918c5c1f
Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com>
Reviewed-on: https://review.coreboot.org/14965
Tested-by: build bot (Jenkins)
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2016-05-29 19:34:54 +02:00
Timothy Pearson e4cca16b42 sio/winbond/common: Add function to configure pin mux
Certain mainboards require SuperIO pinmux configuration before
peripherals will become operational.  Allow each mainboard to
configure the pinmux(es) of Winbond chips if needed.

Change-Id: Ice19f8d8514b66b15920a5b893700d636ed75cec
Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com>
Reviewed-on: https://review.coreboot.org/14960
Tested-by: build bot (Jenkins)
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2016-05-29 19:34:02 +02:00
Duncan Laurie 559e947306 acpi_device: Add support for writing ACPI Device Properties
The recent ACPI specification extensions have formally defined a
method for describing device information with a key=value format that
is modeled after the Devicetree/DTS format using a special crafted
object named _DSD with a specific UUID for this format.

There are three defined Device Property types: Integers, Strings, and
References.  It is also possible to have arrays of these properties
under one key=value pair.  Strings and References are both represented
as character arrays but result in different generated ACPI OpCodes.

Various helpers are provided for writing the Device Property header
(to fill in the object name and UUID) and footer (to fill in the
property count and device length values) as well as for writing the
different Device Property types.  A specific helper is provided for
writing the defined GPIO binding Device Property that is used to allow
GPIOs to be referred to by name rather than resource index.

This is all documented in the _DSD Device Properties UUID document:
http://uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf

This will be used by device drivers to provide device properties that
are consumed by the operating system.  Devicetree bindings are often
described in the linux kernel at Documentation/devicetree/bindings/

A sample driver here has an input GPIO that it needs to describe to
the kernel driver:

chip.h:
  struct drivers_generic_sample_config {
    struct acpi_gpio mode_gpio;
  };

sample.c:
  static void acpi_fill_ssdt_generator(struct device *dev) {
    struct drivers_generic_sample_config *config = dev->chip_info;
    const char *path = acpi_device_path(dev);
    ...
    acpi_device_write_gpio(&config->mode_gpio);
    ...
    acpi_dp_write_header();
    acpi_dp_write_gpio("mode-gpio", path, 0, 0, 0);
    acpi_dp_write_footer();
    ...
  }

devicetree.cb:
  device pci 1f.0 on
    chip drivers/generic/sample
      register "mode_gpio" = "ACPI_GPIO_INPUT(GPP_B1)"
      device generic 0 on end
    end
  end

SSDT.dsl:
  Name (_CRS, ResourceTemplate () {
    GpioIo (Exclusive, PullDefault, 0, 0, IoRestrictionInputOnly,
            "\\_SB.PCI0.GPIO", 0, ResourceConsumer) { 25 }
  })
  Name (_DSD, Package () {
    ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
    Package () {
      Package () {"mode-gpio", Package () { \_SB.PCI0.LPCB, 0, 0, 1 }}
    }
  })

Change-Id: I93ffd09e59d05c09e38693e221a87085469be3ad
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14937
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-28 03:48:55 +02:00
Duncan Laurie 70c86d9b26 acpi_device: Add support for writing ACPI SPI descriptors
Add required definitions to describe an ACPI SPI bus and a method to
write the SpiSerialBus() descriptor to the SSDT.

This will be used by device drivers to describe their SPI resources to
the OS.  SPI devices are not currently enumerated in the devicetree but
can be enumerated by device drivers directly.

generic.c:
  void acpi_fill_ssdt_generator(struct device *dev) {
    struct acpi_spi spi = {
      .device_select = dev->path->generic.device.id,
      .device_select_polarity = SPI_POLARITY_LOW,
      .spi_wire_mode = SPI_4_WIRE_MODE,
      .speed = 1000 * 1000; /* 1 mHz */
      .data_bit_length = 8,
      .clock_phase = SPI_CLOCK_PHASE_FIRST,
      .clock_polarity = SPI_POLARITY_LOW,
      .resource = acpi_device_path(dev->bus->dev)
    };
    ...
    acpi_device_write_spi(&spi);
    ...
  }

devicetree.cb:
  device pci 1e.2 on
    chip drivers/spi/generic
      device generic 0 on end
    end
  end

SSDT.dsl:
  SpiSerialBus (0, PolarityLow, FourWireMode, 8, ControllerInitiated,
                1000000, ClockPolarityLow, ClockPhaseFirst,
                "\\_SB.PCI0.SPI0", 0, ResourceConsumer)

Change-Id: I0ef83dc111ac6c19d68872ab64e1e5e3a7756cae
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14936
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-28 03:48:06 +02:00
Duncan Laurie 1010b4aeac acpi_device: Add support for writing ACPI I2C descriptors
Add required definitions to describe an ACPI I2C bus and a method to
write the I2cSerialBus() descriptor to the SSDT.

This will be used by device drivers to describe their I2C resources to
the OS.  The devicetree i2c device can supply the address and 7 or 10
bit mode as well as indicate the GPIO controller device, and the bus
speed can be fixed or configured by the driver.

chip.h:
  struct drivers_i2c_generic_config {
    enum i2c_speed bus_speed;
  };

generic.c:
  void acpi_fill_ssdt_generator(struct device *dev) {
    struct drivers_i2c_generic_config *config = dev->chip_info;
    struct acpi_i2c i2c = {
      .address = dev->path->i2c.device,
      .mode_10bit = dev->path.i2c.mode_10bit,
      .speed = config->bus_speed ? : I2C_SPEED_FAST,
      .resource = acpi_device_path(dev->bus->dev)
    };
    ...
    acpi_device_write_i2c(&i2c);
    ...
  }

devicetree.cb:
  device pci 15.0 on
    chip drivers/i2c/generic
      device i2c 10.0 on end
    end
  end

SSDT.dsl:
  I2cSerialBus (0x10, ControllerInitiated, 400000, AddressingMode7Bit,
                "\\_SB.PCI0.I2C0", 0, ResourceConsumer)

Change-Id: I598401ac81a92c72f19da0271af1e218580a6c49
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14935
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-28 03:47:09 +02:00
Duncan Laurie cfb6ea7e65 acpi_device: Add support for writing ACPI GPIO descriptors
Add definitions to describe GPIOs in generated ACPI objects and a
method to write a GpioIo() or GpioInt() descriptor to the SSDT.

ACPI GPIOs have many possible configuration options and a structure
is created to describe it accurately in ACPI terms.  There are many
shared descriptor fields between GpioIo() and GpioInt() so the same
function can write both types.

GpioInt shares many properties with ACPI Interrupts and the same types
are re-used here where possible.  One addition is that GpioInt can be
configured to trigger on both low and high edge transitions.

One descriptor can describe multiple GPIO pins (limited to 8 in this
implementation) that all share configuration and controller and are
used by the same device scope.

Accurately referring to the GPIO controller that this pin is connected
to requires the SoC/board to implement a function handler for
acpi_gpio_path(), or for the caller to provide this directly as a
string in the acpi_gpio->reference variable.

This will get used by device drivers to describe their resources in
the SSDT.  Here is a sample for a Maxim 98357A I2S codec which has a
GPIO for power and channel selection called "sdmode".

chip.h:
  struct drivers_generic_max98357a_config {
    struct acpi_gpio sdmode_gpio;
  };

max98357a.c:
  void acpi_fill_ssdt_generator(struct device *dev) {
    struct drivers_generic_max98357a_config *config = dev->chip_info;
    ...
    acpi_device_write_gpio(&config->sdmode_gpio);
    ...
  }

devicetree.cb:
  device pci 1f.3 on
    chip drivers/generic/max98357a
      register "sdmode_gpio" = "ACPI_GPIO_OUTPUT(GPP_C5)"
      device generic 0 on end
    end
  end

SSDT.dsl:
  GpioIo (Exclusive, PullDefault, 0, 0, IoRestrictionOutputOnly,
          "\\_SB.PCI0.GPIO", 0, ResourceConsumer, ,) { 53 }

Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Change-Id: Ibf5bab9c4bf6f21252373fb013e78f872550b167
Reviewed-on: https://review.coreboot.org/14934
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-28 03:46:29 +02:00
Duncan Laurie 6b7c1f605c acpi_device: Add support for writing ACPI Interrupt descriptors
Add definitions for ACPI device extended interrupts and a method to
write an Interrupt() descriptor to the SSDT output stream.

Interrupts are often tied together with other resources and some
configuration items are shared (though not always compatibly) with
other constructs like GPIOs and GPEs.

These will get used by device drivers to write _CRS sections for
devices into the SSDT.  One usage is to include a "struct acpi_irq"
inside a config struct for a device so it can be initialized based
on settings in devicetree.

Example usage:

chip.h:
  struct drivers_i2c_generic_config {
    struct acpi_irq irq;
  };

generic.c:
  void acpi_fill_ssdt_generator(struct device *dev) {
    struct drivers_i2c_generic_config *config = dev->chip_info;
    ...
    acpi_device_write_interrupt(&config->irq);
    ...
  }

devicetree.cb:
  device pci 15.0 on
    chip drivers/i2c/generic
      register "irq" = "IRQ_EDGE_LOW(GPP_E7_IRQ)"
      device i2c 10 on end
    end
  end

SSDT.dsl:
  Interrupt (ResourceConsumer, Edge, ActiveLow, Exclusive,,,) { 31 }

Change-Id: I3b64170cc2ebac178e7a17df479eda7670a42703
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/14933
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-28 03:40:35 +02:00
Aaron Durbin b3f5418ec1 soc/intel/apollolake: provide SMM dependency requirements
Depending on which options are selected there needs to be certain
functions supplied. However, the spi, mmap_boot, and tsc_freq modules
were not included in the SMM builds. Fix the omission.

Change-Id: I25ab42886cfd46770ce0f4beee65f2f4d15649f3
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/14977
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan@google.com>
2016-05-27 19:56:01 +02:00
Aaron Durbin 07dd474d65 mainboard/google/reef: increase BIOS region size
An updated descriptor expands the BIOS region while descreasing
the 'device expansion region' utilized by the CSE. Update the
end region marker to reflect this new size as well as the
chromeos.fmd file which needs to be adjusted for logical boot
parition 2 requirement which resides halfway through the BIOS
region. The GBB was moved and shunk to accommodate the change.

Change-Id: I7baa5282d7c608af648b5773c4dfa123060a6e45
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/14974
Reviewed-by: Furquan Shaikh <furquan@google.com>
Tested-by: build bot (Jenkins)
2016-05-27 19:55:30 +02:00
Furquan Shaikh 2b56ba5a4f google/reef: Sync chromeos.fmd with fmap.dts and fix offsets
CQ-DEPEND=CL:347460
BUG=chrome-os-partner:53689
BRANCH=None
TEST="emerge-reef chromeos-bootimage" completes without error

Change-Id: Ic954e29628423937604772a8d2d0414954e6ba3e
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/347441
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://review.coreboot.org/14975
Tested-by: build bot (Jenkins)
2016-05-27 19:54:43 +02:00
Aaron Durbin 7a3edb6f27 mainboard/google/reef: support verstage
The chromeos.c suport needs to be linked into verstage so it will
link.

Change-Id: If85e232a3721443edfbbd278b32f72302f13f3a8
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/14973
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan@google.com>
2016-05-27 19:54:06 +02:00
Aaron Durbin bef75e7dd9 soc/intel/apollolake: add support for verstage
There previously was no support for building verstage on apollolake.
Add that suport by linking in the appropriate modules as well as
providing vboot_platform_is_resuming(). The link address for verstage
is the same as FSP-M because they would never be in CAR along side
each other. Additionally, program the ACPI I/O BAR and enable decoding
so sleep state can be determined for early firmware verification.

Change-Id: I1a0baab342ac55fd82dbed476abe0063787e3491
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/14972
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan@google.com>
2016-05-27 19:53:34 +02:00
Aaron Durbin 10221a0e57 arch/x86: provide verstage support for CONFIG_C_ENVIRONMENT_BOOTBLOCK
When CONFIG_C_ENVIRONMENT_BOOTBLOCK is employed there's no need for
a chipset specific verstage entry point because cache-as-ram has
already been initialized. Therefore, provide a default entry point
for verstage in that environment.

Change-Id: Idd8f45bd58d3e5b251d1e38cca7ae794b8b77a28
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/14971
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Andrey Petrov <andrey.petrov@intel.com>
2016-05-27 19:53:16 +02:00