Commit Graph

2517 Commits

Author SHA1 Message Date
Nicolas Boichat
3857a34873 hammer: Add elan trackpad support
BRANCH=none
BUG=chrome-os-partner:59083
TEST=make BOARD=hammer -j && bash flash_hammer

Change-Id: I8b0e2f3e33f48622097ce698c9548d3e96ac75f1
Reviewed-on: https://chromium-review.googlesource.com/407741
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
2016-11-09 04:41:10 -08:00
Nicolas Boichat
840ba2b6e4 hammer: Initial checkout
BRANCH=none
BUG=chrome-os-partner:59083
TEST=make BOARD=hammer -j && bash flash_hammer

Change-Id: I8cc11408d28677a800af58e738f47d5dcadea3e6
Reviewed-on: https://chromium-review.googlesource.com/407739
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2016-11-08 23:24:50 -08:00
Gwendal Grignou
9b67ffcd52 common: Add tablet_mode API
Simple API to set/get the tablet mode. It can be set via lid angle
calculation or if a board has a dedicated HAL sensor/GPIO.

Merged from glados branch, add MKBP switch support.

BUG=chromium:606718
BRANCH=gru
TEST=Check with Cave that both mode works.

Reviewed-on: https://chromium-review.googlesource.com/402089
Reviewed-by: Shawn N <shawnn@chromium.org>
(cherry picked from commit c940f36ceabcf2425284001298f03ebdb4c3079e)
Change-Id: I2ee5130f3e0a1307ec3ea543f7a32d66bc32b31d
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/404915
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2016-11-08 17:11:28 -08:00
Wonjoon Lee
b044fba33c bd9995*: maintain VBAT voltage as battery maximum
BUG=chrome-os-partner:54248
BRANCH=gru
TEST=Manual on kevin, high temperature chamber(60C),
battery will require 0 voltage because of high temp,
then check 'chgstate' vbat maintained at 8688 mV.

Change-Id: I3b5835701c42a0cd861400ba921b3d3797152bbd
Signed-off-by: Wonjoon Lee <woojoo.lee@samsung.com>
Reviewed-on: https://chromium-review.googlesource.com/400088
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2016-11-08 02:53:54 -08:00
Bill Richardson
c335895df7 Cr50: Let NVMEM take more time and memory
We were getting occasional stack overflow and watchdog timeouts
when clearing NVMEM. Bump up the stack size a bit in the HOOKS
task, and pet the watchdog before invoking the tpm2 init
functions.

BUG=chrome-os-partner:59419
BRANCH=none
TEST=make buildall, manual

Lock the console, then unlock it. This will reboot the EC & AP,
but should never reboot the Cr50.

Before this CL, it did about half the time.
After, it doesn't.

Change-Id: I33adfeb7360bf7d146a55ef16c923a1a0416393d
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/407847
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-11-05 21:03:06 -07:00
Vijay Hiremath
cc944ac92a reef: Update battery structure info as in the spec
BUG=chrome-os-partner:59285
    chrome-os-partner:55861
BRANCH=none
TEST=make buildall -j

Change-Id: I2a22f5ef0072793701f4899cd6e669b8cccca78b
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/406682
Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-11-05 17:41:04 -07:00
Shawn Nematbakhsh
ddc3b3429f elm / kevin / oak: Don't wake from S3 on lid close
BUG=chrome-os-partner:59256
BRANCH=gru
TEST=None

Change-Id: I8e41dc131343e7639850364db27a3ff926164fba
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/407078
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2016-11-05 14:40:15 -07:00
Mary Ruthven
f16d6e43d3 g: add permission level checks
The jittery clock and trng security features require high permissions to
be initialized. In the future these initializations and the permission
level drop may be moved to RO.

This change adds permission level checks before trying to access any
registers that require high permission, so when we update RO to change
the permission RW can still function fine.

BUG=chrome-os-partner:59107
BRANCH=none
TEST=Move the permission drop to the beginning of main and verify the
system still boots.

Change-Id: I5b7cb856decd0640288ad3476f875ec9edc42635
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/405840
2016-11-04 18:31:44 -07:00
Gwendal Grignou
cbae8f9b32 kevin: Add Sensor in S3, disable keyboard wakeup in tablet mode.
Let sensor be powered on in S3. It is useful for Android and if we want to
disable keyboard wakeup based on lid angle.
Allow EC to disable touchpad and not send keyboard events when lid angle
is greater than 180.

BUG=chrome-os-partner:57510,chromium:620633
BRANCH=gru
TEST=In S3, check the sensors are readable.
Check that when in S3 and lid angle is < 180 EC sends keyboard events.
Check that when in S3 and lid angle is > 180 EC does not send keyboard
events.

Change-Id: I4e7959ed37bc5dfdf9c105ecae94c314b253d77f
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/406739
Commit-Ready: Gwendal Grignou <gwendal@google.com>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2016-11-04 04:54:20 -07:00
philipchen
6b1f11d6b9 gru: fix the power led color
In the current implementation, it's hard to tell
when led turns from amber to green.

BUG=chrome-os-partner:57079
BRANCH=None
TEST=Verify LED is green when charging w/ nearly full battery.
Also verify LED control host commands work as expected:
ectool led battery green=1  // green
ectool led battery amber=1  // amber
ectool led battery red=1    // red
ectool led battery red=0    // off

Change-Id: Ie18162fd1608a0548e25472faeca026f1995fc8d
Reviewed-on: https://chromium-review.googlesource.com/406471
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-11-02 17:40:04 -07:00
Nick Sanders
a04fc68e72 usb_i2c: refactor into common
This combines stm32 and chip/g usb_i2c interfaces so they
will not diverge. Note that this fixes the chip/g implementation
to use 8-bit i2c addresses.

BUG=chrome-os-partner:57059
BRANCH=none
TEST=servod interacts with servo_micro and servo_v4

Change-Id: Ibff217d84b132556202c8a71e3d42c07d546c634
Reviewed-on: https://chromium-review.googlesource.com/405108
Commit-Ready: Nick Sanders <nsanders@chromium.org>
Tested-by: Nick Sanders <nsanders@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2016-11-02 17:39:56 -07:00
Kevin K Wong
180ac77e16 reef: enable tcpc-controlled drp toggle
BUG=chrome-os-partner:54668
BRANCH=none
TEST=Verified SNK is detected in S0 (toggle on), S3 (toggle off),
and S5 (force sink). SRC is detect in S0 only, stays detected when
entered S3, but unplug/plug while in S3 will not re-detect until
system back in S0. When go to S5, SRC will get disconnected until
back in S0, and hotplug SRC in S5 will not get detected. Checked
power role swap with another chromebook in the above scenario also.

Change-Id: I2a487fca5cb04c45524aa3efde84fcd10ff0579e
Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/396918
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-11-02 06:42:04 -07:00
Mary Ruthven
488afbd2cf cr50: remove pullups on dioa9 and a1
BUG=chrome-os-partner:59238
BRANCH=none
TEST=verify reef still boots and cr50 still goes to sleep in s3 and s5.

Change-Id: Ibea9ae5ca501dc4bd9ff87d7c702f232be24acbd
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/405837
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-11-01 19:18:37 -07:00
Bruce
e8ab026bac Snappy: support LED behavior
Support LED behavior.

BUG=chrome-os-partner:58771, chrome-os-partner:58772
BRANCH=None
TEST=make buildall

Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Change-Id: Ieb323b5ff5e1096febef9948cf39b1fb22ff094a
Reviewed-on: https://chromium-review.googlesource.com/403674
Commit-Ready: Bruce Wan <Bruce.Wan@quantatw.com>
Tested-by: Bruce Wan <Bruce.Wan@quantatw.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-10-31 22:40:26 -07:00
Bruce
49ed82eaa7 Pyro: Add firmware for shipping mode follow Pyro battery spec.
Add firmware for shipping mode follow Pyro battery spec.

BUG=None
BRANCH=None
TEST=The battery could enter shipping mode and wake up

Change-Id: If1b6e88192ad0a59b19b6b6b664b46780596fa18
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/403731
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-10-31 14:21:27 -07:00
Scott
3c39ccabda eve: Enable BMI160 and BMM150 gyro/compass sensors
Added necessary CONFIG options and board specific info to enable the
following sensors:

1. KXCJ9 Lid motion sensor
2. BMI160 motion sensor
3. BMI160 gyro sensor
4. BMM150 magnetometer sensor

BRANCH=none
BUG=chrome-os-partner:58894
TEST=manual
accelrate 2 10000 -> enable gyro
accelrate 3 10000 -> enable magnetometer
accelinfo on 1000 -> display sensor outputs once per second

See outputs like the following:
Base Accel=3022 , 1685 , -15925
Base Gyro=188  , -1404, -300
Base Mag=-253 , 218  , 1004

Moved eve board around and saw the readings change accordingly.
Have not tested lid motion sensor at this stage.

Change-Id: Ia658de4cbf441759482a053358230793550ef5ab
Signed-off-by: Scott <scollyer@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/404987
Commit-Ready: Scott Collyer <scollyer@chromium.org>
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@google.com>
2016-10-31 11:49:35 -07:00
Vincent Palatin
cf7ff32b92 kevin: set accurate current limit on USB load switch
When sourcing current on the type-C port, set the OCP limit on the VBUS
load switch according to current dynamic capability.
(3.0A when only one port is a power source, 1.5A else)

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BRANCH=gru
BUG=chrome-os-partner:56110
TEST=manual: connect Caroline to Kevin with Twinkie in between,
ask Caroline to sink current through the UI.
without anything else connected on Kevin, see 3A flowing when measuring
with Twinkie ('tw vbus'), plug a dangling C-to-A receptacle dongle on
the other Kevin port and see 1.5A flowing through Twinkie.
Force the input current limit on Caroline to 3.0A and see Kevin cutting
VBUS.

Change-Id: Ib879b1ed720b20aa702c5f3643948ba0575d1193
Reviewed-on: https://chromium-review.googlesource.com/403869
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-10-31 03:27:49 -07:00
philipchen
34066e92a9 gru: Enable barometer and ALS
BUG=chrome-os-partner:59084
BRANCH=gru
TEST=ec console command 'accelread' and 'als'

Change-Id: I2385799626eabef1ad7af5afe96e3d62ecaf7dd4
Reviewed-on: https://chromium-review.googlesource.com/402693
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-10-29 04:47:42 -07:00
Vijay Hiremath
cbc14b38f4 reef: Enable BD9995X power save mode when hibernated
Turn off the charger BGATE when the system is hibernated to
save maximum power.

BUG=chrome-os-partner:59001
BRANCH=none
TEST=Manually verified on the Reef.
     System can boot from hibernate wake sources.
     Following are the power measurement values at Battery
     voltage = 8.3V & temperature = 23 deg C.
     a. Normal operation 540uA, 3.500mW
     b. BGATE OFF        80uA, 0.592mW

Change-Id: Ia30655ccefbf0dded623246150d53b2a815df2de
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/404685
Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-10-28 21:07:46 -07:00
Bruce
df028763fb Pyro: Yoga sensor setting fine tune
Fine tune matrix of base and lid.

BUG=chrome-os-partner:58798
BRANCH=None
TEST=check sceen rotate normally

Change-Id: Ib6740f0f5d6cda87d937b95dfa5788ae72b6aaaf
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/403694
Commit-Ready: Saurabh Madan <ssmadan@chromium.org>
Tested-by: Devin Lu <Devin.Lu@quantatw.com>
Tested-by: Saurabh Madan <ssmadan@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-10-28 21:07:35 -07:00
Bruce
3df0f6a8d0 Pyro: modify led behaivor for Pyro spec
modify led behaivor for Pyro spec

BUG=chrome-os-partner:58696
BRANCH=None
TEST=make buildall

Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Change-Id: I072dee0d15e83e6ea537b52e5475ed6c894e64ef
Reviewed-on: https://chromium-review.googlesource.com/403578
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-10-28 21:07:02 -07:00
li feng
8b0aac61dd reef: clear hpd bit in board level tcpc init
PD alternate mode is covered in tcpc interface. So tcpci_tcpm_init()
doesn't reset HPD. If keeping HDMI/DP type-C cable connected, doing
sysjump sets HPD signal to high while it's already high(this high comes
from previous state), then OS doesn't output to HDMI/DP monitor.
Reef Type-C port 1 follows TCPCI and has this issue.

BUG=chrome-os-partner:57689
BRANCH=none
TEST=Connect HDMI/DP type-C dongle, boot up system, OS detects HDMI/DP
monitor and extends screen to it; in console doing "sysjump RO"
or "sysjump RW", display goes out then comes back.

Change-Id: I12239a86490f29d0123fe8bad1b813d3be28d041
Signed-off-by: li feng <li1.feng@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/398444
Commit-Ready: Li1 Feng <li1.feng@intel.com>
Tested-by: Li1 Feng <li1.feng@intel.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-10-28 21:07:00 -07:00
Gwendal Grignou
c457822a81 kevin: Set BMI160 interrupt
Interrupt from BMI160 was not set up.

BRANCH=gru
BUG=none
TEST=compile

Change-Id: I7d4bdb0b83ffb5de25c40e2c11b6e53b55863dcd
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/404914
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-10-28 21:06:53 -07:00
Gwendal Grignou
f0adf18c91 driver: bma2x2/kionix remove unused fields
Remove fields that are not used anymore.

BRANCH=gru
BUG=none
TEST=make buildall

Change-Id: If4128a5db05e14314bba6c1d367774f098854ac5
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/404913
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-10-28 21:06:51 -07:00
Aseda Aboagye
ea1a8699e9 kevin: Remove PD related TODOs.
It was confirmed that these values were correct.

BUG=chrome-os-partner:59074
BUG=chrome-os-partner:59075
BRANCH=gru
TEST=make -j buildall

Change-Id: I8c63d563515c1fdcbd9f83203c193ba09f8f3447
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/404709
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-10-28 01:00:11 -07:00
Vijay Hiremath
799c272e28 BD9995X: Disable input to port when sourcing
POR has both VCC & VBUS enabled. If the port is sourcing VBUS it will
also act as sync and AC_OK pin gets enabled. Hence disable the input
to the port when sourcing.

BUG=chrome-os-partner:59020
BRANCH=none
TEST=Manually verified on Reef. Connected HoHo and AC_OK is not
     enabled.

Change-Id: Ic51b81f45759d7dddb2c9744d1c24dbafd1e1293
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/404168
Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-10-27 19:28:53 -07:00
philipchen
b6937caeeb gru/kevin: turn on flags to save code size
Turn on CONFIG_HOSTCMD_ALIGNED and
CONFIG_COMMON_GPIO_SHORTNAMES to squeeze more
space for the upcoming sensor code.

BUG=chrome-os-partner:59084
BRANCH=gru, kevin
TEST=Check the map to confirm the size reduction

Change-Id: I7a9ca8fccf6d57a797c391dc76cacb0b929e14df
Reviewed-on: https://chromium-review.googlesource.com/403485
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-10-27 19:28:43 -07:00
Aseda Aboagye
5b556dbd24 kevin: Add bugs to TODOs.
Found some TODOs and filed bugs for them.

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

Change-Id: I3aa4350383f1fe9954f2dd20811c2256d0940a48
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/404112
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Philip Chen <philipchen@chromium.org>
2016-10-27 01:21:54 -07:00
Vadim Bendebury
f2c33b73b2 cr50: provide platform API for fw version capability
The tpm is supposed to report its firmware version when
TPM_PT_FIRMWARE_VERSION_1 and TPM_PT_FIRMWARE_VERSION_2 capabilities
are requested.

This patch retrieves form the build info string SHA1s of the ec and
tpm2 repositories and returns them to the caller.

BRANCH=none
BUG=chrome-os-partner:58177
TEST=with the appropriate tpm2 source tree changes the ec and tpm
      SHA1s are now reported:

    localhost ~ # tpm_version
    TPM 2.0 Version Info:
    Chip Version:        2.0.0.0
    ....
    Firmware Version:    0a92ec7c01b9c924

    (the first half is the zero prepended 7 characters of the ec SHA1,
    and the second half is the zero prepended 7 characters of the tpm2
    SHA1).

Change-Id: I01e4fffdafbbdc4668342ea511ca9c4a555e20a9
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/403115
Reviewed-by: Andrey Pronin <apronin@chromium.org>
2016-10-26 19:59:15 -07:00
Duncan Laurie
a5393caeb5 eve: Add new board
Add support for eve P0 board with:

- chip: npcx
- pmic: bd999992GW
- charger: bd99956
- tcpc: 2x anx3429

BUG=chrome-os-partner:58666
BRANCH=none
TEST=build and boot on eve board

Change-Id: I69ff246e9f8197d5d50241e6a8fa4796f4c9bfda
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/400638
2016-10-26 14:22:54 -07:00
Vincent Palatin
fffea303b4 pd: fix contract negotiation with dynamic PDOs
When the board is using dynamic source PDOs, we need to ensure that we
are checking the incoming sink power request against the right set of
PDOs else we might reject a valid request (e.g. with high-power source,
we need to check against the 3.0A limit if we only have one port
connected).

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BRANCH=gru
BUG=chrome-os-partner:56110
TEST=Connect Kevin to Caroline, ask Caroline to charge from the other
side and see it negotiating successfully a 5V/3A contract.

Change-Id: Ie1aa5746776be5946422bf07c08ae0f22faddd8c
Reviewed-on: https://chromium-review.googlesource.com/403088
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-10-26 01:45:17 -07:00
Mary Ruthven
6e82ee4729 cr50: enable write protect
Enable write protect based on the type of image being built. Write
protect will be enabled on production images and disabled on dev images.

BUG=chrome-os-partner:49959
BUG=chrome-os-partner:55604
BUG=chrome-os-partner:58961
BRANCH=none
TEST=verify wp is enabled unless the image is built with CR50_DEV=1

Change-Id: Ibcd7f35fb4b33142c94e59e8c103624fce4e0b10
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/403308
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-10-26 01:45:10 -07:00
Bruce
d73f705442 Snappy: Fix multi-func mode for USB PD
Without this change the Alternate mode adapter with
multi-function capablity would only be configured as
DP instead of (DP + USB).

BUG=None
BRANCH=master
TEST=make buildall

Change-Id: I44d2b0ff56a8851b8104c4305b8f5826dcbe2107
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/401266
Commit-Ready: Bruce Wan <Bruce.Wan@quantatw.com>
Tested-by: Bruce Wan <Bruce.Wan@quantatw.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-10-26 01:45:02 -07:00
Bruce
53556b96d7 Snappy: Enable low power idle mode
BUG=None
BRANCH=none
TEST=make buildall

Change-Id: I8c71f6916b17d36026d9f96c91391f397bbaef43
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/401245
Commit-Ready: Bruce Wan <Bruce.Wan@quantatw.com>
Tested-by: Bruce Wan <Bruce.Wan@quantatw.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-10-26 01:44:38 -07:00
Andrey Petrov
b1ac9d3c6e amenia: remove mainboard
Amenia is EOL. Remove mainboard.

BUG=chrome-os-partner:57490
BRANCH=none
TEST=none

Change-Id: Idd453299df866c8ea6e4a4903d94bc26ff9150c6
Signed-off-by: Andrey Petrov <andrey.petrov@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/392231
Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-10-25 17:33:50 -07:00
Vijay Hiremath
e46d67518e reef/pyro/elm/amenia/snappy: Remove false battery critical message
Till the charger task is initialized port is not set for the BD9995X
users and a false battery critical message is printed. Removed the
false message printed for BD9995X users to avoid confusion.

BUG=chrome-os-partner:58972
BRANCH=none
TEST=Manually tested on Reef.
     False battery critical message is not printed on the EC console.

Change-Id: Iec8d0f354c4f6dc17efa9da8db38b125e57addab
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/402668
Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-10-25 17:33:48 -07:00
Duncan Laurie
b8050224e5 include: Add default state for ESPI and VW_SIGNALS
Add the default undefined state for CONFIG_ESPI and rename
CONFIG_VW_SIGNALS to CONFIG_ESPI_VW_SIGNALS.

BUG=chrome-os-partner:58666
BRANCH=none
TEST=pass presubmit checks

Change-Id: I45242d545915c16bb46f751532a01ab937cee5f0
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/400032
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-10-25 17:33:42 -07:00
nagendra modadugu
e6549481c7 CR50: introduce a fixed endorsement seed & certs
This change introduces a 'fixed' endorsement seed,
and corresponding certificates.  This fixed seed
is used in the endorsement process when a production
mode chip is running dev-signed firmware (or vice-versa).

The fixed certificates are untrusted by production
services, and are suitable for use in a development
environment.

BRANCH=none
BUG=none
TEST=build succeeds

Change-Id: Ifad0b361413a10f88c4977b03033a30a750cd536
Signed-off-by: nagendra modadugu <ngm@google.com>
Reviewed-on: https://chromium-review.googlesource.com/401634
Commit-Ready: Nagendra Modadugu <ngm@google.com>
Tested-by: Nagendra Modadugu <ngm@google.com>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-10-25 14:47:09 -07:00
Bruce
f140370353 Pyro: Fix multi-func mode for USB PD
Without this change the Alternate mode adapter with
multi-function capablity would only be configured as
DP instead of (DP + USB).

BUG=None
BRANCH=master
TEST=make buildall

Change-Id: I85c8b52469dec6fc347c5cfe6a3b208bc765069e
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/401074
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-10-24 13:49:03 -07:00
Bruce
1f533bd6eb Pyro: Enable low power idle mode
BUG=None
BRANCH=none
TEST=make buildall

Change-Id: If3ba1f57989d9c0f1027e8281a4ff6bddaac7dec
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/402108
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-10-24 13:48:50 -07:00
Bruce
0ef87a741c Pyro: Fix sensors order for devices with BM160 and LPC mode.
When the kernel reads sensor data via LPC, it expects the order to be:
- ACCEL
- ACCEL
- GYRO
(other sensors data are read through EC commands)
BMI160 expects ACCEL, GYRO and MAG to be next to each other.
Reorganize motion_sensor array to fit these 2 requirements:
If BMI160 in the lid:
- BASE_ACCEL
- LID_ACCEL
- LID_GYRO
...
If BMI160 in the base:
- LID_ACCEL
- BASE_ACCEL
- BASE_GRYO
...

BUG=none
BRANCH=none
TEST=make buildall

Change-Id: If89cf29d28b70e9a46dde8a3301a1942b3a1dd8b
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/401206
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-10-23 01:00:03 -07:00
Bruce
a0e1cd054a Pyro: remove obsolete code for proto
BUG=none
BRANCH=none
TEST=make buildall

Change-Id: Idfa57dc6f06e0b3a42eca3f77279c60e615b6ae5
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/401222
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-10-23 01:00:02 -07:00
Bruce
bbdc57361a Pyro: Enable CONFIG_CMD_ACCEL_INFO
Enable this EC console command for testing

BUG=None
BRANCH=master
TEST=make buildall

Change-Id: I95e3926bcc30f91ebb5174a055db98469b5a8b76
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/400983
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-10-23 01:00:00 -07:00
Bruce
d295d36520 Pyro: Enable Host command that enables/disables Display Backlight
This command will be used to perform power validation.

BUG=none
BRANCH=none
TEST=make buildall

Change-Id: I993438162871ceba3e45635db31e3b1bd5aae643
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/401084
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-10-23 00:59:58 -07:00
Vijay Hiremath
a4da57e0f3 reef: Enable low power idle mode
BUG=chrome-os-partner:56183
BRANCH=none
TEST=Used dut-control command 'dut-control pp3300_ec_mw -r <n>'
     to measure the pp3300 rail and power in S3 dropped from
     ~9mW to ~5mW.

Change-Id: I64b463351a6f191a94a41a31de9ee51ae6d9b7b4
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/400948
Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
2016-10-20 23:23:55 -07:00
Bruce
dc6cff16ee Snappy: Create initial board
Create initial snappy EC code, by copy from reef

BUG=chrome-os-partner:58233
BRANCH=None
TEST=make buildall

Change-Id: Ie13491c07165988047d131404a0e759c0d40562a
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/401221
Commit-Ready: Bruce Wan <Bruce.Wan@quantatw.com>
Tested-by: Bruce Wan <Bruce.Wan@quantatw.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-10-20 23:22:37 -07:00
Randall Spangler
5e1c63f6eb Support alignment for EC host command structures
The host command parameter and response buffers should be explicitly
aligned by the LPC/SPI/I2C drivers.  But the host command handlers don't
know that, and the structs are all __packed, so the compiler generates
horribly inefficient ARM Cortex-M code to cope with unaligned accesses.

Add __ec_align{1,2,4} to force the param / response structs to be
aligned.  Use it in a few structs now which were straightforward to
test.  It should be added to more structs as space is needed, but that
would make this change unwieldy to review and test.

Add CONFIG_HOSTCMD_ALIGNED to enable the additional alignment.
Currently, this is enabled only for LM4 and samus_pd, so that EC code
can be tested without affecting other non-samus ToT development (none of
which uses LM4).

Fix the two handlers that weren't actually aligned (despite one of
them having comments to the contrary).

Also, add a CHROMIUM_EC define that can be used to determine if a file
is being compiled for an EC target.  We need that so that we only force
structure alignment for EC binaries.  On the AP side, buffers may not be
aligned, so we should not force alignment.

BUG=chromium:647727
BRANCH=none
TEST=Flash samus and samus_pd.  Boot samus and run a bunch of ectool
     commands (with and without --dev=1, so it tests both EC and PD).
     System boots and all commands return expected results.

Change-Id: I4537d61a75cf087647e24281288392eb85f22eba
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/387126
2016-10-19 20:07:09 -07:00
Kevin K Wong
09ad7536ce pd_task: print pd state name
Shifted pd_task debug level by 1 so that debug level 1 will
enable printing the pd state name.

Added a CONFIG flag to remove ability to change debug_level
during runtime and debug print level will be fixed.

BUG=none
BRANCH=none
TEST=make buildall

Change-Id: I545813bafa8084355cedc2d8334c3aec5a2b6739
Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/339935
Tested-by: Divya S Sasidharan <divya.s.sasidharan@intel.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-10-19 02:45:36 -07:00
Divya Sasidharan
ff9b1d158e reef: usb_pd_policy: Fix multi-func mode for USB PD
Without this change the Alternate mode adapter with
multi-function capablity would only be configured as
DP instead of (DP + USB).

BUG=chrome-os-partner:58670
BRANCH=master
TEST=On Reef, with Dell dongle verified on both ports
 that USB 3.0 device and ethernet is working.

Change-Id: I7a15a281306e29f589de2ef59da9c424f3f6710d
Signed-off-by: Divya Sasidharan <divya.s.sasidharan@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/400080
Commit-Ready: Kevin K Wong <kevin.k.wong@intel.com>
Tested-by: Divya S Sasidharan <divya.s.sasidharan@intel.com>
Tested-by: Li1 Feng <li1.feng@intel.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-10-19 02:45:34 -07:00
Nick Sanders
6e03484c01 polyberry: add initial board build
This supports gpio initialization only.

BUG=None
TEST=Successfully checked console and available GPIO on sweetberry
BRANCH=None

Change-Id: Id50f66652b05c25a8c79ce2938fa161a944d93b8
Signed-off-by: Nick Sanders <nsanders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/399643
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2016-10-18 22:15:52 -07:00