Commit Graph

30 Commits

Author SHA1 Message Date
Vijay Hiremath
646760bb20 Skylake: Add low power Pseudo G3 support
BUG=none
TEST=Used "shutdown -h now" Kernel console command to test on Kunimitsu.
     With only battery after 1 hour, device enters to Pseudo G3 and the
     V3p3A is off. With AC connected, device is in G3.
BRANCH=none

Change-Id: I955662eb69ac608e9b2d12bdcfbc1258ca83f3a5
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/292976
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-08-21 03:46:19 +00:00
Wenkai Du
60ddfc8310 kunimitsu: Enable CONFIG_VBOOT_HASH
Port Shawn's patch for glados to kunimitsu:

Enable CONFIG_VBOOT_HASH to support image hash related host commands.
Originally-reviewed-on: https://chromium-review.googlesource.com/294567

Removed temperature sensor test command to save space.

BUG=chrome-os-partner:44214
TEST=Verify `ectool echash` prints a hash
BRANCH=None
Change-Id: I72312cd4d3ae116073e15bb07ca3256c82efe3dd
Signed-off-by: Wenkai Du <wenkai.du@intel.com>
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/294735
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2015-08-21 00:49:17 +00:00
Wenkai Du
5b4fd77df3 kunimitsu_pd: enable kunimitsu PD build
Symbolic link kunimitsu_pd to glados_pd folder. Disable PD test
build until issue is fixed.

BUG=chrome-os-partner:43142
TEST=emerge-kunimitsu chromeos-ec and check EC and PD binaries

Change-Id: Ic0f1d73246333d8ec7752bb4c42b1c0ac220b5c3
Signed-off-by: Wenkai Du <wenkai.du@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/292841
Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-08-12 04:25:20 +00:00
Vijay Hiremath
85be3038a3 Kunimitsu: Add board version support
BUG=none
TEST=Verified correct board version is returned via "version" console command.
BRANCH=none

Change-Id: I1449ea0883437f782c950f772b4539eedc64770d
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/290578
Reviewed-by: Shawn N <shawnn@chromium.org>
Tested-by: Divya Jyothi <divya.jyothi@intel.com>
Commit-Queue: Divya Jyothi <divya.jyothi@intel.com>
2015-08-05 22:28:48 +00:00
Alec Berg
feea8de21b usb_charger: move common usb charger code out of board directory
Move common USB charger code out of board directory including
setting VBUS supplier when VBUS changes, and initializing BC1.2
supplier types on init.

This also enables re-enabling of Pericom BC1.2 detection interrupts
when VBUS is changed on all boards that use USB_CHG task.

BUG=chrome-os-partner:42292
BRANCH=none
TEST=make -j buildall. Tested on glados and samus by plugging in
a few different chargers and making sure we charge.

Change-Id: Ib102fbf7a6aace998e6fcb6d35f3c97e5f03f5c2
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/290453
Reviewed-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Rong Chang <rongchang@chromium.org>
2015-08-05 16:50:46 +00:00
Alec Berg
e8720732b5 usb_charger: configure boards to disconnect USB when UFP.
Configure boards whose chipset cannot be a USB UFP to disconnect
USB lanes when the data role is UFP.

BUG=none
BRANCH=strago
TEST=make -j buildall. tested on glados by adding ccprintf to
usb_charger_set_switches(). verified when we are DFP, USB 2
switches are connected and when we are UFP, they are disconnected.

Change-Id: Ic8c817a0cc21b56ee67239e8cc81d5cbbda8d4de
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/290422
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-08-04 20:50:20 +00:00
Alec Berg
d804e8fdbd usb_charger: cleanup: move setting usb 2 switches to usb_charger
Move function to set D+/D- switches from board directory to
usb_charger module.

BUG=none
BRANCH=strago
TEST=make -j buildall

Change-Id: I5c5997c799cecea90448444863167af860a8f3e1
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/290421
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-08-04 19:22:07 +00:00
Shawn Nematbakhsh
c4a67803b3 mec1322: Fix dedicated SPI port access
Correct spi_rx_option table, and use correct port for kunimitsu.

BUG=chrome-os-partner:42304
TEST=Burn + boot glados
BRANCH=None

Change-Id: Ic52ecb48102a74d3c17ab06b6da24ee40659ef86
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/289868
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
2015-08-01 02:51:44 +00:00
Gwendal Grignou
a3a5c90b54 accel: mechanical changes from i2c_addr to addr
Encode both the I2C address and SPI GPIO CS in addr field.
Mechanical change to rename i2c_addr into addr.

BRANCH=smaug
TEST=compile
BUG=chrome-os-partner:42304

Change-Id: I1c7435398deacb27211445afa27a08716d224c06
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/288513
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
2015-07-30 19:58:01 +00:00
Gwendal Grignou
5b71b33aba common: change interface to SPI flash
Allow more than one SPI master.
Add CONFIG variables to address the system SPI flash.

To have SPI master ports, spi_ports array must be defined.

BRANCH=smaug
TEST=compile
BUG=chrome-os-partner:42304

Change-Id: Id43869f648965c1582b7be1c7fb3a38f175fda95
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/288512
Commit-Queue: David James <davidjames@chromium.org>
2015-07-30 19:57:55 +00:00
Shawn Nematbakhsh
a9527fd686 acpi: Ensure continuity of memmap data with a read cache
For multi-byte ACPI memmap reads, we previously had a mutex to ensure
data continuity. A better approach is to use a read cache. Since the
kernel will enable burst mode before reading a multi-byte memmap
variable and disable it afterward, we can populate the cache on the
first read after enabling burst. This solution removes deadlock bugs, is
contained entirely in acpi.c, and saves a deferred function.

BUG=chromium:514283
TEST=Manual on Glados. Add prints in acpi_read, verify that multi-byte
reads come from cache and non-burst reads continue to function as
before.
BRANCH=Cyan

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I74e4927bf2b433e31a9ff65d72820fa087c51722
Reviewed-on: https://chromium-review.googlesource.com/288871
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2015-07-28 21:31:38 +00:00
Alec Berg
6eecf91b63 pd: enable try.src for necessary boards
Enable Try.Src for Glados, Kunimitsu, Strago, and Oak so that they
default to sourcing power when connecting to other dual-role
devices.

BUG=none
BRANCH=strago
TEST=make -j buildall
Tested on glados by plugging in charger, hoho, and another
dual-role device and making sure we resolve roles appropriately.

Change-Id: I9393e30b35620eeda3ef1ef56366a97e59ba8054
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/288247
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-07-27 19:30:01 -07:00
Alec Berg
07951e7f93 kunimitsu: disable asserts to save flash space
BUG=none
BRANCH=none
TEST=make -j buildall

Change-Id: I8909001a093ebfd4ea482984855931b0764e2552
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/288770
Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-07-27 19:30:01 -07:00
Vijay Hiremath
2302647f57 kunimitsu: add HPD handling to policy layer
Ported the HPD handling to policy from Glados
 Change-Id: I293224fa5189c8827f1837877ffb791fddc7fb77
 Reviewed-on: https://chromium-review.googlesource.com/285743

BUG=none
TEST=make buildall -j
BRANCH=none

Change-Id: I72e2f0853902bfa3536ba083f8ece5785be625c4
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/287410
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-07-22 05:02:48 +00:00
Vijay Hiremath
dfcb1dc9e1 Kunimitsu: Add support for USB-C muxes
Ported the USB-C muxes from Glados
 Change-Id: I9d42108688a9070b982ae77f77633654bc6505ed
 Reviewed-on: https://chromium-review.googlesource.com/282281

BUG=none
TEST=Tested the USB & DP status from "typec" console command.
     Observed usb_mux_set() & usb_mux_get() function are getting called
     and also the polarity of the USB-C is getting detected properly.
BRANCH=none

Change-Id: I56da12f4fe20a05a73e8b93893ba5a425a20808f
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/287360
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-07-22 05:02:42 +00:00
Vijay Hiremath
ff99342641 Kunimitsu: Initial support for FAB3
Following features are enabled.
1. ALS OPT3001 is enabled
2. Charger ISL9237 is enabled
3. Sleep mode in G3 is enabled
4. CMD_HASH, CMD_TIMERINFO, CONSOLE_HISTORY, CMD_ACCEL_INFO, CMD_ACCES
   are disabled to save the memory.

BUG=none
TEST=Device boots to UI.
BRANCH=none

Change-Id: I225dcafdb5b066b6d9b9b2b00bd06586d33d3527
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/286783
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-07-21 01:34:33 +00:00
Shawn Nematbakhsh
79ff743aaa kunimitsu: Remove console commands to save flash space
BUG=chrome-os-partner:42853
TEST=make buildall -j
BRANCH=None

Change-Id: I025942a4349a7fcd27d3eec8e67476416fe070a8
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/286151
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-07-17 00:05:59 +00:00
Shawn Nematbakhsh
78016324ac mec1322: Allow multiple hibernate wake sources
Allow multiple GPIOs to wake the EC from hibernate by requiring boards
to define hibernate_wake_pins and hibernate_wake_pins_used. In addition,
clean up the GPIO-skipping hibernate code, and skip setting PCH_RTCRST
as an input due to a bug on certain boards.

BUG=chrome-os-partner:42104
TEST=Manual on Glados. Run 'hibernate' from EC console, verify that EC
wakes with power button press or with "dut-control lid_open:no".
BRANCH=None

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I13a6e062393cab8ed7129eda253585951f771109
Reviewed-on: https://chromium-review.googlesource.com/285924
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-07-16 05:15:29 +00:00
Gwendal Grignou
c0f78b4c0a motion: Add sample frequency per sensor
Store at which frequency each sensor should be sampled.
This frequency is different from the sensor frequency:
- sensor frequency: frequency at which the sensor produce information.
- sensor sampling frequency: frequency at the which the EC gater
information.
If 2 sensors must be sampled at very different frequency,
we don't want to oversample the slow one, and filling the
software FIFO unnecessarily.

BRANCH=smaug
TEST=Unit test. Check that frequency is correct when sensor
frequencies change from IIO driver.
BUG=chrome-os-partner:39900

Change-Id: I4272963413f53d4ca004e26639dc7a2affd317eb
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/284616
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-07-15 02:07:01 +00:00
Alec Berg
ac1cba419a cleanup: remove board_discharge_on_ac() unless custom func needed
Remove duplicate board_discharge_on_ac() functions and create
CONFIG_CHARGER_DISCHARGE_ON_AC_CUSTOM for boards that have a
unique implementation of board_discharge_on_ac().

BUG=chrome-os-partner:42294
BRANCH=none
TEST=make -j buildall.
load on samus and test 'ectool chargecontrol discharge' forces
discharging on AC, and 'ectool chargecontrol normal' resumes normal
charging.

Change-Id: I2b7c04b9278d07748d6d41798ceab1a7e90684e4
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/284911
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2015-07-14 22:39:36 +00:00
Alec Berg
693bf0e40b cleanup: remove GPIO_INT_DSLEEP from chips where it's not useful
GPIO_INT_DSLEEP is useful on LM4 to save power when in deep sleep
by allowing us to disable clock to gpio blocks unless it's needed
as a wake source. The MEC and ST chips don't have this option, so
all gpio's can be used as wake source from deep sleep. Therefore
remove this flag from all boards where this flag doesn't do
anything to remove confusion.

BUG=none
BRANCH=none
TEST=make -j buildall

Change-Id: I4cb175431a22f100035a81b32e9367b510f4836e
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/284742
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-07-13 23:27:23 +00:00
Alec Berg
10dc22867f cleanup: remove board function callback on charge override timeout
Remove board function callback on charge override timeout, since
the implementation should be common to all boards: send host event.
This function is called when a power swap fails during an issued
charge override and notifies the host so that it is aware that the
power swap did not succeed.

BUG=none
BRANCH=smaug
TEST=make -j buildall

Change-Id: Ia2a078a17aef6b302fd2b9fd21a5a92c628fd7db
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/284923
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2015-07-13 03:18:38 +00:00
Alec Berg
16d40b0b3c cleanup: define one set of USB charger voltage and min current
Remove duplicate definitions of USB charger min current across
boards and make one set of defines for standard USB charger voltage
and minimum USB charger current.

BUG=none
BRANCH=smaug
TEST=make -j buildall

Change-Id: Ib842fafb317417c8de9a67d314fdde4c1e47ad9d
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/284956
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2015-07-13 03:18:32 +00:00
Kevin K Wong
75b95672ac kunimitsu: Update gpio according to fab3 hardware changes
BUG=none
TEST=Verified system can boot to OS and able to do PD negotiation.
BRANCH=none

Change-Id: Ie232954931984256887f953d387e56baccba2178
Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/282390
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-06-30 08:58:35 +00:00
Kevin K Wong
daea221d56 kunimitsu: add initial PD support
This is based off glados commit:
 glados: limit type-C voltage to 5V to increase charging reliability
 Change-Id: I4d67b62a18cf40d645b132081a431f9ce187168b
 Reviewed-on: https://chromium-review.googlesource.com/276366

BUG=none
TEST=Verified PD negotiate on Port 0 on Kunimitsu Fab2.
     Port 1 is also functional after hardware changes.
BRANCH=none

Change-Id: I0cb1edcf1703f55882f81c65e6359a45be4c1629
Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/281833
Reviewed-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-06-30 08:58:31 +00:00
Kevin K Wong
ccb6b15d51 kunimitsu: Code clean up.
This allows cleaner code diff from glados.
No new functional change is added.

BUG=none
TEST=Able to boot kunimitsu to OS.
BRANCH=none

Change-Id: I0ff7a097a617907a44c78d5e0f01dc409eb047ec
Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/281832
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-06-26 18:57:25 +00:00
Bill Richardson
104f811e67 cleanup: fix all the header guards
This unifies all the EC header files to use __CROS_EC_FILENAME_H
as the include guard. Well, except for test/ util/ and extra/
which use __TEST_ __UTIL_ and __EXTRA_ prefixes respectively.

BUG=chromium:496895
BRANCH=none
TEST=make buildall -j

Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: Iea71b3a08bdec94a11239de810a2b2e152b15029
Reviewed-on: https://chromium-review.googlesource.com/278121
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2015-06-18 19:07:00 +00:00
Steven Jian
937cc8a64e mec1322: Simplify GPIO lists
Our existing GPIO macros use port# / gpio#, but the concept of different
GPIO ports does not exist on the mec1322. Therefore, add new GPIO macros
for chips which do not have distinct GPIO ports.

BUG=None
BRANCH=None
TEST=make buildall -j

Change-Id: Ibda97c6563ad447d16dab39ecadab43ccb25174b
Signed-off-by: Steven Jian <steven.jian@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/262841
Reviewed-by: Anton Staaf <robotboy@chromium.org>
2015-05-27 03:58:16 +00:00
Shawn Nematbakhsh
0a71b4418d cleanup: Use CONFIG_BATTERY_CUT_OFF for supported boards
Common battery cut-off host command / console command infrastructure
already exists behind CONFIG_BATTERY_CUT_OFF, so add the config rather
duplicating the code at the board level.

BUG=chromium:488157
TEST=Manual on Squawks. Verify that both "cutoff" on the ec console and
"ectool batterycutoff" succeed to cut-off the battery.
BRANCH=None

Change-Id: I159026d54924e058ea0262db04d8770c663ee613
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/271513
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2015-05-16 03:00:16 +00:00
Kevin K Wong
1cdb90878f kunimitsu: Initial GPIO and Power Sequence support
BUG=none
TEST=Device boots to UI.
BRANCH=none

Change-Id: I2b2cc471b096f8f6d2b2a6af4a634f05fcc3b989
Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com>
Signed-off-by: Divya Jyothi <divya.jyothi@intel.com>
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/270775
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-05-15 06:42:37 +00:00