Commit graph

8,484 commits

Author SHA1 Message Date
Duncan Laurie
1ee11133c0 ec: Add romstage function for checking and rebooting EC
Now that we are executing VbInit() in coreboot we can end up
in a situation where the recovery reason is consumed during
VbInit (end of romstage) and then the EC is rebooted to RO
during ramstage EC init, thereby losing the recovery reason.

Two possiblities are to remove the EC check+reboot from ramstage
and let it happen in depthcharge.  This however means that the
system has to boot all the way into depthcharge and then reboot
the EC and the system again.

Instead if we do a check in romstage before VbInit() is called
then we can reboot the EC into RO early and avoid booting all
the way to depthcharge first.

This change adds a ramstage version the EC init function and
calls it from the shared romstage code immediately after the
PCH decode windows are setup.

BUG=chrome-os-partner:19928
BRANCH=none
TEST=manual: enter recovery with crossystem recovery_request=193

Change-Id: Ic927c69a95a2114e29c343f0dcc28374266db394
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57470
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-06-04 12:53:44 -07:00
Duncan Laurie
8f6c55c28f haswell boards: Enable VIRTUAL_DEV_SWITCH
This config option was not enabled which was preventing
the user from enabling developer mode from recovery mode.

With this enabled we can disable the "dev mode by default"
behavior and let people enable it by entering recovery mode.

This will make the firmware behave like a typical chromeos
device.

Peppy is left in "default dev mode" until after bringup.

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

1) boot slippy in normal mode by default
2) enter recovery mode with servo button
3) Ctrl+D on USB keyboard to enter developer mode
4) boot slippy in developer mode

Change-Id: I414c0d10dd0489e3c89798f75a2872a43297c8d8
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57350
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-06-04 12:53:43 -07:00
Duncan Laurie
79dc6673de haswell: Update pei_data to match ref code
- Add a new USB location field
- Add a new "ddr_refresh_2x" field, enabled on Falco only
- Fix copy+paste bug in baskingridge

BUG=chrome-os-partner:19869
BRANCH=none
CQ-DEPEND=CL:*39053
TEST=manual: test to ensure refresh rate 2x can be enabled

Checked that tREFI is halved during memory setup in the memory
training log:
tREFImin = 6240       << DEFAULT
  C(0).tREFI = 0xc30  << MODIFIED (=3120)
  C(0).tREFI = 0xc30  << MODIFIED (=3120)

Also ensure that the SD card is detected properly again.

Change-Id: Ie3a82c08df06ada9af56282b5255caefa56487f2
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57349
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-06-04 12:53:42 -07:00
Aaron Durbin
532903ffd8 vboot: use out_flags to indicate dev mode
In order to make the proper decision on loading the
option rom or not the developer mode setting needs to be
known. Under early firmware selection it is possible to know
the state of developer mode by a flag in out flags. Use this
flag when early firmware selection is being employed to determine
if developer mode is enabled or not.

BUG=None
BRACNh=None
TEST=booted slippy w/ patch and option rom is loaded correctly when
     virtual dev switch is employed.

Change-Id: I9c226d368e92ddf8f14ce4dcde00da144de2a5f3
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57380
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2013-06-04 10:08:27 -07:00
Duncan Laurie
de2357a7c5 chrome ec: Update EC header from EC repository
- Updated ec_commands.h is copied in directly from EC repo
- Removed "old" interface and update resources for "new" interface
- Updated temp sensor constants and added "not calibrated"
- Update mainboards to remove check for EC_SWITCH_KEYBOARD_RECOVERY

BUG=chrome-os-partner:19874
BRANCH=none
TEST=manual: tested on slippy to ensure EC communication still works

Change-Id: Ib9cab27d9987b380da74926794b49ebabbc9e5d7
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57348
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-06-03 14:33:48 -07:00
Duncan Laurie
dac91570ba lynxpoint: Enable USB clock gating, late setup, and sleep prep
Both EHCI and XHCI controllers have additional setup steps
that are not part of the PEI reference code so they need to
be done later.

Both controllers also have specific clock gating setup
requirements that are now implemented.

Additionally they both have specific requirements when entering
sleep states.  XHCI needs something in S3/S4/S5 and EHCI only
has steps for S4/S5 entry.

BUG=chrome-os-partner:19035
BRANCH=none
TEST=manual: build and boot on slippy and verify basic USB operation

Change-Id: Ic62cbc8b6255455e56b72dd5d52e27a311999330
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57033
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-06-03 14:33:47 -07:00
Aaron Durbin
40e55948b2 haswell: check for clean reset
When an INIT# is delivered to the CPU the CPU starts
executing from the reset vector. However, the internal state
is maintained. Therefore, check for such a condition and
reset the system.

BUG=chrome-os-partner:19355
BRANCH=None
TEST=Issues 'apreset warm' on the EC console. INIT# is sent and
     CPU notices it's not a clean reset and forces one. No hangs.

Change-Id: I71229e0e5015ba8c60f5989c533268604ecc1ecc
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57111
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2013-06-03 14:33:01 -07:00
Aaron Durbin
7937c7c5e9 libpayload: place dummy_media.c in correct object list
The commit introducing dummy_media.c was placed in the
libc object list. This wasn't correct. It should be in the
libcbfs object list as well as guarded by CONFIG_CBFS.

BUG=None
BRANCH=None
TEST=Built with  USE=depthcharge emerge-daisy depthcharge libpayload

Change-Id: Iace43fff8f85f60ecac5e6eb8350cd1f3ee9d35e
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56925
2013-06-03 14:33:01 -07:00
Shawn Nematbakhsh
e97185cdbb Butterfly: Force DDR refresh rate to 2x.
Due to OEM request, always set DDR refresh rate at 2x.

TEST=Manual. Verify pei values in MRC.
BUG=chrome-os-partner:18967

Change-Id: I81a4f57aca6388551dca6effbd9a4ac1a97e4f5a
Reviewed-on: https://gerrit.chromium.org/gerrit/50477
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Tested-by: Shawn Nematbakhsh <shawnn@chromium.org>
Commit-Queue: Shawn Nematbakhsh <shawnn@chromium.org>
2013-06-03 14:32:52 -07:00
Shawn Nematbakhsh
60a9452d24 Add DDR refresh config to pei data structure.
Allow platform customized DDR config, including forcing refresh rate to
2x.

TEST=Manual. Verify pei values in MRC.
BUG=chrome-os-partner:18967

Change-Id: I311ae7ddf25142153c94a3fc3fb0a36e03f50ab2
Reviewed-on: https://gerrit.chromium.org/gerrit/50476
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Tested-by: Shawn Nematbakhsh <shawnn@chromium.org>
Commit-Queue: Shawn Nematbakhsh <shawnn@chromium.org>
2013-06-03 14:32:51 -07:00
Shawn Nematbakhsh
f74ea6c391 peppy: Re-enable EC software sync
The EC was disabling flash commands and sysjump was not working
properly. With those two fixed software sync works properly.
(Taken from I63ca00d6c94854f2b395eb736ce20792da5f8de2).

BUG=chrome-os-partner:19636
BRANCH=none
TEST=emerge-peppy chromeos-coreboot-peppy

Change-Id: I9c7d1d1f1aaf7de33d0cec5f6daf648576ba8900
Reviewed-on: https://gerrit.chromium.org/gerrit/57289
Reviewed-by: Dave Parker <dparker@chromium.org>
Commit-Queue: Shawn Nematbakhsh <shawnn@chromium.org>
Tested-by: Shawn Nematbakhsh <shawnn@chromium.org>
2013-06-03 14:32:23 -07:00
Shawn Nematbakhsh
c71396c18d peppy: Update GPIO table + USB port map.
- Update GPIO table to match board.
- Update USB port map.
- Remove iSSD power sequencing code.

BUG=chrome-os-partner:19636
TEST=emerge-peppy chromeos-coreboot-peppy
BRANCH=none

Change-Id: Iaa8e5921ed9db6bcfd18b5a888c7f80b2c93a710
Reviewed-on: https://gerrit.chromium.org/gerrit/56869
Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org>
Tested-by: Shawn Nematbakhsh <shawnn@chromium.org>
Commit-Queue: Shawn Nematbakhsh <shawnn@chromium.org>
2013-06-03 14:32:22 -07:00
Aaron Durbin
a8ec8f2d84 haswell: fix overflow handling TOUUD
It's possible that the TOUUD can be set to less than
4GiB. When that is the case the size_k variable is
an extremely large value. Instead ensure TOUUD is greater
than 4GiB before adding said resources.

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

Change-Id: I456633d6210824e60665281538300fd15656b86d
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57329
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2013-06-03 14:31:58 -07:00
Duncan Laurie
2dea08aba2 lynxpoint: Do not clear ACPI NVS region on resume
There are useful values in NVS that are set at boot
and runtime and they should not be cleared on resume.

BUG=chrome-os-partner:19035
BRANCH=none
TEST=manual: suspend/resume twice on slippy and ensure
that the USB ports are still powered on the second suspend.

Change-Id: I4bce60b02b6637f6683120ae9c4a5c64563aacf7
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56941
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-06-03 14:31:57 -07:00
Duncan Laurie
9e843da303 lynxpoint: Add an inverted input GPIO type
The wake device input pins are active low and the
GPIOs need to be set as inverted when they are marked
as an input so they are not spuriously logged.

BUG=chrome-os-partner:19664
BRANCH=none
TEST=manual: suspend/resume on slippy with trackpad wake:

8 | 2013-05-29 07:43:14 | ACPI Enter | S3
9 | 2013-05-29 07:43:18 | ACPI Wake | S3
10 | 2013-05-29 07:43:18 | Wake Source | GPIO | 12

and with power button wake:

11 | 2013-05-29 07:43:35 | ACPI Enter | S3
12 | 2013-05-29 07:43:40 | EC Event | Power Button
13 | 2013-05-29 07:43:40 | ACPI Wake | S3
14 | 2013-05-29 07:43:40 | Wake Source | Power Button | 0

Change-Id: I15d38dcc9b2fb4b2b0eb27da358fa3c343e22323
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56940
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-06-03 14:31:57 -07:00
Duncan Laurie
e33f000cd3 slippy/falco: Re-enable EC software sync
The EC was disabling flash commands and sysjump was not working
properly.  With those two fixed software sync works properly.

BUG=chrome-os-partner:19366
BRANCH=none
TEST=boot with updated EC to test software sync

Google Chrome EC MKBP driver ready, id 'slippy_no_version'
Clearing the recovery request.
EC hash:7fea29992ef72e3e64d8ffe522aa1dfa68dcb44a2da96a4c19530ea1a0bd22c4
EC-RW hash address, size are 0xffa1cfe8, 32.
Hash = 727e79934d9394184da496cebc27f7275b9d2d91079bf125d8f977a1f8aa4cde
Expected hash:727e79934d9394184da496cebc27f7275b9d2d91079bf125d8f977a1f8aa4cde
EC-RW firmware address, size are 0xffad000c, 57180.
VbEcSoftwareSync() - expected len = 57180
Computed hash of expected image:727e79934d9394184da496cebc27f7275b9d2d91079bf125d8f977a1f8aa4cde
VbEcSoftwareSync() updating EC-RW...
VbEcSoftwareSync() jumping to EC-RW
VbEcSoftwareSync() in RW; done

Change-Id: I63ca00d6c94854f2b395eb736ce20792da5f8de2
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56821
2013-06-03 14:31:56 -07:00
Aaron Durbin
47413a0cdd x86: fix compile error for !CONFIG_MULTIBOOT
Some code was previously removed regarding elf notes. However,
that code left a dangling comma under !CONFIG_MULTIBOOT
configs for inline assembly constraints. Instead, place the comma
within the #ifdef stanza.

BUG=None
BRANCH=None
TEST=Successfully built wtm2.

Change-Id: I805453ef57d34fbfb904b4d145d8874921d8d660
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56844
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
2013-05-30 11:23:32 -07:00
Stefan Reinauer
887edac45c RTC: Skip rtc_init() in S3 resume path
In addition to not clearing the pending interrupts, we also
don't want to reset the RTC control register when booting
with an S3 resume.

On most new systems, when the RTC well is losing power, we
will also lose state that is required to perform a resume,
so we end up in a normal boot anyways. Hence don't do any
RTC initialization in the S3 resume path.

Signed-off-by: Stefan Reinauer <reinauer@google.com>
BUG=none
TEST=Resume on Link, observe RTC initialization is skipped
BRANCH=none

Change-Id: I73b486082faa741e9dccd15f2b8e3a8399c98f80
Reviewed-on: https://gerrit.chromium.org/gerrit/56826
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Commit-Queue: Stefan Reinauer <reinauer@google.com>
Tested-by: Stefan Reinauer <reinauer@google.com>
2013-05-28 13:50:07 -07:00
Aaron Durbin
21102247ef haswell: allow for disabled hyperthreading
There were assumptions being made in the haswell
MP and SMM code which assumed the APIC id space
was 1:1 w.r.t. cpu number. When hyperthreading is
disabled the APIC ids of the logical processors
are all even. That means the APIC id space is sparse.
Handle this situation.

BUG=chrome-os-partner:19699
BRANCH=None
TEST=Used HT disabled part on WTM2. No more spontaneous reboots.

Change-Id: Ia4e3aa7456092e0ac0ea0ef16f10ba638a3e6dbe
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56824
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2013-05-28 13:50:06 -07:00
Stefan Reinauer
c3c5a9f668 Drop ELF remains from boot code
This stuff is not used, so let's drop it.

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

BUG=none
BRANCH=none
TEST=boot tested on Link and Snow

Change-Id: Ib3f3eab653f87a75e9e1e6a0bcdd72a605f77e6c
Reviewed-on: https://gerrit.chromium.org/gerrit/56652
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-by: Ronald G. Minnich <rminnich@chromium.org>
Commit-Queue: Stefan Reinauer <reinauer@google.com>
Tested-by: Stefan Reinauer <reinauer@google.com>
2013-05-28 13:50:06 -07:00
Stefan Reinauer
f52ab6c2b5 ARMv7: flatten arch/armv7 source tree
With only 19 source files it doesn't make a whole lot of sense to
create sub directories in arch/armv7, especially since the files
were distributed somewhat randomly.

Signed-off-by: Stefan Reinauer <reinauer@google.com>
BUG=none
TEST=emerge-daisy chromeos-coreboot-snow builds.
BRANCH=none

Change-Id: I0c3dafb5deb7d70955a8b08be062b3c9824525ff
Reviewed-on: https://gerrit.chromium.org/gerrit/56651
Reviewed-by: Ronald G. Minnich <rminnich@chromium.org>
Commit-Queue: Stefan Reinauer <reinauer@google.com>
Tested-by: Stefan Reinauer <reinauer@google.com>
2013-05-28 13:50:05 -07:00
Shawn Nematbakhsh
32aeafc4cb peppy: Add Elipda DIMM SPD
Peppy RAM ID table is as follows:

000 41K256M16HA
001 H5TC4G63AFR
010 EDJ4216EFBG

Elpida SPD taken from Ib1e430cd390b4dbc013fc0802f1a59c1a0412577 by
dlaurie.

BUG=chrome-os-partner:19636
BRANCH=none
TEST=manual: emerge-peppy chromeos-coreboot-peppy

Change-Id: Iac156a2d25435514f28e2e73bef617d0fe2d90a1
Reviewed-on: https://gerrit.chromium.org/gerrit/56687
Tested-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-by: Dave Parker <dparker@chromium.org>
Commit-Queue: Shawn Nematbakhsh <shawnn@chromium.org>
2013-05-28 12:53:54 -07:00
Shawn Nematbakhsh
4c4bb076d7 peppy: Initial mainboard commit
Taken directly from slippy with only constant + string changes.
(Peppy port of I4172460d3b075bfd5bb22013a6225cf0e8f95b9c by dlaurie)

The following changes are required in a subsequent commit:

- Add Elpida SPD data.
- Update GPIO map.
- Remove iSSD power sequencing.
- Update USB port map.

BUG=chrome-os-partner:19636
BRANCH=none
TEST=manual: emerge-peppy chromeos-coreboot-peppy
CQ-DEPEND=I3da8679d5ac9752eca75264589f66451eadad94c

Change-Id: I01dfb841f0e9186cf8a0a23f72e7be986a83be42
Reviewed-on: https://gerrit.chromium.org/gerrit/56513
Tested-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-by: Dave Parker <dparker@chromium.org>
Commit-Queue: Shawn Nematbakhsh <shawnn@chromium.org>
2013-05-28 12:53:54 -07:00
Aaron Durbin
d3410c28ef libpayload: provide missing cbfs symbol
The generic cbfs code relies on the libpayload_init_default_cbfs_media
symbol. However, none was provided for ARM. Provide an empty
implementation that returns an error as there is no generic way
to locate the default cbfs media.

BUG=None
BRANCH=None
TEST=emerge-daisy libpayload depthcharge

Change-Id: Ie0d06fbe6fc790c9d92434cd2d60922908acdc69
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56805
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2013-05-28 10:38:56 -07:00
Duncan Laurie
5d5de24783 falco: Update DIMM SPD table
RAM_ID indices have been changed and settled on a 2GB config
that will be the same DRAM chips but only used in one channel.

BUG=chrome-os-partner:19657
BRANCH=none
TEST=emerge-falco chromeos-coreboot-falco

Change-Id: I444e655883ae045622ab3dfb964da4d7f86e1c0d
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56810
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-05-28 10:38:49 -07:00
Duncan Laurie
ca4ca5bbd7 falco: Add panel power sequence timings
These are placeholder values until we can configure for
the exact panel.

BUG=chrome-os-partner:19638
BRANCH=none
TEST=tested on slippy

Change-Id: If40367c0e5f80d46d085c89b0edae60f1ccacdaf
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56808
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-05-28 10:38:49 -07:00
Duncan Laurie
e4fed715b2 slippy: Add panel power sequence timings
These are placeholder values until we can configure for
the exact panel.

BUG=chrome-os-partner:19638
BRANCH=none
TEST=manual: boot in normal mode on slippy

Change-Id: Ibe88cc3588947366eb1728e5b3e1ab8c8be6dfe8
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56807
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-05-28 10:38:48 -07:00
Duncan Laurie
9fbb537cf7 haswell: Add magic to turn on grahpics in normal mode
The haswell i915 kernel driver apparently expects the VBIOS
to set a few specific registers.  This sequence is enough to
make the driver happy without executing the VBIOS.

This also makes graphics work after suspend/resume.

BUG=chrome-os-partner:19638
BRANCH=none
TEST=manual: boot normal mode on slippy

Change-Id: I34937d55ffff8a9445442e6e6ca1bfc49869da63
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56806
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-05-28 10:38:48 -07:00
Aaron Durbin
1b2944e459 libpayload: expose cbfs ram functions
The ram_media.c file is being compiled, however the
global functions were not exposed through a header.

BUG=chrome-os-partner:19691
BRANCH=none
TEST=Built depthcharge with including cbfs_ram.h and
     calling the exposed functions.

Change-Id: I4588fbe320c29051566cef277bf4d20a83abf853
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56642
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@google.com>
2013-05-24 16:27:51 -07:00
Aaron Durbin
91afd7004f libpayload: allow for pointers in cbfs ram media
The ram_map() handled offsets from 0->size as well as
negative offsets from the top of the region. However,
the cbfs core tries to map a offset that is actually a
pointer within the region itself. Allow for such instances.
This fixes an issue when using ram_media with tthe ebmedded
SeaBIOS cbfs.

BUG=chrome-os-partner:19691
BRANCH=none
TEST=manual: used ram_media to parse embedded SeaBIOS cbfs properly.

Change-Id: I15b0b3b643390d3784ae5887c0f17d420d59c5b6
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56641
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@google.com>
2013-05-24 16:27:51 -07:00
Duncan Laurie
2b6efcedd4 falco: Add Elpida DIMM SPD
This was provided by the vendor but I added the part number at
byte 128-143 so it can be identified when extracted by mosys.

BUG=chrome-os-partner:19637
BRANCH=none
TEST=manual: emerge-falco chromeos-coreboot-falco

Change-Id: Ib1e430cd390b4dbc013fc0802f1a59c1a0412577
Reviewed-on: https://gerrit.chromium.org/gerrit/56634
Tested-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Commit-Queue: Duncan Laurie <dlaurie@chromium.org>
2013-05-24 16:27:44 -07:00
Duncan Laurie
8ccfb926f8 falco: Add on-board devices and configure GPIO irq/wake
Add the onboard I2C devices for Falco trackpad/lightsensor
and generate SMBIOS Type41 tables for them.

Add ACPI device for the trackpad to expose the interrupt map
to the OS so it can be used.

Configure interrupt GPIOs as PIRQ type and wake GPIOs as
just standard input type.  The wake GPIO is reconfigured as
ACPI SCI in the specific device _DSW method.  This prevents
the wake GPIO from generating a flood of SCI at runtime.

LTE_WAKE_L_Q and WLAN_WAKE_L_Q are left as ACPI SCI as these
are not repurposed interrupt pins so they are not generated
at runtime.

SIM_DET and ALS_INT_L are set as input since we don't have an
interrupt handler for them.

BUG=chrome-os-partner:19637
BRANCH=none
TEST=tested on slippy as part of previous commit

Change-Id: Ibe9687b2f7f41ead18353c3f650219fe6e94ae2f
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56632
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-05-24 16:27:44 -07:00
Duncan Laurie
45fa19facf slippy: Add on-board devices and configure GPIO irq/wake
Add the onboard I2C devices for Slippy trackpad/lightsensor
and generate SMBIOS Type41 tables for them.

Add ACPI device for the trackpad to expose the interrupt map
to the OS so it can be used.

Configure interrupt GPIOs as PIRQ type and wake GPIOs as
just standard input type.  The wake GPIO is reconfigured as
ACPI SCI in the specific device _DSW method.  This prevents
the wake GPIO from generating a flood of SCI at runtime.

LTE_WAKE_L_Q and WLAN_WAKE_L_Q are left as ACPI SCI as these
are not repurposed interrupt pins so they are not generated
at runtime.

SIM_DET and ALS_INT_L are set as input since we don't have an
interrupt handler for them.

BUG=chrome-os-partner:19664
BRANCH=none
TEST=manual: tested on slippy with trackpad with additional
kernel changes to chromeos_laptop.c to initialize devices.

1) Ensure trackpad interrupt is functional and that there
is not a flood of ACPI SCI when trackpad does interrupt:
  9:          1          0          0          0   IO-APIC-fasteoi   acpi
 37:        421          0          0          0   IO-APIC-fasteoi   cyapa

2) Ensure that devices are exposed as wake capable:
Device  S-state   Status   Sysfs node
TPAD      S3    *enabled   pnp:00:00
TSCR      S3    *disabled  pnp:00:01

3) Ensure that trackpad can wake from S3 by default, but
that it does not cause an immediate wake when entering suspend.

4) Ensure that trackpad can be disabled as a wake source with
echo TPAD > /proc/acpi/wakeup

Change-Id: Id562d20b54eeefec56040b8f70ef238911312628
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56622
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-05-24 16:27:44 -07:00
Duncan Laurie
8188577cf9 lynxpoint: Add ACPI Method to enable GPIO as wake source
This is an LPT-LP specific method that will enable a specific
GPIO as an ACPI SCI wake source.

It can be used by a device _DSW method to enable a pin that is
otherwise not configured to generate SCI at runtime.

It will set:
- GPIO owner to ACPI
- GPIO route to SCI
- GPIO config to GPIO, Input, Inverted

Also clean up and remove ACPI field definitions that are unused
and/or incorrect.

BUG=chrome-os-partner:19664
BRANCH=none
TEST=manual: This commit just adds a new method but does not use it.
Followon commit will make use of this to enable wake from trackpad.

Change-Id: I14acc2de50e6200f61c2898a7bd1252400e0f0be
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56621
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-05-24 16:27:43 -07:00
Duncan Laurie
a187695c51 lynxpoint: Enable extra 16 IOAPIC entries for GPIO PIRQ
LynxPoint-LP has an additional 16 entries in the IOAPIC that
can be assigned to specific GPIOs when they are configured
as PIRQ.

The maximum redirection entries field in the IOAPIC needs to
be set to 0x27 when this is enabled.

Additionally specific GPIOs need to be routed to PIRQ so they
interrupt via the IOAPIC instead of the GPIO IRQ 14/15.

BUG=chrome-os-partner:19664
BRANCH=none
TEST=manual: nothing specific changes with this commit, but
it is used with a series of commits to enable the trackpad
interrupt on slippy.

Change-Id: Ie587e1d203422ff6fb7fc5056d20a5ae66720991
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56620
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-05-24 16:27:42 -07:00
Aaron Durbin
8371efd9cc wtm2: add ssdt2 table
The LynxPoint southbridge ACPI code needs the SSDT2 table to function
properly. Otherwise the ACPI evaluator in the kernel spews errors.

BUG=None
BRANCH=None
TEST=Booted and noted no more ACPI errors.

Change-Id: I73918545a07e43f4a281ff34d8537340d601b102
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56601
2013-05-24 14:02:59 -07:00
Duncan Laurie
2a28bb1374 smbios: Add generic type41 write function
Mainboards were defining their own SMBIOS type41
write function.  Instead pull this into the generic
SMBIOS code and change the existing mainboards to
make use of it.

BUG=chrome-os-partner:19035
BRANCH=none
TEST=manual: emerge-{link,parrot,butterfly}
chromeos-coreboot-{link,parrot,butterfly}

Change-Id: I3c8a95ca51fe2a3118dc8d1154011ccfed5fbcbc
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56619
Reviewed-by: Stefan Reinauer <reinauer@google.com>
2013-05-24 14:02:57 -07:00
Duncan Laurie
e7e2c638e4 elog: Check for successful flash erase in elog_shrink
A parrot device with a bad flash part has been seen to hang
in the elog_shrink code becuase the flash was not successfully
erased and it gets stuck in a loop trying to shrink the log
and then add an event.

BUG=chrome-os-partner:18852
BRANCH=parrot
TEST=manual: power cycle testing on device with bad flash

Change-Id: I8bb13dbadd293f9d892f322e213c9255c8e9acb3
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56405
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-05-24 14:02:57 -07:00
Aaron Durbin
ce8fd58e93 haswell: update pei_data data structure
Update and use the new pei_data data structure. Now that the
reference code is fixed it's possible to properly disable/enable
the USB2 and USB3 ports correctly.

BUG=None
BRANCH=None
TEST=emerge slippy. All USB connections available to me still work. Both
     USB3 and USB2. Other boards assumed to work.

Change-Id: I075c646e7574be354420b6e59507e8917a97d0f0
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56594
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2013-05-24 11:36:49 -07:00
Duncan Laurie
ce0a7ddf6c falco: Initial mainboard commit
- Only the first two DIMM SPDs are specified so far
- GPIO map is updated
- iSSD power sequencing removed
- USB port map updated

BUG=chrome-os-partner:19637
BRANCH=none
TEST=manual: emerge-falco chromeos-coreboot-falco

Change-Id: I4172460d3b075bfd5bb22013a6225cf0e8f95b9c
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56329
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-05-23 10:02:23 -07:00
Duncan Laurie
18039f957e slippy: Clean up for easier porting
Minor tweaks to variable names in the slippy mainboard
that make it easier to base a new board from without
as much renaming.

Also properly set up the thermal variables for the
thermal zone that is defined in ACPI instead of using
the generic setup from WTM2.

BUG=chrome-os-partner:19035
BRANCH=none
TEST=manual: emerge-slippy chromeos-coreboot-slippy

Change-Id: I752c1a50bfdc06b6ddad95bd1331c6870b9f9df2
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56328
2013-05-23 10:02:22 -07:00
Aaron Durbin
d5fcda55b2 lynxpoint: fix mem corruption during ssdt2 gen
The ssdt2 generation code was calling acpigen_patch_len().
However, none of the entries had AML object lengths that
needed patching. That resulted in the following message:

ASSERTION FAILED: file 'src/arch/x86/boot/acpigen.c',  line 52

Additionally, this caused an errant write to a memory address
whose value was in the variable ltop. This was the 0 address.

BUG=chrome-os-partner:18635
BRANCH=none
TEST=Built and booted. Noted no more error message.

Change-Id: I44abf5a4e4225220575aee6b5c9bb6b0be093a28
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56299
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@google.com>
2013-05-22 19:15:57 -07:00
Duncan Laurie
66eb6d241c lynxpoint: Fix XHCI controller device in ACPI
The ACPI code was defining two EHCI controllers and ignoring
the XHCI controller.  This changes the second EHCI controller
to be XHCI instead and changes the wake resource to indicate
S3 and not S4.

BUG=chrome-os-partner:19035
BRANCH=none
TEST=manual: cat /proc/acpi/wakeup

Device  S-state   Status   Sysfs node
HDEF      S4    *disabled  pci:0000:00:1b.0
EHCI      S3    *enabled   pci:0000:00:1d.0
XHCI      S3    *enabled   pci:0000:00:14.0

Change-Id: If28775e6ef8608c22c85ca91d91d1f598ec7755d
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56263
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-05-22 12:29:10 -07:00
Duncan Laurie
31a478b5e2 lynxpoint: Enable SerialIO clock in PCI mode
The clock gating register at offset 0x800 is managed by the
clock driver in the kernel when the devices are in ACPI mode.
When in PCI mode we should force enable the clock here.

When in ACPI mode or the device is disabled it should be put
in D3Hot state.

BUG=chrome-os-partner:19495
BRANCH=none
TEST=manual: tested on slippy

> i2cdetect -y -r 10
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- 44 -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Change-Id: Ib93ffd41bf36386d5ce63bfc0ae6597f3e23bc48
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56122
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-05-22 12:29:09 -07:00
Gabe Black
9c2e66d4eb exynos5420: Replace the 5250 clock logic with 5420.
The new code is stolen from U-Boot with little or no understanding of how it
works.

BUG=chrome-os-partner:16132
TEST=Built for pit. Verified that boot progressed past clock initialization.
BRANCH=None

Change-Id: I3f826e799529adee89898015af9e3f3a5114b7f5
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/55570
Reviewed-by: Ronald G. Minnich <rminnich@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2013-05-22 04:53:51 -07:00
Gabe Black
69b5412131 exynos5420: Make the ps_hold_setup function was public.
This function had been declared in a public header file, but was marked
static when actually defined.

BUG=chrome-os-partner:16132
TEST=Built for pit.
BRANCH=None

Change-Id: I7cc9e583c20e54c926b805fcc49b06b629c8a508
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/55569
Reviewed-by: Ronald G. Minnich <rminnich@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2013-05-22 04:53:50 -07:00
Gabe Black
24d167a9d4 peach: Disable early console output on peach.
The UART doesn't seem to be working early on boot.

BUG=chrome-os-partner:16132
TEST=Built for peach.
BRANCH=None

Change-Id: Iadc42e4bbb8d99e321751f081bbfeb1701011802
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/55568
Reviewed-by: Ronald G. Minnich <rminnich@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2013-05-22 04:53:50 -07:00
Stefan Reinauer
1c51fb4535 Exynos5420: Clean up console code
- Don't initialize console twice in the bootblock
 - remove printk in memory init that would mess up the UART
 - unconditionally run console_init() in romstage, as it is
   also unconditionally run in the bootblock.

BUG=none
TEST=not yet, pit is still in early bringup.
BRANCH=none
Signed-off-by: Stefan Reinauer <reinauer@google.com>

Change-Id: I8165622580e1fbe76e1ad06805dc87b4a06b27d8
Reviewed-on: https://gerrit.chromium.org/gerrit/55808
Commit-Queue: Stefan Reinauer <reinauer@google.com>
Tested-by: Stefan Reinauer <reinauer@google.com>
Reviewed-by: Gabe Black <gabeblack@chromium.org>
2013-05-22 03:50:07 -07:00
Stefan Reinauer
8ec9eb7b8c libpayload: Fix xcompile
The architecture name for our ARM port is armv7, not arm.
Hence, none of those flags were ever actually used.

Fix the architecture name and remove the flags, they should
not be set in xcompile, but in the Makefile, like in coreboot.

BUG=chrome-os-partner:18635
TEST=compile tested
BRANCH=none

Change-Id: Id9c5db7ebceafddb58a1ce1988417f09c074ba6c
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/56084
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-05-21 20:14:26 -07:00
Duncan Laurie
f6b7fd9db3 slippy: Run EC init as part of mainboard init step
This will log and clear EC events so they do not take effect
when the SMI handler is enabled.

BUG=chrome-os-partner:19035
BRANCH=none
TEST=manual: ensure system does not shut down when booting
after lidclose/lidopen sequence on EC console.

Change-Id: I5ef563f7cedc8977410cc3f69e2655fc4e14c9eb
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56055
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-05-21 12:10:24 -07:00