Commit graph

9,176 commits

Author SHA1 Message Date
Aaron Durbin
ebc3d2741d baytrail: pcie: Root port initialization
Add PCIe driver to initialize root ports.

BUG=chrome-os-partner:24111
TEST=Manual on Rambi. Verify that PCIe Wifi card is detected and able to
detect networks.
BRANCH=None.

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>

Change-Id: I3c68da5f27cd162e112add488bdf5ced192b7d12
Reviewed-on: https://chromium-review.googlesource.com/177652
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Commit-Queue: Shawn Nematbakhsh <shawnn@chromium.org>
Tested-by: Shawn Nematbakhsh <shawnn@chromium.org>
2013-11-25 18:32:51 +00:00
David Hendricks
f292352632 tegra124: fix SPI AHB burst length
The AHB burst length was being set to an invalid value. Apparently
this didn't hurt anything, but we may as well set it correctly.

Also, we don't need to explicitly set AHB_SEQ_WRAP since it defaults
to the value we want.

BUG=none
BRANCH=none
TEST=built and booted on Nyan rev. 0 and 1
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Change-Id: Iffb9edeb178ab48876f891d0822a24daae93aa8e
Reviewed-on: https://chromium-review.googlesource.com/177564
Reviewed-by: Tom Warren <twarren@nvidia.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2013-11-23 02:33:47 +00:00
Julius Werner
5635b13877 arm: Have the linker garbage-collect unused functions and variables
This patch activates -ffunction-sections and -fdata-sections for the
compiler and --gc-sections for the linker. This will strip out all
unused functions and static/global variables from the final binaries and
reduce the amount of data we need to read over SPI.

A quick test with ToT images shows a 2.5k (13%) / 10k (29%) / 12k (28%)
reduction on Nyan and 3k (38%) / 23k (50%) / 13k (29%) on Pit,
respectively for bootblock / romstage / ramstage.

BUG=None
TEST=Made sure Nyan and Pit still boot to kernel.

Change-Id: I052411d4ad190d0395921ac4d4677341fb91568a
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/177111
2013-11-23 02:33:40 +00:00
Gabe Black
38c84786fc tegra124: Initialize the MCR when setting up the UART.
This doesn't seem to be truly necessary, but it matches what other drivers do
and might be a good idea for safety's sake.

BUG=chrome-os-partner:24138
TEST=Built and booted on norrin.
BRANCH=None

Change-Id: Ie7c2717e81b2a5dcb831e608eb56347709dc1483
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://chromium-review.googlesource.com/177638
Reviewed-by: Tom Warren <twarren@nvidia.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2013-11-23 02:33:29 +00:00
Gabe Black
bd533cc109 tegra124: Mux some unused pins away from UARTA, and pull up the serial RX line.
On nyan boards, the hardware flow control pins for the UART aren't used or
connected to anything, but the reset pinmux settings still have them routed
out some of the SOC pins. That can break input over the serial console if the
pin is pulled in the wrong direction.

Also, if the RX line isn't connected to anything, ie if no servo is connected,
then we don't want it to float around and potentially draw power through the
input pin buffering logic. We add a pull up to it so it will go somewhere in
particular if otherwise unattached.

This is generally not a great place to put pinmux configuration because it's
specific to a particular board but this is shared by everything with a
tegra124 in it. It's a good idea to have serial output as soon as possible,
though, and the other serial related pinmux settings were probably put here
before we really understood the complexities and flexibility of the tegra
pinmux. We might want to factor out this part of the serial console config and
delegate it to a hook in the mainboard specific code, or just wait until we
call bootblock_mainboard_init.

BUG=chrome-os-partner:24138
TEST=Built and booted on a peppy based nyan. Before this change serial input
was ignored. After this change, serial input was accepted by both the firmware
and the kernel.
BRANCH=None

Change-Id: Ie5428500aa525a600eb1ff4a81b5cc2805d5cc92
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://chromium-review.googlesource.com/177637
Reviewed-by: Tom Warren <twarren@nvidia.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2013-11-23 02:33:26 +00:00
Gabe Black
d7ddcf262a nyan: Create kconfig variables for each SDRAM config.
Instead of choosing between SDRAM configurations for rev0 nyans and everything
else (currently only rev1), we should create a kconfig for each possible config
and put them inside a "choice" block. That way we can have an arbitrarily large
number of choices without them getting to be hard to manage or accidentally not
being mutually exclusive. This also makes the choice of SDRAM config more
explicit instead of it being implied by what rev you're compiled for.

One tradeoff of this approach is that you need to know which config goes with
which rev. Unfortunately we can't decide using the board ID like we can for
most other things because the BCT is consumed by code we don't control before
any of our own code runs.

We default to the slower config for safety's sake, because it will work on
both boards, and because it's the right config for the norrin which we were
going to transition to soon anyway.

Also, we can eliminate the NYAN_IN_A_PIXEL kconfig variable. Alas, we hardly
knew ye.

BUG=None
TEST=Built and booted on both types of nyan.
BRANCH=None

Change-Id: I9a630189e001e95c740c6741057511bf5939fdbb
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://chromium-review.googlesource.com/177580
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Reviewed-by: Tom Warren <twarren@nvidia.com>
Reviewed-by: Ronald Minnich <rminnich@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2013-11-23 02:33:14 +00:00
Gabe Black
677bdb9df5 nyan: Use the board ID to decide how to initialize the PMIC.
Use the board ID to figure out how to initialize the PMIC instead of using a
config option.

BUG=None
TEST=Built and booted on both types of nyan.
BRANCH=None

Change-Id: I26f735f3c7ba910fd237a1d00d616d3d89b9fbd9
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://chromium-review.googlesource.com/177489
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Reviewed-by: Tom Warren <twarren@nvidia.com>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2013-11-23 02:33:10 +00:00
Gabe Black
5fccbce99e nyan: Add some code for reading the board ID.
We can use that to figure out which revision of nyan we're running on and make
some small adjustments for the differences in hardware.

BUG=None
TEST=Built and booted on both versions of nyan.
BRANCH=None

Change-Id: Iaedbc36dcc8e27b95b1e1ec5687bd9592c49d775
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://chromium-review.googlesource.com/177488
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Reviewed-by: Tom Warren <twarren@nvidia.com>
Reviewed-by: Ronald Minnich <rminnich@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2013-11-23 02:33:05 +00:00
David Hendricks
c25337dac8 tegra124: Bump up HCLK and PCLK
This sets the sclk:hclk:pclk ratio to 1:2:2 which allows faster
transfers from peripherals to memory.

Performance-wise this currently decreases ramstage loading time
by about 20ms and payload loading time by 35ms.

BUG=chrome-os-partner:24182
BRANCH=none
TEST=Built and booted on Nyan rev 1 and 0. No longer see long
delays in between bytes when transferring >64 bytes via SPI.
CQ-DEPEND=CL:177578

Change-Id: I5812122bf6312a1ab490945c6e52fa3372e86fc9
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/177563
Reviewed-by: Tom Warren <twarren@nvidia.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2013-11-22 07:19:14 +00:00
Shawn Nematbakhsh
5b9481b14f baytrail: gpio: Fix NCORE gpio-to-pad LUT
NCORE pad addresses were wildly wrong due to documentation bugs.

BUG=chrome-os-partner:24179
TEST=Manual on Rambi. Verify display isn't always on. Verify brightness
control now works in Chrome OS.
BRANCH=None.

Change-Id: I464436a58baa4957329c11231c5a866dafd97ce8
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/177597
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-11-21 22:22:22 +00:00
Gabe Black
6b119685f6 nyan: Separate the SDRAM BCT config for the two nyans, and turn down norrin.
The memory clock set up for the pixel based nyan boards is too fast for the
peppy based boards. We want to use the right config for the right board, so
that needs to be configurable based on what board your targeting.

This CL makes the SDRAM BCT config configurable based on whether your nyan is
in a pixel case, and also adds a slower config for us on norrin.

BUG=None
TEST=Built with settings for each board. Used bct_dump to verify that the
settings matched the current config.
BRANCH=None

Change-Id: Ibf1335ac3c9eb488d3753e41c5c9c40c9eda3d56
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://chromium-review.googlesource.com/177487
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2013-11-21 22:21:07 +00:00
Gabe Black
7cbb801d00 nyan: Add a prompt to the CONFIG_NYAN_IN_A_PIXEL option.
It turns out that kconfig will silently ignore settings to a variable that
doesn't have a prompt, meaning that this variable was always off no matter
what the config said.

BUG=None
TEST=Before this change, saw that CONFIG_NYAN_IN_A_PIXEL was always off no
matter how it was set in the config. Afterwards, saw that the value followed
the setting in the config.
BRANCH=None

Change-Id: I6f003c4bc2fbaea013a3f1e328280e64fbe7479d
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://chromium-review.googlesource.com/177486
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2013-11-21 22:21:04 +00:00
Aaron Durbin
e484d7d56e rambi: use SERIRQ pad as keyboard irq in gpio mode
The level shifting between 3.3V and 1.8V for the SERIRQ
signal is not working. Instead use the SERIRQ pad as
a gpio which is used as a direct IRQ signal for the
keyboard interupt.

BUG=chrome-os-partner:23965
BRANCH=None
TEST=Built and booted rambi. Keyboard works with associated EC change.
CQ-DEPEND=CL:177189

Change-Id: Ifc270ca38207828a6d4711551d4bde9121559cca
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/177223
Tested-by: Bernie Thompson <bhthompson@chromium.org>
2013-11-21 07:17:14 +00:00
Aaron Durbin
c4cc572d6c chromeec: allow override of i8042 interrupt
Some boards need to override which IRQ the i8042 keyboard
controller has its interrupt on instead of the default
IRQ#1. The SIO_EC_PS2K_IRQ macro provides the mainboard
an ability to override the interrupt location.

BUG=chrome-os-partner:23965
BRANCH=None
TEST=Built and booted rambi using this option. New IRQ is correctly
     picked up by kernel allowing keyboard support.

Change-Id: Ic2b222018dfc3aa30e24a31009e832ae0fb7e9cf
Reviewed-on: https://chromium-review.googlesource.com/177222
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: Aaron Durbin <adurbin@chromium.org>
Commit-Queue: Aaron Durbin <adurbin@chromium.org>
2013-11-21 04:31:04 +00:00
Mohammed Habibulla
836b3288de panther: Configure USB_ILIM_SEL to low
(panther port of Ib980100c648ae7472eac6f97e47f8ef3cbe72c7e)

BUG=none
BRANCH=none
TEST=boot tested on Panther

Change-Id: Iedcc107a43be170762d42d515c7e2a16ec395452
Reviewed-on: https://chromium-review.googlesource.com/177474
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Commit-Queue: Mohammed Habibulla <moch@google.com>
Tested-by: Mohammed Habibulla <moch@google.com>
2013-11-21 04:30:40 +00:00
Mohammed Habibulla
68ac5c00c8 panther: Set default interrupt value for Environmental Controller
This writes the default value to the register, but it gets rid of
the error that disturbs some of our tests:

ERROR: PNP: 002e.4 70 irq size: 0x0000000001 not assigned
(panther port of Ieab1c776b553c996a7d06e4059110943aaf41338)

BRANCH=none
BUG=chrome-os-partner:23945
TEST=boot test on Panther

Change-Id: Id45c3bdc0d2feaf6f75d984c41d1f6ffef592d4d
Reviewed-on: https://chromium-review.googlesource.com/177468
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Commit-Queue: Mohammed Habibulla <moch@google.com>
Tested-by: Mohammed Habibulla <moch@google.com>
2013-11-21 04:30:36 +00:00
Julius Werner
d0706b8485 arm: Remove exception_test()
The exception_test() mechanism might have been useful when exceptions
were first implemented, but now that they are pretty stable it's really
not necessary anymore (especially not on every single boot in production
Chromebooks). It forces a simple unaligned access, and as we start
having exceptions in stages that might not have paging turned on yet,
it's better to remove that completely.

Also removed the duplicated implementations of SCTLR-stuff and switched
to the existing ones in cache.h.

BUG=None
TEST=Made sure Pit and Nyan still boot and can trigger exceptions in all
stages.

Change-Id: I85e66269f5e2f2dfd3e8aaaa18441493514b62f8
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/177101
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Reviewed-by: Gabe Black <gabeblack@chromium.org>
2013-11-20 06:51:13 +00:00
Julius Werner
2960623f4a arm: Move exception_init() close to console_init()
This patch adds stub implementations of exception_init() to all archs
so that it can be called from src/lib/hardwaremain.c. It also moves/adds
all other invocations of exception_init() (which needs to be rerun in
every stage) close to console_init(), in the hopes that it will be less
likely overlooked when creating future boards. Also added (an
ineffective) one to the armv4 bootblock implementations for consistency
and in case we want to implement it later.

BUG=None
TEST=Made sure exceptions can fire and get handled correctly in romstage
and ramstage on Nyan and all three stages on Snow.

Change-Id: Iecad10172d25f6c1fc54b0fec8165d7ef60e3414
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/176764
Reviewed-by: Gabe Black <gabeblack@chromium.org>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
2013-11-20 06:51:09 +00:00
Julius Werner
0bec32e09e nyan: Do console_init() in romstage
console_init() is supposed to be called again in every stage, and we
forgot to do that in romstage. Bad us. (It still worked... kinda.)

BUG=None
TEST=None

Change-Id: I52102d436e42b60c9bcf9183428d4d7afc70698a
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/176763
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
2013-11-20 06:51:05 +00:00
Julius Werner
61c360a1c3 arm: Put exception_stack into BSS
"Hey guys, I have this awesome idea! How about we put a huge array
filled with 0xa5 into the data segment of our uncompressed romstage
for no particular reason? Give our SPI driver something to do so it
doesn't get too bored, you know?"

Guess it pays off to just hexdump our image and sanity-check it top to
bottom every once in a while...

Also reduces the size because 8K is crazy just to print a bunch of
registers (256 bytes ought to be enough for anybody).

BUG=None
TEST=Triggered an exception, still works as expected (and verified
romstage load size on Nyan is notably smaller now).

Change-Id: Icec0a711a1b5140d2ebcd98338ec638a4b6262fa
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/176762
Reviewed-by: Gabe Black <gabeblack@chromium.org>
Reviewed-by: Ronald Minnich <rminnich@chromium.org>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
2013-11-20 06:51:02 +00:00
Julius Werner
ebfd698e57 arm: Remove CAR_MIGRATE Kconfig and associated cruft
This is essentially a revert of commit 5a1469d5. The CAR_MIGRATE
mechanism is only useful to migrate variables from a special region
(e.g. cache as RAM) into DRAM-backed CBMEM between different parts of
the romstage (it does not persist into ramstage). Since ARM devices use
SRAM for which there is no reason to become inaccessible in later parts
of the romstage, this mechanism isn't useful for them. Removing it makes
the romstage.ld script much simpler, which has the nice side-effect of
putting the BSS at the end of the memory image (so that cbfstool can
actually figure out that it doesn't need to be part of the ROM image).

BUG=None
TEST=Still boots and the romstage BSS is no longer part of the load
size in the CBFS image.

Change-Id: I50e91d8bd51b5deb19446d9da48699edecbef6ea
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/176761
Reviewed-by: David Hendricks <dhendrix@chromium.org>
2013-11-20 06:50:58 +00:00
David Hendricks
c98de65482 nyan: Set SPI4 speed to 33MHz
This sets the SPI4 speed to 33MHz. The bootrom sets it to
408/22=18.5MHz, so this increases the frequency substantially.

However, we still do not achieve much gain from this because there
are still annoying ~500-600ns pauses in between byte transfers.
Copying ramstage takes around 62ms instead of 67ms.

TODO: We should be able to go up to 50MHz, but that does not work
reliably.

BUG=none
BRANCH=none
TEST=tested on nyan, verified frequency with logic analyzer
Signed-off-by: David Hendricks <dhendrix@chromium.org>

Change-Id: I4e56bec24c2a30ef0aa0b279b774c55b3d897410
Reviewed-on: https://chromium-review.googlesource.com/177038
Reviewed-by: Tom Warren <twarren@nvidia.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: David Hendricks <dhendrix@chromium.org>
Tested-by: David Hendricks <dhendrix@chromium.org>
2013-11-20 01:15:22 +00:00
Aaron Durbin
e234f09fec rambi: make ramids non-legacy gpio inputs
The romstage code for rambi uses the mmio way of reading
inputs. However, this is a problem is the GPIOs are set up
as legacy mode. Subsequent warm resets mean the ram_id is
read incorrectly. Ensure the ram_id is read consistently
by keeping the GPIOs for ram_id in mmio mode.

BUG=chrome-os-partner:24085
BRANCH=None
TEST=Built and booted. And rebooted. Now seeing consistent ram_id
     values on warm resets.

Change-Id: Ieff98c000be80998854f325754f1e819975d2be5
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/177230
Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org>
2013-11-19 14:49:59 +00:00
Aaron Durbin
b04eb1d564 baytrail: enable caching and prefetching in spi controller
The default mode of the SPI controller has prefetching disabled.
That obviously has a performance impact. Enable both caching
and prefetching to make booting faster. This has a significant
impact on streaming data out of SPI.

BUG=chrome-os-partner:24085
BRANCH=None
TEST=Built and booted rambi. Payload loading step went from ~285ms
     to ~54ms.

Change-Id: I065cf44e1de7dcefc49aa9ea9ad0204929ab26f4
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/177220
Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org>
2013-11-19 14:49:56 +00:00
Aaron Durbin
71b66abaf7 baytrail: fix direct irq pad configuration
When a pad is configured for direct IRQ it needs to be in
non-legacy. Additionally, the signal is passed directly to
the APIC by setting the LEVEL and TPE bits in the pad config
register. The APIC can then be configured for level, edge,
and rising/falling.

BUG=chrome-os-partner:24037
BUG=chrome-os-partner:22863
BRANCH=None
TEST=Built and booted with this config. Trackpad is firing interrupts
     more than it should, but it appears to be a trackpad firmware
     and/or configuration issue.

Change-Id: I00042b2ddba67d6bf23f0e7468d0719196e6f865
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/176793
Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org>
2013-11-19 06:07:19 +00:00
Julius Werner
2a81112abd arm: Remove some pointless CFLAGS
This patch removes the -ffixed-r8 CFLAG from the coreboot and libpayload
Makefiles. This seems to be a relic from U-Boot, which uses that
register to keep it's global data structure pointer. There's no reason
for us to throw away a perfectly fine register on this already pretty
constrained architecture.

Also removed a config.h inclusion from the Makefile because that should
really be done inside the C files.

BUG=None
TEST=Nyan still boots.

Change-Id: Ia176c0f323c1be07cddf88fa5488788786a27cdf
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/177110
Reviewed-by: Gabe Black <gabeblack@chromium.org>
2013-11-19 06:06:40 +00:00
Gabe Black
06c10df889 tegra124: When leaving the bootblock/AVP, really stop the AVP.
We'd been stopping the AVP by calling hlt, but this just puts it into a loop
which it busily executes forever. If the memory the loop is in is replaced,
however, the AVP will race off and do something random. It turns out that it
was writing the early parts of the rom stage into memory on top of the kernel
as it ran, either by coincidence or because it had rebooted and was actually
reloading the stage into memory.

Many thanks to Hung-Te for determining what was being overwritten by what
which helped determine who was doing the overwriting.

BUG=None
TEST=Before this change, booting in normal mode would cause the kernel to
behave strangely, often crashing. With this change, the kernel seems to boot
fine in normal mode.
BRANCH=None

Change-Id: I292c039c28691387e72386d2a9321c29437076ed
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://chromium-review.googlesource.com/177086
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
2013-11-19 06:05:25 +00:00
Gabe Black
b50d315506 tegra124: Flesh out/tidy up the flow controller constants.
These were a bit incomplete and weren't the same as the names in the manual.
The names for the event types were also a little too generic and might have
conflicted with other names. Also changed them from #defines to enums.

BUG=None
TEST=Built and booted on nyan.
BRANCH=None

Change-Id: I8b61e611fb599c0f989bd0ce246cb044464d1bd0
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://chromium-review.googlesource.com/177085
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
2013-11-19 06:05:21 +00:00
Gabe Black
fe4795e66b nyan: Increase the CPU voltage to 1.2V.
This voltage is recommended for the CPU when running at 1.8GHz.

BUG=None
TEST=Built and partially booted on the new form factor nyan.
BRANCH=None

Change-Id: I4ae4b16179d1be241119d85986823ad52af4fb70
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://chromium-review.googlesource.com/176906
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
2013-11-15 06:44:27 +00:00
Gabe Black
31507f6a57 nyan: Set the CPU voltage differently depending on which PMIC is in use.
The PMIC used on the older pixel based nyan boards and the newer boards are
different and use a different base offset for their voltage settings. We need
to set them to different values in order to get the correct voltage out.

BUG=None
TEST=With this and other changes, built and booted on old and new nyan boards.
BRANCH=None

Change-Id: Ie37b11802d8c08f07f37c350ceb732f519b69280
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://chromium-review.googlesource.com/176905
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2013-11-15 06:44:23 +00:00
Gabe Black
1d05fd5bc4 nyan: Add a kconfig for building for the original nyans in pixel cases.
The variable defaults to off because this will very much be the common case.
It's set to y in the nyan config at the moment, though, since the pixel
versions are the most common for now.

BUG=None
TEST=With this and other changes built and booted on old and new nyan boards.
BRANCH=None

Change-Id: Ib42c71e693663ccbea62fbabbc1500a1c7ecef24
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://chromium-review.googlesource.com/176904
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2013-11-15 06:44:17 +00:00
Gabe Black
86ab1ce9fb nyan: De-array-ify the PMIC setup code.
We're going to need some logic to decide what to set the PMIC registers to, so
we need to set the registers using code instead of an array. I never really
liked the array way of doing things anyway.

BUG=None
TEST=With this and other changes, built and booted on the new and old nyan
boards.
BRANCH=None

Change-Id: Ice7ee2830b1b24c25ac506ee004574eb861cf1c0
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://chromium-review.googlesource.com/176903
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2013-11-15 06:44:13 +00:00
Marc Jones
aabf131930 lynxpoint: Add SATA DEVSLP disable option
Add the chip option to disable SATA DEVSLP. This disables
the SDS bit in the SATA CAP2 register.

BUG=chrome-os-partner:23186
BRANCH=leon
TEST=Manual: System runs without SATA failure for more than 10 hours

Original-Change-Id: I8baa40935421769aeee341a78441fb19ecaa3206
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: https://chromium-review.googlesource.com/174648
Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org>
(cherry picked from commit 49d25812b04a983d687a53a39530559ba99fd9b4)

Change-Id: Iac0b32f80958f5ffb571733484dc931bee216f55
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: https://chromium-review.googlesource.com/176352
Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2013-11-15 04:58:50 +00:00
Stefan Reinauer
c7ff63038b stack check: cosmetics
Print a space after a full stop.

BUG=none
TEST=boot tested
BRANCH=none

Change-Id: Ic7d0522ae35079b64ce61956d06ea59843ef9d80
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: https://chromium-review.googlesource.com/176756
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Stefan Reinauer <reinauer@chromium.org>
2013-11-15 03:54:51 +00:00
Stefan Reinauer
8f74f3f522 cbfstool: Fix architecture check when adding payload
In the process of rewriting cbfstool for ARM and using
a new internal API a regression was introduced that would
silently let you add an ARM payload into an x86 CBFS image
and the other way around. This patch fixes cbfstool to
produce an error in that case again.

BRANCH=none
BUG=none
TEST=emerge-peach_pit with and without my other CL that fixes
     the cbfs image type and see it fail without that CL.

Change-Id: I37ee65a467d9658d0846c2cf43b582e285f1a8f8
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: https://chromium-review.googlesource.com/176711
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Stefan Reinauer <reinauer@chromium.org>
2013-11-15 03:54:46 +00:00
Aaron Durbin
37e1f42d28 baytrail: ensure init_chromeos() is called in romstage
The TPM needs to have the TPM_Startup command sent to it
on all boot paths. The call init_chromeos() in romstage_common()
fulfills this requirement.

BUG=chrome-os-partner:24057
BRANCH=None
TEST=Built and booted. Was able to suspend to ram multiple times
     in a row.

Change-Id: Id0339a9d82897249d20ff5f62d2dcb8b535310fa
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/176803
Reviewed-by: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org>
2013-11-15 01:38:54 +00:00
Aaron Durbin
816e8a5e8b rambi: distribute IRQs away from PIRQA on pci devices
Some of the drivers in the kernel were not so happy about
having shared IRQs. Also, sharing IRQs means more code
needs to be run in interrupt context to determine if the IRQ
was meant for a particular device. Fix this.

No more 'mmc1: got irq while runtime suspended' messages.

BUG=chrome-os-partner:24056
BRANCH=None
TEST=Built and booted. Looked at /proc/interrupts and noted no
     more sharing between pci devices.

Change-Id: Ie5da102204ffe3156dd55ab17af77df245a57c97
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/176792
Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org>
2013-11-15 01:38:50 +00:00
Aaron Durbin
86614237e3 baytrail: don't allow PCIE wake ups
The PCIe subsystem was constantly waking up boards from
S3 and S5. Completely disable PCIe wake ups. It can be made
mainboard-configurable later if needed.

BUG=chrome-os-partner:24004
BRANCH=None
TEST=Both S3 and EC RW->RW update (trip through S5) don't
     cause wakeups.

Change-Id: I922e2947c4b6e29277d913f06192601a2954f8fe
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/176791
Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org>
2013-11-15 01:38:46 +00:00
Stefan Reinauer
f595042851 beltino: Configure USB_ILIM_SEL to low
Talking to David Chang, we decided to switch USB_ILIM_SEL
to low to allow the system to negotiate SDP/CDP with the
USB devices for the front USB ports.

BUG=none
BRANCH=none
TEST=boot tested on Beltino

Change-Id: Ib980100c648ae7472eac6f97e47f8ef3cbe72c7e
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: https://chromium-review.googlesource.com/176146
Reviewed-by: David Chang <davidchang@chromium.org>
Commit-Queue: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Stefan Reinauer <reinauer@chromium.org>
2013-11-14 03:34:20 +00:00
Stefan Reinauer
0de30a0788 beltino: Set default interrupt value for Environmental Controller
This writes the default value to the register, but it gets rid of
the error that disturbs some of our tests:

ERROR: PNP: 002e.4 70 irq size: 0x0000000001 not assigned

BRANCH=none
BUG=chrome-os-partner:23945
TEST=boot tested on Beltino

Change-Id: Ieab1c776b553c996a7d06e4059110943aaf41338
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: https://chromium-review.googlesource.com/176145
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Commit-Queue: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Stefan Reinauer <reinauer@chromium.org>
2013-11-14 03:34:16 +00:00
Stefan Reinauer
cbf37fefd9 cbfstool: remove dead code
The introduction of the buffer and cbfs_image api also
brought in some regressions, such as broken architecture
detection, that went undetected. This patch prepares
cbfstool for a fix.

- There has been a significant amount of dead code that
  went undetected. Remove it!
- Fix a few shadowed variables
- Compile cbfstool with more warnings

BRANCH=none
TEST=build and boot coreboot on peach_pit and beltino
BUG=none

Change-Id: Ib6d02abd3ea404ec1e90f2acab6d7c67cac19220
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: https://chromium-review.googlesource.com/176710
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
2013-11-14 02:38:23 +00:00
Shawn Nematbakhsh
cfcd65b08c baytrail: gpio: Make pad input/output state mutually exclusive
Previously pads were being configured as both input and output
simultaneously due to the config bits being active low. Create new
defines that only enable either input or output, and use them in our
GPIO configs.

BUG=chrome-os-partner:22863
TEST=Manual on Rambi. Verify system boots and peripherals still
function.
BRANCH=None.

Change-Id: If386682a3d810864b7b9f5d2aecdb2e6cfceea86
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/176725
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-11-14 01:42:36 +00:00
Aaron Durbin
ceac4f1c8f rambi: fixup settings so trackpad can be found in kernel
The kernel chromeos_laptop driver nomenclature expects the
board name to not be in all caps. Fix this as well as the i2c
address for the trackpad.

BUG=chrome-os-partner:24307
BRANCH=None
TEST=Built and booted. trackpad device is found. IRQs still not
     working yet.

Change-Id: Id6be8ee4bce2835e303ea4fe63944be80d2d7ec2
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/176680
Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org>
2013-11-13 22:24:31 +00:00
Duncan Laurie
d18462f6fc samus: Fix 8GB SPD
The 8GB variant is x16 with 11 column bits and 4Gb density.

BUG=chrome-os-partner:23752
BRANCH=none
TEST=boot on proto1b device

Change-Id: I3aa647aba88dbc928fefd826cbd01e4fa8273660
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/176640
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Commit-Queue: Aaron Durbin <adurbin@chromium.org>
2013-11-13 18:00:23 +00:00
Aaron Durbin
a6a5e5728d baytrail: first pass at lpss device initialization
This commit does the common parts for all LPSS devices
that are enabled: enable snoop in IOSF and enable power
management. Additionally, the i2c devices are taken out of
reset.

BUG=chrome-os-partner:23790
BRANCH=None
TEST=Built and booted with modified kernel-next. I2C bus devices
     show up and I see 0x10 on one of the buses.

Change-Id: I540caea6a8666f5684dc5cee683a6b085dfac6de
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/176424
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2013-11-13 18:00:13 +00:00
Aaron Durbin
cb2e888570 reg_script: add iosf lpss port access
Add the LPSS IOSF port access to reg_script. This is
going to be used by baytrail.

BUG=chrome-os-partner:23790
BRANCH=None
TEST=Buit.

Change-Id: I0367acdb584f2de0bb871b136042b57fe6b7ec90
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/176423
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2013-11-13 18:00:10 +00:00
Mohammed Habibulla
b409cb5f15 panther: make sure the S5 power status is on track
(panther port of I933c475f693b0271f86b5166eb2c9b3873f1c2c6)

BUG=none
BRANCH=none
TEST=boot test on panther

Change-Id: I5958a8d701901706eaa38df4323120c8352fea5c
Reviewed-on: https://chromium-review.googlesource.com/176563
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Commit-Queue: Mohammed Habibulla <moch@chromium.org>
Tested-by: Mohammed Habibulla <moch@chromium.org>
2013-11-13 06:13:17 +00:00
Duncan Laurie
75a0944f32 samus: Misc fixes from proto1b bringup
- NFC interrupt is expected in the kernel as a GPIO now,
so set it back to that type
- NFC FW update GPIO should be low
- Accel/Codec interrupts were still set as GPIO type,
they should be set as PIRQ type

BUG=chrome-os-partner:23752
BRANCH=samus
TEST=build and boot on samus proto1b

Change-Id: I354c848ae7b158943f4745872b82a49e17e67e2f
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/176513
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-11-13 05:19:12 +00:00
Aaron Durbin
cf74b83ace baytrail: initialize eMMC device
The eMMC device is initialized as version 4.5 with HS200 speeds.

BUG=chrome-os-partner:23966
BRANCH=None
TEST=Built and booted rambi to login screen off of eMMC device.

Change-Id: I686c6136005fcb2587b939ddea293f4398df9868
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/176536
Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2013-11-13 01:36:55 +00:00
Aaron Durbin
c52a633b82 baytrail: initialize common SSC functionality
The SSC (storage control cluster) houses the SD, SDIO, and eMMC
interfaces. The scc cofniguration function, baytrail_init_scc(),
is ran in the pre device stage to initialize the SCC. The eMMC
is expected to be configured for version 4.5.

BUG=chrome-os-partner:23966
BRANCH=None
TEST=Built and booted with some other eMMC changes into login screen off
     of eMMC device.

Change-Id: I81cc755a790b7e43ad234a8201dae480277202c8
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/176535
Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2013-11-13 01:36:50 +00:00