Commit graph

17869 commits

Author SHA1 Message Date
Vadim Bendebury
5a25c10705 kconfig: allow various tpm type and interface permutations
Until now it was assumed that all TPM devices were of the same type
(TCG 1.2 spec compliant) and x86 based boards had LPC connected TPMs
and all other boards had I2C connected TPMs.

With the advent of TPM2 specification there is a need to be able to
configure different combinations of TPM types (TPM or TPM2) and
interfaces (LPC, I2C and SPI).

This patch allows to do it. Picking Chrome OS still assumes that the
board has a TPM device, but adding MAINBOARD_HAS_TPM2 to the board's
Kconfig will trigger including of TPM2 instead.

MAINBOARD_HAS_LPC_TPM forces the interface to be set to LPC, adding
SPI_TPM to the board config switches interface choice to SPI, and if
neither of the two is defined, the interface is assumed to be I2C.

BRANCH=none
BUG=chrome-os-partner:50645
TEST=verified that none of the generated board configurations change
     as a result of this patch. With the rest of the stack in place it
     is possible to configure different combinations of TPM types and
     interfaces for ARM and x86 boards.

Change-Id: I659e9301a4a4fe065ca6537ef1fa824a08d36321
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/349850
Reviewed-by: Martin Roth <martinroth@chromium.org>
2016-06-15 15:29:06 -07:00
Furquan Shaikh
85edb4550c UPSTREAM: intel/apollolake: Correct the offsets in gnvs
Offsets start from 0 instead of 1. Fix this in the gnvs definitions.

BUG=chrome-os-partner:54342

Change-Id: Id6766a8766ef430d19ffcb801bfab43d38de37db
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/15180
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
Reviewed-on: https://chromium-review.googlesource.com/353024
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
2016-06-15 15:29:04 -07:00
Furquan Shaikh
40274fe657 UPSTREAM: intel/apollolake: Add CBMEM console to GNVS
CBMEM console stores all the console logs in CBMEM. Address of this
location in CBMEM where console logs are stored needs to be passed up to
OS using GNVS.

1. Add CBMC to GNVS fields in globalnvs.asl
2. Add cbmc member to global_nvs_t structure in nvs.h
3. Initialize gnvs->cbmc to address of cbmem console

BUG=chrome-os-partner:54342

Change-Id: Idcd4573e626fa433c1623bdcbe29921de64539b2
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/15177
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
Reviewed-on: https://chromium-review.googlesource.com/353023
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
2016-06-15 15:29:01 -07:00
Rolf Evers-Fischer
05edf586e9 UPSTREAM: ifwitool: Fix calculation of dst_size
Change-Id: I07523252eacffb323e2bb54c306f5e9ac83e4cbd
Signed-off-by: Rolf Evers-Fischer <embedded24@evers-fischer.de>
Reviewed-on: https://review.coreboot.org/15162
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: https://chromium-review.googlesource.com/353022
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-15 15:28:59 -07:00
Andrey Petrov
624ccef488 UPSTREAM: drivers/intel/fsp2_0: Add FSP return types for reset
FSP methods may require reset under certain conditions. That is indicated
by returning specific return code. Add the missing return status codes.

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

Change-Id: I460353c5f835548a98255bd3e11dbfd08260ea52
Signed-off-by: Andrey Petrov <andrey.petrov@intel.com>
Reviewed-on: https://review.coreboot.org/15185
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
Reviewed-on: https://chromium-review.googlesource.com/353021
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
2016-06-15 15:28:57 -07:00
Elyes HAOUAS
66bc922b47 UPSTREAM: Added CL7 support
according to "JEDEC_DDR2_SPD_Specification_Rev1.3.pdf"
Annex J: Serial Presence Detects for DDR2 SDRAM (Revision 1.3)
page 16 and page 60, CL7 support added

Change-Id: I22aaf064ab8767755f74dfdb44e32d13fc61b2c4
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/14976
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://chromium-review.googlesource.com/353020
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-15 15:28:54 -07:00
Furquan Shaikh
8714fa8e96 UPSTREAM: google/reef: Correct use of globalnvs.asl
Use the correct globalnvs.asl from apollolake.

BUG=chrome-os-partner:54342

Change-Id: I1a5b8f61c540bdb2668b532f032350d8e4d48010
Original-Signed-off-by: Furquan Shaikh <furquan@google.com>
Original-Reviewed-on: https://review.coreboot.org/15178
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/352511
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-14 14:11:04 -07:00
Zhao, Lijian
25b08629a1 UPSTREAM: google/reef: Update EMMC DLL settings
Update EMMC DLL setting for reef board, after that system can
boot up into EMMC successfully.

BUG=chrome-os-partner:54228
TEST=Boot up into EMMC and check with Rootdev

Change-Id: I614cd624dce9069c5565599a955f87906bcea53b
Original-Signed-off-by: Zhao, Lijian <lijian.zhao@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15156
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Furquan Shaikh <furquan@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/352510
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Commit-Ready: Lijian Zhao <lijian.zhao@intel.com>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Lijian Zhao <lijian.zhao@intel.com>
2016-06-14 14:11:02 -07:00
Lee Leahy
8c88018b51 UPSTREAM: soc/intel/quark: Add C bootblock
Add a bootblock which builds with C_ENVIRONMENT_BOOTBLOCK selected.
This is the first piece in supporting FSP 2.0. Move esraminit from
romstage into the bootblock. Replace cache_as_ram with
car_stage_entry.S and code in romstage.c

TEST=Build and run on Galileo Gen2

BUG=None
BRANCH=None
TEST=None

Change-Id: I14d2af2adb6e75d4bff1ebfb863196df04d07daf
Original-Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15132
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/352036
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-13 15:56:07 -07:00
Lee Leahy
9babf5001b UPSTREAM: bootblock: Declare common bootblock_pre_c_entry routine
Enable uses of a common bootblock_pre_c_entry routine. Pass in TSC
value as a uint64_t value.

TEST=Build for amenia and Galileo Gen2

BUG=None
BRANCH=None
TEST=None

Change-Id: I8be2e079ababb2cf1f9b7e6293f93e7c778761a1
Original-Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15124
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Lee Leahy <lpleahyjr@gmail.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/352035
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-13 15:56:05 -07:00
Aaron Durbin
1774e9a483 UPSTREAM: soc/intel/common: don't infinitely recurse in busmaster_disable_on_bus()
If a bridge has the primary bus equal to the secondary bus the
busmaster_disable_on_bus() will infinitely call itself. Avoid the
inifinite recursion by checking current bus number against the
secondary bus number.

BUG=chrome-os-partner:54262
TEST=Ran on reef. Able to actually get the chipset to assert SLP_Sx
signals which means no more infinite recursion.

Change-Id: I52b21fbba24e6a652ea8f9f87f5f49f60109c8f2
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/15157
Original-Reviewed-by: Furquan Shaikh <furquan@google.com>
Original-Tested-by: build bot (Jenkins)
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/352034
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-13 15:56:03 -07:00
Aaron Durbin
e86214739e UPSTREAM: soc/intel/apollolake: save GNVS pointer to SMM handler
Like other boards there will likely be information needed from
GNVS in the SMM handler. Therefore, it's important that the point
is stashed accordingly.

BUG=chrome-os-partner:54275
TEST=Noted GNVS messages from SMM console on reef.

Change-Id: If12b69731330a1e0af7f8fe880635e5ffd02d715
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/15152
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Furquan Shaikh <furquan@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/352033
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-13 15:56:00 -07:00
Aaron Durbin
d24882e6af UPSTREAM: soc/intel/apollolake: allow DEBUG_SMI to work
The UART support is needed in SMM in order for DEBUG_SMI to
function.

BUG=chrome-os-partner:54262
TEST=Ran on reef with DEBUG_SMI enabled. Can observed SMI messages.

Change-Id: Ibd6b12e27d5776046b400adf72f24133b9e54af8
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/15151
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Furquan Shaikh <furquan@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/352032
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-13 15:55:58 -07:00
Aaron Durbin
01b2daad98 UPSTREAM: soc/intel/apollolake: provide fake PM1 SMI status bit
It appears that PM1 is not wired up to the SMI status register, but
it does definitely cause SMIs to trigger. Therefore, provide a fake
PM1 status bit by checking the power button status when SMI status
is indicating no status as well as the PM1 control indicating that
SCI mode is not enabled.

BUG=chrome-os-partner:54262
TEST=Smashed power button on reef to cause SMI in firmware. No longer
loops infinitely with constant SMIs firing.

Change-Id: I9aa1b5f79b651cbc19a2d3353d9ef65429386889
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/15155
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Original-Reviewed-by: Furquan Shaikh <furquan@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/352031
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-13 15:55:56 -07:00
Aaron Durbin
f4aa77de20 UPSTREAM: soc/intel/apollolake: add SMI status bit definitons and use them
Provide the bit definitions for the SMI status register. Also,
utilize them which means deleting some of the handlers that can't
exist because there are no status bits.

BUG=chrome-os-partner:54262

Change-Id: I389c7cb3cad01ba0eca52a337ffee352a2010bfa
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/15154
Original-Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Original-Reviewed-by: Furquan Shaikh <furquan@google.com>
Original-Tested-by: build bot (Jenkins)
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/352030
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-13 15:55:53 -07:00
Patrick Rudolph
037bae58ba UPSTREAM: nb/intel/raminit (native): Read PCI mmio size from devicetree
Instead of hardcoding the PCI mmio size read it from devicetree.
Set a default value of 2048 MiB and 1024MiB for laptops without
discrete graphics.

Tested on Sandybridge Lenovo T520.

BUG=None
BRANCH=None
TEST=None

Change-Id: I791ebd6897c5ba4e2e18bd307d320568b1378a13
Original-Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Original-Reviewed-on: https://review.coreboot.org/15140
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/352029
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-13 15:55:51 -07:00
Furquan Shaikh
269c5e5b2c UPSTREAM: ifwitool: Do not calculate checksum for subpart_dir
1. The checksum method that was documented is not correct. So, no use
filling in a value based on wrong calculations. This can be added back
once updated information is available.
2. Checksum does not seem to affect the booting up of SoC. So, fill in 0
for now.

BUG=None
BRANCH=None
TEST=None

Change-Id: I0e49ac8e0e04abb6d7c9be70323612bdef309975
Original-Signed-off-by: Furquan Shaikh <furquan@google.com>
Original-Reviewed-on: https://review.coreboot.org/15145
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/352028
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-13 15:55:49 -07:00
Furquan Shaikh
ab2bc08371 UPSTREAM: ifwitool: Correct pack order and header order
Update pack and header order and mark the entries as mandatory and
recommended w.r.t. ordering (mandatory = essential for booting,
recommended = okay to change, but this config is tested and known to work).

BUG=None
BRANCH=None
TEST=None

Change-Id: Ia089bdaa0703de830bb9553130caf91a3665d2c4
Original-Signed-off-by: Furquan Shaikh <furquan@google.com>
Original-Reviewed-on: https://review.coreboot.org/15144
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/352027
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-13 15:55:46 -07:00
Jonathan Neuschäfer
834561e7d6 UPSTREAM: riscv-spike: Replace custom UART with a memory-mapped 8250
Since the HTIF is a non-standard interface, and coreboot already has a
8250 driver, I started implementing an 8250 core for spike[1].

[1]: https://github.com/riscv/riscv-isa-sim/pull/53

BUG=None
BRANCH=None
TEST=None

Change-Id: I84adc1169474baa8cc5837358a8ad3d184cfa51b
Original-Signed-off-by: Jonathan Neuschfer <j.neuschaefer@gmx.net>
Original-Reviewed-on: https://review.coreboot.org/15150
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/352026
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-13 15:55:44 -07:00
Jonathan Neuschäfer
4b4688a767 UPSTREAM: arch/riscv: Compile with -mcmodel=medany
In the default (medlow) code model, pointers are loaded with a lui, addi
instruction sequence:

lui a0, 0xNNNNN
addi a0, a0, 0xNNN

Since lui sign-extends bits 32-63 from bit 31 on RV64, lui/addi can't
load pointers just above 0x80000000, where RISC-V's RAM now lives.

The medany code model gets around this restriction by loading pointers
trough auipc and addi:

auipc a0, 0xNNNNN
addi a0, a0, 0xNNN

This way, any pointer within the current pc 2G can be loaded, which is
by far sufficient for coreboot.

BUG=None
BRANCH=None
TEST=None

Change-Id: I77350d9218a687284c1337d987765553cf915a22
Original-Signed-off-by: Jonathan Neuschfer <j.neuschaefer@gmx.net>
Original-Reviewed-on: https://review.coreboot.org/15148
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/352025
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-13 15:55:42 -07:00
Jonathan Neuschäfer
3c17c59bb4 UPSTREAM: arch/riscv: Add misc.c to bootblock/romstage to get udelay()
The uart8250mem driver needs it.

BUG=None
BRANCH=None
TEST=None

Change-Id: I09e6a17cedf8a4045f008f5a0d225055d745e8db
Original-Signed-off-by: Jonathan Neuschfer <j.neuschaefer@gmx.net>
Original-Reviewed-on: https://review.coreboot.org/15147
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/352024
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-13 15:55:39 -07:00
Jonathan Neuschäfer
09e2cb8296 UPSTREAM: arch/riscv: copy read/write8/16/32 from x86
BUG=None
BRANCH=None
TEST=None

Change-Id: I12de8f82499074f0fbbc1c09210b00c6a9614c1b
Original-Signed-off-by: Jonathan Neuschfer <j.neuschaefer@gmx.net>
Original-Reviewed-on: https://review.coreboot.org/15146
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/352023
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-13 15:55:37 -07:00
Jonathan Neuschäfer
8ba14423e3 UPSTREAM: arch/riscv/trap_util.S: Use "li" pseudo-instruction to load a constant
BUG=None
BRANCH=None
TEST=None

Change-Id: I9759771fa6fc708d7d97509c5f5e0cefb8ab4c96
Original-Signed-off-by: Jonathan Neuschfer <j.neuschaefer@gmx.net>
Original-Reviewed-on: https://review.coreboot.org/14962
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/352022
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-13 15:55:35 -07:00
Furquan Shaikh
dacfd9368c UPSTREAM: intel/apollolake: Use custom reset calls
Due to USB LDO issue in current steppings, cold reboot needs to be
temporarily disabled. Thus, hard_reset call should be the same as
soft_reset.

Once future steppings are available INTEL_COMMON_RESET can be enabled again.

BUG=None
BRANCH=None
TEST=None

Change-Id: If0ec56db3864d500acc93d2b363a78a6cd7632da
Original-Signed-off-by: Furquan Shaikh <furquan@google.com>
Original-Reviewed-on: https://review.coreboot.org/15143
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/352021
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-13 15:55:32 -07:00
Lee Leahy
6319b54884 UPSTREAM: Documentation/Intel/Board: Update the Galileo checklist
Update the Galileo board implementation checklist.

TEST=Build and run on Galileo Gen2

BUG=None
BRANCH=None
TEST=None

Change-Id: I1c88e9500d304273a3176d8b034a805920aab9bb
Original-Signed-off-by: Lee Leahy <Leroy.P.Leahy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15137
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/352020
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-13 15:55:30 -07:00
Chris Ching
b4be0ab09e UPSTREAM: autoport: Add prompt for enabling unsafe inteltool glx option
BUG=None
BRANCH=None
TEST=None

Change-Id: Ib674ab7ca8b6464de553a86536b1762fda98d94e
Original-Signed-off-by: Chris Ching <chingcodes@google.com>
Original-Reviewed-on: https://review.coreboot.org/14901
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351789
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-13 15:55:28 -07:00
Patrick Rudolph
0f0acd053c UPSTREAM: nb/intel: Factor out common MRC code
Remove code duplication and use the common function
store_current_mrc_cache instead.
No functionality is changed.

Tested on Sandybridge Lenovo T520.

BUG=None
BRANCH=None
TEST=None

Change-Id: I4aa5463f1b1d5e1afbe44b4bfc659524d86204db
Original-Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Original-Reviewed-on: https://review.coreboot.org/15074
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Tested-by: build bot (Jenkins)
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351788
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-13 15:55:25 -07:00
Lee Leahy
8e1e13a892 UPSTREAM: arch/x86: Support "weak" BIST and timestamp save routines
Not all x86 architectures support the mm register set. The default
routine that saves BIST in mm0 and a "weak" routine that saves the TSC
value in mm2:mm1. Select the Kconfig value
BOOTBLOCK_SAVE_BIST_AND_TIMESTAMP to provide a replacement routine to
save the BIST and timestamp values.

TEST=Build and run on Amenia and Galileo Gen2.

BUG=None
BRANCH=None
TEST=None

Change-Id: I8119e74664ac3522c011767d424d441cd62545ce
Original-Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15126
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351787
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-13 15:55:23 -07:00
Lee Leahy
6fde566b59 UPSTREAM: mainboard/intel/galileo: Support bootblock in C
Initialize the GPIOs during the boot block to properly route the SOC
UART pins.

TEST=Build and run on Galileo Gen2

BUG=None
BRANCH=None
TEST=None

Change-Id: I22c24f8c83f04566a0bbd598a141a5209569a924
Original-Signed-off-by: Lee Leahy <Leroy.P.Leahy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15133
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351786
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-13 15:55:21 -07:00
Lee Leahy
97f0b07fac UPSTREAM: arch/x86: Add debug spinloops in assembly_entry.S
Use Kconfig values to enable debug spinloops in assembly_entry.S. This
makes it easy to debug the assembly code.

TEST=Build and run on Galileo Gen2

BUG=None
BRANCH=None
TEST=None

Change-Id: Ic56bf2260b8e3181403623961874c9289f3ca945
Original-Signed-off-by: Lee Leahy <Leroy.P.Leahy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15135
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351785
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-13 15:55:18 -07:00
Lee Leahy
38f9c49f34 UPSTREAM: arch/x86: Add debug spinloop
Conditionally add a debug spinloop to enable easy connection of JTAG
debuggers.

TEST=Build and run on Galileo Gen2 with a JTAG debugger.

BUG=None
BRANCH=None
TEST=None

Change-Id: I7a21f9e6bfb10912d06ce48447c61202553630d0
Original-Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15127
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351784
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2016-06-13 15:55:16 -07:00
Brandon Breitenstein
bcfa7f239b UPSTREAM: Revert "soc/intel/apollolake: Do not use StackBase FSP-M parameter"
This reverts commit 5ede3d8cce.
No longer needed due to FSP being updated, with the 139_40 release,
to accept StackBase field

BUG=chrome-os-partner:52784
BRANCH=none
TEST=built and booted with FSP 139_40

BUG=None
BRANCH=None
TEST=None

Change-Id: Ic832d8dc4ca87631f5fef80d4d41558d9a72630a
Original-Signed-off-by: Brandon Breitenstein <brandon.breitenstein@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15068
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351381
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-06-10 00:18:00 -07:00
Brandon Breitenstein
302b9328d4 UPSTREAM: soc/intel/apollolake: FSP Header file update for FSP 139_40
FSP 2.0 spec has updated the signatures for the FSPM and FSPS blobs
with the 139_40 release. In order to successfully pass through
memory/silicon init the header files must be updated to the latest
versions

BUG=chrome-os-partner:52784
BRANCH=none
TEST=built and booted

BUG=None
BRANCH=None
TEST=None

Change-Id: Ib60d0d9afa4ee29dff26177826ba59db81b630e8
Original-Signed-off-by: Brandon Breitenstein <brandon.breitenstein@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15066
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Tested-by: build bot (Jenkins)
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351380
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-06-10 00:17:59 -07:00
Lee Leahy
0821c5c48e UPSTREAM: util/checklist: Add bootblock support
Scan the boot block when building it with C_ENVIRONMENT_BOOTBLOCK
selected.

TEST=Build and run with Galileo Gen2

BUG=None
BRANCH=None
TEST=None

Change-Id: I922f761c31e95efde0975d8572c47084b91b2879
Original-Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15130
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351379
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-06-10 00:17:58 -07:00
Lee Leahy
7d35119d05 UPSTREAM: vendorcode/intel/fsp1_1/checklist: romstage - Add car_stage_entry
Add car_stage_entry as an optional routine in the checklist.

TEST=Build and run on Galileo Gen2

BUG=None
BRANCH=None
TEST=None

Change-Id: I52f6aefc2566beac01373dbebf3a43d35032a0df
Original-Signed-off-by: Lee Leahy <Leroy.P.Leahy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15129
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351378
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-06-10 00:17:57 -07:00
Lee Leahy
489906536d UPSTREAM: mainboard: Support ROM_SIZE > 16 MiB
Support ROM_SIZE greater than 16 MiB. Work around SMBIOS rom size
limitation of 16 MiB by specifying 16 MiB as the ROM size.

TEST=Build and run on neoncity

BUG=None
BRANCH=None
TEST=None

Change-Id: I3f464599cd8a1b6482db8b9deab03126c8b92128
Original-Signed-off-by: Lee Leahy <Leroy.P.Leahy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15108
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Tested-by: build bot (Jenkins)
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351377
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-06-10 00:17:56 -07:00
Bora Guvendik
f933b66e74 UPSTREAM: soc/intel/apollolake: Update FSP header files
Update autogenerated FSP 2.0 generic header files
based on FSP release 136_30.
Changes were made to avoid duplicating some of the
structs for every SoC.

BUG=chrome-os-partner:50765
TEST=Build coreboot

BUG=None
BRANCH=None
TEST=None

Change-Id: I6f3c9270fb67210d6ea87e17ccf52d203fa64b4b
Original-Signed-off-by: Bora Guvendik <bora.guvendik@intel.com>
Original-Reviewed-on: https://chromium.devtools.intel.com/7145
Original-Reviewed-by: Petrov, Andrey <andrey.petrov@intel.com>
Original-Tested-by: Petrov, Andrey <andrey.petrov@intel.com>
Original-Reviewed-on: https://chromium.devtools.intel.com/7584
Original-Reviewed-on: https://review.coreboot.org/15081
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351376
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-06-10 00:17:55 -07:00
Zhao, Lijian
5165ee3b6a UPSTREAM: intel/amenia: Program EMMC dll setting
EMMC TX DATA Control needs to be programmed to 0x1A1A to make amenia
system can run stable on EMMC with HS400 mode.

BUG=None
BRANCH=None
TEST=None

Change-Id: I42c23ff7e6956e75de5e1b1339a570b35d999301
Original-Signed-off-by: Zhao, Lijian <lijian.zhao@intel.com>
Original-Tested-by: Petrov, Andrey <andrey.petrov@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15092
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351375
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-06-10 00:17:54 -07:00
Zhao, Lijian
e6f5a9e886 UPSTREAM: soc/intel/apollolake: Add EMMC DLL API
Starting from 136_30,FSP supports to update all the SDIO DLL
programming value through silicon init upd. Implement the interface
to pass board specific programming value to fsp silicon init.

BUG=None
BRANCH=None
TEST=None

Change-Id: Ifd901148f3f7f89f966217491c661ec346337c38
Original-Signed-off-by: Zhao, Lijian <lijian.zhao@intel.com>
Original-Reviewed-on: https://chromium.devtools.intel.com/7372
Original-Reviewed-by: Petrov, Andrey <andrey.petrov@intel.com>
Original-Tested-by: Petrov, Andrey <andrey.petrov@intel.com>
Original-Reviewed-on: https://chromium.devtools.intel.com/7585
Original-Reviewed-on: https://review.coreboot.org/15084
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351374
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-06-10 00:17:54 -07:00
Duncan Laurie
fa3fe1d85e UPSTREAM: skylake: Support common LPSS I2C driver
Support the common Intel LPSS I2C driver for the 6 I2C bus controllers
that are present on the Skylake-LP PCH with a 120 mHz clock. The
required lpss_i2c_base_address() method is implemented separately for
verstage/romstage and ramstage environments.

This provides methods to convert to and from "struct device" and the
I2C controller bus number for that device. These are used to provide
support for the "I2C Bus Operations" that are present in the coreboot
devicetree.

To support the I2C controller before ramstage an early init function
is provided to do minimal initializaiton of the PCI device and assign
a temporary base address for use before memory. The final base
address is assigned during device enumeration and used during ramstage.

Because it is usually not necessary to enable I2C controllers before
ramstage a config register for the devicetree is provided to perform
early initialization of this controller. In addition the bus speed
can be set in the devicetree and that speed will be applied when the
device is initialized. If not provided the default speed is set to
I2C_SPEED_FAST.

This was tested with the google/chell mainboard by reading and writing
from the trackpad and codec devices during both verstage and ramstage.

BUG=None
BRANCH=None
TEST=None

Change-Id: Ia0270adfaf2843a3be4e00c732c85401a3401ef5
Original-Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/15105
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Tested-by: build bot (Jenkins)
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351373
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-06-10 00:17:53 -07:00
Lee Leahy
1db3825b95 UPSTREAM: lib: Build reg_script for bootblock
Allow reg_script to be used during the bootblock.

TEST=Build and run on Galileo Gen2

BUG=None
BRANCH=None
TEST=None

Change-Id: I55fe0be3f50116927b801ce67a3f23bb1931f6e7
Original-Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15131
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351372
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-06-10 00:17:52 -07:00
Lee Leahy
2842b25b32 UPSTREAM: arch/x86: Enable SSE in bootblock_crt0.S
Don't write reserved bits in the Quark platform. Follow the previous
boot behavior and just enable SSE.

TEST=Build and run on Galileo Gen2

BUG=None
BRANCH=None
TEST=None

Change-Id: Ib3143eff02b2610b595bd666c10d70e43103ccda
Original-Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15128
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351371
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-06-10 00:17:51 -07:00
Lee Leahy
1e85b126ec UPSTREAM: lib: Add asmlinkage attribute to bootblock_main_with_timestamp
Add asmlinkage to bootblock_main_with_timestamp so that it may be called
directly from the assembly code.

TEST=Build for Amenia and Galileo Gen2

BUG=None
BRANCH=None
TEST=None

Change-Id: Iefb8e5c1ddce2ec495b9272966b595d5adcebc1c
Original-Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15125
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351370
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-06-10 00:17:50 -07:00
Duncan Laurie
9444cb8304 UPSTREAM: skylake: Move I2C bus configuration to separate structure
Move the existing I2C voltage configuration variable into a new
structure that is equivalent, similar to how USB ports are configured.

This is to make room for additional I2C configuration options like
bus speed and whether to enable the bus in early boot which are coming
in a subsequent commit.

The affected mainboards are updated in this commit so it will build.

BUG=None
BRANCH=None
TEST=None

Original-Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Change-Id: Id2dea3df93e49000d60ddc66eb35d06cca6dd47e
Original-Reviewed-on: https://review.coreboot.org/15104
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351339
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-06-10 00:17:49 -07:00
Duncan Laurie
b3590daa8f UPSTREAM: skylake: gpio: Add support for setting 1.8V tolerant
Add the voltage tolerance GPIO attribute for configuring I2C/I2S buses
that are at 1.8V. This is currently done by passing in a value to FSP
but it is needed earlier than FSP if the I2C bus is used in verstage.

This does not remove the need for the FSP input parameter, that is
still required so FSP doesn't disable what has been set in coreboot.
The mainboards that are affected are updated in this commit.

This was tested by exercising I2C transactions to the 1.8V codec while
in verstage on the google/chell mainboard.

BUG=None
BRANCH=None
TEST=None

Original-Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Change-Id: I93d22c2e3bc0617c87f03c37a8746e22a112cc9c
Original-Reviewed-on: https://review.coreboot.org/15103
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Tested-by: build bot (Jenkins)
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351338
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-06-10 00:17:48 -07:00
Duncan Laurie
65c95826cf UPSTREAM: skylake: Add function to set PRR for protecting flash
Add a function similar to broadwell to set the PRR for a region of
flash and protect it from writes. This is used to secure the MRC
cache region if the SPI is write protected.

BUG=chrome-os-partner:54003
BRANCH=glados
TEST=boot on chell, verify PRR register is set and that the
MRC cache region cannot be written if the SPI is write protected.

BUG=None
BRANCH=None
TEST=None

Change-Id: I925ec9ce186f7adac327bca9c96255325b7f54ec
Original-Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Original-Original-Commit-Id: abb6f645f5ceef3f52bb7afd2632212ea916ff8d
Original-Change-Id: I2f90556a217b35b7c93645e41a1fcfe8070c53da
Original-Original-Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Original-Original-Reviewed-on: https://chromium-review.googlesource.com/349274
Original-Original-Reviewed-by: Shawn N <shawnn@chromium.org>
Original-Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Original-Tested-by: Shawn N <shawnn@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/15102
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-by: Leroy P Leahy <leroy.p.leahy@intel.com>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351337
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-06-10 00:17:48 -07:00
Duncan Laurie
3073004ca5 UPSTREAM: soc/intel/common: Add LPSS I2C driver
Add a generic LPSS I2C driver for Intel SOCs that use the Synopsys
DesignWare I2C block and have a similar configuration of that block.

This driver is ported from the Chromium depthcharge project where it
was ported from U-Boot originally, though it looks very different now.
From depthcharge it has been modified to fit into the coreboot I2C
driver model with platform_i2c_transfer() and use coreboot semantics
throughout including the stopwatch API for timeouts.

In order for this shared driver to work the SOC must:

1) Define CONFIG_SOC_INTEL_COMMON_LPSS_I2C_CLOCK_MHZ to set the clock
speed that the I2C controller core is running at.

2) Define the lpss_i2c_base_address() function to return the base
address for the specified bus. This could be either done by looking
up the PCI device or a static table if the controllers are not PCI
devices and just have a static base address.

The driver is usable in verstage/romstage/ramstage, though it does
require early initialization of the controller to set a temporary base
address if it is used outside of ramstage.

This has been tested on Broadwell and Skylake SOCs in both pre-RAM and
ramstage environments by reading and writing both single bytes across
multiple segments as well as large blocks of data at once and with
different configured bus speeds.

While it does need specific configuration for each SOC this driver
should be able to work on all Intel SOCs currently in src/soc/intel.

BUG=None
BRANCH=None
TEST=None

Change-Id: Ibe492e53c45edb1d1745ec75e1ff66004081717e
Original-Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/15101
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351336
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-06-10 00:17:47 -07:00
Duncan Laurie
643bd216b8 UPSTREAM: device: i2c: Add support for I2C bus operations
In order to support doing bus operations on an I2C device that is
described in the devicetree there needs to be some linkage of the
device and the existing opaque I2C controller bus number.

This is provided in a similar fashion to the existing SMBUS operations
but modified to fit within the existing I2C infrastructure.

Variants of the existing I2C helper functions are provided that will
obtain the bus number that corresponds to this device by looking for
the SOC-provided I2C bus operation structure to provide a function
that will make that translation.

For example an SOC using a PCI I2C controller at 0:15.0 could use:

soc/intel/.../i2c.c:
static int i2c_dev_to_bus(struct device *dev)
{
if (dev->path.pci.devfn == PCI_DEVFN(0x15, 0))
return 0;
return -1;
}
static struct i2c_bus_operation i2c_bus_ops = {
.dev_to_bus = &i2c_dev_to_bus
}
static struct device_operations i2c_dev_ops = {
.ops_i2c_bus = &i2c_bus_ops
...
}

With an I2C device on that bus at address 0x1a described in the tree:

devicetree.cb:
device pci 15.0 on # I2C0
chip drivers/i2c/sample
device i2c 1a.0 on end
end
end

That driver can then do I2C transactions with the device object
without needing to know that the SOC-specific bus number that this
I2C device lives on is "0".

For example it could read a version value from register address 0
with a byte transaction:

drivers/i2c/sample/sample.c:
static void i2c_sample_enable(struct device *dev)
{
uint8_t ver;
if (!i2c_dev_readb(dev, 0x00, &ver))
printk(BIOS_INFO, "I2C %s version 0x02xn", dev_path(dev), ver);
}

BUG=None
BRANCH=None
TEST=None

Change-Id: I6c41c8e0d10caabe01cc41da96382074de40e91e
Original-Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/15100
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351335
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-06-10 00:17:46 -07:00
Lee Leahy
502935b5ee UPSTREAM: soc/intel/quark: Pass serial port address to FSP
Pass the serial port address to FSP using a UPD value in the MemoryInit
API.

TEST=Build and run on Galileo Gen2

BUG=None
BRANCH=None
TEST=None

Change-Id: I86449d80310b7b34ac503ebd2671a4052b080730
Original-Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Original-Reviewed-on: https://review.coreboot.org/15079
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/351334
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2016-06-10 00:17:45 -07:00
Julius Werner
e3e661b6a9 UPSTREAM: veyron: Add exception_init() to romstage
I'm not even sure how this slipped through... looks like it had never
been there in the first place. Anyway, on ARM exceptions should always
be reinitialized in all stages to make sure the handlers are still
around (especially in an OVERLAP_VERSTAGE_ROMSTAGE board like this one).

Change-Id: Ic74ea1448d63b363f2ed59d9e2529971b3d32d9a
Original-Signed-off-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/15099
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
(cherry-picked from commit 221fdd8cce)
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/350971
Commit-Ready: Aaron Durbin <adurbin@chromium.org>
Tested-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-09 02:16:11 -07:00