Commit graph

10,420 commits

Author SHA1 Message Date
Duncan Laurie
813c45bc3f samus: Add codec platform info in ACPI
This is the specific codec setup platform data for samus.

BUG=chrome-os-partner:29649
BRANCH=samus
TEST=emerge-samus coreboot

Change-Id: I5e2a8fad58bb8a3d02ccece0b1f6fe52f56c94ea
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/221539
Reviewed-by: Ben Zhang <benzh@chromium.org>
2014-10-07 01:29:45 +00:00
Furquan Shaikh
ef2184e970 arm64: Select RELOCATABLE_MODULES by default for secmon
If secure monitor is used, rmodules support should be compiled in as well.

BUG=None
BRANCH=None
TEST=Compiles and boots to kernel prompt

Change-Id: Id1e33fd500d52cfa03a946bf7dd85e6a90f3360e
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/221574
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
2014-10-07 01:29:41 +00:00
Furquan Shaikh
5e43dfe1aa armv4: Add verstage to armv4
BUG=None
BRANCH=None
TEST=Compiles successfully

Change-Id: I7735a2148da5330f220bd9a87b09e9fe3e37ffd1
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/221322
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
2014-10-07 01:29:37 +00:00
Furquan Shaikh
4889cb73b0 armv7: Add config option guard for verstage class
Add files to verstage class depending upon value of
CONFIG_ARCH_VERSTAGE_ARM_V7.

BUG=None
BRANCH=None
TEST=Compiles successfully

Change-Id: I60fb8390abd9d378e38511d4f4ac323b43450232
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/221321
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
2014-10-07 01:29:32 +00:00
Neil Chen
13d6accfdb nyan*: known-good drive for fast-train only
A higher drive setting is used for fast link training, once the
link training succeeds, a known-good drive setting will be used
for the main stream transactions.
For full link training sequence, the sink devices may ask for a
preferred drive setting, thus this drive setting should be used
for the main stream transactions too.

BUG=chrome-os-partner:32129
TEST=all panels on blaze/big devices work fine.

Change-Id: Icc540650dc1329af07fd9ee4661eb7fad435fde4
Signed-off-by: Neil Chen <neilc@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/219544
Reviewed-by: Julius Werner <jwerner@chromium.org>
2014-10-04 21:08:45 +00:00
Neil Chen
24966517d4 nyan*: add support of full link training
The original dp driver supports only fast link training and a
special drive setting is used for the link training sequence.
This might not be accepted by all panels. The better way is to
go through full link training sequence to negotiate for a best
drive setting.

With the change, dp driver will try fast link training first,
this is same as before. If it fails in fast link training, will
try full link training.

BUG=chrome-os-partner:32129
TEST=all panels on blaze/big devices work fine.

Change-Id: I6f3402c4c5993a156c965c7f52b011d336a2946f
Signed-off-by: Neil Chen <neilc@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/219543
Reviewed-by: Jimmy Zhang <jimmzhang@nvidia.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2014-10-04 21:08:38 +00:00
David Hendricks
f76cce3b38 rk3288: Replace SPI fifo_size with constant
rockchip_spi_slave has a fifo_size member which doesn't change.
This just replaces the struct member with a #define.

BUG=none
BRANCH=none
TEST=built and booted on Pinky

Signed-off-by: David Hendricks <dhendrix@chromium.org>
Change-Id: I9ea5cdad49ee10c5f32304d0909c4a7e74a261f9
Reviewed-on: https://chromium-review.googlesource.com/220471
Reviewed-by: Julius Werner <jwerner@chromium.org>
2014-10-04 05:12:50 +00:00
David Hendricks
de33d2ed63 rk3288: Pass SPI bus speed in as parameter to init function
This re-factors rockchip_spi to remove speed_hz which will instead be
passed in via rockchip_spi_init(), thus making it easier to support
other boards which may have different slave devices attached.

BUG=none
BRANCH=none
TEST=built and booted on Pinky

Signed-off-by: David Hendricks <dhendrix@chromium.org>
Change-Id: I7baf0fa0a2660e3c975847fdec3eb92bcd0d6c10
Reviewed-on: https://chromium-review.googlesource.com/220411
Reviewed-by: Julius Werner <jwerner@chromium.org>
2014-10-04 05:12:47 +00:00
David Hendricks
0a7dec2fe7 pinky: Move some init to mainboard bootblock
This patch moves init for I2C, SPI, ChromeOS GPIOs to the
board-specific bootblock init function on Pinky, the idea being
to isolate SoC code so that it's more readily adaptable for
different boards.

BUG=none
BRANCH=none
TEST=built and booted on Pinky

Signed-off-by: David Hendricks <dhendrix@chromium.org>
Change-Id: I75516bbd332915c1f61249844e18415b4e23c520
Reviewed-on: https://chromium-review.googlesource.com/220410
Reviewed-by: Julius Werner <jwerner@chromium.org>
2014-10-04 05:12:43 +00:00
David Hendricks
53bff629f2 rk3288/pinky: Move uart address to mainboard Kconfig
Since the UART which is used for the serial console may change from
board-to-board, this moves CONSOLE_SERIAL_UART_ADDRESS from rk3288's
Kconfig into Pinky's Kconfig.

BUG=none
BRANCH=none
TEST=built and booted on pinky

Signed-off-by: David Hendricks <dhendrix@chromium.org>
Change-Id: I29837a72d8cf205a144494a6c8ce350465118b34
Reviewed-on: https://chromium-review.googlesource.com/221438
Reviewed-by: Julius Werner <jwerner@chromium.org>
2014-10-04 05:12:37 +00:00
Julius Werner
6fc334d6b6 Makefile: Change $(generic-deps) to order-only prerequisite
Turns out making the compilation of every single source file depend on
the auto-generated build.h in CL:219170 wasn't really such a great idea
for incremental builds. Who would've thought.

However, it's still undesirable that individual Makefiles for sources
that actually include build.h need to add that dependency manually.
Therefore, this patch fixes the issue by using $(generic-deps) as an
order-only prerequisites in rules. This kind of prerequisite is still
made before the target if it doesn't exist, but it is not automatically
updated based on the timestamp. Also removed some additional manual
build.h dependencies that I must somehow overlooked in the old patch.

The files that actually include build.h still get it as a normal
prerequisite through the automatic dependency rule in <filename>.d that
is created by GCC's -MMD option. $(generic-deps) only solves the
chicken-and-egg problem of where build.h comes from in fresh/cleaned
build directories that don't have any .d dependency files yet.

BUG=chrome-os-partner:32622
TEST=Manually did an incremental build with a single changed file.
Confirmed that actual build.h dependencies (id.bootblock.o, console.*.o)
were still remade, but not all other coreboot sources.

Change-Id: I5a830aae6b17dd7d4061a577fd2410b678d6f1f0
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/221470
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-10-04 03:10:51 +00:00
Vadim Bendebury
ab41713c70 mips: do not place branch instructions in branch delay slot
A branch instruction in a branch delay slot confuses the execution
pipeline and causes an exception.

bootblock.S was written 'by hand', has a branch instruction in branch
delay slot and includes '.set noreorder' directive, which causes it to
crash when trying to branch to main().

Adding a nop instruction fixes the problem. Also adding a nop after
the last branch in the file just in case main() returns and the object
linked next starts with a branch.

BUG=chrome-os-partner:31438
TEST=Running on the simulator can reach main() now

Change-Id: I0882b2eb5ce426f5a311018ffbb6f37a2ca64d98
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/221421
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-10-03 22:26:55 +00:00
Julius Werner
d6cc55708e configs: Remove CONFIG_CONSOLE_PRERAM_BUFFER_SIZE
This Kconfig option was removed with the memlayout patch.

BUG=None
TEST=None

Change-Id: Ie768202503b4d205a6911fe643367c62903a153d
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/219681
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-10-03 09:09:44 +00:00
Julius Werner
f1e2028e7e New mechanism to define SRAM/memory map with automatic bounds checking
This patch creates a new mechanism to define the static memory layout
(primarily in SRAM) for a given board, superseding the brittle mass of
Kconfigs that we were using before. The core part is a memlayout.ld file
in the mainboard directory (although boards are expected to just include
the SoC default in most cases), which is the primary linker script for
all stages (though not rmodules for now). It uses preprocessor macros
from <memlayout.h> to form a different valid linker script for all
stages while looking like a declarative, boilerplate-free map of memory
addresses to the programmer. Linker asserts will automatically guarantee
that the defined regions cannot overlap. Stages are defined with a
maximum size that will be enforced by the linker. The file serves to
both define and document the memory layout, so that the documentation
cannot go missing or out of date.

The mechanism is implemented for all boards in the ARM, ARM64 and MIPS
architectures, and should be extended onto all systems using SRAM in the
future. The CAR/XIP environment on x86 has very different requirements
and the layout is generally not as static, so it will stay like it is
and be unaffected by this patch (save for aligning some symbol names for
consistency and sharing the new common ramstage linker script include).

BUG=None
TEST=Booted normally and in recovery mode, checked suspend/resume and
the CBMEM console on Falco, Blaze (both normal and vboot2), Pinky and
Pit. Compiled Ryu, Storm and Urara, manually compared the disassemblies
with ToT and looked for red flags.

Change-Id: I005506add4e8fcdb74db6d5e6cb2d4cb1bd3cda5
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/213370
2014-10-03 09:09:36 +00:00
Julius Werner
5b517fc46b arm: Prevent compilation of old, experimental SMP support
The ARM SMP feature was added a long time ago and has never really been
used by anyone since. We are still always compiling cpu_info() even
though we don't use it, and it makes some dangerous assumptions about
stack alignment that are not guaranteed anywhere.

I'm planning to change the way the stack boundaries are defined. Rather
than trying to work that into this unsafe, unused and hard to test
feature, I think we should just seal it off with police tape and make
sure that if anyone ever tries to use it again (which currently seems
unlikely), they get forced to do their due diligence on making sure it
works as intended.

BUG=None
TEST=Compiled Veyron_Pinky.

Change-Id: I8a60bd30e8b27a22bb3da68ca84daea99424dee9
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/219680
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
2014-10-03 09:09:30 +00:00
Ben Zhang
e2c0ede19c samus: Assign GPIO2 to HP_AMP_SHDN_L
BUG=chrome-os-partner:29649
BRANCH=samus
TEST=Audio playback to headphone works

Change-Id: Ib51aace52026688dc8972047e5d934c80138ff80
Signed-off-by: Ben Zhang <benzh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/221294
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2014-10-03 04:30:02 +00:00
Ben Zhang
348608fe61 samus: Make codec interrupt active high
The codec interrupt needs to be active high because multiple
interrupt sources share this line:

1) Headphone plug detect
2) Mic present
3) Hotword detect

These interrupt sources are OR-ed together.

BUG=chrome-os-partner:29649
BRANCH=samus
TEST=Jack detection works on samus

Change-Id: Ief0a291d9455f2d03789198153781ff8133aa1ce
Signed-off-by: Ben Zhang <benzh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/220588
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2014-10-03 04:29:58 +00:00
Kenji Chen
31d7276fbd Broadwell: Fix PCIe L1 Sub-State capability ID not filled.
BUG=chrome-os-partner:31424,chromeos-os-partner:32380
TEST=Build a BIOS image and check the value is applied correctly.
Signed-off-by: Kenji Chen <kenji.chen@intel.com>
Change-Id: I0adda3643776b259a635a021babd983090f1df43
Reviewed-on: https://chromium-review.googlesource.com/220475
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2014-10-02 23:18:31 +00:00
Ryan Lin
172c5fc259 Broadwell: Reg_Script: add END tag to array "smbus_init_script"
Need END tag, "REG_SCRIPT_END", to indicate the end of smbus_init_script.

BUG=chromium:416651
TEST=test on Auron.

Change-Id: I1f5624f4c6ce7f0e8ceb8971aaa595d99e9ff82e
Signed-off-by: Ryan Lin <ryan.lin@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/220934
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Kenji Chen <kenji.chen@intel.com>
2014-10-02 23:18:25 +00:00
Kane Chen
f0887ed494 broadwell: enable PCIE endpoint clk management
BUG=chrome-os-partner:31424
BRANCH=none
TEST=build only, due to I don't have broadwell system with wifi to test
     need somebody help me to verify
Change-Id: I52360176e135ea7f01cc67a926be4870265f57d1
Signed-off-by: Kane Chen <kane.chen@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/220743
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2014-10-02 18:24:31 +00:00
Jim Lin
4ad57fd673 libpayload: EHCI: Support root-hub TT feature
If EHCI controller has TT (Transaction Translator) support in
root-hub, then we need to keep control over this controller when
USB keyboard (low-speed device) is connected to root-hub port.

Need to add "CONFIG_LP_USB_EHCI_HOSTPC_ROOT_HUB_TT=y" to config file
(e.g. payloads/libpayload/configs/config.nyan_big) to support this
feature.

BUG=chrome-os-partner:32355
TEST=Tested on nyan_big platform.
Press ESC+REFRESH+POWER keys on internal keyboard to power up.
Press Left Arrow or Right Arrow on USB keyboard to switch between
"English" and "Default Locale" in coreboot UI. Or unplug and plug
in device and try again.
Root hub <- low-speed USB keyboard
Root hub <- full-speed hub <- low-speed USB keyboard
Root hub <- high-speed hub <- low-speed USB keyboard

Change-Id: Id86a289bc587653b85227c1d50f7a4f476f37983
Signed-off-by: Jim Lin <jilin@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/220125
Reviewed-by: Julius Werner <jwerner@chromium.org>
2014-10-02 18:24:26 +00:00
Kane Chen
13a423bc8b pcie: add code to support PCIE clk power management
Set PCIE "Enable Clock Power Management", if endp supports

BUG=chrome-os-partner:31424
BRANCH=none
TEST=build and boot on rambi, check Enable Clock Power Management
     in link control register is set properly

Change-Id: Ie54110d1ef42184cfcf47c9fe4d735960aebe47f
Signed-off-by: Kane Chen <kane.chen@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/220742
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2014-10-02 18:24:22 +00:00
Julius Werner
a4ad042746 Add predefined __ROMSTAGE__ and __RAMSTAGE__ macros
This patch adds the macros __ROMSTAGE__ and __RAMSTAGE__ which get
predefined in their respective stages by make, so that we have one
specific macro for every stage. It also renames __BOOT_BLOCK__ and
__VER_STAGE__ to __BOOTBLOCK__ and __VERSTAGE__ for consistency.

This change is intended to provided finer control and clearer
communication of intent after we added a new (optional) stage that falls
under __PRE_RAM__, and will hopefully provide some robustness for the
future (we don't want to end up always checking for romstage with #if
defined(__PRE_RAM__) && !defined(__BOOT_BLOCK__) &&
!defined(__VER_STAGE__) && !defined(__YET_ANOTHER_PRERAM_STAGE__)). The
__PRE_RAM__ macro stays as it is since many features do in fact need to
differentiate on whether RAM is available. (Some also depend on whether
RAM is available at the end of a stage, in which case #if
!defined(__PRE_RAM__) || defined(__ROMSTAGE__) should now be
authoritative.)

It's unfeasable to change all existing occurences of __PRE_RAM__ that
would be better described with __ROMSTAGE__, so this patch only
demonstratively changes a few obvious ones in core code.

BUG=None
TEST=None (tested together with dependent patch).

Change-Id: I6a1f25f7077328a8b5201a79b18fc4c2e22d0b06
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/219172
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-10-02 07:02:23 +00:00
Julius Werner
5528aa9252 Clean up architecture-specific Kconfigs
It's an unfortunate side effect of our different-archs-per-stage
mechanism that all src/arch/*/Kconfig files are always parsed with no
if blocks to exclude them if they're not relevant. This makes it very
easy to accidentally rely on a Kconfig default set by a totally
different and not applying architecture.

This patch moves a few Kconfigs from ARM and X86 that leaked out like
this into a common Kconfig file for clarity. It also removes the
never-used and never-working BOOTBLOCK_NORMAL mechanism from ARM, and
gave ARM64 its own BOOTBLOCK_CUSTOM mechanism so that it doesn't leech
off the ARM one (currently not used by any board).

In the future, we should maybe prefix all options in the arch/*/Kconfig
files with the architecture name (such as X86_BOOTBLOCK_NORMAL and
ARM_LPAE are already doing), to make it more apparent when they are used
in the wrong place.

BUG=None
TEST=None (tested together with dependent changes)

Change-Id: Ieb2d79bae6c6800be0f93ca3489b658008b1dfae
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/219171
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-10-02 07:02:16 +00:00
Julius Werner
af6852b98f Makefile: Preprocess linker scripts and other general improvements
This patch started out as an attempt to run linker scripts through the
preprocessor. However, since that required some more infrastructure
changes, the build system is so intertwined, and there are so many other
small issues that turned up and are easier to fix (and get running, and
test thoroughly) in a single go, it turned out a little bigger. In order
of appearance, it:

- wraps direct linker invocations in a macro to avoid the widespread
  ifeq($(CONFIG_COMPILER_LLVM_CLANG),y) duplication.

- introduces an $(generic-deps) (equivalent to $(<class>-deps)) variable
  for targets that all files depend on

- makes the $(src-to-obj) function usable in multiple places as the
  authoritative way to get an output file name (even if the respective
  source file is also under build/), and makes it preserve extensions on
  everything except %.c and %.S (e.g. %.ld and %.asl)

- replaces the old $(<class>-postprocess) with a single
  $(postprocessors) variable. The old ramstage-postprocess was weird
  because it contained unescaped $(eval ...)s, meaning it gets executed
  as soon as the variable is first substituted (and the other
  $(eval ...) in the toplevel Makefile does essentially nothing). The
  new mechanism is just $(eval ...)ed directly after the recursive parse
  with no further magic. Files can freely append their own (escaped)
  content to it and access variables valid in the calling context (like
  $(<class>-objs)) directly.

- enhances the existing $(<class>-<type>-ccopts) mechanism with
  $(<class>-generic-ccopts) and $(generic-<type>-ccopts) to reduce
  duplication.

- makes .ld a type that can be added like a normal class file, causing
  it to be preprocessed with the correct #defines for the current class
  (needed for a follow-up feature). Migrates all linker scripts to this
  mechanism, which allows us to get rid of the weird $(ldoptions)
  mechanism (Kconfigs are replaced by preprocessor and no longer need to
  be defined as symbols).

- removes duplicate $(INCLUDES) from $(CFLAGS)

- repairs the crazy state of MIPS Makefiles, which seem to have been
  copied together from X86 despite having absolutely nothing in common
  with that architecture. They were using the same code to paste
  assembly pieces and linker scripts together without really needing it
  for anything, and even accidentally relied on a Kconfig default set
  in the arch/x86 subdirectory (I wish I was kidding). Changed them to
  work equivalent to the arm/arm64 Makefiles which are far closer
  related (also being SRAM-based platforms).

- moves the x86-specifc $(OPTION_TABLES_H) into the x86 Makefile.inc and
  fixes an rule that would've had an empty target if it wasn't defined

- removes the custom ldscript-gathering variables for x86 bootblock and
  romstage. The Makefile simply combines all .ld files that have been
  added to the respective class now.

- uses the normal class build system to replace some of the custom rules
  for autogenerated bootblock/crt0 files on x86, and removes some
  hardcoded flags by using the normal $(...-ccopts) variables.

- moves the handling of .asl files from the global Makefile.inc to x86.
  Changed to reuse the generic template for the preprocessing and C
  compilation steps.

- removed the extra <name>.o linking step before linking an rmodule for
  modules that don't require special linker flags (most of them).

- removes the incorrect assumption that there was a global $(LDFLAGS)
  from the SMM Makefile.inc (it was named $(LDFLAGFS in one place so it
  couldn't have been all that important ;) ).

- allow -j flag for parallel builds to be properly passed through to
  vboot child invocation by using special $(MAKE) variable.

BUG=None
TEST=Built for Falco, Nyan_Blaze, Stout, Rush_Ryu and Urara. Binary
diffed old and new coreboot.rom (and some manually uncompressed stages),
confirmed that images/stages are byte-for-byte identical except for some
embedded timestamps and commit hashes. (Addresses in Falco/Stout
ramstages shifting slightly due to different link order for ASL object
files within their directory. Some addresses in Urara ramstage .rodata
and some relocation entries in rmodules moved around due to linking them
in fewer steps.)

Change-Id: I50af7dacf616e0f8ff4c43f4acc679089ad7022b
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/219170
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-10-02 07:02:10 +00:00
Duncan Laurie
b81ef37c03 broadwell: Disable ADSP power gating feature by default
Disable ADSP D3 and SRAM power gating features by default, and make
the devicetree.cb flags into enable flags instead of disable.

BUG=chrome-os-partner:31588
BRANCH=samus,auron
TEST=build and boot on samus

Change-Id: Ib881290acc07819b55d776d4696bf0062df4d50e
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/220863
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-10-02 01:16:20 +00:00
Furquan Shaikh
5dbfae6bbc t132: Add support for pmc_rst_status get and print
BUG=None
BRANCH=None
TEST=Compiles successfully and pmc rst status POR is seen.

Change-Id: Id0c2b208222deaf099b8938ba583551979588d52
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/220721
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
2014-10-02 01:16:14 +00:00
Furquan Shaikh
030081fe85 t132: Replace use of clk_rst with CLK_RST_REG
Also, get rid of unused clk_rst variables.

BUG=None
BRANCH=None
TEST=Compiles successfully

Change-Id: I880ae5c396c33006f6b184cca7f171e4373f4016
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/220720
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
2014-10-02 01:16:05 +00:00
Furquan Shaikh
c393e166a1 ryu: Add padconfigs for volup and voldown buttons
Both buttons are active low.

BUG=chrome-os-partner:32517
BRANCH=None
TEST=Compiles successfully and volup and voldown button presses are detected in
pseudo keyboard driver in depthcharge

Change-Id: I08f94972db53aa17a63f6e16cbaebe7af358cdc2
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/220687
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
2014-10-02 01:16:01 +00:00
huang lin
4b9b3c2f8b rockchip: support i2c clock setting
BUG=None
TEST=Boot Veyron Pinky and measure i2c clock frequency

Change-Id: I04d9fa75a05280885f083a828f78cf55811ca97d
Signed-off-by: huang lin <hl@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/219660
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Julius Werner <jwerner@chromium.org>
2014-10-01 10:20:21 +00:00
huang lin
4491d9c403 rockchip: support pwm regulator
BUG=None
TEST=Boot Veyron Pinky and test the VDD_LOG

Change-Id: Ie2eef918e04ba0e13879e915b0b0bef44aef550e
Signed-off-by: huang lin <hl@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/219753
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Julius Werner <jwerner@chromium.org>
2014-10-01 10:20:16 +00:00
jinkun.hong
e6689cbb0e coreboot: rk3288: add new ddr config and support ddr3 freq up to 800mhz
Add ddr3-samsung-2GB config and modify 533mhz linit.
Support ddr3 freq up to 800mhz.
Enable ODT at LPDDR3.

BUG=None
TEST=Boot Veyron Pinky

Change-Id: Ic02a381985796a00644c5c681b96f10ad1558936
Signed-off-by: jinkun.hong <jinkun.hong@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/220113
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: Lin Huang <hl@rock-chips.com>
Commit-Queue: Julius Werner <jwerner@chromium.org>
2014-10-01 10:20:05 +00:00
David Hendricks
bdb67fe489 pinky: Force delay for EC SPI transfers
This gives the EC some time to wake-up between asserting /CS and
starting a transfer.

BUG=chrome-os-partner:32223
BRANCH=none
TEST=verified ~100us delay using logic analyzer on Pinky

Change-Id: I9874e65abd405874c43c594d8caeeff9e1300455
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/220243
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Alexandru Stan <amstan@chromium.org>
Commit-Queue: Alexandru Stan <amstan@chromium.org>
Tested-by: Alexandru Stan <amstan@chromium.org>
2014-10-01 06:53:33 +00:00
David Hendricks
ec6b10e4e3 chromeec: Add wakeup delay after SPI /CS assertion
Some ECs may require a few microseconds to ramp up their clock after
being awaken by /CS assertion. This adds a Kconfig variable that can
be overridden at the mainboard-level which will force a delay between
asserting /CS and beginning a transfer.

BUG=chrome-os-partner:32223
BRANCH=none
TEST=verified ~100us delay using logic analyzer

Change-Id: Ibba356e4af18f80a7da73c96dadfda0f25251381
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/220242
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Alexandru Stan <amstan@chromium.org>
2014-10-01 06:53:27 +00:00
Julius Werner
9428e0d1b7 veyron_pinky: Add rev2 support, clean up mainboard.c
This patch adds support for the board changes in rev2 (board_id = 0001).
It also moves the existing mainboard.c code around a bit to group it by
component.

BUG=chrome-os-partner:32139
TEST=Booted on rev1. Confirmed SD card still works. Confirmed power
button was still as broken as before.

Change-Id: Ifc4876687db64ca50e41d009d911446129d57b1b
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/220251
2014-10-01 06:53:23 +00:00
Julius Werner
102a5c0a80 rk3288: Add GPIO() macro
The static gpio_t initializers are stylish, but they are still a little
too annoying to write and read in day-to-day use. Let's wrap that in a
macro to make it a little easier to handle.

BUG=None
TEST=None

Change-Id: I385ae5182776c8cbb20bbf3c79b986628040f1cf
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/220250
Reviewed-by: David Hendricks <dhendrix@chromium.org>
2014-10-01 06:53:18 +00:00
David Hendricks
4ff2629fdf rk3288: Add missing #include and use uniform types
This updates timer.h to #include the header necessary for u32,
and to change the one instance of uint32_t to u32 to be uniform.

BUG=none
BRANCH=none
TEST=compiled

Change-Id: Ie406fb1f518af5d1fd1e623630b2bcbbef35622c
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/220612
Reviewed-by: Julius Werner <jwerner@chromium.org>
2014-10-01 06:53:13 +00:00
Daisuke Nojiri
d8c0c407bf vboot2: factory-initialize kernel space in tpm
this change makes coreboot initialize kernel space and backup space in the tpm
when no firmware space is found in the tpm.

BUG=chrome-os-partner:32410
TEST=Forced factory initialization and verified it went through without errors.
BRANCH=None
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>

Change-Id: I777e3cb7004870c769163827543c83665d3732b9
Reviewed-on: https://chromium-review.googlesource.com/220412
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
2014-10-01 01:47:49 +00:00
Ionela Voinescu
621849942e IMGTEC SPI controller driver
The Serial Peripheral Flash Interface (SPFI) block allows
communication with various devices over the SPI bus.

It uses a configurable transaction interface and it clocks
the bus according to the configured command, address, gap (aka
dummy) and data lengths.

This controller requires the SPI_ATOMIC_SEQUENCING flag set
(write and read done in the same transaction) as it cannot
directly control CS and will assert/de-assert CS at the
beginning/end of a transaction itself.

Note that the size of any transfer cannot be greater than
64KB - 1, as this is configured in a 16-bit field.

The SOC has 2 SPFI interfaces each of them providing 5 slave select
lines. SPFI 0 supports single and dual modes, SPFI 1 supports
single, dual and quad modes.

For SPFI interface 0:
 - The block needs the system PLL and the following top level
   SPI clock registers to be set:
   - CR_cr_top_spi0clkinternal_CTRL[2:0] with division value
   - CR_MIPS_CLOCK_GATE[19]: bit cr_top_SPI0CLKOUT_MIPS set
   - CR_cr_top_SPI0CLKOUT_CTRL[6:0] with division value
 - The following MFIO configuration paramters are also required:
   Signal name		Pad name        MFIO mode
   spim0_d0_txd		MFIO_MIPS_10	0
   spim0_d1_rxd		MFIO_MIPS_9	0
   spim0_mclk		MFIO_MIPS_8	0
   spim0_cs0		MFIO_MIPS_2	1
   spim0_cs1		MFIO_MIPS_1	1
   spim0_cs2		MFIO_MIPS_55	1
			MFIO_MIPS_28	1
   spim0_cs3		MFIO_MIPS_56	1
			MFIO_MIPS_29	1
   spim0_cs4		MFIO_MIPS_57	1
			MFIO_MIMPS_30	1

For SPFI interface 1:
 - The block needs the system PLL and the following top level
   SPI clock registers to be set:
   - CR_cr_top_spi1clkinternal_CTRL[2:0] with division value
   - CR_MIPS_CLOCK_GATE[20]: bit cr_top_SPI1CLKOUT_MIPS set
   - CR_cr_top_SPI1CLKOUT_CTRL[6:0] with division value
 - The following MFIO configuration paramters are also required:
   Signal name		Pad name	MFIO mode
   spim1_d0_txd		MFIO_MIPS_5	0
   spim1_d1_rxd		MFIO_MIPS_4	0
   spim1_mclk		MFIO_MIPS_3	0
   spim1_d2		MFIO_MIPS_6	0
   spim1_d3		MFIO_MIPS_7	0
   spim1_cs0		MFIO_MIPS_0	0
   spim1_cs1		MFIO_MIPS_1	0
   			MFIO_MIPS_58	1
   spim1_cs2		MFIO_MIPS_2	0
   			MFIO_MIPS_55	2
   			MFIO_MIPS_31	1
   spim1_cs3		MFIO_MIPS_56	2
   spim1_cs4		MFIO_MIPS_57	2

BUG=chrome-os-partner:31438, chrome-os-partner:32441
TEST=Tested as bare-metal driver on Pistachio FPGA

Change-Id: Ib257eb6236bd2895281175871b4ab979660f1239
Signed-off-by: Ionela Voinescu <ionela.voinescu@imgtec.com>
Reviewed-on: https://chromium-review.googlesource.com/217320
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2014-09-30 23:04:28 +00:00
David Hendricks
03e0bb2eac pinky: Add mainboard-specific bootblock init
This adds a mainboard-specific bootblock function that will be used
to set up some board-specific parameters which are currently set up
in the SoC bootblock function.

BUG=none
BRANCH=none
TEST=built and booted on Pinky

Signed-off-by: David Hendricks <dhendrix@chromium.org>
Change-Id: Ibee7076ebd6080f04b0697067e85ce8b6b2230e4
Reviewed-on: https://chromium-review.googlesource.com/220399
Reviewed-by: Julius Werner <jwerner@chromium.org>
2014-09-30 08:32:29 +00:00
Vadim Bendebury
58696cc7c7 urara: use proper SOC name
Danube has become Pistachio, let's rename all instances where this SOC
is mentioned.

BUG=none
TEST=board urara still builds

Change-Id: Ie5ede401c4f69ed5d832a9eabac008eeac6db62d
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/220401
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
2014-09-30 01:53:48 +00:00
Duncan Laurie
3958efb288 samus: Fix codec interrupt and add GPIO defines
The codec interrupt needs to come from codec GPIO1, so use the
HOTWORD_DET GPIO as the codec IRQ and the DSP_INT as the wake.The

This means codec interrupt is GPIO46 which is PIRQO and should be
interrupt 30.

Also add GPIO defines for the GPIOs attached to the codec itself.
These are defined by index, and I used the same "jack detect" and
"mic present" indices that were used in baytrail.

The codec interrupt to the host is added at index 2 and the
hostword detect interrupt to the host is added at index 3.

These can be changed as we work through the implementation in the
kernel driver.

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

Change-Id: I1c1ac1b6095fab7e3f4412555db4f9a9138e528b
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/220326
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-09-30 01:53:43 +00:00
Vadim Bendebury
261837539f danube: modify to use the generic timer interface
Actual timer support is not yet available for Danube, it will be added
soon. For now, just to make the target build, modify it to use
GENERIC_UDELAY and HAVE_MONOTONIC_TIMER configuration option.

BUG=none
TEST=the target builds again

Change-Id: Ie3289eace9d2baadd01bd641b5dffc635ac80c0f
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/220395
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-09-30 01:53:40 +00:00
Duncan Laurie
b4dccc03bd chromeec: Fix logging of EC wake events
The EC behavior for reading events from the ACPI interface was broken
with this commit:

d899fda lpc: ACPI query-next-event drops masked events
https://chromium-review.googlesource.com/194935

This is causing no EC wake events to be logged.  To make sure they are
logged once again set the wake mask before querying for events.

Also remove the check for port80 event logging since this is no longer
used as we now store the port80 code in CMOS and this is unnecessary
commands to do for the resume path.

BUG=chrome-os-partner:32462
BRANCH=samus,auron
TEST=build and boot on samus, check for EC wake events for keyboard
and lid in the event log.

Change-Id: Icdd0c1a37a94e0cbd9fd256172324bf989e6d0dc
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/220373
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-09-30 01:53:33 +00:00
Duncan Laurie
85d14842ae samus: Clean up touch wake sources
Move _PRW to the ACPI devices for the touchpad and touchscreen.
Add a _DSW method, but disable it by default for now until a
spurious wake issue can be resolved.

BUG=chrome-os-partner:32232
BRANCH=samus
TEST=build and boot on samus, ensure trackpad does not
spuriously wake the system.

Change-Id: Ic4763f2cb5f3a59d04b236cee94906025661c615
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/220325
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-09-29 23:18:58 +00:00
Duncan Laurie
d4e06c7dfc broadwell: Add support for ACPI \_GPE._SWS
In order to report the GPE that woke the system to the kernel
coreboot needs to keep track of the first GPE wake source and
save it in NVS so it can be returned in \_GPE._SWS method.

This is similar to the saving of PM1 status but needs to go
through all the GPE0_STS registers and check for enabled and
triggered events.

A bit of cleanup is done for areas that were touched:
- ramstage.c:s3_resume_prepare() was not indented with tabs
- platform.asl was not formatted correctly

BUG=chrome-os-partner:8127
BRANCH=samus,auron
TEST=manual:
- suspend/resume and wake from EC event like keyboard:
ACPI _SWS is PM1 Index -1 GPE Index 112  ("special" GPIO27)
- suspend/resume and wake from RTC event:
ACPI _SWS is PM1 Index 10 GPE Index -1  (RTC)
- suspend/resume and wake from power button:
ACPI _SWS is PM1 Index 8 GPE Index -1
- suspend/resume and wake from touchpad:
ACPI _SWS is PM1 Index -1 GPE Index 13
- suspend/resume and wake from WLAN:
ACPI _SWS is PM1 Index -1 GPE Index 10

Change-Id: I9bfbbe4385f2acc2a50f41ae321b4bae262b7078
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/220324
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-09-29 23:18:50 +00:00
Duncan Laurie
0f1cccfd00 broadwell: Add event log entry for GPIO27
Add event log entry if GPIO27 is used to wake the system.
This GPIO is treated separately from other GPE and it is
one of the only events that can wake from Deep Sx.

BUG=chrome-os-partner:31549
BRANCH=samus
TEST=samus: suspend/resume and wake from keypress, check for
GPIO27 event in event log.

Change-Id: I38a44a62f68288a4ae3f97fe078ca222fd01390a
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/220323
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-09-29 23:18:47 +00:00
Duncan Laurie
70e2e6aaf3 auron: Add new battery status event
Add the new battery status event to the SCI list so the
host can get notified when battery charge status changes.

BUG=chrome-os-partner:32196
BRANCH=auron
TEST=emerge-auron coreboot

Change-Id: Icc6182e65eb3a1d37442d3c0de1555b9ac2a2765
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/220322
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-09-29 23:18:43 +00:00
Duncan Laurie
0e3ebcb865 samus: Fix and clean up GPIOs and EC info/events
- Define specific GPIOs in gpio.h instaed of smihandler.c
- Add battery status event to SCI list
- Remove old proto board version defines and SPD index usage
- Do not disable cmd_pwr training now that it works on EVT board

BUG=chrome-os-partner:32196,chrome-os-partner:29117
BRANCH=samus
TEST=build and boot on samus

Change-Id: I53cf8d80ed7f675c10fa04e8fe8b879a4af9b21f
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/220321
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-09-29 23:18:39 +00:00
Duncan Laurie
a779fc7f32 chromeec: Add battery status event and re-enable _BIX
Add a new host event to send a notify(0x80) to the battery
when the EC indicates that battery status has changed.

The kernel has fixed the bug with _BIX method so it can
be enabled now.

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

Change-Id: I0ebb17e5441e875875d98168ce3c31486d57330e
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/220320
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-09-29 23:18:32 +00:00