Commit Graph

6312 Commits

Author SHA1 Message Date
Martin Roth
ab6a4897b6 extra/usb_gpio: fix misspelled variable name
This should be 'transferred'.

BUG=None
BRANCH=None
TEST=make buildall passes

Change-Id: I40c3c456256eb1d4ae553545497566afae929e32
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/403422
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
2016-11-15 17:42:01 -08:00
Martin Roth
3d738b88ab board/kevin: fix misspelled #define
This should be 'THRESHOLD'.

BUG=None
BRANCH=None
TEST=make buildall passes

Change-Id: Ib80c21edde6890ec51b809896acd9a6cedf49a87
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/403421
Reviewed-by: Wonjoon Lee <woojoo.lee@samsung.com>
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
2016-11-15 17:41:59 -08:00
Martin Roth
680e4fff2b include/btle_hcl_int.h: Fix misspellings in #defines and struct name
These are not used anywhere else in the EC codebase.

Fix VERSION, OCCURRED, Response, & Supported

BUG=None
BRANCH=None
TEST=make buildall passes

Change-Id: I078a8b613fffac0029723cf3c8a5666e71d4a9ac
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/403420
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Myles Watson <mylesgw@chromium.org>
2016-11-15 17:41:58 -08:00
Martin Roth
b3bc41c2fe util/ecst: Fix misspelling in #defines
This should be 'default'

BUG=None
BRANCH=None
TEST=make buildall passes

Change-Id: I58a960ed48f8ea42529682cef4d99c98ac1aa2dc
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/403419
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Mulin Chao <mlchao@nuvoton.com>
2016-11-15 17:41:56 -08:00
Martin Roth
651f8b9acd chip/g to chip/lm4: fix more misspellings in comments
No functional changes.

BUG=none
BRANCH=none
TEST=make buildall passes

Change-Id: I0c4fcc900ec0326d6904aa14f298206e62be0fda
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/403418
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
2016-11-15 17:41:55 -08:00
Martin Roth
897ce78bdd Fix various misspellings in comments
No functional changes.

BUG=none
BRANCH=none
TEST=make buildall passes

Change-Id: Ie852feb8e3951975d99dce5a49c17f5f0e8bc791
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/403417
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
2016-11-15 17:41:53 -08:00
Mario Tesi
64b57efebd accel: add accel driver for LSM6DSM
This add basics for acc and gyro sensor ST lsm6dsm
Still need to add interrupt management for embedded
functions and FIFO

BUG=none
BRANCH=master
TEST=Tested on discovery BOARD with sensor connected on
EC i2c master bus. Added motion sense task on discovery
board task list, added gpio info in board configuration
file and tested with motion sense console commands. Data
for acc/gyro seems ok, can successfully change ODR and
full scale range for acc and gyro.

Change-Id: Ie50c8c0ee366994ed97f7ff3252633893b813ac2
Signed-off-by: Mario Tesi <mario.tesi@st.com>
Reviewed-on: https://chromium-review.googlesource.com/406947
Commit-Ready: mario tesi <mario.tesi@st.com>
Tested-by: mario tesi <mario.tesi@st.com>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
2016-11-15 07:04:30 -08:00
Aseda Aboagye
1d093deb54 motion_lid: Make tablet mode great (again).
Chrome seems to pay attention to the tablet mode switch reported by the
EC.  However, for some devices that don't actually have a switch and use
the lid angle as a "virtual" switch, it's possible for invalid tablet
mode change events to be reported.  This is because a single reading
could flip the switch.

This commit adds some debouncing to the tablet mode event changes.
Instead of having a single event be able to change the tablet mode
switch, we will now perform TABLET_MODE_DEBOUNCE_COUNT number of
calculations of the new tablet mode value.  If those calculations all
agree, then we'll flip the switch.  This should help mitigate false
tablet mode change events caused by spurious forces.

BUG=chrome-os-partner:59203
BUG=chrome-os-partner:59480
BRANCH=gru
TEST=flash kevin; open lid to pi/2 rad; rotate device counter-clockwise
pi/2 rad; shake device and verify that tablet mode doesn't change
easily.
TEST=verify that tablet mode still works.

Change-Id: Id020f7db28e93e53b276b3f0d28a40251f035f0b
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/410942
Commit-Ready: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
2016-11-15 03:09:02 -08:00
Vijay Hiremath
cfe12b90bc reef: Enable high current on type-A ports by default
BUG=chrome-os-partner:59309
BRANCH=none
TEST=Able to draw 1.5A from Type-A ports

Change-Id: I9c598f77a542650edf15f407ec4a10d0e7e7465e
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/411345
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-11-15 00:53:29 -08:00
Ryan Zhang
7618346aaa Electro: modify battery cutoff command
Follow Banon's setting

BUG=chrome-os-partner:59535
BRANCH=master
TEST=`make -j buildall`, shipping mode works well.

Change-Id: Idf4b253ddb86a82752fca0f872ddb9603dee256c
Signed-off-by: Ryan Zhang <Ryan.Zhang@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/411023
Commit-Ready: Ryan Zhang <ryan.zhang.quanta@gmail.com>
Tested-by: 志偉 黃 <David.Huang@quantatw.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-11-14 22:47:44 -08:00
Divya Sasidharan
af848fcce3 anx74xx: Fix typo in anx74xx_check_cc_type function
BRANCH=none
BUG=none
TEST=manual, On Reef connected hoho and made sure it is
properly detected instead of as an accessory.

Change-Id: I1c271a8c5c2800dd88bf0e63a7c7aa2e23551510
Signed-off-by: Divya Sasidharan <divya.s.sasidharan@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/411382
Commit-Ready: Kevin K Wong <kevin.k.wong@intel.com>
Tested-by: Divya S Sasidharan <divya.s.sasidharan@intel.com>
Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: David Hendricks <dhendrix@chromium.org>
2016-11-14 22:47:43 -08:00
Ryan Zhang
4a1f5b0927 Electro: Support 360 Degree rotation
Follow Cyan's & Glados's setting.

BUG=chrome-os-partner:59536
BRANCH=master
TEST=system can boot up normally.

Change-Id: I6abfcef06e5b46cb974706b7472c73f00a644544
Signed-off-by: Ryan Zhang <Ryan.Zhang@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/408497
Commit-Ready: Ryan Zhang <ryan.zhang.quanta@gmail.com>
Tested-by: 志偉 黃 <David.Huang@quantatw.com>
Reviewed-by: Mohammed Habibulla <moch@google.com>
Reviewed-by: Vincent Wang <vwang@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-11-14 22:47:31 -08:00
Mary Ruthven
9495ea7564 cr50: Stop disabling the AP/EC uart when ccd is disabled
This change removes the uart disable in rdd_disconnect. It used to be
necessary because we used to disable device state detection in
rdd_disconnect. Without device state detect we had to disable the AP and
EC uart to make sure there were no interrupt storms. Now we keep device
state detection running all the time. It handles enabling/disabling the
AP and EC uart when it senses the RX signals aren't pulled up.

UART is only enabled/disabled when cr50 detects that the AP or EC state
changed from off to on or on to off. If the debug cable is detached and
then reattched the uart will be disabled on detach, but it won't be
reenabled until the AP/EC are rebooted.

BUG=chrome-os-partner:58222
BRANCH=none
TEST=Detach and reattach suzyq without rebooting the AP or EC and make
sure both consoles come back after reattaching the cable.

Change-Id: Id104e12dc533e8d7047f32aebd41abd1c959d267
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/410269
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-11-14 20:00:40 -08:00
Vijay Hiremath
f61da52856 reef: Enable fast charging profile
Enable fast charging profile config (CONFIG_CHARGER_PROFILE_OVERRIDE)
so that the battery desired current & voltage can be selected for given
rated performance values.

BUG=chrome-os-partner:59779
BRANCH=none
TEST=Manually overrode the temperature and voltage. Observed correct
     charge profile config is selected for each tests.

Change-Id: I080a3ace6d2f77bb6b97911b7705a44ec563258b
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/410824
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-14 20:00:09 -08:00
Bruce
3af2f5e0d4 Snappy: enable tcpc-controlled drp toggle
BUG=None
BRANCH=None
TEST=make buildall

Change-Id: Icdeb4c67234c863128d1d3dd9bdecd149ee866ce
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/409733
Commit-Ready: Devin Lu <Devin.Lu@quantatw.com>
Tested-by: Devin Lu <Devin.Lu@quantatw.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-11-13 21:58:31 -08:00
Vijay Hiremath
9b47a0812d skylake: Add support to S0iX based on host commands from Kernel
Picked the code from Glados branch.
 Change-Id: I4bf114235c4d542dd7cf0dad6427c771e54d4611
 https://chromium-review.googlesource.com/#/c/331358/

BUG=chrome-os-partner:59742
BRANCH=none
TEST=make buildall -j

Change-Id: Ib79f1209dfd9e6a9de0438cb1866bba2939e5393
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/410036
Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Kevin K Wong <kevin.k.wong@intel.com>
2016-11-13 10:58:58 -08:00
Vijay Hiremath
98402bb466 smart_battery: Add console command to read ManufacturerAccess() data
Added console command to read ManufacturerAccess() data on a given
register block.

BUG=chrome-os-partner:59660
BRANCH=none
TEST=Enabled config on Reef.
     Successfully able to read ManufacturerAccess() data

Change-Id: Ic86ae1b44ca8016634c48b54b1130d30fdd2d3fa
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/409638
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-12 23:55:08 -08:00
Bruce
4975e8db75 Pyro: Enable BD9995X power save mode when hibernated
Turn off the charger BGATE when the system is hibernated to
save maximum power.

BUG=None
BRANCH=None
TEST=make buildall

Change-Id: Ifd5d50bbdfde1383538e3ce86f002845798940ac
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/409853
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-11-12 20:33:10 -08:00
Bruce
b7c2f5c295 Pyro: enable tcpc-controlled drp toggle
BUG=None
BRANCH=None
TEST=make buildall

Change-Id: I9a37cffc6018a34ba865d718f488206f06d96087
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/409895
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-11-12 20:33:08 -08:00
Bruce
c6273b6145 Pyro: 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.

BUG=None
BRANCH=none
TEST=make buildall

Change-Id: Ic3bc75b1e5579816d8c1b294fe2eb65a20e3eae3
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/409751
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-11-12 20:33:07 -08:00
Vijay Hiremath
3f728b4ca6 bd9995x: Battery charging profile settings
Added battery charging profile settings as given in the datasheet.

BUG=chrome-os-partner:58553
BRANCH=none
TEST=Manually verified on reef. VBAT is equal to battery voltage.
     Previous/current Charge status is equal to the conditions given
     in the datasheet.

Change-Id: Ie04619a122fe52d6768c03ff5156b368e3f2d340
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/398080
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-11-12 01:50:27 -08:00
Mary Ruthven
732dced60f cr50: request 0mA instead of 500mA for CCD
This changes the usb descriptor to set the MaxPower to 0mA instead of
500mA.

BUG=chrome-os-partner:59564
BRANCH=none
TEST=Verify 'lsusb -vd 18d1:5014 | grep MaxPower' shows the power is 0mA

Change-Id: Ieeb8dec6c205f4fe51392f8106b3a0ed7d3ea0a5
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/410288
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: David Schneider <dnschneid@chromium.org>
2016-11-11 23:12:02 -08:00
Bill Richardson
12da6c23fb Cr50: Add TPM-compliant commands for console lock
This allows custom TPM commands to be declared using the a
DECLARE_VENDOR_COMMAND macro instead of the original (and still
unchanged) DECLARE_EXTENSION_COMMAND macro.

The new commands are nearly identical, but they are encapsulated
using the vendor-specific protocols described in the TPMv2 spec.
Our original extensions use a non-standard command code, and
return a non-standard struct on completion, which can be
confusing to standard TPM drivers and tools.

Demonstrating the use of the new macros, this adds commands to
obtain the state of the Cr50 restricted console lock, or to set
the lock. There is intentionally no command to unlock the
console.

Note that this CL just adds the commands to the Cr50. We still
need to provide a nice userspace utility for the AP to use.

BUG=chrome-os-partner:58230
BUG=chrome-os-partner:57940
BRANCH=none
TEST=make buildall; load, boot, test, and update again on Reef

On Reef, I can use the trunks_send tool to send the raw TPM bytes
to invoke these commands:

Get the lock state:

  # trunks_send 80 01 00 00 00 0C 20 00 00 00 00 10
  80010000000D00000000001000

The last byte 00 indicates that the lock is NOT set, so set it:

  # trunks_send 80 01 00 00 00 0C 20 00 00 00 00 10
  80010000000C000000000011

Success. On the Cr50 console, I see it take effect:

  [480.080444 The console is locked]

Query the state again:

  # trunks_send 80 01 00 00 00 0C 20 00 00 00 00 10
  80010000000D00000000001001

and now the last byte 01 indicates that the console is locked.

And of course the existing extension commands still work as
before. In addition to uploading firmware, I can use the
usb_updater from my build machine to query the running firmware
version:

  $ ./extra/usb_updater/usb_updater -f
  open_device 18d1:5014
  found interface 4 endpoint 5, chunk_len 64
  READY
  -------
  start
  Target running protocol version 5
  Offsets: backup RO at 0x40000, backup RW at 0x4000
  Keyids: RO 0x3716ee6b, RW 0xb93d6539
  Current versions:
  RO 0.0.10
  RW 0.0.9
  $

Change-Id: I7fb1d888bf808c2ef0b2b07c782e926063cc2cc4
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/409692
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-11-11 23:11:51 -08:00
Kevin K Wong
7300bc56c0 reef: enable tcpc low power mode
BUG=chrome-os-partner:55158,chrome-os-partner:55889,chrome-os-partner:55890
BRANCH=none
TEST=on reef use ina (pp3300_pd_a_mw) to check tcpc power consumption

Change-Id: I5a2904f4e549b7da22242848bb3b1887331ecadd
Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/399882
Reviewed-by: David Hendricks <dhendrix@chromium.org>
2016-11-11 23:11:43 -08:00
Kevin K Wong
3de9c1dcd0 reef/ps8751: Add force wake for PS8751.
If PS8751 goes into low power mode during sysjump, then tcpm_init will
fail since PS8751 is not accessible via I2C, so force it to wake up
during hook_init.

BUG=chrome-os-partner:59693
BRANCH=none
TEST=Verified PS8751 port on reef is functional after sysjump.

Change-Id: I2aa5a80b2ea9c17a01e4cba04493f83cb0a39955
Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/410132
Reviewed-by: David Hendricks <dhendrix@chromium.org>
2016-11-11 23:11:41 -08:00
Nick Sanders
bb3ab2fbc4 sweetberry: add usb power logging interface
This allows logging of power data over sweetberry

BUG=chromium:608039
TEST=log power data
BRANCH=None

Change-Id: I6f642384cbf223959294c7bd99bca0f9206775b8
Signed-off-by: Nick Sanders <nsanders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/385540
Reviewed-by: Todd Broch <tbroch@chromium.org>
2016-11-11 17:20:19 -08:00
nagendra modadugu
d7222a4956 CR50: add a constant time buffer equals implementation
Various cryptographic operations leak timing
information if comparisons are not executed
in constant time.  This change adds DCRYPTO_equals(),
a constant runtime comparator.

Also replace crypto related callsites that used
memcmp() as a binary comparator.

BUG=none
BRANCH=none
TEST=tcg tests pass

Change-Id: I3d3da3c0524c3a349d60675902d1f2d338ad455f
Signed-off-by: nagendra modadugu <ngm@google.com>
Reviewed-on: https://chromium-review.googlesource.com/410163
Commit-Ready: Nagendra Modadugu <ngm@google.com>
Tested-by: Nagendra Modadugu <ngm@google.com>
Reviewed-by: Marius Schilder <mschilder@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-11-11 14:27:23 -08:00
Nicolas Boichat
d558d2bee1 hammer: Switch to exponent 3 RSA keys
BRANCH=none
BUG=chrome-os-partner:59083
TEST=make BOARD=hammer -j && bash flash_hammer

Change-Id: I686dbcfa3ad75ce83a997b20a06c22d8a005fccc
Reviewed-on: https://chromium-review.googlesource.com/410580
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2016-11-11 05:40:22 -08:00
Kyoung Kim
fa1cec0b60 ISH: fix UART reference clock
UART reference clock is 100KHz for ISH4 and 120MHz for ISH3

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

Change-Id: Ie33e0bd33e0a0c8e56a58fcf4a48677d38c9d61e
Signed-off-by: Kyoung Kim <kyoung.il.kim@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/409594
Commit-Ready: Kyoung Il Kim <kyoung.il.kim@intel.com>
Tested-by: Kyoung Il Kim <kyoung.il.kim@intel.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-11-11 00:12:33 -08:00
Wai-Hong Tam
31df657df8 flash_ec: Only check the board in the raiden list if the board not empty
The firmware provision job running in the lab calls the flash_ec
script with the --chip parameter, instead of the --board parameter.
So only check if the board name is in the raiden list if it is a
non-empty board.

BRANCH=none
BUG=chrome-os-partner:58039
TEST=Manually triggered the flash_ec command:
$ flash_ec --chip=npcx_spi --image=${IMAGE} --port=9999 --raiden

Change-Id: I25fef906d93803a94c544f7699ce494a84c46bd8
Reviewed-on: https://chromium-review.googlesource.com/410162
Commit-Ready: Wai-Hong Tam <waihong@google.com>
Tested-by: Wai-Hong Tam <waihong@google.com>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2016-11-10 21:28:57 -08:00
Daisuke Nojiri
2ae311c901 eCTS: Test task priority
CTS task wakes up A and C then goes to sleep:

  CTS -> A, C -> A -> B -> C

Since C has a higher priority, C should run first. This should result
in C running one more time than A (or B).

BUG=chromium:663873
BRANCH=none
TEST=cts.py -m task

Change-Id: I89c733ba3aab09b293edf8583d6ed73791531e59
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/409535
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-11-10 21:28:33 -08:00
Daisuke Nojiri
0874f1a197 eCTS: Add task suite
Task A wakes up B and goes to sleep. Task B wakes up C then goes to
sleep. Task C wakes up A then goes to sleep. This is repeated
repeat_count times:

  A -> B -> C -> A -> ...

It's expected all tasks to run exactly repeat_count times. Tick task
runs to inject some irregularity.

BUG=chromium:663873
BRANCH=none
TEST=cts.py -m task

Change-Id: Ib7227f05f09b7a49f8528aff6e6e8d3e6df93ba7
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/409534
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-11-10 21:28:31 -08:00
Nicolas Boichat
d7178e9b5f test/rsa: Add test for RSA with public exponent 3
This tests RSA 2048 with public exponent 3.

BRANCH=none
BUG=chromium:663631
TEST=make run-rsa3

Change-Id: I979ad4a23de6baba63aba037d2713b74fed4737f
Reviewed-on: https://chromium-review.googlesource.com/408130
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2016-11-10 21:28:29 -08:00
Nicolas Boichat
ef0f355e47 common/rsa: Add support for exponent 3 RSA keys
These keys are much quicker to verify (259ms to 51ms on a -M0 at
48 Mhz), so they can be used when timing is critical and
verification needs to be performed on the board.

BRANCH=none
BUG=chromium:663631
TEST=make buildall -j && make run-rsa
TEST=make run-rsa3 (next commit)

Change-Id: I0da4b3e21543bb6f7b18e8b6ddc5e153046a61b8
Reviewed-on: https://chromium-review.googlesource.com/408006
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2016-11-10 21:28:28 -08:00
Mary Ruthven
5edf3f5a8c cr50: disable sleep
When bus obfuscation is enabled we have the chance of doing a security
reset when resuming from sleep. Since we cannot disable bus obfuscation
on current boards, we need to disable sleep.

BUG=chrome-os-partner:57994
BRANCH=none
TEST=make buildall

Change-Id: I6f49278a9b41c1d15c646838044e34f03b979479
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/409576
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-11-10 18:34:21 -08:00
Jeffy Chen
30f2aced12 charge_manager: send EC_HOST_EVENT_PD_MCU at the end of refresh
When kernel get EC_HOST_EVENT_PD_MCU event and query power state, we may
not done refresh here. Delay EC_HOST_EVENT_PD_MCU event to avoid this
race.

BUG=chrome-os-partner:59499
BRANCH=gru
TEST=Manual on kevin, check power state correct after unplug charger

Change-Id: Ib88acf5a39c2780c6e40144ccebfba17cf84f77c
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/408131
Commit-Ready: Douglas Anderson <dianders@chromium.org>
Tested-by: Wonjoon Lee <woojoo.lee@samsung.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-11-10 12:25:35 -08:00
Daisuke Nojiri
5488976a20 eCTS: Add nested interrupt test (High->Low)
Add a nested interrupt test to eCTS. Higher priority IRQ is fired,
followed by lower priority IRQ. Handlers should be executed
sequentially.

P1               *-----*
                /       \
P2             /         *-----*
              /                 \
task_cts ----*                   *----
                 B     C A     D

BUG=chromium:653195
BRANCH=none
TEST=cts.py -m interrupt; make buildall

Change-Id: Ia9f1bf4205cefe8bdc11cc0aa3ad2057359b73ef
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/409611
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-11-09 23:26:31 -08:00
Daisuke Nojiri
b2f14a26b9 eCTS: Add nested interrupt test (Low->High)
Add a nested interrupt test to eCTS. Lower priority IRQ is fired,
followed by higher priority IRQ. Handler executions should be nested.

P1                    *-----*
                     /       \
P2             *----*         *----*
              /                     \
task_cts ----*                       *----
               A      B     C      D

BUG=chromium:653195
BRANCH=none
TEST=cts.py -m gpio, interrupt, timer; make buildall

Change-Id: I34dc7b4e819051b9070a11e69d13d6be704f2e5f
Reviewed-on: https://chromium-review.googlesource.com/408797
Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-11-09 23:26:30 -08:00
Daisuke Nojiri
d57ca41577 eCTS: Pause a few seconds before flushing tty
After a board is reset for setting up a tty port, the host should
wait for a few seconds before flushing the port as the board may
still be booting. This should prevent output from the previous boot
from creeping into a test run.

BUG=none
BRANCH=none
TEST=cts.py -m gpio, interrupt, timer

Change-Id: I1fb567a3a8ddcfff61865b6db3866c56be386c4a
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/408759
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-11-09 23:26:28 -08:00
Nicolas Boichat
f44bc36982 test/rsa: Add test for RSA signature checking
This tests RSA 2048 with public exponent F4 (65537).

BRANCH=none
BUG=chromium:663631
TEST=make run-rsa3

Change-Id: I195a349bb9a862606971054adc9ac3b56a817fe7
Reviewed-on: https://chromium-review.googlesource.com/408129
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
2016-11-09 21:14:17 -08:00
Shawn Nematbakhsh
92d91adbdb npcx: hwtimer: Fix 'slow' timer count just before overflow
If our 32-bit usec timer is close to overflow, we may deep sleep several
times in succession without making any adjustment to our count, causing
deadlines on the other side (eg. HOOK_TICK expiration) to be reached much
slower than expected. Avoid this by not entering deep sleep if our timer
is about to overflow. This will result in a <= HOOK_TICK_INTERVAL (200ms
interval) period of not entering deep sleep, every ~4300 seconds.

BUG=chrome-os-partner:59240
BRANCH=gru
TEST=Verify 3x kevin units survive 16 hours in S3 without EC watchdog.

Change-Id: I2126458be8820f78212e19c2bb79242ff1194f6f
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/409673
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-11-09 21:14:09 -08:00
Shawn Nematbakhsh
ebdb6a62aa npcx: Fix hwtimers
- Wait for ITEN bit to be set / cleared, since writing this bit just
  sets a 'request'.
- Ensure ITIM_EVENT_NO reg is set with minimum value 1, per the
  datasheet.
- Don't dsleep if our wake event is in the past (eg. wake event will
  occur any time now)

BUG=chrome-os-partner:59240
BRANCH=gru
TEST=Manual on kevin, verify that dsleep period never exceeds expected
wait period. Also verify that EC watchdog doesn't occur after 5 hours in
S3.

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: Iedb2723c3f12b74dea66082b1d8b8ce1b6e7d945
Reviewed-on: https://chromium-review.googlesource.com/409672
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-11-09 21:14:08 -08:00
Daisuke Nojiri
5e8a2255ab stm32f0: Allow change of external int priorities
This change allows each board to customize external interrupt
priorities.

BUG=none
BRANCH=none
TEST=make buildall

Change-Id: I5941f368ea70a069b34ce1d98508a1fad1ac22da
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/408796
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-11-09 18:40:00 -08:00
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
de0f53afef driver/touchpad_elan: Basic elan touchpad driver
BRANCH=none
BUG=chrome-os-partner:59083
TEST=make BOARD=hammer -j && bash flash_hammer

Change-Id: I0ff4f48ff1399e054f745ac13ffacf81dffedeab
Reviewed-on: https://chromium-review.googlesource.com/407740
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:52 -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
Furquan Shaikh
e3298150ea ec_commands: Add a new host event for extended events
Since we are out of host event bits, add a bit to indicate extended host
event exists. This is put in as a placeholder for now so that we don't
lose out the last available hostevent bit.

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

Change-Id: If35a246f3da511fde9f8c0bba419afb76a1a9827
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/407804
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-11-08 20:30:09 -08:00
Furquan Shaikh
2fc7ba9df1 common: Add new recovery mode button combination
This adds new key combination (Left_Shift+Esc+Refresh+Power) that triggers
recovery mode by setting a new host event
EC_HOST_EVENT_KEYBOARD_RECOVERY_HW_REINIT. This host event can be used
whenever user wants to request entry into recovery mode by
reinitializing all the hardware state (e.g. memory retraining).

BUG=chrome-os-partner:56643,chrome-os-partner:59352
BRANCH=None
TEST=Verified that device retrains memory in recovery mode
with (Left_Shift+Esc+Refresh+Power) on reef.

Change-Id: I2e08997acfd9e22270b8ce7a5b589cd5630645f8
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/407827
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-11-08 20:30:07 -08:00
Gwendal Grignou
bf4e1db093 driver: sensor: Remove set_interrupt
Remove set_interrupt(), was always a noop.
Unused, interrupt is done inside the init routine.

BUG=none
BRANCH=none
TEST=buildall

Change-Id: I0ff4843212ea8140be41dcd17af130991117e3da
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/407968
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2016-11-08 17:12:18 -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