Commit graph

10,440 commits

Author SHA1 Message Date
Aaron Durbin
66518fd86e libpayload: arm64: fix mmu bugs
1. keep functions and objects used entirely within mmu.c as static.
2. DMA region finding needs to terminate. Therefore, the next address
   to be attempted needs to be less then the current end address.
3. Ensure mmu_ranges passed to mmu_init_ranges_from_sysinfo() has
   0 entries marked as used.

BUG=chrome-os-partner:31634
BRANCH=None
TEST=Booted ryu with RAM hole above cbmem tables below 4GiB.

Change-Id: I5cb4e5009359cb04c4e1b5fe60845f80fbdff02c
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/221725
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
2014-10-09 16:42:13 +00:00
Aaron Durbin
df4991ce1d cbmem: stop assuming 1MiB of memory can be mapped
The default mapping size is 1MiB of ram. However, not
all systems allow 1MiB of memory to mapped depending on
the kernel's memory map. Therefore, be explicit about
the sizes to mmap().

The only path that wasn't cleaned up was the coverage path
as that needs to handle dynamic cbmem. The correct way to
fix that is to add a global like the timestamps that is set
while parsing cbtable.

BUG=chrome-os-partner:31355
BRANCH=None
TEST=Can cbmem -ltc on ryu.

Change-Id: I27b70ae8a8fba168d1c1829bbef0135c7b651eac
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/221971
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
2014-10-09 16:42:09 +00:00
Aaron Durbin
8ab5fca570 UPSTREAM: util/cbmem: handle larger than 1MiB mappings for console
In some cases the cbmem console can be larger than the default
mapping size of 1MiB. Therefore, add the ability to do a mapping
that is larger than the default mapping using map_memory_size().
The console printing code will unconditionally map the console based
on the size it finds in the cbmem entry.

Change-Id: I016420576b9523ce81195160ae86ad16952b761c
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/5440
Tested-by: build bot (Jenkins)
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/221970
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
2014-10-09 16:42:04 +00:00
Furquan Shaikh
907ea2d1f8 arm64: Add verstage support
This stage is not tested on any hardware.

BUG=None
BRANCH=None
TEST=Compiles successfully for rush_ryu and veyron_pinky

Change-Id: I6dd266471c815895bb3dd53d34aacc8fe825eeb6
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/221911
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
2014-10-08 09:30:54 +00:00
Furquan Shaikh
a843bb6773 verstage: Add proper guard conditions
BUG=None
BRANCH=None
TEST=Compiles successfully

Change-Id: I8494402144ad22a4e1c0652e3c94e59cd706bb16
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/221808
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
2014-10-08 09:30:48 +00:00
Duncan Laurie
c3fbeac10f broadwell: Skip DDI-A enable in S3 resume
DDI-A should not need re-enabled in the resume path, just
the resume path when we did not execute VBIOS.

BUG=chrome-os-partner:28234
BRANCH=samus,auron
TEST=build and boot on samus, test suspend+resume

Change-Id: Iaf7d083c5c92c42b7a117e2d2c9546ada6bf5f76
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/221988
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-10-08 07:14:59 +00:00
Duncan Laurie
481aba8341 broadwell: Update 306D4 to microcode 0x11
This is the latest available microcode.

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

Change-Id: I3fdc93d834a43c97cf6f404f0f465902781ad9e4
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/221987
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-10-08 05:07:27 +00:00
Vadim Bendebury
c76f4b40eb Change GDB_DEBUG to SOURCE_DEBUG
With introduction of GDB support the GDB_DEBUG make parameter sounds
misleading. Let's change it to SOURCE_DEBUG. It is still quite useful
when debugging with GDB, but can be used with any debugger.

BUG=None
TEST=built coreboot with SOURCE_DEBUG in the environment, observed it
     compiled as expected

Change-Id: Ia6cfddfa1764fb070f4d35f374ed4f35e38d38fe
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/221386
Reviewed-by: Julius Werner <jwerner@chromium.org>
2014-10-08 05:07:21 +00:00
Julius Werner
41bb802681 stddef: Add KHz, MHz and GHz constants
This patch adds some simple constants to more easily write and do math
with frequencies, analogous to the existing KiB, MiB and GiB constants
for sizes. They are exemplary added to the Veyron_Pinky/Rk3288 code for
now and will hopefully be adopted by other parts of the codebase in the
future.

BUG=None
TEST=Compiled Veyron_Pinky.

Change-Id: I4a1927fd423eb96d3f76f7e44b451192038b02e0
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/221800
Reviewed-by: David Hendricks <dhendrix@chromium.org>
2014-10-07 20:59:39 +00:00
Michael Spang
1182c46e39 Revert "arm64: Add verstage support"
This reverts commit 36960019dc.

Change-Id: Ie347622774bd9343face4890da2f65e8b29f4fb7
Reviewed-on: https://chromium-review.googlesource.com/221944
Reviewed-by: Michael Spang <spang@chromium.org>
Commit-Queue: Michael Spang <spang@chromium.org>
Tested-by: Michael Spang <spang@chromium.org>
2014-10-07 14:35:34 +00:00
Jim Lin
37e6844906 libpayload: config: nyan: Set CONFIG_LP_USB_EHCI_HOSTPC_ROOT_HUB_TT
Set "CONFIG_LP_USB_EHCI_HOSTPC_ROOT_HUB_TT=y" for nyan-series
platforms to enable USB keyboard when it's connected to root hub.

BUG=chrome-os-partner:32355
TEST=Tested on nyan series platforms.
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: I0c47cdd7018133185b6ffe1a51c62932f1287b34
Signed-off-by: Jim Lin <jilin@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/221035
Reviewed-by: Julius Werner <jwerner@chromium.org>
2014-10-07 05:54:13 +00:00
Furquan Shaikh
1b950f3a2e rush: Enable vboot2 config option
CQ-DEPEND=CL:221601, CL:*178568
BUG=chrome-os-partner:32684
BRANCH=None
TEST=Compiles successfully

Change-Id: I0bc5061a012214e451a289473dc6f8cc8c52849e
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/221600
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
2014-10-07 03:38:07 +00:00
Furquan Shaikh
14e3487213 rush: Add vboot2 support
CQ-DEPEND=CL:221601, CL:*178568
BUG=chrome-os-partner:32684
BRANCH=None
TEST=Compiles successfully

Change-Id: I50d0475dbe1390b640a726c259364f36abcbebe0
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/221579
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
2014-10-07 03:37:59 +00:00
Furquan Shaikh
7657e2a9fc ryu: Enable vboot2 config option
CQ-DEPEND=CL:221598, CL:*178568
BUG=chrome-os-partner:32684
BRANCH=None
TEST=Compiles and boots to kernel prompt

Change-Id: I807c5c2945d95bfae961c4880ed54d650aea7ecf
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/221578
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
2014-10-07 03:37:52 +00:00
Furquan Shaikh
9f5a6ae8cb ryu: Add vboot2 support
CQ-DEPEND=CL:221598, CL:*178568
BUG=chrome-os-partner:32684
BRANCH=None
TEST=Compiles and boots to kernel prompt

Change-Id: If7c725333b45a92f951ab674c3e4bd6a51c180c2
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/221577
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
2014-10-07 03:37:43 +00:00
Furquan Shaikh
8335915940 t132: Add vboot2 support
BUG=chrome-os-partner:32684
BRANCH=None
TEST=Compiles successfully and boots to kernel prompt using vboot2

Change-Id: Ibf7666d273e4d1af719c60d3f02bddcb4461f4bd
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/221576
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
2014-10-07 03:37:25 +00:00
Furquan Shaikh
3d5b47e836 cbfs: Add macro CBFS_LOAD_ERROR for returning failure in case of cbfs_load_*
For all cbfs_load_* functions, use CBFS_LOAD_ERROR macro instead of (void *)-1

BUG=chrome-os-partner:32684
BRANCH=None
TEST=Compiles successfully

Change-Id: I85aa890866b91e38614bd0eb324e072104573006
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/221674
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
2014-10-07 03:37:20 +00:00
Furquan Shaikh
49487e5af4 t132: Provide weak implementation of usb_setup_utmip in funitcfg.c
Provide a weak implemenation of usb_setup_utmip function for those stages that
do not include usb.c.

BUG=chrome-os-partner:32684
BRANCH=None
TEST=Compiles successfully

Change-Id: Ib235cf039a17204ef7e06d545a3c86b75aff5b4c
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/221575
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
2014-10-07 03:37:16 +00:00
Furquan Shaikh
36960019dc arm64: Add verstage support
This stage is not tested on any hardware.

BUG=None
BRANCH=None
TEST=Compiles successfully

Change-Id: Ib0b0d18090d83559276f978b57bdf600c7267606
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/221323
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
2014-10-07 03:37:09 +00:00
Duncan Laurie
716d26c82a broadwell: Fix building with USE=quiet-cb
This function needs to be available in different LOGLEVELs.

BUG=chrome-os-partner:28234
BRANCH=samus
TEST=USE=quiet-cb emerge-samus coreboot

Change-Id: Ia8f0d05af24c9070c8c9241a3a7e137f845d1cab
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/221540
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-10-07 01:29:49 +00:00
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