Commit graph

8,459 commits

Author SHA1 Message Date
Gabe Black
2384bae15f chromeec: Add a function to send passthrough i2c messages.
BUG=chrome-os-partner:19420
TEST=Built and booted into depthcharge on pit. Used the function to read and
write i2c registers on the tps65090 and verified that they were consistent
with expected values and were affected by writes in a reasonable way.
BRANCH=None

Change-Id: I57ea6be8b81e31191399a7457ef5106c56f7f27d
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/60516
Reviewed-by: Ronald G. Minnich <rminnich@chromium.org>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2013-06-29 10:36:15 -07:00
Aaron Durbin
2e92f1080c elog: handle ROM_SIZE differences from detected flash size
The elog code calculates flash offsets and their equivalent
addresses in the memory address space. However, it assumes
the detected flash size is entirely mapped into the address
space. This can lead to incorrect calculations. Add code
to allow ROM_SIZE to be less than detected flash size. The
underlying assumption is that the first ROM_SIZE bytes are
programmed into the larger device.

BUG=None
BRANCH=None
TEST=Built and ran a 8MiB image on a 16MiB flash part.

Change-Id: Id848f136515289b40594b7d3762e26e3e55da62f
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/60501
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2013-06-28 15:25:41 -07:00
Ronald G. Minnich
af9d0f0902 Add in the Makefile bits for the new intel gma driver
The Intel GMA driver is in, this CL splices in the Makefile bits.

BUG=None
TEST=Build and boot falco
BRANCH=None

Change-Id: Icf42a537575b8cc90a679ec1fc15b09294630611
Signed-off-by: Ronald G. Minnich <rminnich@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/60346
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Commit-Queue: Ronald G. Minnich <rminnich@chromium.org>
Tested-by: Ronald G. Minnich <rminnich@chromium.org>
2013-06-28 11:26:17 -07:00
Duncan Laurie
b4d92f8015 bolt: Initial mainboard commit
BUG=chrome-os-partner:20448
BRANCH=none
TEST=emerge-bolt chromeos-coreboot-bolt

Change-Id: I634a755ac7659e7a977b51bcc061f69eb8263810
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/59843
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-06-28 10:27:28 -07:00
Hung-Te Lin
0b902f6e1c armv7/pit: Correct EC device in mainboard configuration.
The ChromeOS EC for peach_pit is connected to SPI2 bus, not I2C.

BUG=chrome-os-partner:20441
TEST=emerge-peach_pit chromeos-coreboot-peach_pit
BRANCH=peach_pit

Change-Id: I4a14cf21e7564102090e0dc26ea16dede3fc42b2
Reviewed-on: https://gerrit.chromium.org/gerrit/60087
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2013-06-27 21:20:45 -07:00
Hung-Te Lin
75240701fe armv7/exynos5420: Remove the extra reopen when reading SPI.
The workaround of re-opening device in exynos_spi_read has been fixed by the new
correct open/close and xfer procedure. It's safe to be removed now.

BUG=none
TEST=emerge-peach_pit chromeos-coreboot-peach_pit; # Successfully boot on pit.
BRANCH=peach_pit

Change-Id: I85d80a5298bbec09b4b731e83dd7bd1d97b3e039
Reviewed-on: https://gerrit.chromium.org/gerrit/60086
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2013-06-27 21:20:45 -07:00
Hung-Te Lin
6850a81cf1 armv7/exynos5420: Apply new implementation for SPI transmission.
Switch spi_xfer and exynos_spi_read to use the new spi_rx_tx function.

BUG=chrome-os-partner:20441
TEST=emerge-peach_pit chromeos-coreboot-peach_pit; # Successfully boots on pit.
BRANCH=peach_pit

Change-Id: I46dae4d604c8b78bec5aaeb8778dfad635e657b1
Reviewed-on: https://gerrit.chromium.org/gerrit/60085
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2013-06-27 21:20:44 -07:00
Hung-Te Lin
0b1d8e1423 armv7/exynos5420: Add output ability and half-duplex mode in SPI driver.
The SPI driver (exynos_spi_rx_tx) was implemented with only "read" ability and
only full-duplex mode. To communicate with devices like ChromeOS EC, we need
both output (tx) and half-duplex (searching frame header) features.

This commit adds a spi_rx_tx that can handle all cases we need.

BUG=chrome-os-partner:20441
TEST=emerge-peach_pit chromeos-coreboot-peach_pit
BRANCH=peach_pit

Change-Id: I4f216c42e2d9a1930e8c169e3cdd082ba7918357
Reviewed-on: https://gerrit.chromium.org/gerrit/60084
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2013-06-27 21:20:44 -07:00
Hung-Te Lin
edec2f7a9f armv7/exynos5420: Revise SPI open/close/reset procedure.
The original Exynos SPI open/close procedure was copied from U-Boot SPL with
some assumptions that only works in SPL stage.  For example, it tries to always
work in 4-byte transmission mode with only RX data is swapped, and claims a
packet for initial address command (and with incorrect size).

This commit revises open/close and reset so only the required SPI registers are
configured.

BUG=chrome-os-partner:20441
TEST=emerge-peach_pit chromeos-coreboot-peach_pit
BRANCH=peach_pit

Change-Id: I8c16d539f6aebd14182846ced5afa7a9457890e4
Reviewed-on: https://gerrit.chromium.org/gerrit/60083
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2013-06-27 21:20:43 -07:00
Hung-Te Lin
8c12f46b7c armv7/exynos5420: Provide configuration for SPI0~SPI2.
Fill the SPI device parameters for spi_setup_slave on Exynos 5420.

BUG=chrome-os-partner:20441
TEST=emerge-peach_pit chromeos-coreboot-peach_pit
BRANCH=peach_pit

Change-Id: I447e877332451a0172e2530f3f127343f8a730c3
Reviewed-on: https://gerrit.chromium.org/gerrit/60082
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2013-06-27 21:20:43 -07:00
Hung-Te Lin
2a5d1c1272 armv7/exynos5420: Change SPI module to standard <spi-generic> interface.
The SPI module in Exynos 5420 didn't follow Coreboot's SPI API standard
(spi-generic.h) and will be a problem when we want to share SPI drivers.

This commit replaces exynos_spi_* by spi_* functions.

Note, exynos_spi_read is kept and changed to a static function because its usage
is different from the standard API "spi_xfer".

BUG=chrome-os-partner:20441
TEST=emerge-peach_pit chromeos-coreboot-peach_pit
BRANCH=peach_pit

Change-Id: Iadd14bcedbe97aacecd490d97f6ca17c4097e4a5
Reviewed-on: https://gerrit.chromium.org/gerrit/60081
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2013-06-27 21:20:43 -07:00
Hung-Te Lin
d5240740fa armv7/exynos5420: Clean up unused header and constants in spi.c
Remove unused header and constant definition in SPI module.

BUG=none
TEST=emerge-peach_pit chromeos-peach_pit
BRANCH=none
Change-Id: I5d858dc8894ee60c2332da4eaae4c6f10eae0649
Reviewed-on: https://gerrit.chromium.org/gerrit/60080
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2013-06-27 21:20:42 -07:00
Hung-Te Lin
4adfdb2140 armv7/exynos5420: Revise SPI device list in cpu.h
Add SPI0 and SPI2 to Exynos 5 SPI list, and correct structure names.
Also removed the un-enumerated devices (SPI_BASE, base_spi()).

BUG=chrome-os-partner:20441
TEST=emerge-peach_pit chromeos-coreboot-peach_pit
BRANCH=peach_pit

Change-Id: I059dbd778dc37633c59702050965632b7b22e685
Reviewed-on: https://gerrit.chromium.org/gerrit/60079
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2013-06-27 21:20:42 -07:00
Hung-Te Lin
10888bb24a ec/google: Support ChromeOS EC on SPI bus.
For devices with ChromeOS EC on SPI bus, use the standard SPI driver interface
(see spi-generic.h) to exchange data.

Note: Only EC protocol v3 is supported for SPI bus.

BUG=chrome-os-partner:20441
TEST=emerge-peach_pit chromeos-coreboot-peach_pit
BRANCH=peach_pit

Change-Id: Iefea401cad2163b429a548b35545c6bd2c5cacf3
Reviewed-on: https://gerrit.chromium.org/gerrit/60078
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2013-06-27 21:20:42 -07:00
Hung-Te Lin
8ae01142bb ec/google: Support Chrome EC protocol version 3.
Add the new Chrome EC protocol version 3 to Coreboot.

Note, protocol version 3 is not applied on any bus implementations yet.
LPC (x86) and I2C (arm/snow) are still using v2 protocol.  The first one to use
v3 protocol will be SPI bus (arm/pit).  LPC / I2C will be updated to v3 only
when they are ready to change.

BUG=chrome-os-partner:20257
TEST=emerge-daisy chromeos-coreboot-snow; emerge-link chromeos-coreboot-link
BRANCH=none

Change-Id: Ica48b56cb9c7ca0fccb1375de45cee16fbbc100e
Reviewed-on: https://gerrit.chromium.org/gerrit/59670
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
2013-06-27 21:20:41 -07:00
Ronald G. Minnich
f99a6dbe50 FUI: add intel_dp driver derived from kernel functions
These functions are not all used yet, but do compile and are partially used
in the FUI testing.

They were extracted from the 3.4 kernel using coccinnelle filters. The .c files
are only compiled in if CONFIG_INTEL_DP is set.

BUG=None
TEST=Build and boot on falco and slippy with and without these compiled in and used
BRANCH=None

Change-Id: Id95622a75aa02b496c9ea4717cb143394a8332e3
Signed-off-by: Ronald G. Minnich <rminnich@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/60245
Commit-Queue: Ronald G. Minnich <rminnich@chromium.org>
Tested-by: Ronald G. Minnich <rminnich@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@google.com>
2013-06-27 18:31:54 -07:00
Ronald G. Minnich
7f0984e7a8 HASWELL: pull in the init code for FUI.
Removed two unnecessary register sets, and did the power well a bit
more correctly. Also, added a register definition include file so we can
used constants instead of magic numbers.

We also set registers to common initialized values that are
needed for FUI, VBIOS, and kernel. This set of registers
appears to be an absolute bare minimum. Since we're hoping to use
FUI for all chipsets from this one forward, we unconditionally do the
setting here.

BUG=None
TEST=build and boot with FUI. Then build and boot with VBIOS and a
kernel. As before, remove the VBIOS image to fully test that the
kernel can work without the VBIOS at all.
BRANCH=None

Signed-off-by: Ronald G. Minnich <rminnich@google.com>

Change-Id: Ife3f661ba010214d92b646b336f2b06645119f17
Reviewed-on: https://gerrit.chromium.org/gerrit/59988
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Commit-Queue: Ronald G. Minnich <rminnich@chromium.org>
Tested-by: Ronald G. Minnich <rminnich@chromium.org>
2013-06-27 10:00:22 -07:00
Ronald G. Minnich
553f1217b9 LINK: use the new edid functions when in FUI mode
The new edid functions support converting the edid to an lb_framebuffer.
Use them. Also, since panels seem to set bits per color instead of bits
per pixel, just force the right value in the edid struct.

Add helpful comment because people don't always believe we need to set
the pallette.

While we're at it, fix a problem that caused it to not compile.

BUG=None
TEST=build and boot and get graphics.
BRANCH=All

Change-Id: I645edc4e442d9b96303d9e17f175458dc7ef28b6
Signed-off-by: Ronald G. Minnich <rminnich@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/57619
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Commit-Queue: Ronald G. Minnich <rminnich@chromium.org>
Tested-by: Ronald G. Minnich <rminnich@chromium.org>
2013-06-26 12:40:41 -07:00
Ronald G. Minnich
2fd54deb2d Move the MARK_GRAPHICS_MEM_WRCOMB to x86 architecture
The MARK_GRAPHICS_MEM_WRCOMB was spreading like a cancer
since it was defined in sandybridge. It is really
more of an x86 thing however.

I considered making this more general, since it technically
can apply to PTE-based systems like ARM, and maybe we should.

BUG=None
TEST=abuild
BRANCH=None

Change-Id: I93d2daa2eff06ddd8cd7cd2e9d5beb8208115506
Signed-off-by: Ronald G. Minnich <rminnich@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/57219
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Commit-Queue: Ronald G. Minnich <rminnich@chromium.org>
Tested-by: Ronald G. Minnich <rminnich@chromium.org>
2013-06-26 11:56:58 -07:00
Hung-Te Lin
9223006e8f ec/google: Generalize communication protocol support in EC drivers.
Since EC protocol v3, the packet format will be the same for all buses (inclding
I2C, SPI, and LPC). That will simplify the implementation in each individual bus
driver source file.

To prepare for that, we will move the protocol part into crosec_proto.c:
crosec_command_proto, with bus driver in callback "crosec_io".

BUG=none
TEST=emerge-daisy chromeos-coreboot-snow # built successfully.
BRANCH=none

Change-Id: I5d59d5922cbe68f4e838d01de530d8a5e57eb2b2
Reviewed-on: https://gerrit.chromium.org/gerrit/59244
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
2013-06-25 23:24:21 -07:00
Hung-Te Lin
973beef0cf armv7/pit: Setup EC on SPI2.
The Embedded Controller (EC) for Pit is connected via SPI2, and needs to be
configured before we can talk to it.

BUG=chrome-os-partner:20441
TEST=emerge-peach_pit chromeos-coreboot-peach_pit; boot successfully.
BRANCH=none

Change-Id: Ic260d89a4aad0633868800af9c331ce8cf7a518f
Reviewed-on: https://gerrit.chromium.org/gerrit/59751
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
2013-06-25 23:24:21 -07:00
Duncan Laurie
d9dd16c117 lynxpoint: Update LPT-LP PM settings
- updates from 1.6.0 ref code
- remove the step comments as they are no longer even close
- add constants for LPT revisions

BUG=chrome-os-partner:20453
BRANCH=none
TEST=manual: build and boot on Falco

Check that RCBA+2300[1] is set:
> mmio_read32 0xfed1e300
0x00000002

Change-Id: I8b3c5fda3f3170455699a7834239cb991603e7a8
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/59821
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-06-25 12:20:04 -07:00
Hung-Te Lin
df09a839bc arm/exynos: Correct SPI session commands.
Some initialization / shutdown commands should be paired correctly in a SPI I/O
session. For example, setting CS should be enabled and disabled in each read;
and the bus width (byte or word) should be configured only when opening /
closing the SPI device.

BUG=none
TEST=manually: emerge-daisy chromeos-coreboot-snow; boot on Snow.
BRANCH=none

Change-Id: I1e4532e71fb535453c9fd9151f89dd2aca52e7d0
Reviewed-on: https://gerrit.chromium.org/gerrit/59691
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
2013-06-25 09:05:47 -07:00
David Hendricks
9a191c53e6 pit: update I2C4 speed constant
BUG=none
BRANCH=none
TEST=tested on pit

Change-Id: I61896f70f41eec12a1499307f695fa69f3d42d88
Reviewed-on: https://gerrit.chromium.org/gerrit/59692
Reviewed-by: Gabe Black <gabeblack@chromium.org>
Commit-Queue: David Hendricks <dhendrix@chromium.org>
Tested-by: David Hendricks <dhendrix@chromium.org>
2013-06-24 21:36:03 -07:00
Gabe Black
bf54108b62 exynos5420: i2c: Fix error handling.
The functions which checked the status of a transfer would return success if
the bus was no longer occupied, even if it's no longer occupied because the
transfer failed. This change modifies those functions to return three possible
values, 0 if the transfer isn't done, -1 if there was a fault, and 1 if the
transaction completed successfully.

BUG=chrome-os-partner:19420
TEST=Built and booted into depthcharge on pit and verified that the PMIC was
initialized successfully by coreboot. Similar changes were tested in
depthcharge when probing the tpm and when communicating with it and corrected
some problems there.
BRANCH=None

Change-Id: If20e0f29688542ba03f08c1da3ebe0429103d33d
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/59733
Reviewed-by: Ronald G. Minnich <rminnich@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2013-06-24 15:44:27 -07:00
Gabe Black
69599da6c4 exynos5420: Clock the mmc blocks off of the mpll.
The exynos manual suggests hooking the mmc ip blocks to the mpll. They had
been set to use a different pll. This changes them over and modifies the
divider so that the frequency stays the same.

BUG=chrome-os-partner:19420
TEST=Built and booted into depthcharge on pit.
BRANCH=None

Change-Id: I9b473b683c5806a49c9eba91807baa0b58c9c9dd
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/59732
Reviewed-by: Ronald G. Minnich <rminnich@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2013-06-24 15:44:27 -07:00
Gabe Black
4d7d1ed821 pit: Configure the pinmux for the i2c busses that are connected on pit.
BUG=chrome-os-partner:19420
TEST=Built and booted into depthcharge on pit. Saw that depthcharge could talk
to the TPM over i2c.
BRANCH=None

Change-Id: I08c483bf57b17ed923dee0715e1a244ff607bd64
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/59731
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2013-06-24 15:44:26 -07:00
David Hendricks
651af7a366 exynos5420: use speed parameter in i2c_init() for HSI2C
This allows us to set different speeds for each HSI2C bus.

BUG=none
BRANCH=none
TEST=using logic analyzer on pit, saw I2C4 run at 1MHz
     and I2C9 run at 400KHz

Change-Id: I27bf54084644c4cbcdbed423197a1113d6f6c17b
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/59693
Reviewed-by: Gabe Black <gabeblack@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2013-06-24 15:44:26 -07:00
Gabe Black
82178acc91 exynos5420: Change some clock settings.
This change adjusts some clock settings so that they match U-Boot. There are
three different changes.

1. Change the source for psgen from the oscillator clock to the pclk.
2. Change the pll feeding the SPI busses from epll to mpll, as suggested in
   the manual.
3. Change the SPI prescaller.

BUG=chrome-os-partner:19420
TEST=Built and booted into depthcharge on pit.
BRANCH=None

Change-Id: I2896c099a91bdb78bfac03fbb804ef65c3233cd0
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/59730
Reviewed-by: Ronald G. Minnich <rminnich@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2013-06-24 15:44:25 -07:00
Gabe Black
0dd1750cba exynos5420: Fix the way the rate of the input clock for i2c buses is found.
The clock divider was being read from registers incorrectly which meant that
the periph rate was wrong.

BUG=chrome-os-partner:19420
TEST=Built and booted into depthcharge on pit.
BRANCH=None

Change-Id: Idb38374195a737fac2f096771929c8f1645d7247
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/59729
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2013-06-24 15:44:24 -07:00
Hung-Te Lin
6cf67f7261 snow: Add flush to UART driver.
Wait for UART FIFO to be ready.
(Credit to dhendrix for finding the bits to test with.)

BUG=none
TEST=manually boot device and see no garbage on serial output.
BRANCH=none

Change-Id: Ic921cc39a27b137f1a7fd137e032ffb61489bdd1
Reviewed-on: https://gerrit.chromium.org/gerrit/57660
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: David Hendricks <dhendrix@chromium.org>
Tested-by: David Hendricks <dhendrix@chromium.org>
2013-06-24 14:04:01 -07:00
Julius Werner
e39e2d8476 libpayload: Make USB transfer functions return amount of bytes
The USB bulk and control transfer functions in libpayload currently
always return 0 for success and 1 for all errors. This is sufficient for
current use cases (essentially just mass storage), but other classes
(like certain Ethernet adapters) need to be able to tell if a transfer
reached the intended amount of bytes, or if it fell short.

This patch slightly changes that USB API to return -1 on errors, and the
amount of transferred bytes on successes. All drivers in the current
libpayload mainline are modified to conform to the new error detection
model. Any third party users of this API will need to adapt their
if (...<controller>->bulk/control(...)) checks to
if (...<controller>->bulk/control(...) < 0) as well.

The host controller drivers for OHCI and EHCI correctly implement the
new behavior. UHCI and the XHCI stub just comply with the new API by
returning 0 or -1, but do not actually count the returned bytes.

BUG=chrome-os-partner:16957
TEST=None
BRANCH=None

CQ-DEPEND=CL:59674

Change-Id: Ic2ea2810c5edb992cbe185bc9711d2f8f557cae6
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/48308
Reviewed-by: Gabe Black <gabeblack@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Tested-by: Gabe Black <gabeblack@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
2013-06-24 14:03:27 -07:00
Aaron Durbin
4e63582549 lynxpoint: enable clock gating
Implement the LynxPoint BIOS Spec for clock gating.

BUG=chrome-os-partner:20262
BRANCH=None
TEST=Built. Booted. WLAN card able to detect network with applied
     patch.

Change-Id: Iaa84cb447bd29b0d13cdda481a1661ea40499de1
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/59590
Reviewed-by: Stefan Reinauer <reinauer@google.com>
2013-06-24 13:08:17 -07:00
Hung-Te Lin
f904184040 ec/chromeec: Merge upstream V3 structure and constant definition.
Chrome EC protocol V3 has several new command structure and constants defined.
Simply cherry-picking changes from upstream.

BUG=none
TEST=emerge-daisy chromeos-coreboot-snow # build pass

Change-Id: Iaabd90058620e9e4497b701341a4b4ca5027c302
Reviewed-on: https://gerrit.chromium.org/gerrit/59410
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
2013-06-21 20:16:58 -07:00
Aaron Durbin
e4cc292b03 lynxpoint: provide gpio_is_native()
There's a need to determine if a specific gpio pin is
is set up to be a native function or not. Implement this.

BUG=chrome-os-partner:20262
BRANCH=None
TEST=Built. Determined LP version worked correctly based off of another
     patch.

Change-Id: I91d57a549e0f4fddc0b1849e5f74320fc839642c
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/59589
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2013-06-21 20:16:44 -07:00
Aaron Durbin
f266116f30 lynxpoint: implement additional programming steps
The BIOS spec for LynxPoint calls out additional
programming steps for the PCIe Root Ports. Implement those
steps from the BIOS spec. These steps are completed before
deeper PCIe probing. The "late" programming was removed as
that was applicable to Cougar/Panther point where this
code was originally copied, though there was some overlap.

BUG=chrome-os-partner:20262
BRANCH=None
TEST=Built and booted. Spot checked some registers. Device
     shows up in lspci.

Change-Id: I64f25e4451e035d98ca6b66b0335bd280b70b074
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/59558
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2013-06-21 20:16:43 -07:00
Aaron Durbin
08a0bf7e97 lynxpoint: disable pcie devices based on config
PCIe Root Ports should be disabled based on pin ownership
and the strapping configuration. Implement this logic
for LynxPoint. The chip_ops->enable_dev() path is no
longer used. Instead the PCIe driver handles the enabling
and disabling of devices. This allows for having an empty
or incomplete device tree since those "allocated" devices
do not travel through the chip_ops->enable_dev() path.
The coalescing was tested to be working properly, however
not all configurations were tested.

BUG=chrome-os-partner:20262
BRANCH=None
TEST=Booted with different devictree configurations. Coalescing
     works.

Change-Id: I1e8bfe5e447b72ff8a4b04b650982d8c1ae0823c
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/59424
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2013-06-21 20:16:43 -07:00
Stefan Reinauer
2b8b95807d Exynos5420: Initialize USB PHY
... this is needed for libpayload to talk to USB devices.
(forward ported from https://gerrit.chromium.org/gerrit/#/c/55554)

BUG=chrome-os-partner:18635
TEST=Boot on Snow, see EHCI stack find devices
BRANCH=none

Change-Id: I2db8eb30ccc7983e2305b6222f02babf14ddb53f
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/55811
Commit-Queue: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Stefan Reinauer <reinauer@chromium.org>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
2013-06-20 22:56:24 -07:00
Stefan Reinauer
aea2807bb7 Exynos5250: Initialize USB PHY
... this is needed for libpayload to talk to USB devices.

BUG=chrome-os-partner:18635
TEST=Boot on Snow, see EHCI stack find devices
BRANCH=none

Change-Id: I663cb560d79e98cd2b767238fd4aec2cd04854e9
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/55554
Commit-Queue: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Stefan Reinauer <reinauer@chromium.org>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
2013-06-20 19:50:29 -07:00
Shawn Nematbakhsh
13f7e6e757 peppy: Disable forced dev mode.
Don't force dev mode. Allow users to enter / exit dev mode as normal.

TEST=Manual. Build + boot image, test verified boot.
BUG=chrome-os-partner:19636.

Change-Id: I168eb04a8ac102a8c4a1ca8936f78f62b001e0eb
Reviewed-on: https://gerrit.chromium.org/gerrit/59492
Commit-Queue: Shawn Nematbakhsh <shawnn@chromium.org>
Tested-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-by: Dave Parker <dparker@chromium.org>
2013-06-20 18:52:18 -07:00
Stefan Reinauer
4d350b8066 libpayload: Have similar cache api on ARM and x86
So far this is used by the USB driver, and instead of
having ifdefs all throughout that code, implement the same
API on x86 and ARM.

BUG=chrome-os-partner:18635
TEST=Boot from USB on Snow
BRANCH=none

Change-Id: I8093ad818ad2e38a0901787aa8674faf591d580c
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/56105
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Commit-Queue: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Stefan Reinauer <reinauer@chromium.org>
2013-06-20 18:52:16 -07:00
Duncan Laurie
3c613a89f0 Fix Makefile to include all copies of the SPD sources
On some systems there may be 2GB SKU that is the same as the
4GB SKU but just one channel of memory.  In that case we need
to ensure that both copies of the same SPD source end up
populated by ensuring that repeated entries are included by
using $+ instead of $^.

Alternatively we could do the check inside romstage, but it
is already set to behave this way if the SPD gets populated
correctly.

BUG=chrome-os-partner:20268
BRANCH=none
TEST=manual:

I changed spd_index to 3 in falco romstage to force it to
pretend it was a 2GB config of the same memory, then booted
to ensure it was indeed limited to 2GB.

memcfg channel[0] config (00780008):
   ECC inactive
   enhanced interleave mode on
   rank interleave on
   DIMMA 2048 MB width x16 single rank, selected
   DIMMB 0 MB width x16 single rank
memcfg channel[1] config (00600000):
   ECC inactive
   enhanced interleave mode on
   rank interleave on
   DIMMA 0 MB width x8 single rank, selected
   DIMMB 0 MB width x8 single rank

Change-Id: Ibfe5051ccda2fe69e8caff3f3c264116e3411c65
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/59483
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: Jay Kim <yongjaek@chromium.org>
2013-06-20 17:50:00 -07:00
Duncan Laurie
bfc28e109a HDA: Enable Mini-HDA and fix up PCH-HDA init
The SystemAgent contains a mini-hd audio controller at PCI 0:3.0
which uses the same verb table init sequence as the southbridge.

In order to avoid two copies of the verb table loading code I
separated out the HDA verb table functions into a file that can
be re-used and then added a minihd driver to the haswell northbridge.

The minihd verb table is the same across devices so it can live
within the minihd driver rather than needing to be specified in
each separate mainboard.

I also fixed up the driver for lynxpoint HDA by following the
reference code.

BUG=chrome-os-partner:19993
BRANCH=none
TEST=manual: boot into linux and check for mini-hd

Without HDMI cable plugged in driver does not find any codec,
and it does not seem to re-probe when HDMI is connected.  We may
be missing kernel patches for this.

hda-intel 0000:00:03.0: no codecs found!

With a basic kernel patch to add 0x0a0c device ID to HDA driver
and with HDMI cable connected it is much happier:

snd_hda_intel 0000:00:03.0: irq 60 for MSI/MSI-X
input: HDA Intel MID HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:03.0/sound/card0/input9
snd_hda_intel 0000:00:1b.0: irq 61 for MSI/MSI-X
input: HDA Intel PCH Mic as /devices/pci0000:00/0000:00:1b.0/sound/card1/input10
input: HDA Intel PCH Headphone as /devices/pci0000:00/0000:00:1b.0/sound/card1/input11

Change-Id: Ifa587984be4fc2801704a0368b9cdf8379c2450e
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/59336
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-06-20 17:50:00 -07:00
Stefan Reinauer
8d40bbf3e0 libpayload: Clean up CFLAGS
- Add -ffreestanding and -fomit-frame-pointer for all
  platforms.
- Add ARMv7 specific flags to the armv7 Makefile

BUG=none
TEST=build, boot depthcharge on ARM and x86
BRANCH=none

Change-Id: I71ab1b096e505940cc20c266bccd43917bcfad3a
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/56104
Commit-Queue: Stefan Reinauer <reinauer@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Stefan Reinauer <reinauer@chromium.org>
2013-06-20 17:49:58 -07:00
Stefan Reinauer
7a32c00755 libpayload: sync ARMv7 arch/io.h with coreboot
On ARMv7 we need to carefully add memory barriers to
all memory read and write operations. This change
brings libpayload in sync with what coreboot is doing.

Signed-off-by: Stefan Reinauer <reinauer@google.com>
BUG=none
BRANCH=none
TEST=no functional change

Change-Id: Ie9c30b0f0d30531c5f9d99c2729246a86b8cec26
Reviewed-on: https://gerrit.chromium.org/gerrit/59294
Reviewed-by: Gabe Black <gabeblack@chromium.org>
Tested-by: Stefan Reinauer <reinauer@chromium.org>
Commit-Queue: Stefan Reinauer <reinauer@chromium.org>
2013-06-20 16:47:21 -07:00
Stefan Reinauer
c0fc747c62 Exynos: Only compile UART in if serial console is selected
BUG=none
BRANCH=none
TEST=none

Change-Id: I8a303ca0794c7de7095f75cfc12a178745c84de9
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/59325
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Stefan Reinauer <reinauer@chromium.org>
Commit-Queue: David Hendricks <dhendrix@chromium.org>
2013-06-20 15:51:34 -07:00
Stefan Reinauer
aefbafb683 qemu-armv7 CPU: Move Kconfig code into CPU directory
Signed-off-by: Stefan Reinauer <reinauer@google.com>
BUG=none
TEST=none
BRANCH=none

Change-Id: Icae8042add5f4dd5c707369ffc4587c613d69d29
Reviewed-on: https://gerrit.chromium.org/gerrit/59324
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Stefan Reinauer <reinauer@chromium.org>
Commit-Queue: David Hendricks <dhendrix@chromium.org>
2013-06-20 15:51:33 -07:00
Stefan Reinauer
1139ba7c6c Don't try to use CBMEM console in bootblock
Otherwise we have to worry about hand off between bootblock and
romstage. Too much complexity

Signed-off-by: Stefan Reinauer <reinauer@google.com>

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

Change-Id: I3979be4b1d67de27275bc7ba4f45131b09a276f0
Reviewed-on: https://gerrit.chromium.org/gerrit/59323
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Stefan Reinauer <reinauer@chromium.org>
Commit-Queue: David Hendricks <dhendrix@chromium.org>
2013-06-20 15:51:33 -07:00
Ronald G. Minnich
a7d40e1502 Exynos5420: add code to make sure resume will work on DRAM.
Found during a perusal of u-boot changes. It looks important.
For more info: http://git.chromium.org/gitweb/?p=chromiumos/third_party/u-boot.git;a=commit;h=56eab63922d2b2380518238ae03e8d69e99af4fe

BUG=chrome-os-partner:19420
BRANCH=none
TEST=not yet

Change-Id: I8173629f0d841aedb9be17ad97b6c9b48dc0c53d
Signed-off-by: Ronald G. Minnich <rminnich@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/59317
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Commit-Queue: Ronald G. Minnich <rminnich@chromium.org>
Tested-by: Ronald G. Minnich <rminnich@chromium.org>
2013-06-20 13:54:45 -07:00
Stefan Reinauer
292a54e240 cbmem: Implement ARM support
Signed-off-by: Stefan Reinauer <reinauer@google.com>

BUG=chrome-os-partner:18637
TEST=Run sudo cbmem -l on Snow w/ coreboot, observe that it finds
     CBMEM
BRANCH=none

Change-Id: If5f961afb23791af6f32dd4fc9a837a1aa41b70e
Reviewed-on: https://gerrit.chromium.org/gerrit/59322
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Stefan Reinauer <reinauer@chromium.org>
Commit-Queue: Stefan Reinauer <reinauer@chromium.org>
2013-06-20 13:54:35 -07:00