Commit Graph

631 Commits

Author SHA1 Message Date
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
Gwendal Grignou
e40fb3ef58 util: Fix fifo_info when lost vectors are present
Due to an error in ms_command_sizes, fifo_info command
would fail when lost vectors are present:
packet too long (16 bytes, expected 10)
Reorder ms_command_sizes commands properly.
Get the number of sensors present before printing the number of lost
vectors per sensor.

BUG=none
BRANCH=none
TEST=On cave (with broken MKBP support), check fifo_info
is returning the lost vectors count.

Change-Id: Ic745eb762563705372d8a670ce34eab15e188bf9
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/391887
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2016-10-05 04:03:19 -07:00
Vadim Bendebury
e3a34da55b cr50: bump up minor RW version field
In preparation to the new CR50 image release bump up the minor version
number to trigger autoupdate on the devices in the field.

BRANCH=none
BUG=none
TEST=none

Change-Id: I7744b8cb8436d9134ee5900b352487a1cdddcd28
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/392447
2016-10-04 00:34:40 -07:00
Martin Roth
a5f66d9658 util/signer/gnubby.c: set home dir correctly
If HOME is not set in the environment, the variable 'home' was getting
looked up, but not set.  This sets the variable.

From https://scan.coverity.com/projects/chromium-ec :
    CID61407: Dereference after null check

BUG=chromium:632768
TEST=Built all boards
BRANCH=None

Previously fixed in commit 4f6f505900

Change-Id: I77614ed96b5247fc7c6b08d810ea87150ff3adfd
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/390411
Commit-Ready: Marius Schilder <mschilder@chromium.org>
Tested-by: Marius Schilder <mschilder@chromium.org>
Reviewed-by: Marius Schilder <mschilder@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-09-28 22:09:23 -07:00
Randall Spangler
818dea4a07 flash: Add command to get SPI flash chip info
Previously, there was no way to identify which flash chip was used by
the EC, for ECs using an external SPI flash.  Now, 'ectool flashinfo'
will print more information about the SPI flash chip in these cases.

BUG=chrome-os-partner:56765
BRANCH=any EC with MEC1322 or NPCX still going through factory
TEST=define CONFIG_HOSTCMD_FLASH_SPI_INFO, then
     'ectool flashspiinfo' on samus indicates no SPI flash info,
     and prints additional info on chell and kevin.  Without
     the config defined, all platforms report no spi flash info.
CQ-DEPEND=CL:386368

Change-Id: I3c162f7ad12ed4b30ab951c03f24476683382114
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/385702
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-09-23 12:21:51 -07:00
Bill Richardson
c5d03154ee Cr50: Remove private-cr51 from version string
We no longer depend on this directory, so there's no need to
include its sha1sum in the version string.

BUG=chrome-os-partner:54101
BRANCH=none
TEST=make buildall; try on Cr50 hardware

Before

> version
Chip:    g cr50 B2
Board:   0
RO_A:  * 0.0.9/0088a3eb
RO_B:    0.0.3/8fe06b9e
RW_A:  * 0.0.6/DEV/cr50_v1.1.5333-cca986c
RW_B:    0.0.6/DEV/cr50_v1.1.5334-115b338
Build:   0.0.6/DEV/cr50_v1.1.5333-cca986c
         private-cr51:v0.0.87-24457f2
         tpm2:v0.0.264-5e5aaa3
         cryptoc:v0.0.4-5319e83
         2016-09-16 21:59:31 wfrichar@wintermute.mt
>

After

> version
Chip:    g cr50 B2
Board:   0
RO_A:  * 0.0.9/0088a3eb
RO_B:    0.0.3/8fe06b9e
RW_A:    0.0.6/DEV/cr50_v1.1.5333-cca986c
RW_B:  * 0.0.6/DEV/cr50_v1.1.5334-36b2cee
Build:   0.0.6/DEV/cr50_v1.1.5334-36b2cee
         tpm2:v0.0.264-5e5aaa3
         cryptoc:v0.0.4-5319e83
         2016-09-19 17:48:17 wfrichar@wintermute.mtv.corp.google.com
>

Change-Id: I785dff86e6b970219da87c8674f2a324fa074987
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/387238
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2016-09-21 19:37:13 -07:00
Bill Richardson
30f978d9c1 Cr50: Flag unofficial images in the version string
We often find it handy to build test images that are unlocked or
have special powers. To avoid confusing these with production
images, this adds a "DEV/" to the version string:

"make BOARD=cr50" looks like this:

  > version
  Chip:    g cr50 B2
  Board:   0
  RO_A:  * 0.0.9/0088a3eb
  RO_B:    0.0.8/710d4375
  RW_A:  * 0.0.6/cr50_v1.1.5261-4848d7e
  RW_B:    0.0.6/cr50_v1.1.5261-4848d7e
  [...]

"CR50_DEV=1 make BOARD=cr50" looks like this:

  > version
  Chip:    g cr50 B2
  Board:   0
  RO_A:  * 0.0.9/0088a3eb
  RO_B:    0.0.8/710d4375
  RW_A:    0.0.6/cr50_v1.1.5261-4848d7e
  RW_B:  * 0.0.6/DEV/cr50_v1.1.5261-4848d7e
  [...]

BUG=chrome-os-partner:55557
BRANCH=none
TEST=make buildall; also..

Build both with and without the CR50_DEV=1 environment variable.
Observe that the version string differs even if nothing else
does.

Change-Id: Ifee9fbf922c2bbb40a1a9d0a716d2d11aa0d3ec2
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/382851
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-09-08 11:22:30 -07:00
Vadim Bendebury
834207c485 cr50: provide build mode for signing with fob
We don't really have the ability to build the latest signer yet, but
this should not stop us from being able to build a properly signed
image using the ec makefiles.

As a stopgap measure the suggestion is to keep the latest signer
binary in ~/bin/codesigner in chroot, then with this patch applied
invoking make with CR50_DEV=1 will cause the proper sighner used and
proper signing procedure followed.

The signed targets need to be built in series to avoid concurrent use
of the signer fob, an addition dependency is being added to enforce
that.

BRANCH=none
BUG=chrome-os-partner:55557
TEST=ran make as follows:
   CR50_DEV=1 make BOARD=cr50
   touched the fob when requested, uploaded the generated
   build/cr50/ec.bin on a kevin-tpm2 using usb_updater, and observed
   it boot properly with the new version.

Change-Id: Ia9494bdc60b4bd3b8e5e09cbcbd8b27409c739d2
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/376885
Tested-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-09-07 00:16:56 -07:00
Nicolas Boichat
107cb0df63 util: Add ec_parse_panicinfo tool to parse binary panicinfo
To be able to parse binary panicinfo from feedback reports, we need
a host tool:
 - Move panicinfo generic parsing functions to a separate C file
 - Create a new host utility to parse panicinfo

BRANCH=none
BUG=chromium:643062
TEST=base64 -d | ec_parse_panicinfo

Change-Id: Idd8560a2894f270d0ab3a9f654c333135759e57f
Reviewed-on: https://chromium-review.googlesource.com/379639
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-09-06 22:02:27 -07:00
Vincent Palatin
ebc973ce39 pd: log source current
Record what current limit we set when we act as a source
and when we are changing it.

The change should be backward-compatible as older EC will return 0 in
`current_max` when their role is PD_ROLE_SOURCE while newer firmware
will set the actual limit.

BRANCH=none
BUG=chrome-os-partner:56110
TEST=manual: on Kevin, plug and unplug various devices on the 2
ports, and dump the values with 'ectool usbpdpower'.

Change-Id: I8e78663f3196b1b81c2235ed8642da0638bed649
Reviewed-on: https://chromium-review.googlesource.com/375918
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-09-02 04:23:49 -07:00
Vijay Hiremath
ade0de9881 Revert "ectool: Add ectool command to do AP force shutdown"
There are no actual use cases of this command hence reverting it.
This reverts commit 2324ed47aa.

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

Change-Id: Ibfa6c99d591e7601299236d8ad56451ef5ab20f2
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/377852
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-09-01 05:02:38 -07:00
Vijay Hiremath
2324ed47aa ectool: Add ectool command to do AP force shutdown
Added support to do force AP shutdown from kernel console using
the ectools.

BUG=chrome-os-partner:56681
BRANCH=none
TEST=make buildall -j; Manually tested on reef.
     "ectool reboot_ec apshutdown" puts system in G3.

Change-Id: I509678a67a6a54da67de99efb00e1f08a1ed1fea
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/376863
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-08-30 02:50:32 -07:00
Kevin Cheng
0f5f4862e2 flash_ec: Add check for servo_has_cold_reset.
When flashing a servo v4, the function will try to initiate a cold_reset
but that interface does not exist for a servo v4. Add in a check for
cold_reset before trying an ec_reset to prevent printing the useless
error message 'No control named "cold_reset"'.

BRANCH=None
BUG=None
TEST=flashed and did not see error message anymore.

Change-Id: I6086883f002b4961807ae0663b0ee32aea4c63d8
Reviewed-on: https://chromium-review.googlesource.com/365151
Commit-Ready: Kevin Cheng <kevcheng@chromium.org>
Tested-by: Kevin Cheng <kevcheng@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
2016-08-22 14:52:24 -07:00
Nick Sanders
65ba93af93 sweetberry: add build target for sweetberry
sweetberry is an stm32f446 based power monitoring
board, with 48 channels of INA current sense chips

BUG=chromium:608039
TEST=boots
BRANCH=none

Change-Id: If263bcee3a648ba3605f991999d481b7a0e2a1db
Signed-off-by: Nick Sanders <nsanders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/370718
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
2016-08-19 14:21:19 -07:00
Nick Sanders
6fcd163da5 stm32f446e-eval: add support for stm32f446
This adds basic support for the stm32f446.
This consists of:
* New DMA model for stm32f4
* New clock domain support.
* MCO oscillator gpio export support.
* Flash support for irregular blocks.

BUG=chromium:608039
TEST=boots w/ correct clock, stm32f0 also boots.
BRANCH=None

Change-Id: I1c5cf6ddca09009c9dac60da8a3d0c5ceedfcf4d
Signed-off-by: Nick Sanders <nsanders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/363992
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
2016-08-17 16:19:07 -07:00