Commit Graph

645 Commits

Author SHA1 Message Date
Vincent Palatin
253366b3af ectool: fix fan commands for older EC
When invoking ectool fan commands on older ECs not supporting
EC_CMD_GET_FEATURES, the tool is choking on the lack of the command at
the beginning of get_num_fans() and not going further.
The regression was introduced by
https://chromium-review.googlesource.com/c/359069/, let's go back to the old
behavior for machines without feature bits and skip the
EC_FEATURE_PWM_FAN check.

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

BRANCH=none
BUG=b:35575890
TEST=on Buddy, run 'ectool pwmgetnumfans' and 'ectool pwmgetfanrpm all'
and get results.

Change-Id: Ie9255d4afc9fa95a55807c310e9593a28c2aadc1
Reviewed-on: https://chromium-review.googlesource.com/456598
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-03-18 14:24:51 -07:00
Bruce
80cb93f45d pyro: battery FW update tool modify for learning mode
Let unit can't update battery FW when battery state in learning mode.

BUG=b:36372859
BRANCH=reef
TEST=check unit can't update battery FW in learning mode.

Change-Id: I9d69811d84fc386cda6adb51be51f1cfb4fcdf55
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/454656
Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com>
Tested-by: Keith Tzeng <keith.tzeng@quantatw.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-03-16 22:28:21 -07:00
Vincent Palatin
e86a0dad24 ectool: support FP MCU device node number
Some people love to address the EC device nodes by number with ectool,
add the special offset for the FP MCU (e.g. '--dev=8').
Addressing it by name already works (e.g. '--name=cros_fp').

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

BRANCH=none
BUG=b:35648259
TEST=on Eve, execute 'ectool --dev=8 version'
and see a similar result to 'ectool --name=cros_fp version'
e.g. "RO version:    eve_fp_v1.1.6177-945b19f+ [...]"

Change-Id: Ic08e3b7a3ae31b7e1b73bccc8375badf3284b49c
Reviewed-on: https://chromium-review.googlesource.com/453179
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
2017-03-16 00:11:42 -07:00
Vadim Bendebury
597a3bc943 cr50: prepare to release rw 0.0.18
Erase the first location in the manifest info map to ensure that the
flash info state is updates and then the RO prevents booting earlier
images (where the map is unaltered).

BRANCH=cr50
BUG=none
TEST=verified that once both RW_A and RW_B are programmed with the new
     image and the H1 is restarted, the first info map location is erased.

Change-Id: Id48d8a2009f7cf9842b7a33f036dc98457dbeafc
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/455580
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-by: Marius Schilder <mschilder@chromium.org>
2017-03-15 23:58:39 +00:00
Duncan Laurie
35387474a1 led: Add options for left and right led
Add LED types for left and right so they can be addressed
properly with ectool.

BUG=b:36150361
BRANCH=none
TEST=manual testing of 'ectool led <left|right> <color>' behavior

Change-Id: Iea25cc69db2d35416e787dcb5a324d2e2cf5d3a6
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: https://chromium-review.googlesource.com/453126
Reviewed-by: Scott Collyer <scollyer@chromium.org>
2017-03-13 19:58:51 -07:00
Vadim Bendebury
3d9c605257 cr50: fix prod images timestamp
When sighing prod images it is important to be able to reproduce them
bit for bit. Setting the manifest timestamp filed to a non-zero value
makes sure that this value is used in the header as opposed to the
current time.

Setting the value to 1 guarantees that any dev image with the same
epoch/major/minor field values will be preferred, as it would have a
later timestamp.

BRANCH=none
BUG=none

TEST=verified that two images built with this manifest are exactly the
     same (they used to differ before this change).
     verified that the header timestamp field is indeed set to 1:

  $ od -Ax -t x1 -vd d2/cr50.bin.prod | grep -A1 004350
  $ 004350 ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00
  $ 004360 00 00 00 00 11 00 00 00 01 00 00 00 00 00 00 00

     location 0x435c is the epoch_ field offset, 32 bit
     epoch/major/minor is set to 0/0/17 and 64 bit timestamp is set to
     1.

Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>

Change-Id: I6ea0e664fa3eab7917ca472d715824feec49eb51
Reviewed-on: https://chromium-review.googlesource.com/452956
Commit-Ready: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Marius Schilder <mschilder@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2017-03-10 19:52:33 -08:00
Vadim Bendebury
154868ed90 cr50: prepare to release rw 0.0.17
Update both prod and dev manifests.

BRANCH=none
BUG=none
TEST=none

Change-Id: I07b0c188cdc22539dc368900c0acade7c582a0eb
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/450956
Commit-Ready: Vadim Bendebury <vbendeb@google.com>
Tested-by: Vadim Bendebury <vbendeb@google.com>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2017-03-08 15:22:01 -08:00
Daisuke Nojiri
ad089de4b0 pdcontrol: Suspend port individually
pdcontrol suspend command will be used to prevent tcpm from putting
the chip into sleep while firmware update is taking place. Currently
the command suspends or resumes port 0. This patch makes the command
apply to ports individually.

pd enable console command now takes a port number:
pd <port> enable/disable.

This patch also replaces CONFIG_USB_PD_COMM_ENABLED with _DISABLED.
When it's defined, PD communication is disabled at startup.

Plankton undefines CONFIG_USB_PD_COMM_ENABLED enable, intending to
disable PD communication at startup. Therefore, this patch defines
CONFIG_USB_PD_COMM_DISABLED in its board.h.

BUG=b:35586859
BRANCH=none
TEST=From AP console:
localhost # /tmp/ectool pdcontrol suspend 1
[600.188013 TCPC p1 suspended!]
> pd 1 state
Port C1 CC1, Dis - Role: SNK-UFP State: SUSPENDED, Flags: 0x0020
localhost # /tmp/ectool pdcontrol resume 1
[678.516613 TCPC p1 resumed!]
> pd 1 state
Port C1 CC1, Ena - Role: SNK-UFP State: DRP_AUTO_TOGGLE, Flags: 0x0020
From ec console:
> pd 1 disable
Port C1 disable
> pd 1 state
Port C1 CC1, Dis - Role: SNK-UFP State: DRP_AUTO_TOGGLE, Flags: 0x0020
> pd 1 enable
Port C1 enabled
> pd 1 state
Port C1 CC1, Ena - Role: SNK-UFP State: DRP_AUTO_TOGGLE, Flags: 0x0020

Change-Id: Ia0cc4904ac52adc4b89de20918968c8df78b9c80
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/447968
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-03-07 14:15:56 -08:00
Vadim Bendebury
187d57f292 cr50: change DEV to DBG in debug images version strings
There are two types of signing of CR50 images - prod and dev.
Designating images built with CR50_DEV variable set in the environment
as DEV is confusing, as this has nothing to do with the signing type
(dev vs prod), and is in fact indicating an image with many debug
features enabled.

This patch changes the string to "DBG".

BRANCH=cr50
BUG=none

TEST=verified that the modified image has correct string in the
     version field:
  > vers
  Chip:    g cr50 B2-D
  Board:   0
  RO_A:  * 0.0.10/29d77172
  RO_B:    -1.-1.-1/ffffffff
  RW_A:    0.0.16/DBG/cr50_v1.1.6137-1624610+
  RW_B:  * 0.0.16/cr50_v1.1.6137-1624610+
  Build:   0.0.16/cr50_v1.1.6137-1624610+
           tpm2:v0.0.287-1a68fe6
           cryptoc:v0.0.8-6283eee
           2017-03-06 16:51:15 vbendeb@eskimo.mtv.corp.google.com
   >

Change-Id: I06a97a6aff5418a4d02e71ca23813e6d2005da5c
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/450903
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2017-03-07 04:17:32 -08:00
Vadim Bendebury
ef6f6c5edf g: reformat signing manifests
The json parser used by the signer is perfectly capable of parsing
multiline contents.

Let's reformat signer manifests to make it easier to see the entire
file in one terminal window.

BRANCH=none
BUG=b:35774863
TEST=none

Change-Id: I41d69ad11f07521f68a7a50227dc843872613127
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/447841
Reviewed-by: Marius Schilder <mschilder@chromium.org>
2017-03-01 18:42:20 -08:00
Nick Sanders
a1e96d8c00 ec3po: less chatty debug print
ec3po had very, very chatty debug printing.
Reduce some of this so that -d is a bit easier to read.

BUG=None
BRANCH=None
TEST=sudo servod -b electro -d

Change-Id: I163e1362dd1e90f374ca3c37e1f1e0aa7fd7a1e2
Reviewed-on: https://chromium-review.googlesource.com/441919
Commit-Ready: Nick Sanders <nsanders@chromium.org>
Tested-by: Nick Sanders <nsanders@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2017-03-01 05:04:04 -08:00
Nicolas Boichat
2dcfd2446c flash: Add ROLLBACK flash region, that can be protected separately
ROLLBACK region will be used to store rollback information, and
can be protected independently of RW (it can only be protected when
RO is protected, though).

This is only supported on stm32f0 currently.

BRANCH=none
BUG=chrome-os-partner:61671
TEST=on hammer (stm32f072)
     flashinfo => RO+RW not protected
     flashwp true; reboot => only RO protected
     flashwp all; reboot => RO+RW+RB protected
     flashwp noall; reboot => only RO protected
     flashwp rw; reboot => only RO+RW protected
     flashwp rb; reboot => RO+RW+RB protected
     flashwp norb; reboot => RO+RW protected
     flashwp all; reboot => RO+RW+RB protected
     flashwp norw; reboot => RO+RB protected
TEST=on reef, rb/norb commands not available

Change-Id: I45ffc66d91cf3699ecff025e5114c59a73dc8274
Reviewed-on: https://chromium-review.googlesource.com/430519
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-02-25 08:36:41 -08:00
Sam Hurst
fc75244eb9 ec:Add presubmit hook to enforce host command definitions
Make sure all public and private host commands starting with
EC_CMD_ and EC_PRV_CMD_ are properly formed

BUG=chromium:681240
TEST=manual.
    Added following host commands and verified that they were flagged
    #define EC_CMD_TESTA 1234
    #define EC_CMD_TESTB 0xabcd
    #define EC_CMD_TESTC 0x1ABCD
    #define EC_CMD_TESTD 0xXEF01
    #define EC_PRV_CMD_TESTA 1234
    #define EC_PRV_CMD_TESTB 0xabcd
    #define EC_PRV_CMD_TESTC 0x1ABCD
    #define EC_PRV_CMD_TESTD 0XEF01

    These were also flagged by the script
    include/ec_commands.h:#define EC_CMD_ACPI_READ 0x80
    include/ec_commands.h:#define EC_CMD_ACPI_WRITE 0x81
    include/ec_commands.h:#define EC_CMD_ACPI_BURST_ENABLE 0x82
    include/ec_commands.h:#define EC_CMD_ACPI_BURST_DISABLE 0x83
    include/ec_commands.h:#define EC_CMD_ACPI_QUERY_EVENT 0x84
CQ-DEPEND=CL:445809
BRANCH=none

Change-Id: I4630d6a887ed289a68178e8f1a8f07f5141c80bc
Reviewed-on: https://chromium-review.googlesource.com/445811
Commit-Ready: Sam Hurst <shurst@google.com>
Tested-by: Sam Hurst <shurst@google.com>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-02-25 02:08:37 -08:00
Nicolas Boichat
83cf8d0a7a flash: Add EC_FLASH_PROTECT_RW_[AT_BOOT|NOW] flags
The idea of this flag is to be able to protect/unprotect only the
RW portion of the flash. In the (usual) case where ALL=RO+RW, with
no other region, this makes no difference compared to the existing
EC_FLASH_PROTECT_ALL_* flag, and this flag may not be supported.

This is necessary for futher work, where a ROLLBACK region is added,
so that RW/ROLLBACK can be protected/unprotected individually.

Only support for stm32f0 is added, as this is the target for hammer.

BRANCH=none
BUG=chrome-os-partner:61671
TEST=build and flash hammer (stm32f072)
     flashinfo => RO+RW not protected
     flashwp true; reboot => only RO protected
     flashwp all; reboot => RO+RW protected
     flashwp noall; reboot => only RO protected
     flashwp rw/norw not available
TEST=enable CONFIG_FLASH_PROTECT_RW
     build and flash hammer (stm32f072)
     flashinfo => RO+RW not protected
     flashwp true; reboot => only RO protected
     flashwp all; reboot => RO+RW protected
     flashwp noall; reboot => only RO protected
     flashwp rw; reboot => RO+RW protected
     flashwp norw; reboot => only RO protected
TEST=build and flash reef (npcx)
     flashinfo => RO+RW not protected
     flashwp true => RO protected
     flashwp all; flashinfo => all_now displayed
     reboot => RO protected
     flashwp rw/norw not available

Change-Id: Ica6f499cf2e8a9345b08ef52c915655a983ffe3c
Reviewed-on: https://chromium-review.googlesource.com/442265
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-02-23 19:06:16 -08:00
Vadim Bendebury
3cf2d9047a cr50: preapare to release 0.0.16
BRANCH=none
BUG=none
TEST=none

Change-Id: I69d46d25601ffedb68d3f87e873dc8c502f10810
Reviewed-on: https://chromium-review.googlesource.com/445874
Commit-Queue: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Trybot-Ready: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2017-02-23 17:09:08 +00:00
Vincent Palatin
7a9b35ac70 Add eve_fp board
Eve FP MCU is using the STM32L442 microcontroller.

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

BRANCH=none
BUG=chrome-os-partner:62893
TEST=make BOARD=eve_fp
run it on Nucleo-L432KC (STM32L432KC is mostly the same MCU without AES)

Change-Id: I18dc57e9bf262c36283f8c835a2d4320bc5ee837
Reviewed-on: https://chromium-review.googlesource.com/442467
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
2017-02-17 01:47:29 -08:00
Vincent Palatin
ad40176514 stm32: add support for STM32L442
Should be close to the STM32L476 in the STM32L4 family.
Slightly different flash/RAM.

It's currently running from the internal clock (HSI) at 16Mhz,
we need to upgrade to 80Mhz (or 48Mhz if this is fast enough to save us
the PLL locking time).

The internal flash write/erase/protection is still not implemented for
the whole STM32L4 family.

Upgrade the SPI master support and verify that the TX works.

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

BRANCH=none
BUG=chrome-os-partner:62893
TEST=make BOARD=eve_fp
run it on Nucleo-L432KC (STM32L432KC is mostly the same MCU without AES)

Change-Id: I87be7d4461aedfbd683ff7bb639c3a6005ee171e
Reviewed-on: https://chromium-review.googlesource.com/442466
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
2017-02-17 01:47:29 -08:00
Gwendal Grignou
484ef12119 motion: Add opt3001 as a motion sensor
Use the motion sensor to manage ALS as well.
The current interface (via memmap) is preserved, but
we can also access the sensor via cros ec sensor stack and
send the ALS information to ARC++.

BUG=chrome-os-partner:59423
BRANCH=reef
CQ-DEPEND=CL:424217
TEST=Check the sensor is working via ACPI sensor and
cros ec sensor. Check ARC++ sees the sensors.

Change-Id: Iaf608370454ad582691b72b471ea87b511863a78
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/424323
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2017-02-16 18:03:59 -08:00
Daisuke Nojiri
4d6eb1bc01 pdchipinfo: Add option to force renewal
This change adds an option to pdchipinfo command to force ec to get
the version from the chip instead of the cache (if it's available).

This option will be used after firmware update, which makes the cache
value stale.

BUG=chrome-os-partner:62383
BRANCH=none
TEST=Run ectool as follows:
localhost ~ # /tmp/ectool pdchipinfo 0 on
vendor_id: 0xaaaa
product_id: 0x3429
device_id: 0xad
fw_version: 0x15
localhost ~ # /tmp/ectool pdchipinfo 1 on
EC result 2 (ERROR)

Change-Id: Icefe96d7fc1208b991a4caa13aaf4f04052edba7
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/441271
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-02-14 17:28:16 -08:00
Daisuke Nojiri
c9ea4bddbc pdchipinfo: Increase compatibility of fw_version
The firmware version formats may vary chip to chip. fw_version field is
changed to a union of a 8 byte string and an 64-bit integer.

BUG=chrome-os-partner:62383
BRANCH=none
TEST=ectool pdchipinfo 0/1 on Electro

Change-Id: Id51e66c44338a09ed897ee61f54cd6a394400e63
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/441270
2017-02-14 17:28:15 -08:00
Vadim Bendebury
a526883957 Do not silently ignore invalid attempts to use raiden programmer
When --raiden is passed as a command line parameter, do not proceed
programming as if it were not present, alert the user and refuse to
proceed instead.

Need to jump though a couple of extra hoops to avoid printing the
error message twice.

BRANCH=none
BUG=none
TEST=tried running with boards supporting and not supporting
     programming over CCD.

     $ ./util/flash_ec --board=oak --raiden --image rowan.ec.bin
     INFO: Using ec image : rowan.ec.bin
     ERROR: raiden mode not supported on oak
     $ ./util/flash_ec --board=kevin --raiden --image rowan.ec.bin
     INFO: Using ec image : rowan.ec.bin
     INFO: Flashing chip npcx_spi.
     INFO: Using raiden debug cable.
     ...

Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Change-Id: Ia40f348e6dde57fc2f4c49719bc2a0947036dcc1
Reviewed-on: https://chromium-review.googlesource.com/440051
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-02-11 18:12:15 -08:00
Daisuke Nojiri
4ff544a573 Add host command to get PD chip information
This patch adds a host command to get PD chip info.

For PS8751, tcpci_get_chip_info will fail if the chip is in
low power mode. It can be woken up by reading a random register
first then wait for 10ms.

This code doesn't have the wake-up read to avoid 10ms delay.
Instead, we call this function immediately after the chip is
initialized because it'll gurantee the chip is awake.

Once it's called, the chip info will be stored in cache, which
can be accessed by tcpc_get_chip_info without worrying about
chip states.

localhost ~ # ectool pdchipinfo 0
vendor_id: 0xaaaa
product_id: 0x3429
device_id: 0xad
fw_version: 0x15

localhost ~ # ectool pdchipinfo 1
vendor_id: 0x1da0
product_id: 0x8751
device_id: 0x1
fw_version: 0x37

BUG=chrome-os-partner:62383
BRANCH=none
TEST=ectool pdchipinfo 0/1. make buildall

Change-Id: I3f1667d00ce1826936d90882ada1df6ed6b0ea37
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/433166
2017-02-09 22:50:50 -08:00
Vadim Bendebury
97ef3f6a4f cr50: prepare to release rw 0.0.15
Update both prod and dev manifests.

BRANCH=none
BUG=none
TEST=none

Change-Id: Ie07bb00005461a22e263ee448fac7c77b25060ee
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/438687
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2017-02-07 02:44:57 +00:00
Sam Hurst
ca0d5aba6b ec: delete auron and rambi boards
These boards have been succeeded by newer boards.

BUG=chromium:686106
TEST=make -j buildall
CQ-DEPEND=CL:434909
BRANCH=none

Change-Id: I2c964c1fdd7f8bbc5dab07caa88864847ba4e312
Reviewed-on: https://chromium-review.googlesource.com/434540
Commit-Ready: Sam Hurst <shurst@google.com>
Tested-by: Sam Hurst <shurst@google.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-01-31 21:58:36 -08:00
Simon Glass
b6c1d0d490 Makefile: Suppress 'Not a git repository' errors
We get a lot of these errors when running the EC Makefile from an ebuild.
They are not useful since of course there is no git repo when the source
code is built from a copy. An empty date (as produced in this case) is
presumably good enough.

Suppress these errors by redirecting stderr.

BUG=chromium:680243
BRANCH=none
TEST=V=0 emerge-reef chromeos-ec; See that the git output is gone

Change-Id: Ia3d1e2046c87e0ca88d0c18e432467f9d23b7e9f
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/428156
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-01-14 10:20:02 -08:00
Vadim Bendebury
3d1706f8b4 cr50: prepare for releasing rw version 0.0.14
Which is coming soon.

BRANCH=none
BUG=none
TEST=built a new image, verified that its rw version is 0.0.13

Change-Id: Iddd00f901a74e3b4f6d5796a8092aa39676fc3b3
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/425854
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2017-01-10 21:34:40 -08:00
Aseda Aboagye
b3a9e1b64c motion_sense: Add "spoof" mode
This commit adds a "spoof" mode feature to the motionsense stack.  It
allows the user to arbitrarily set the outputs of the sensor in order to
"spoof" the readings of the sensor.  This can be useful in emulating
tablet mode or device rotations.  A command is available from the EC
console named `accelspoof` and there is a corresponding motionsense
command in ectool called `spoof`.

The usage is as follows:

- EC console
 > accelspoof [id] [on/off] [X Y Z]

- ectool
 # ectool motionsense spoof -- [id] [0/1] [X Y Z]

If on or off(or 0/1) is not specified, the current spoof mode status of
the sensor is returned.  If on is specified, but no components are
provided, the sensor will lock the current values and provide those as
the spoofed values.  If the components are provided, those will be used
as the spoofed values.

BUG=chromium:675263
BRANCH=cyan,glados,gru,oak
TEST=Flash a DUT with accels.  From AP console, run `ectool motionsense
lid_angle` in a loop, use 'accelspoof' EC console command to set spoofed
values.  Verify that the angle is fixed regardless of the actual angle
of the DUT.
TEST=Flash a DUT with accels.  From AP console, use `ectool motionsense
spoof` to spoof values and verify that `ectool motionsense` reflects the
spoofed values.  Test with both provided component values and no
component values.

Change-Id: Ie30688d22f38054e7243b1af493a3092b2cdfb72
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/421280
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
2017-01-07 13:29:52 -08:00
Nicolas Boichat
097008c51a poppy: Add new board
Add support for poppy board with:
    - chip: npcx
    - pmic: bd999992GW
    - charger: isl9238
    - tcpc: 1x anx3429, 1x ps8751
    - bc12: pi3usb9218c

BRANCH=none
BUG=chrome-os-partner:61098
TEST=make BOARD=poppy -j

Change-Id: I3439399b85ba49b4c733536d614118faeeeb0f93
Reviewed-on: https://chromium-review.googlesource.com/422263
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@google.com>
2017-01-05 18:40:00 -08:00
Shawn Nematbakhsh
c6c5a44674 util/ectool: Fix llvm compiler errors
BUG=chromium:668259
BRANCH=None
TEST=Manual on samus (w/ gcc-built ectool).
Verify 'ectool pause_in_s5 [on|off]' followed by 'ectool pause_in_s5'
reflects the new updated state.
Verify 'ectool --name=cros_pd flashpd 0 1 ec.RW.bin' succeeds to flash
valid zinger RW image.
Also verify `emerge-nyan_big ec-utils` succeeds w/ new llvm toolchain.

Change-Id: Ibe83ee0fc0b2e6f535ed822603f438ed62350d29
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/419797
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-12-16 23:47:03 -08:00
Vadim Bendebury
80d5601f39 cr50: prepare for releasing rw version 0.0.13
Which is coming soon.

BRANCH=none
BUG=none
TEST=built a new image, verified that its rw version is 0.0.13

Change-Id: I7a8b2497078f67393df93181d29cfde905d20ba6
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/419182
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2016-12-13 17:51:37 -08:00
Vadim Bendebury
e4250052a7 cr50: update minor versions to 12
In preparation to a new release let's bump up minor versions of both
prod and dev images to 12.

BRANCH=none
BUG=none
TEST=built images and verified version number

Change-Id: I55979374f5e3e21fedde128410c4861e4c2ad9c4
Reviewed-on: https://chromium-review.googlesource.com/417883
Commit-Ready: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Andrey Pronin <apronin@chromium.org>
2016-12-08 12:32:45 -08:00
Vadim Bendebury
26b1d8ae64 cr50: add image signing script
This is a 'semi official' utility script which re-signs previously
generated CR50 RW images.

By default the script uses ec.RW.elf and ec.RW_B.elf in build/cr50/RW
as inputs and util/signer/ec_RW-manifest-dev.json as the manifest, and
places the newly signed images into build/cr50/ec.bin.

The only outside dependency of this script is the signing utility itself,
which is expected to be available as $HOME/bin/codesighner.

The following command line options are accepted:

  b1 - generate signature for the b1 version of the H1 chip
  elves <elf1> <elf2> - sign the supplied elf files instead of the
        default ones. Handy if the builder generated files need to be
        signed
  help - print this message
  hex - generate hex output instead of binary
  prod - sign with prod key (no debug image will be signed)

When invoked with 'hex' as a command line parameter, the script just
re-signs the supplied elf files and places them in 0.signed.hex and
1.signed.hex in the current directory.

This script also allows to sign dev images for running on prod RO. To
do that invoke this script as follows:

  H1_DEVIDS='<dev id0> <dev id1>" ${progname} [other options, if any]

where <dev id0> <dev id1> are values reported by sysinfo command in the
DEV_ID: line when ran on the CR50 for which the image is built.

BRANCH=none
BUG=chrome-os-partner:57956
TEST=manual
  tried signing dev and prod images, including sighing a dev image to
  run on a prod device. All cases succeeded.

Change-Id: I879c4a08503a19a0c440b141aa1fd6b29cc70bf7
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/417221
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-12-08 12:32:28 -08:00
Vadim Bendebury
515249a7d3 cr50: rename dev mode manifest file
The manifest used for signing in dev mode was originally used for
kevin evt 1, but now it is a common dev mode manifest. Rename the fie
appropriately and modify the makefile using it.

BRANCH=none
BUG=chrome-os-partner:57956
TEST=verified that it is still possible to build cr50 with CR50_DEV=1

Change-Id: If744406a83a7045cd34c76c941fdef209bef51ac
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/417220
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-12-06 19:55:19 -08:00
Vadim Bendebury
73860ca8c8 cr50: update both prod and dev minor RW versions to 11
The latest released images are 0.0.11, let's update the manifests such
that images built in dev environment can override released images.

BRANCH=none
BUG=none
TEST=verified that new images are built with RW version 0.0.11

Change-Id: I4db82abd3eb725849b656259f675b32a8314942c
Reviewed-on: https://chromium-review.googlesource.com/415601
Commit-Ready: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-12-02 03:34:59 -08:00
Manoj Gupta
2228b76f74 Fix EC build for latest llvm
llvm bug: https://llvm.org/bugs/show_bug.cgi?id=31050 is now fixed
So remove unnecessary pointer casts.

BRANCH=none
BUG=chromium:665240
TEST=Builds now

Change-Id: I5695a9605b5ab47d11f7e9ecacc52f2ba53385e7
Reviewed-on: https://chromium-review.googlesource.com/412880
Commit-Ready: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Yunlian Jiang <yunlian@chromium.org>
2016-11-20 00:24:27 -08:00
Manoj Gupta
b2bc234197 Fix EC build for latest llvm
BRANCH=none

util/ectool.c:1158 merror: taking address of packed member 'size' of class
or structure 'ec_params_usb_pd_fw_update' may result in an unaligned
pointer value [-Werror,-Waddress-of-packed-member]

For this case, the pointer is always aligned but clang complains.
Workaround using double pointer casts to char and uint.

       uint32_t *data = &(p->size) + 1;

BUG=chromium:665240
TEST=Builds now

Change-Id: Ibccf0f6e409b9724fc9e5acf28dde570e9d341e3
Reviewed-on: https://chromium-review.googlesource.com/411384
Commit-Ready: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Yunlian Jiang <yunlian@chromium.org>
2016-11-16 07:10:41 -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
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
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
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
Marius Schilder
a5dcd95432 Add prod RW manifest and public key.
Change-Id: If008b0dc388fdd81366e52aab8046af83a288e12
Reviewed-on: https://chromium-review.googlesource.com/407050
Commit-Ready: Marius Schilder <mschilder@chromium.org>
Tested-by: Marius Schilder <mschilder@chromium.org>
Reviewed-by: Marius Schilder <mschilder@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-11-03 14:44:24 -07:00
Vadim Bendebury
e4477a7b8c cr50: bump up minor RW version field again
In preparation to a new CR50 image release one more bump up the minor
version number is required.

BRANCH=none
BUG=none
TEST=none

Change-Id: I1ac48eb01cb9d48fb796c79b2676399e7bb57b18
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/403455
Reviewed-by: Marius Schilder <mschilder@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-10-27 19:29:05 -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
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
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
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
Daisuke Nojiri
ce3e350ade getversion: Fix lucid failing because of version strings
make build=lucid fails if there is an uncommitted change in the tree
because '-dirty' is appended to version strings, which causes the image
to exceed the flash size limit.

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

Change-Id: Ie4a7b4c7dc70846108aed953215f79dc30a10fca
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/396617
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-10-14 16:05:47 -07:00
Bruce
a465405302 Pyro: Create initial board
Create initial pyro EC code, by copy from reef

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

Change-Id: Iaae8db11845675421b653d4762d235229bb7c50d
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/393706
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-08 21:25:24 -07:00
Gwendal Grignou
16ab1b69c6 util: ectool: Add names for new sensors.
Match ec_commands.h, adding new type and sensors.

BUG=none
BRANCH=reef
TEST=Check on Reef that barometer sensor info is displayed properly.

Change-Id: I257f5161e5f57be562a2b3a29442b49f47f3fc89
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/394749
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2016-10-08 18:34:43 -07:00
Vadim Bendebury
52260244c6 cr50: bump up minor RW version field
In preparation to the new CR50 image release one more bump up the
minor version number is required.

BRANCH=none
BUG=none
TEST=none

Change-Id: I7d998fc80bd4a45cfc12c003d056a36c93dcc1d3
Reviewed-on: https://chromium-review.googlesource.com/394253
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Queue: Vadim Bendebury <vbendeb@chromium.org>
2016-10-06 19:17:12 +00:00