Commit Graph

7254 Commits

Author SHA1 Message Date
Scott Collyer
2cb6448035 coral: Remove support for magnetometer and barometer sensors
Since Reef was the starting point for /board/coral, coral inherited
support for both the BMI150 magnetometer and BMI280 barometer
sensors. Coral does not need to support either of these sensors.

This CL removes support for both of these sensors.

BUG=b:62519010
BRANCH=none
TEST=Manual Run 'make BOARD=coral' and verify it builds. Used
accelinfo EC console command to verify that other sensor readings are
working. My test setup does not have ALS sensor so couldn't confirm
that operation.

Change-Id: I75abe2f10c8f0ff318f4795e6b88c9aff3d8a9ad
Signed-off-by: Scott Collyer <scollyer@google.com>
Reviewed-on: https://chromium-review.googlesource.com/530448
Commit-Ready: Scott Collyer <scollyer@chromium.org>
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
2017-06-13 15:12:35 -07:00
Mary Ruthven
1cd8daa664 g: don't enable interrupts in gpio_set_flags_by_mask
All other chips rely on gpio_enable_interrupt to enable interrupts. They
aren't enabled by default. This changes chip/g to match that.

If chip/g boards have interrupts, they also enable them in the
init_interrupts function in board.c. Nothing needs to be added to enable
interrupts.

BUG=b:35587228
BRANCH=cr50
TEST=use 'gpiocfg' to verify the setup hasn't changed.

Change-Id: I1e975999e0174b9dcbbe63c09c6110dc4161f8ff
Reviewed-on: https://chromium-review.googlesource.com/530006
Commit-Ready: Mary Ruthven <mruthven@chromium.org>
Tested-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2017-06-13 15:12:33 -07:00
Nicolas Boichat
9ebcc894be test/entropy: Add host test and compute entropy
Check that added entropy is at least somewhat acceptable.

BRANCH=none
BUG=b:38486828
TEST=make BOARD=hammer -j tests
     ./util/flash_ec --board=hammer --image=build/hammer/test-entropy.bin
     EC console: runtest, get around 4000/1000 (=4) bits of entropy, value
     matches (roughly) the value obtained using the awk script.
TEST=make run-entropy

Change-Id: I88d0e9ec0e38ab3ec70d3e8163b8ac1556df978d
Reviewed-on: https://chromium-review.googlesource.com/523482
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-06-13 05:23:33 -07:00
Vincent Palatin
c4f4651852 cr50: add derivation functions using the key-ladder
Add functions to do key derivation for the U2F code,
using the hardware key-ladder.

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

BRANCH=cr50
BUG=b:35545754
TEST=with follow-up CLs, run U2FTest on Eve

Change-Id: I5960fb9baa7ca555423a956fb97ef2bdee82feee
Reviewed-on: https://chromium-review.googlesource.com/525539
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Nagendra Modadugu <ngm@google.com>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Nagendra Modadugu <ngm@google.com>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-06-13 03:45:15 -07:00
Nicolas Boichat
aa15b8621d stm32: Add function to fetch unique id
BRANCH=none
BUG=b:62280271
TEST=Flash hammer
     lsusb -d 18d1:5022 -v -v | grep iSerial
     shows different chip IDs on different boards.

Change-Id: Id56b4509f184eb722d04fef94079c150dc2016e2
Reviewed-on: https://chromium-review.googlesource.com/523044
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
2017-06-12 20:27:55 -07:00
Scott Collyer
3423baba30 coral: Update board version table to account for 16 levels
Coral has 16 voltage levels utilized for board ID. Compared to 8 for
Reef. This CL updates the board_version table to account for 16 board
version entries. In addition, insted of using a fixed error percentage
upper error bar, the table entries have been set to be the mid point
between two consecutive voltage levels.

MOdified the existing board_get_version() function so that it calls a
common function since this needs to be repeated for both board ID and
board SKUs. Modified gpio enable signal name to match the
schematic. Coral uses an active high enable.

Added an EC console command with options id|sku0|sku1 to test each
option. This CL does not include the function which will be used with
the host command interface so the AP can retrieve the sku 0|1 values.

BUG=b:62519010
BRANCH=none
TEST=MANUAL
Using the console command board_id shows the following:
> board_id
Wrong number of params
Usage: board_id <id | sku0 | sku1>
> board_id id
[44.484516 ID/SKU ADC 2 = 123 mV]
Board id|sku: chan 2 = 0
> board_id sku0
[56.850566 ID/SKU ADC 4 = 123 mV]
Board id|sku: chan 4 = 0
> board_id sku1
[65.547598 ID/SKU ADC 3 = 123 mV]
Board id|sku: chan 3 = 0

Change-Id: Iaba146c12c6d9d2c57973569d51c1b7ad3212455
Signed-off-by: Scott Collyer <scollyer@google.com>
Reviewed-on: https://chromium-review.googlesource.com/530907
Commit-Ready: Scott Collyer <scollyer@chromium.org>
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
2017-06-12 12:30:35 -07:00
Nicolas Boichat
32d883ff53 poppy: Add 4th board id strap, with ternary encoding
The first 3 board id straps stay binary, and the 4th is a tristate,
set as Z on all existing boards, so we translate Z=>0, 0=>1, 1=>2.

A few examples:
Z000 => rev0  (Z=>0 * 8 + 0b000 = 0)
Z010 => rev2  (Z=>0 * 8 + 0b010 = 2)
Z111 => rev7  (Z=>0 * 8 + 0b111 = 7)
0000 => rev8  (0=>1 * 8 + 0b000 = 8)
1001 => rev17 (1=>2 * 8 + 0b001 = 17)

BRANCH=none
BUG=b:62242438
TEST=make BOARD=poppy -j, flash, rev0/1/2 shows "Board ID" correctly.

Change-Id: Ifde5e1200b19a17a677875b0464775bd1cd8af1f
Reviewed-on: https://chromium-review.googlesource.com/522083
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2017-06-11 23:17:19 -07:00
Nicolas Boichat
3a8bba3bc3 gpio: Move gpio_get_ternary to common gpio functions
Also, convert from usleep to udelay, as the calling site may not
necessarily be in task context.

BRANCH=none
BUG=b:62242438
TEST=make buildall -j

Change-Id: I9f36f0de4259716a92183b28324c90d974a96239
Reviewed-on: https://chromium-review.googlesource.com/530884
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2017-06-11 23:17:19 -07:00
Furquan Shaikh
cabd486cb2 poppy: Implement workaround for broken reset flags
Boards Rev1 and Rev2 will lose VBAT on power cycle and therefore
cannot successfully save the reset flag state.

Implement workaround that will allow these boards to continue to
work for FAFT testing by indicating to the skylake chipset power code
that it should skip the PMIC reset when doing 'reboot ap-off'.

BUG=b:62504451
BRANCH=None
TEST=Verified that "reboot ap-off" works fine on Rev1.

Change-Id: I97ee346c0e8796375dc295cfa7a86cd0d57d4e4f
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/530515
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
2017-06-11 08:30:17 -07:00
Dino Li
52c5b31c22 reef_it8320: make modifications to GPIO list
This patch makes a few changes to gpio.inc.

- When pre-initialize GPIOs, set default level to low:
  ENTERING_RW and USB2_OTG_VBUSSENSE.

- Disable internal pull-up (not necessary if
  output type is push-pull):
  USB_Cx_5V_EN.

- Set output type to open-drain:
  EN_USB_Cx_3A and USB_C0_CCx_VCONN_EN.
  The USB_C0_CCx_VCONN_EN is externally pulled up to PP3300_PD_A.
  The EN_USB_Cx_3A is pulled to EN_USB_Cx_5V_OUT and connected
  to base of BJT directly. The output current will be huge
  if it is set as push-pull.

BRANCH=none
BUG=none
TEST=1. built and booted on reef_it8320.
     2. plug-in a device on one port and add load current
        on vbus to check if current limit sit at 3A.

Change-Id: I71fec59cd1696fff417d9cddc287e993988aea33
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
Reviewed-on: https://chromium-review.googlesource.com/528034
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-06-10 19:41:37 -07:00
Mulin Chao
206f1dd93b npcx: gpio: Lock VCC_RST# alternative bit of DEVALTA.
This CL locks VCC_RST# alternative bit, NO_VCC1_RST, of DEVALTA
in case the developers switch it to GPO77 unexpectedly by setting
VCC1_RST_LK bit in DEV_CTL4.

BRANCH=none
BUG=none
TEST=Use rw console command to make sure NO_VCC1_RST bit is
locked on npcx7_evb.

Change-Id: Ic7882ef1c8050c3daca85bd241d5368f009e4e2e
Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
Reviewed-on: https://chromium-review.googlesource.com/522206
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-06-10 01:30:23 -07:00
Mulin Chao
a08d004e97 npcx: clock: Add support for external 32kHz crystal osc.
In this CL, we add selecting LFCLK sources functionality for npcx7 ec
series. (Please notice not all of npcx7 ec series support this feature.)
Beside internal LFCLK source, ec also can choose the external 32kHz
crystal oscillator as LFCLK source for the specific application. We also
introduce a new definition, CONFIG_CLOCK_SRC_EXTERNAL, to switch this
feature in the board level driver.

This CL also adds:
1. LFCG register definitions in registers.h.
2. Change the order of each npcx modules by memory address.

BRANCH=none
BUG=none
TEST=Output LFCLK source through GPIO75. Compare with external 32kHz
crystal osc. on npcx7_evb and make sure the sources are the same.

Change-Id: I137146bf51ccb51266b9aac1e2e28bcea87dc4f5
Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
Reviewed-on: https://chromium-review.googlesource.com/520745
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-06-09 21:44:06 -07:00
Nick Vaccaro
e9215ba711 common: allow report disabling of host events
Adds a mechanism that allows a board to disable interrupting the AP /
kernel when the status of any one of the EC_HOST_EVENTS included in
CONFIG_HOST_EVENT_REPORT_MASK changes state.  Default state enables
reporting of all events; a board can override this by defining
CONFIG_HOST_EVENT_REPORT_MASK in its board.h file.

NOTE: The host_set_events() and host_clear_events() routines no longer
interrupt the AP if none of the host events the AP is interested in
changed state.

BRANCH=none
BUG=chromium:637061
TEST=make buildall passes

Signed-off-by: Nick Vaccaro <nvaccaro@chromium.org>
Change-Id: I678fb9d9dab6890848b94b314efd711842b1fd48
Reviewed-on: https://chromium-review.googlesource.com/502078
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2017-06-09 21:44:03 -07:00
Nicolas Boichat
14a3a3ac23 poppy: Adjust lid reference matrix
BRANCH=none
BUG=b:62396794
TEST=With this change, display rotates correctly when screen is rotated.

Change-Id: I0dc2cd88ed36deef73c7e6d4d458e546fa0b254d
Reviewed-on: https://chromium-review.googlesource.com/526754
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2017-06-09 15:33:41 -07:00
Vadim Bendebury
bdbb45b14a usb_updater: allow symbolic Board IDs
When specifying board ID to program, it is convenient to be able to
specify the ID as a string, as reported by the RLZ stored in the VPD.

With this patch the first component of the board_id command line
option is considered a string if it is no longer than 4 bytes.

BRANCH=cr50
BUG=b:35587387,b:35587053

TEST=ran the following commands (interleaved with erasing INFO1 on the
     target):

  localhost ~ # usb_updater -s -i
  Board ID space: ffffffff:ffffffff:ffffffff
  localhost ~ # usb_updater -s -i ABCD
  localhost ~ # usb_updater -s -i
  Board ID space: 41424344:bebdbcbb:0000ff00
  localhost ~ # usb_updater -s -i
  Board ID space: ffffffff:ffffffff:ffffffff
  localhost ~ # usb_updater -s -i 0x41424344:0x1234
  localhost ~ # usb_updater -s -i
  Board ID space: 41424344:bebdbcbb:00001234
  localhost ~ # usb_updater -s -i
  Board ID space: ffffffff:ffffffff:ffffffff
  localhost ~ # usb_updater -s -i ABCD:0x1234
  localhost ~ # usb_updater -s -i
  Board ID space: 41424344:bebdbcbb:00001234

Change-Id: Ied8b240d60ea50f6fc8633f919ce4bc81ac17727
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/528440
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-06-09 13:27:52 -07:00
Nicolas Boichat
2a783457a9 poppy: Enable vbus discharge using PD discharge registers
poppy uses an ISL charger, which, unlike bd9995* charger based
systems, cannot provide an interrupt when VBUS falls below/rises
above a certain threshold.

On poppy rev2 onwards, we have a precise VBUS detection pin coming
from BC1.2 detection chip (PI3USB9281C), we a threshold between
3.1-3.7 V (3.5V typical) so we can use that to
enable discharge, according to this logic:
- When VBUS voltage falls below ~3.5V, and we're not sourcing 5V
  to the port, enable discharge.
- When VBUS voltage rises above ~3.5V, disable discharge.
- When we source 5V to the port, disable discharge.

BRANCH=none
BUG=b:37525769
TEST=Charge out to device (Galaxy S8), and verify that VBUS
     drops to 0.8V much faster than without this patch.
TEST=pd 0 swap power: 28ms (vs 496ms)
TEST=pd 1 swap power: 24ms to 0.875v, 202ms to 0.8v (vs 410ms)
TEST=Disconnect cable (port 0): 65ms (vs 721ms)
TEST=Disconnect cable (port 1): 13ms (vs 515ms)

Change-Id: Ibf2dcf5de31514fa0ce0ebd0c6db53d421a586fe
Reviewed-on: https://chromium-review.googlesource.com/481562
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-06-09 09:16:29 -07:00
Wei-Ning Huang
e237092ee9 ectool: fix command tpframeget return value
ec_command returns the length of response if there is no error. Fix the
return value so tpframeget sub command returns 0 on success.

BRANCH=none
BUG=b:62077098
TEST=`make BOARD=rose -j`

Change-Id: I87288a3efcca75dacebae784e731e314e97017ad
Signed-off-by: Wei-Ning Huang <wnhuang@google.com>
Reviewed-on: https://chromium-review.googlesource.com/527766
Commit-Ready: Wei-Ning Huang <wnhuang@chromium.org>
Tested-by: Wei-Ning Huang <wnhuang@chromium.org>
Reviewed-by: Rong Chang <rongchang@chromium.org>
2017-06-09 09:16:27 -07:00
Chun-Ta Lin
0b5e3aa642 hammer: initial commit for trackpad firmware updater
Tool to update the trackpad firmware over USB. Primarily borrowed from
extra/usb_console/usb_console.c

BRANCH=none
BUG=b:35587174
TEST=Manually executed with hammer

Change-Id: Icad951d2478a3e231f293e11fb461eaae20e5042
Reviewed-on: https://chromium-review.googlesource.com/525192
Commit-Ready: Chun-ta Lin <itspeter@chromium.org>
Tested-by: Chun-ta Lin <itspeter@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
2017-06-09 07:10:41 -07:00
Nick Sanders
f40e79b3f1 servo_v4: enable usb port by default
Set the USB mux and power enable to default to route
the USB3 port to the DUT and enable VBUS.

BUG=b:38391443
BRANCH=None
TEST=ensure that blue port works on power on.

Change-Id: Ie46e422bc083e435379470132159df32f6d644d3
Reviewed-on: https://chromium-review.googlesource.com/527992
Commit-Ready: Nick Sanders <nsanders@chromium.org>
Tested-by: Nick Sanders <nsanders@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2017-06-08 23:20:01 -07:00
Vadim Bendebury
61b87c56b6 g: do not invoke signer with sudo unless it is necessary
Invoking signer with sudo is required only when signing requires a USB
fob. Let's not use it in unless necessary.

BRANCH=cr50
BUG=chromium:728751
TEST=verified that Cr50 build succeeds when both using and not using
     the signing fob.

Change-Id: I8f40bd52f1752bfd88ec002f298b991faf7a2512
Reviewed-on: https://chromium-review.googlesource.com/528373
Commit-Ready: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2017-06-08 18:52:40 -07:00
philipchen
9f48b9aa0c scarlet: support button triggered recovery mode
BUG=b:36902005, b:62307687
BRANCH=gru
TEST=press POWER+VOL-UP+VOL-DN,
and confirm Scarlet enters recovery mode

Change-Id: I32c352e9526746ea3ad6a8dd762d9f2525d21271
Reviewed-on: https://chromium-review.googlesource.com/468052
Commit-Queue: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/524985
Commit-Ready: Philip Chen <philipchen@chromium.org>
Reviewed-by: Philip Chen <philipchen@chromium.org>
2017-06-08 16:39:38 -07:00
Brian Norris
8bd5696180 flash_ec: add scarlet support
BUG=b:62307687
BRANCH=gru
TEST=`flash_ec --board=scarlet`

Change-Id: Iaee413a3710921c37763ddf620eba558da6e569f
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/448760
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/528060
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Philip Chen <philipchen@chromium.org>
2017-06-08 16:39:38 -07:00
philipchen
07c4c09b0b scarlet: modify power-on sequence
Merge PP900_USB_EN, PP900_PLL_EN, and PP900_PMU_EN.
Add a new config flag to enable different power-on sequences
on one SOC.

BUG=chrome-os-partner:62207, b:62307687
BRANCH=gru
TEST=build kevin/gru/scarlet

Change-Id: Iec3082384aa321636c59169b2bc55f773463f3d0
Reviewed-on: https://chromium-review.googlesource.com/434158
Reviewed-by: Shawn N <shawnn@chromium.org>
Commit-Queue: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/524979
Commit-Ready: Philip Chen <philipchen@chromium.org>
Reviewed-by: Philip Chen <philipchen@chromium.org>
2017-06-08 16:39:37 -07:00
philipchen
62df2b1b8a scarlet: change sensor parameters
Follow-up change for CL:431878

BUG=chrome-os-partner:62207, b:62307687
BRANCH=gru
TEST=make BOARD=scarlet

Change-Id: If5d9c4416f01a0428a7a08dc556dc37f1051b417
Reviewed-on: https://chromium-review.googlesource.com/433222
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Commit-Queue: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/524978
Commit-Ready: Philip Chen <philipchen@chromium.org>
Reviewed-by: Philip Chen <philipchen@chromium.org>
2017-06-08 16:39:37 -07:00
Alexandru M Stan
ac56c1a03d scarlet: fix power button when in S5
Enable CONFIG_POWER_BUTTON_IGNORE_LID to make the "if (!lid_is_open())
return 0" section in raw_power_button_pressed() happy.

BUG=b:35917607, b:62307687
TEST=On scarlet, "apshutdown", confirm it's off ("powerinfo" says G3)
Press the power button, note it turning on (ec console should have
lots of spew)
BRANCH=gru

Change-Id: Idf334776c611517531fdd5351f2efba0b472af86
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/449960
Reviewed-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/524983
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
2017-06-08 06:39:44 -07:00
Alexandru M Stan
395cecc8e1 scarlet: Fix Z axis for accelerometer
The Z axis is a little trickier, it's not always obvious that it's backwards.
"ectool motionsense" should show +1g on Z when display is pointing up.

BRANCH=gru
BUG=b:62307687
CQ-DEPEND=CL:524982
TEST=Put display up, "ectool motionsense" shows a largeish
positive value on Z for sensor 0:
localhost ~ # ectool motionsense
Sensor 0: 428   504     17069

Change-Id: I39ee6d524ba907570c85bf9e2fe248e029561999
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/451692
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Philip Chen <philipchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/524984
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Philip Chen <philipchen@chromium.org>
2017-06-08 06:39:44 -07:00
philipchen
46c2dbdffc scarlet: Bump hostcmd task stack size
My Scarlet crashed twice when I went to 'chrome://system'.
Meanwhile I saw this message on the ec console:
'Stack overflow in HOSTCMD task!'

Apparently we need something like this:
https://chromium-review.googlesource.com/#/c/446116/

BUG=b:62307687
BRANCH=gru
TEST=build and flash a Scarlet,
the device stay alive when going to 'chrome://system'

Change-Id: I9f16a2cf531abe6293f3fcdd9704d770c170cf16
Reviewed-on: https://chromium-review.googlesource.com/482571
Commit-Queue: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/524986
Commit-Ready: Philip Chen <philipchen@chromium.org>
Reviewed-by: Philip Chen <philipchen@chromium.org>
2017-06-08 06:39:43 -07:00
Shunqian Zheng
9c7b72b311 scarlet: update the base matrix of accelerometer
This fixs the scarlet display reversion when turning forward or
backward.

BRANCH=gru
BUG=b:62307687
TEST=check display orientation when turn forward/backward, left/right

Change-Id: I28f8eff6e3fb06a705ccb75c86d981f262546a1c
Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/451166
Reviewed-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/524982
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Philip Chen <philipchen@chromium.org>
2017-06-08 04:48:28 -07:00
Jenny TC
30acb338db poppy: add detachbase and attachbase uart console commands
This patch adds two commands to simulate detachbase and
attachbase uart console commands to test & debug automation.

BRANCH=none
BUG=b:37223093
TEST=attach or detach base and check if event is generated

Change-Id: Ie4a487ebd8929f0584da0b59c094f9d9aff13fb7
Signed-off-by: Subramony Sesha <subramony.sesha@intel.com>
Signed-off-by: Archana Patni <archana.patni@intel.com>
Signed-off-by: Jenny TC <jenny.tc@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/486521
Commit-Ready: Jenny Tc <jenny.tc@intel.corp-partner.google.com>
Tested-by: Jenny Tc <jenny.tc@intel.corp-partner.google.com>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
2017-06-08 02:35:39 -07:00
CHLin
e806e20c03 npcx: system: fix the incorrect checking of invalid BBRAM(IBBR) bit.
This CL adds:
1. Fixed the incorrect address of BKUP_STS register.
2. Cleared the IBBR bit of BKUP_STS register at initial because
its default value is 1(means the content of BBRAM is invalid) whenever
VBAT is powered up.
3. Add debug msg when IBBR bit is set to indicate the BBRAM's
corruption.
4. Modified the valid BBRAM offset from 1 to 0 and size from 63 to 64.

BRANCH=none
BUG=b:38187362
TEST=No build error for make buildall; Check IBBR is cleared at initial.
Check IBBR is set by changing the VBAT voltage below VBAT MIN.
Test console command "reboot ap-off" on poppy.

Change-Id: I69d98b50d4e0aec17b55a4a9b5e8f1a412a3fe45
Signed-off-by: CHLin <CHLIN56@nuvoton.com>
Reviewed-on: https://chromium-review.googlesource.com/505861
Commit-Ready: CH Lin <chlin56@nuvoton.com>
Tested-by: CH Lin <chlin56@nuvoton.com>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2017-06-08 02:35:38 -07:00
Vadim Bendebury
3639527eb4 bs: add missing codesigner command line argument
The recent change of the code signer is not backwards compatible, a
new command line parameter must be added.

BRANCH=cr50
BUG=none
TEST=verified that

    H1_DEVIDS='xxxx yyyyy' ./util/signer/bs

  succeeds again.

Change-Id: I9a8e03c20aa4b7b689b1f5e4a1f786cf5857483f
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/527317
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2017-06-07 23:45:41 -07:00
Aseda Aboagye
cfcbe9da95 cr50: Enable EC UART bit banging.
Cr50 needs to be able to bit bang the EC UART in order to flash certain
ECs such as the STM32 family.  This is because the UART block on the
chip has no provision to change the parity which is necessary for the
STM32 bootloader protocol.

This commit adds a configuration to bit bang the EC UART. It's been
tested at 9600 baud.

BUG=b:35648297
BRANCH=cr50
TEST=With a logic analyzer, verify that TX to the EC can be bit banged
with no issues at 9600.
TEST=With some other changes, verify that cr50 is able to flash an EC
image to an STM32 EC.

Change-Id: Ice72aff133f268b5b7f0868aeec590a21404d1af
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/503474
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2017-06-07 23:45:31 -07:00
Aseda Aboagye
27a39b44d1 g: uart_bitbang: Keep debug stuff off by default.
There are some useful UART bitbang commands, statistics, and logs and
such.  These shouldn't be enabled by default, and this commit makes it
so.

BUG=b:35648297
BRANCH=cr50
TEST=Build an image that enables UART bit banging with BITBANG_DEBUG set
to 0.  Verify that the associated debug commands and statistics are not
present.

Change-Id: Ic0348a6fb1620229e2ed601e0ff549596d814e1e
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/527605
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2017-06-07 23:45:30 -07:00
Philip Chen
cb31793924 scarlet: add LED behavior
Amber: charging
Green: fully charged
Red: battery error
Off: no power adapter connected

BUG=chrome-os-partner:62207, b:62307687
CQ-DEPEND=CL:524977
BRANCH=gru
TEST=manually on rev0 board

Change-Id: I4b1ee85ae65b221f7199bf6cc245668de23546a9
Reviewed-on: https://chromium-review.googlesource.com/442365
Reviewed-by: Shawn N <shawnn@chromium.org>
Commit-Queue: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/524980
Commit-Ready: Philip Chen <philipchen@chromium.org>
Reviewed-by: Philip Chen <philipchen@chromium.org>
2017-06-07 23:45:28 -07:00
philipchen
38288aee73 scarlet: remove USB-A control pins
No USB-A ports on Scarlet.

BUG=chrome-os-partner:62207, b:62307687
CQ-DEPEND=CL:524980
BRANCH=gru
TEST=make BOARD=scarlet
TEST=manually test on gru, USB-A ports don't work anymore.

Change-Id: If8a802067e942e8b73ee7f10285d0752b263727f
Reviewed-on: https://chromium-review.googlesource.com/434502
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/524977
Commit-Ready: Philip Chen <philipchen@chromium.org>
Reviewed-by: Philip Chen <philipchen@chromium.org>
2017-06-07 23:45:28 -07:00
philipchen
10c39db1e2 scarlet: add temperature sensor (tmp432)
BUG=chrome-os-partner:62207
BRANCH=gru
TEST=make BOARD=scarlet

Change-Id: I9e0d566b1994914325392d0f2fe6e141fa426a3c
Reviewed-on: https://chromium-review.googlesource.com/433841
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/524976
Commit-Ready: Philip Chen <philipchen@chromium.org>
Reviewed-by: Philip Chen <philipchen@chromium.org>
2017-06-07 19:01:03 -07:00
Duncan Laurie
e0b4a3d205 Revert "eve: Set VCCIO rail to 0.85 and disable low power"
This reverts commit 9565b8ba06.

Reason for revert: This is causing memory test failure under specific
reset conditions that is triggered by a specific FAFT test.

BUG=b:35581264
BRANCH=eve
TEST=pass FAFT test firmware_FwScreenPressPower

Original change's description:
> eve: Set VCCIO rail to 0.85 and disable low power
>
> Set the VCCIO rail to 0.85V where it should be for Y-series parts
> instead of forcing it to 1.0V.  The EDS is pretty clear that pushing
> this voltage higher on Y-series parts will have significant power penalty.
> (up to 250mW at 0.95V)
>
> We also don't want this rail dropping in low power mode, which shoudln't
> be happening as S0ix is disabled so SLP_S0 shouldn't assert, but just in
> case disable this as well.
>
> BUG=b:35587084
> BRANCH=eve
> TEST=stress testing on Eve EVT units
>
> Change-Id: I5535fe0d894f283a8d453d61101dfeb6b9287b7c
> Signed-off-by: Duncan Laurie <dlaurie@google.com>
> Reviewed-on: https://chromium-review.googlesource.com/525836
> Reviewed-by: Todd Broch <tbroch@chromium.org>

Change-Id: Ie60ad319421c00df5bf41b9eca03047a37defb88
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: https://chromium-review.googlesource.com/527513
Reviewed-by: Scott Collyer <scollyer@chromium.org>
2017-06-07 16:59:03 -07:00
philipchen
f490cb8bac scarlet: remove keyboard task/code
BUG=chrome-os-partner:62207
BRANCH=gru
TEST=make BOARD=scarlet

Change-Id: I5f89fd526e96d55ed3902af169de5fd14cb8c0c2
Reviewed-on: https://chromium-review.googlesource.com/433085
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
Commit-Queue: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/524975
Commit-Ready: Philip Chen <philipchen@chromium.org>
Reviewed-by: Philip Chen <philipchen@chromium.org>
2017-06-07 05:22:57 -07:00
Wei-Ning Huang
5b1d2b878d rose: add touchpad related host commands
Add touchpad related host commands:
1) EC_CMD_TP_SELF_TEST: run open short test.
2) EC_CMD_TP_FRAME_INFO: get number of frame and frame size.
3) EC_CMD_TP_FRAME_SNAPSHOT: make a snapshot of the frame.
4) EC_CMD_TP_FRAME_GET: get frame data.

BRANCH=none
BUG=b:62077098
TEST=`make BOARD=rose -j`
     `ectool --name=cros_tp tpselftest` and
     `ectool --name=cros_tp tpframeget` works

Change-Id: I43db82278e556b1e6f6301fe88233fe7c4a18a14
Signed-off-by: Wei-Ning Huang <wnhuang@google.com>
Reviewed-on: https://chromium-review.googlesource.com/515282
Commit-Ready: Wei-Ning Huang <wnhuang@chromium.org>
Tested-by: Wei-Ning Huang <wnhuang@chromium.org>
Reviewed-by: Rong Chang <rongchang@chromium.org>
2017-06-07 05:22:56 -07:00
philipchen
859a33ff46 scarlet: remove lid accel and add barometer
Remove lid accelerometer (kx022) driver and dependent code.
Add barometer (bmp280) driver.

BUG=chrome-os-partner:62207
BRANCH=gru
TEST=make BOARD=scarlet
TEST=manually test on gru

Change-Id: I521027b8877b9c45880090b9af736adc339edb2b
Reviewed-on: https://chromium-review.googlesource.com/431878
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
Commit-Queue: Philip Chen <philipchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/524974
Commit-Ready: Philip Chen <philipchen@chromium.org>
Reviewed-by: Philip Chen <philipchen@chromium.org>
2017-06-07 03:02:56 -07:00
Vadim Bendebury
25fb7bb3e5 Cr50: usb_updater: add commands to get/set board id
This patch enhances the Cr50 usb_updater to allow to get and set Board
ID value saved in the Cr50's INFO1 space using the earlier introduced
dedicated vendor commands.

Getting or Setting the board ID does not require establishing a
connection with the Cr50, the new option is --board_id/-i. When
specified without a parameter, the new option will cause the Board ID
to be read. When specified with a parameter, the board ID value will
be set. The parameter includes one or two values in a single string,
the values separated by a colon.

The first value is a 4 byte board ID, and the second value is the
flags field. The default flags field is set to 0xff00.

BRANCH=cr50
BUG=b:35587387,b:35587053
TEST=verified that it is possible to get and set the board ID value
      using usb_updater, both over USB and TPM.

      verified that it is not possible to set a new board ID value is
      the INFO1 space has been already programmed.

      verified that it is not possible to set a board ID value which
      would not allow the currently running image to start (even
      though there is no run time check yet).

Change-Id: Ief175d8b2ef3177db13fa86f831914088d9447b0
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/525096
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2017-06-07 03:02:55 -07:00
Scott Collyer
16da7b4c8c coral: Modify battery_info struct for 3S + 1P style battery
Initial version of battery.c for coral is just a straight copy from
Reef. Updated this file to include the battery being used for the
first HW build. Removed the profile override config for the starting
point as well.

BUG=b:62272260
BRANCH=none
TEST=Run 'make BOARD=coral' and verify it builds. Can't test on actual
HW yet as the boards aren't build yet.

Change-Id: I15fcf438918c03bf1d459f5806dff04c82fe8b46
Signed-off-by: Scott Collyer <scollyer@google.com>
Reviewed-on: https://chromium-review.googlesource.com/521756
Commit-Ready: Scott Collyer <scollyer@chromium.org>
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-06-06 19:32:29 -07:00
Gwendal Grignou
cf5555a9ce stm32mon: Add support for STM32F412
BRANCH=none
BUG=b:38506987
TEST=On eve, where some sectors were locked, was able to unlock them:
- Enter bootloader:
st_flash --board=eve --enter_bootloader=true
- Unlock all pages:
/tmp/stm32mon -a 8 -l 0x8c -u
ChipID 0x441 : STM32F412
Bootloader v1.2, commands : \
00 01 02 11 21 31 44 63 73 82 92 32 45 64 74 83 93 00
Flash write unprotected.

Change-Id: I423e4b7f235ee2c9dddf28f4166fca2a74132733
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/511886
Reviewed-by: Alexandru M Stan <amstan@chromium.org>
2017-06-06 17:09:28 -07:00
Gwendal Grignou
7719869dac board: Add support for nucleo-f411re
Add nucleo-f411re for testing STM32F411.
Fix registers.h to include F411 specific features.

TEST=Check uart,gpio works. Check BMI160 accel/gyro sensor works over
i2c
Install firmware with "make BOARD=nucleo-f411re flash"

BUG=b:38018926
BRANCH=none

Change-Id: I8514d1aa48e06708053e72f8d4be15738eda6cf4
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/249994
Reviewed-by: Alexandru M Stan <amstan@chromium.org>
2017-06-06 17:09:28 -07:00
Vadim Bendebury
885c02a92d cr50: usb_updater: do not send setup request unless necessary
There are only two usb_updater actions which require establishing a
connection with the Cr50: transferring the firmware image during
update and reporting the version of the running image (because the
version is reported when the connection is established).

This patch refactors usb_updater code to establish the connection only
when necessary.

BRANCH=cr50
BUG=b:35587387,b:35587053
TEST=verified that 'usb_updater -c' succeeds both issued over USB and
      TPM

Change-Id: I6a0c82eb440c092263d4802f124f458f148a8ab5
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/525095
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2017-06-06 17:09:28 -07:00
Vadim Bendebury
af92414985 cr50: include more vendor commands into the USB set
The upcoming changes in usb_updater will allow to issue vendor
commands to set and get board ID value. It is also useful to be able
to corrupt the alternative RW header over Suzy-Q when Cr50 is running
a debug image.

BRANCH=cr50
BUG=b:35587387,b:35587053
TEST=not yet.

Change-Id: I54ac6eb4cebd85f97407211c5212b868d61e560f
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/524894
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2017-06-06 17:09:27 -07:00
Vadim Bendebury
b06942187e cr50: usb_updater: add proper vendor command processing
So far vendor command processing has been a second class citizen in
the Cr50 usb_updater: return codes were mostly ignored even when using
TPM, when using USB there was no way to communicate return codes at
all.

This patch refactors the source code to use a single function to
process vendor commands over both USB and TPM, adding proper passing
of the result codes back to the caller in both cases, retrieving the
return code from the response header when using TPM and from the first
byte of the response payload when using USB.

BRANCH=cr50
BUG=b:35587387,b:35587053
TEST=verified that it is possible to update rw13, rw18 and rw20 both
     over TPM and USB, which indicates that vendor commands are
     properly handled.

Change-Id: I837e17b29d3b025fbca5b1ef49463cfb1729fe6c
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/525094
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2017-06-06 17:09:27 -07:00
Philip Chen
aafff584ae scarlet: Adapt to the master branch
To port Scarlet from firmware-gru-8785.B to master, we need
some change in naming/definition of variables/functions.

BUG=b:62307687
CQ-DEPEND=CL:524034, CL:524973, CL:524981
BRANCH=gru
TEST=build image and boot Scarlet

Change-Id: I20c1a4f311c9250a3bf1a2a5b0c70dd0f7c7e45b
Reviewed-on: https://chromium-review.googlesource.com/524987
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2017-06-06 17:09:27 -07:00
Philip Chen
d8036441ca scarlet: enable mkbp
BUG=chrome-os-partner:62987, b:62307687
CQ-DEPEND=CL:524987, CL:524034, CL:524973
BRANCH=scarlet
TEST=manually push VolUp/VolDown on scarlet

Change-Id: I593bdce6c69856c4099c8c17059f5fd1eb8aae33
Reviewed-on: https://chromium-review.googlesource.com/443746
Reviewed-by: Shawn N <shawnn@chromium.org>
Commit-Queue: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/524981
Commit-Ready: Philip Chen <philipchen@chromium.org>
Reviewed-by: Philip Chen <philipchen@chromium.org>
2017-06-06 17:09:27 -07:00
philipchen
f7930038a1 scarlet: Remove one usb type-c port
BUG=chrome-os-partner:62207, b:62307687
CQ-DEPEND=CL:524981, CL:524987, CL:524034
BRANCH=gru
TEST=make BOARD=scarlet
TEST=manually test on gru - only one type-c port works.

Change-Id: I0b1735d3da11ee9432ce97467036e2a6cf2b8dbe
Reviewed-on: https://chromium-review.googlesource.com/431000
Reviewed-by: Shawn N <shawnn@chromium.org>
Commit-Queue: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/524973
Commit-Ready: Philip Chen <philipchen@chromium.org>
Reviewed-by: Philip Chen <philipchen@chromium.org>
2017-06-06 17:09:27 -07:00