Commit Graph

762 Commits

Author SHA1 Message Date
Martin Roth
b38792b78b util: Remove duplicate 'const' in export_taskinfo.c
This is causing an error in the latest coreboot toolchain:
util/export_taskinfo.c:33:30: error: duplicate 'const' declaration
specifier [-Werror=duplicate-decl-specifier]

BUG=None
TEST=Build now passes with latest coreboot toolchain and cros
Ztoolchain
BRANCH=None

Change-Id: I069d08128e264310d25a09ada2276f92796294b7
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://chromium-review.googlesource.com/679939
Commit-Ready: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@google.com>
2017-11-20 15:08:44 -08:00
Aseda Aboagye
fc4a6f13b2 flash_ec: Add support for meowth.
BUG=None
BRANCH=None
TEST=None

Change-Id: Ib0c6b029c608ac361ed661249138589c99ea68b6
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/772910
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-11-16 21:07:36 -08:00
Vadim Bendebury
9c090eb0c9 cr50: prepare to release 0.0.26
The new release will include fixes for SPI problems discovered when
debugging Fizz.

BRANCH=cr50
BUG=none
TEST=none

Change-Id: I4ac2ab762ec86957a7555b0aaa41235f44a54d47
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/772738
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2017-11-15 16:07:33 -08:00
Edward Hill
6d4674fd05 grunt: Initial GPIO setup for grunt
Configure GPIOs to match grunt proto v1.1 schematic.
Change EC chip to npcx7m6f.
Minimal board.c/h, just enough to build.

BUG=b:64935726
BRANCH=none
TEST=make BOARD=grunt

Change-Id: I1a1f581c7ee7b80808c0dde179bc3ee0d69f960e
Signed-off-by: Edward Hill <ecgh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/754302
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-11-14 13:31:48 -08:00
Ege Mihmanli
b3c9986802 rainier: add rainier support for flash_ec
BUG=chromium:776441
BRANCH=none
TEST=Run "./flash_ec --board=rainier" from ec/util directory and
make sure there is no error "board rainier not supported" on stderr.
Signed-off-by: egemih@chromium.org
Change-Id: I4b4b714962685d0b33d3b9aa4c96b5a89eb566c5
Reviewed-on: https://chromium-review.googlesource.com/767589
Commit-Ready: Ege Mihmanli <egemih@google.com>
Tested-by: Ege Mihmanli <egemih@google.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-11-14 00:42:46 -08:00
Nicolas Boichat
bce7b5b4b6 ectool: Print temperature unit in ectool temps output
Currently, 'ectool temps all|<n>' just prints "300". This may easily
be mistakenly read as tenth of degree C (30.0 C), as the value
appears to make sense (close to room temperature). However, the value
is actually 300 K (27 C).

CQ-DEPEND=CL:763578
BRANCH=none
BUG=chromium:783845
TEST=ectool temps all shows temperature unit (K)

Change-Id: I70f7f04d061cb1d4f741d59f8b48c7963dd8280f
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/763996
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-11-11 12:13:42 -08:00
Shawn Nematbakhsh
ad3696b1ca cleanup: Remove llama board
The llama is a South American relative of the camel, though the llama
does not have a hump. These sturdy creatures are domestic animals used
by the peoples of the Andes Mountains.

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

Change-Id: I55dbd8d5b0b14c41e27c4ef473833563f38878c3
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/761298
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
2017-11-09 16:43:54 -08:00
Nicolas Boichat
fe69abf6c3 board: Add support for whiskers board
A hammer derivative.

BRANCH=none
BUG=b:68934906
TEST=make BOARD=whiskers -j

Change-Id: I8df5156d622bf518f647addf2fcea6342b2d6f2b
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/754078
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-11-09 16:43:54 -08:00
Wai-Hong Tam
fca1b7b710 flash_ec: Set NEED_SERVO according to chip name instead of board name
One can pass either a board name (e.g. hammer) or a chip name (stm32)
to the flash_ec command. If given a board name, will map to a proper
chip name and then call its chip-flashing method.

The NEED_SERVO variable ("no" if servo not needed) was set according
to the board name. It was broken if only given a chip name. It should
be set according to the chip name.

BUG=b:68943874
BRANCH=None
TEST=Flashed the Staff firmware
SERVO $ dut-control ec_boot_mode:on
DUT   $ ectool gpioset PP3300_DX_BASE 0
DUT   $ ectool gpioset PP3300_DX_BASE 1
DUT   $ flash_ec --chip stm32_dfu --image staff_ec.bin
SERVO $ dut-control ec_boot_mode:off
DUT   $ ectool gpioset PP3300_DX_BASE 0
DUT   $ ectool gpioset PP3300_DX_BASE 1

Change-Id: I1799f083115bfdf203a405733c5baefadbe3fe3e
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/755614
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
2017-11-06 17:26:16 -08:00
Wai-Hong Tam
b9e95e9692 flash_ec: Get the path of EC UART PTY only in flash_stm32
Flashing STM32 requires the EC UART. The path of EC UART PTY was
originally set under some conditions which didn't reflect the case.
Instead of fixing these conditions, this change simply moves it
inside flash_stm32() as other flash functions don't need EC UART PTY.

BRANCH=none
BUG=b:67010776
TEST=Used servo-micro to flash_ec a STM32 EC, no error on getting EC
UART PTY.

Change-Id: I20c31de8e6c7a99fde259f4f397e53325ee80b07
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/745101
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
2017-10-30 23:21:37 -07:00
Vadim Bendebury
9eac4de2ef cr50: prepare to release 0.0.25
Let's make CCD and RMA auth features available on pre-PVT decvices.

BRANCH=cr50
BUG=b:68161393
TEST=none

Change-Id: Ic4ced2ba0e44b620bfeef9aa11f4676667c3176f
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/734762
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2017-10-24 12:57:45 -07:00
Chris Wang
ca013a9780 ec: add initial nautilus board
For now use the files from poppy. To be changed later on.

BUG=b:66458931
TEST=emerge-nautilus chromeos-ec/make buildall -j

Change-Id: If829d7307f834f1f30878934623c0e9ee77b907d
Signed-off-by: Chris Wang <chriswang@ami.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/701996
Commit-Ready: Grace Kao <grace.kao@intel.com>
Tested-by: Grace Kao <grace.kao@intel.com>
Reviewed-by: Philip Chen <philipchen@chromium.org>
2017-10-23 04:28:27 -07:00
Shawn Nematbakhsh
7c2c5a9dc3 pd: Add "freeze" dual-role policy
Add a new DRP policy to "freeze" the power role of each port, never
toggling automatically, though manual role swaps may still occur.

BUG=chromium:769895
BRANCH=servo
TEST=On servo_v4, verify DUT port stays in SRC role and POWER port
stays in SNK role while disconnected.

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: Ibff3cd1ffaf0e884b030c231003763a57acbe02e
Reviewed-on: https://chromium-review.googlesource.com/715276
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-10-19 12:56:42 -07:00
Patrick Georgi
87dbec5dfa util/misc_util: Fix unchecked error
It's unlikely, but let's check for ftell() errors.

BUG=b:64477774
BRANCH=none
TEST=none

Change-Id: I3690da60f756ab056e852e9f485b3c439c82e67b
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Found-by: Coverity Scan #58158
Reviewed-on: https://chromium-review.googlesource.com/719196
Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Martin Roth <martinroth@chromium.org>
2017-10-19 05:15:31 -07:00
Aseda Aboagye
8f3f0c0807 flash_ec: Add 1s delay after turning on SPI VREF.
On zoombini, we were taking enough power that the voltage dipped for a
little bit.  This commit adds a 1 second delay after applying SPI VREF
but before actually flashing the EC.

BUG=b:65694390
BRANCH=None
TEST=`./util/flash_ec --board zoombini` still works.

Change-Id: I431cbfcc569fd5369971b06dedb85e8d5fdb9a32
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/722354
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-10-18 10:30:41 -07:00
Vadim Bendebury
26a8e16de1 util: let cr50 signer use chroot version of gsctool
Requiring installation of the gsctool locally in the EC tree could
collide with debug versions or executables built for wrong
architectures.

Let's use the version installed in chroot and give user instructions
how to install it if it is not there.

BRANCH=cr50
BUG=none
TEST=verified that create_released_image.sh still works with the
     chroot version of the tool

Change-Id: Ib155e166297d28c1660f7f33bb000b3bb8fe7a15
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/709739
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2017-10-16 18:17:35 -07:00
Patrick Georgi
828da3d556 util/iteflash.c: make sure that the file is closed
An insignificant bug, but Coverity complains about it. Reduce the
cognitive load by making sure that file is closed in time.

BUG=none
BRANCH=none
TEST=none

Change-Id: I2efbe136f4991cf829b95568eef22eb7b2d1a8c6
Found-by: Coverity Scan #141758
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://chromium-review.googlesource.com/702304
Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Chris Ching <chingcodes@chromium.org>
2017-10-14 08:03:05 -07:00
Patrick Georgi
57ae0b0f18 util/iteflash.c: Handle potential resource leaks
They're of really little consequence right now since an error in
verify_flash() is only followed by resource tear down and process exit.
verify_flash could gain other call-sites though, so better be safe than
sorry.

BUG=none
BRANCH=none
TEST=none

Change-Id: I5fa8276dc3b3e124dacceca1ea857430982f7567
Found-by: Coverity Scan #141761, #141762
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://chromium-review.googlesource.com/702482
Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Chris Ching <chingcodes@chromium.org>
2017-10-14 08:03:05 -07:00
Shawn Nematbakhsh
7f472114fb cleanup: Use CONFIG_BATTERY to indicate whether a board has a battery
BUG=b:35528297
BRANCH=None
TEST=`make buildall -j`

Change-Id: I9e4814b4172f20711f7edd691c9569f9130aec8e
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/713395
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-10-13 14:45:16 -07:00
Aseda Aboagye
051339e28c flash_ec: Save more variables.
It was found on zoombini, when flashing via flash_ec failed, it would
prevent the board from booting as certain controls were left in their
"flashing" state.  This was because these controls were missing from the
variables list which is what was used to restore the controls.

BUG=b:65694294
BRANCH=None
TEST=Attempt to flash zoombini without the flex connected.  Attach the
servo flex, apply power, verify DUT boots up.

Change-Id: Ic2bc74ef1a61d4f10da6d3ceac77fbd373697838
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/714023
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-10-12 13:37:15 -07:00
YH Lin
c478733f19 grunt: initial setup for ec
Initial files for grunt, to be revised later.

BUG=b:67187149
TEST=None
BRANCH=None

Change-Id: I392bb4982fea0c9374ba8d262f8f4288522207d5
Signed-off-by: YH Lin <yueherngl@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/699554
Reviewed-by: Jason Clinton <jclinton@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-10-11 20:45:08 -07:00
Vadim Bendebury
a08f61506c g: rename usb_updater into gsctool
The usb_updater utility has long been not just an updater, and has
long been using other interfaces in addition to USB. gsctool is a much
more suitable name.

CQ-DEPEND=CL:709776
BRANCH=cr50
BUG=b:67007500

TEST=verified that make -C ./extra/usb_updater generates
     ./extra/usb_updater/gsctool:

  $ ./extra/usb_updater/gsctool --help

  Usage: gsctool [options] <binary image>

  This updates the Cr50 RW firmware over USB.
  The required argument is the full RO+RW image.

  Options:
  [...]
  $

Change-Id: I3ab70c28acf3664ddefaa923a87ba1fd5c3c437b
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/709738
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2017-10-10 22:13:43 -07:00
Patrick Georgi
f1e6af516c util/ectool.c: Make sure device_name is NUL terminated
BRANCH=none
BUG=none
TEST=none

Found-by: Coverity Scan #144116
Change-Id: I9ec030c1a3820af7d08c2a83e3c1f4c3ee7a3f0a
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://chromium-review.googlesource.com/702302
Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Chris Ching <chingcodes@chromium.org>
2017-10-09 03:06:27 -07:00
Jagadish Krishnamoorthy
49958cf5c2 vboot: Modify the parameter offset
For the Host Command vboot hash EC_VBOOT_HASH_GET case,
if the input parameter offset and size is 0 then change
offset to data_offset to obtain the latest hash value.
Else retain the offset to get the hash value at offset.

BUG=b:66957716
BRANCH=NONE
TEST=On Soraka, ectool echash commands
(RO, RW) should result in hash information.

Change-Id: Ife17d35b0dfeecb5ec799c9ed722ae48dbec5b5b
Signed-off-by: Jagadish Krishnamoorthy <jagadish.krishnamoorthy@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/685738
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
2017-09-27 19:03:03 -07:00
Nicolas Boichat
82e0892fc3 update_fw: Store complete touchpad FW hash
This will be used by the updater to first check that the touchpad
FW on AP side matches the one for which we stored hashes on EC
side.

This guarantee that we do not accidentally try to flash an
incorrect FW, which would render the touchpad non-functional.

BRANCH=none
BUG=b:63993173
TEST=make TOUCHPAD_FW=SA459C-1211_ForGoogleHammer_3.0.bin \
          BOARD=hammer -j
TEST=./usb_updater2 -t
     includes output of
     sha256sum A459C-1211_ForGoogleHammer_3.0.bin

Change-Id: Id30ab2d7c7d7e2d0f25cc893f685d218c44c022e
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/641736
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-09-15 10:50:27 -07:00
Vadim Bendebury
4fdccb6de5 util: fix bug in tagbranch
After mulptiple edits of the script, there is a case when bash
variable is not properly quoted, let's fix it.

BRANCH=cr50
BUG=b:64698702
TEST=verified proper tag description set by git

Change-Id: I5847437cde717bb6e1f4b672fe6008b8e6e6f4e3
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/667917
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-09-15 08:46:32 -07:00
Vadim Bendebury
38650d0b5d util: move 'dirty' marker to be a prefix, not a suffix
With longer git SHA1s reported by git commands and longer version
strings, the entire SHA1 could be not fitting into the 32 byte version
of the VERSION string. So, instead of adding the 'dirty' marker to the
end of SHA1 let's replace the prefix dash with it in case the tree is
dirty.

This way the length of the version string does not change (as long as
the 'dirty' marker is one character long).

BRANCH=cr50
BUG=b:64698702
TEST=verified output of running getversion.sh with a clean tree

   $ ./util/getversion.sh  | grep VERSION32
   #define CROS_EC_VERSION32 "_v1.1.7046-591608e2e"

  and a 'dirty' tree

   $ ./util/getversion.sh  | grep VERSION32
   #define CROS_EC_VERSION32 "_v1.1.7046+591608e2e"

Change-Id: I42684522beaff9e9714206cfaddaf97e6cd644be
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/665958
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-09-15 08:46:32 -07:00
Nicolas Boichat
94279fc38f Makefile: Generate hashes for the touchpad FW
Based on the passed TOUCHPAD_FW parameter to the make command, the
build system generates hashes for the touchpad FW.

To generate the hashes, gen_touchpad_hash splits the touchpad FW
in blocks of CONFIG_UPDATE_PDU_SIZE, that are hashed individually
(SHA-256), and then stored in the EC image.

This will allow the USB updater code to verify the integrity of
the touchpad firmware being flashed.

When no FW is provided, zeros are output, which do not match
any valid data.

BRANCH=none
BUG=b:63993173
TEST=make TOUCHPAD_FW=SA459C-1211_ForGoogleHammer_3.0.bin \
          BOARD=hammer -j
TEST=Using variations of
     make TOUCHPAD_FW=SA459C-1211_ForGoogleHammer_3.0.bin \
          BOARD=hammer -j
     make TOUCHPAD_FW=SA459C-1211_ForGoogleHammer_4.0.bin \
          BOARD=hammer -j
     make BOARD=hammer -j
     Check that TPHASH touchpad_fw_hash.h is only regenerated when
     the parameter changes.

Change-Id: Ie347270aa9c00342de13489c9422e45e681b94c2
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/615321
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-09-15 03:08:26 -07:00
Vadim Bendebury
a26ddda387 utils: a script to help creating EC git tags
The script tries to determine the upstream branch name, and finds out
which is the first sha1 of the current branch.

Then the script tags the branch and generates a git command strings
the operator is supposed to check for sanity and enter to push the new
tag to the server.

With the new tag set each following run of ./util/getversion.sh would
generate version strings including the new tag name and number of
patches above the branch point.

More implementation details are included in the comments in the
script.

BRANCH=cr50
BUG=b:64698702
TEST=tried  the script in cr50 and gru firmware branches:
   cr50$ <path to>/tagbranch.sh
   A new tag 'v1.9308_B.0' has been set. Use the following command
   to push it to the server

   git push --tags https://chromium.googlesource.com/chromiumos/platform/ec v1.9308_B.0

   Or if you want to delete it:

   git tag -d v1.9308_B.0
   cr50$ ./util/getversion.sh | grep -w VERSION
   #define VERSION "_v1.9308_B.192-b5c9d0aa7"
   cr50$
   cr50$ cd <path/to>gru
   gru$ <path to>/tagbranch.sh

   A new tag 'v1.8785_B.0' has been set. Use the following command
   to push it to the server

   git push --tags https://chromium.googlesource.com/chromiumos/platform/ec v1.8785_B.0

   Or if you want to delete it:

   git tag -d v1.8785_B.0

   es^o: ~/new_projects/gru-8785/src/platform/ec 175 > ./util/getversion.sh | grep -w VERSION
   gru$ #define VERSION "_v1.8785_B.218-5d857ed8c"
   gru$

Change-Id: I0c0067f6b7bb837a0c119bc14ff48cb9223a3fa5
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/656575
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-09-14 11:36:37 -07:00
Vadim Bendebury
857ab8ffa2 cr50: generate self signed images with proper header values
The self signed images generated when running 'make BOARD=cr50' use
constant default values for the epoch, major and minor image header
fields. For the purposes of continuous testing we need the generated
images have sensible values in those header fields.

Since adding a full blown C++ based parser to the signer image is too
much trouble, let's just have a very basic Python based parser, which
pays attention only to the required fields from the current manifest.

BRANCH=cr50
BUG=none
TEST=built the new image and checked its version:
  $ make BOARD=cr50
  ...
  $ ./extra/usb_updater/usb_updater -b build/cr50/ec.bin
  read 524288(0x80000) bytes from build/cr50/ec.bin
  RO_A:0.0.23 RW_A:0.0.23[00000000:00000000:00000000] RO_B:-1.-1.-1 ...

Change-Id: I822475ed0a3c481b08e9268f9c13663b0b132d4a
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/651132
Reviewed-by: Marius Schilder <mschilder@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2017-09-13 21:47:07 -07:00
Vadim Bendebury
092040b0b7 cr50: prepare to release 0.0.24
There are upcoming releases from different branches.

BRANCH=cr50
BUG=b:65128360
TEST=none

Change-Id: I1abf4fe4df90b1b0f93d5d13a8b7e361ba9b2240
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/663425
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2017-09-12 18:16:28 -07:00
Shawn Nematbakhsh
5ec58b35f1 cleanup: Remove lucid and snoball boards
BUG=None
TEST=`make buildall -j`
BRANCH=None

Change-Id: I667e471d4d9187f530da7ae8807c8aa339a17847
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/663817
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2017-09-12 16:17:07 -07:00
Daisuke Nojiri
4dcee1c545 EFS: Add support for early firmware selection
Chromebox ECs performs EFS: verifying firmware before the AP boots.
This patch updates host commands which are required for the EFS.

The change includes:
* Update EC_CMD_FLASH_REGION_INFO to accept EC_FLASH_REGION_UPDATE
* Update EC_CMD_VBOOT_HASH to accept EC_VBOOT_HASH_OFFSET_UPDATE

When EC_FLASHS_REGION_UPDATE is specified, EC_CMD_FLASH_REGION_INFO
returns the slot which currently is not hosting a running RW copy.

When EC_VBOOT_HASH_OFFSET_UPDATE is specified, EC_CMD_VBOOT_HASH
computs the hash of the update slot. This hash covers the entire
region, including the signature at the end.

This patch undefines CONFIG_CMD_USBMUX and CONFIG_CMD_TYPEC
for gru to create space.

BUG=b:65028930
BRANCH=none
CQ-DEPEND=CL:648071
TEST=On Fizz, verify:
1. RW_B is old and updated by soft sync. RW_B is activated and
   executed after reboot. System continues to boot to OS.
2. RW_A is old and updated by soft sync. RW_A is activated and
   executed after reboot. System continues to boot to OS.

Change-Id: I9ece907b764d07ce94054ba27996e048c665a80a
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/648448
2017-09-12 01:11:59 -07:00
Shawn Nematbakhsh
f67f1a9b78 cleanup: Remove 'ryu' board
Remove 'ryu' and related ryu-only code.

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

Change-Id: I19b966ea6964a7ed083724f7de80ae192235a406
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/656314
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-09-11 11:14:24 -07:00
Che-yu Wu
03fb836a44 util/build.mk: Fix makefile dependencies of export_taskinfo
export_taskinfo is a utility used by the stack analyzer.
This patch makes sure it will be recompiled when the EC code changed.

BUG=none
BRANCH=none
TEST=make BOARD=eve -j && make BOARD=eve analyzestack
     Add a fake task in board/eve/ec.tasklist
     make BOARD=eve -j && make BOARD=eve analyzestack
     The fake task shows in the report

Change-Id: I57c2700610680975571d254e0059571556f184fe
Signed-off-by: Che-yu Wu <cheyuw@google.com>
Reviewed-on: https://chromium-review.googlesource.com/651449
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-09-06 07:12:45 -07:00
Che-yu Wu
653a18ffc4 ec: Fix missing Makefile dependencies.
Add the extra dependencies to "deps-y" and include it in "deps".

BUG=chromium:761922
BRANCH=none
TEST=Add "$(info $(deps))" before "-include $(deps)" in Makefile.rules
     make BOARD=eve utils | grep "build/eve/util/usb_pd_policy.o.d"
     There is "build/eve/util/usb_pd_policy.o.d"

Change-Id: I77670a8e90a1a913943fcba143402318aaf7d274
Signed-off-by: Che-yu Wu <cheyuw@google.com>
Reviewed-on: https://chromium-review.googlesource.com/649455
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-09-05 08:21:27 -07:00
Nicolas Boichat
2777b7771e presubmit_check: Check unittests results on extra/stack_analyzer
BRANCH=none
BUG=none
TEST=util/presubmit_check.sh

Change-Id: I6078377603719de1d633660c69ad3a40b29ffadf
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/640191
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Che-yu Wu <cheyuw@google.com>
2017-08-29 22:08:20 -07:00
Vadim Bendebury
4ec14d890e signer: no need to sign dev images any more.
The chromeos-cr50 ebuild does not install dev images any more, and
chromeos-cr50-scripts do not try updating dev versions of H1 any more.
Let's stop releasing dev Cr50 images.

BRANCH=Cr50
BUG=none

TEST=tried creating a release image in the release branch, got a
     tarball of the desired contents:

   $ tar tf cr50.r0.0.10.w0.0.22_ZZAF_ffffffff_00007f80.tbz2
   cr50.r0.0.10.w0.0.22_ZZAF_ffffffff_00007f80/
   cr50.r0.0.10.w0.0.22_ZZAF_ffffffff_00007f80/cr50.bin.prod

Change-Id: Ib2acaf5f31f7067a98c35c0ec83e730736398a7d
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/624193
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2017-08-22 16:43:59 -07:00
Vadim Bendebury
60f8deccb1 cr50: prepare to release RW 0.0.23
New released images need higher version number.

BRANCH=none
BUG=none
TEST=built and ran an image, verified version number to be right.

Change-Id: I0b5b690d84b2f281752ad01b154efdebeba2e136
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/621296
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2017-08-18 20:53:06 -07:00
Vincent Palatin
3cbdff8b1b stm32: add embryonic support for STM32F76x
The STM32F76x is really close to the STM32F4 family, so the most concise
implementation is just using CHIP_FAMILY_STM32F4 and adding
CHIP_VARIANT_F76X.

Tune the clock settings to 180 Mhz CPU clock as the goal is performance.
(over-drive is not implemented yet to get to 216 Mhz)

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

BRANCH=none
BUG=none
TEST=ran on nucleo-f767zi board.
'make BOARD=nucleo-f767 flash', the red LED is on and the green LED
turns on/off when pressing the user button, UART console works properly.

Change-Id: I1f67df3aec874c965c81188df46c72de210728d9
Reviewed-on: https://chromium-review.googlesource.com/612750
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-08-18 16:46:34 -07:00
Che-yu Wu
104fa97f67 util/genvif.c: Remove duplicated include.
The header file "stdint.h" is included twice.

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

Change-Id: Iba6975b65309be032e0ae040d13a7d06a534fc0d
Signed-off-by: Che-yu Wu <cheyuw@google.com>
Reviewed-on: https://chromium-review.googlesource.com/620291
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-08-17 22:41:12 -07:00
Stefan Reinauer
63158e2ee6 st32mon: Define SPI_IOC_WR_MODE32 if it's missing
On Goobuntu, the uapi copy of spidev.h doesnot contain
SPI_IOC_WR_MODE32, however the kernel supports the IOCTL.
To be able to build the tool outside of the ChromeOS chroot,
define it if it's not available.

Signed-off-by: Stefan Reinauer <reinauer@google.com>
BRANCH=none
TEST=make buildall -j outside of the chroot
BUG=b:35567067

Change-Id: I04ec968e221c7d43f1bdb364a195d371370ec886
Reviewed-on: https://chromium-review.googlesource.com/614645
Commit-Ready: Stefan Reinauer <reinauer@google.com>
Tested-by: Stefan Reinauer <reinauer@google.com>
Reviewed-by: Martin Roth <martinroth@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-08-16 17:48:05 -07:00
Che-yu Wu
64ecddfd86 ec: Add a task information library for the stack analyzer.
Add a shared library to export task information.
Modified the stack analyzer to get information from the shared library.
Show allocated stack sizes of tasks in the stack analyzer.

To get the all task information (including the allocated stack size),
A shared library is added and compiled with the board to export all
configurations of the tasklist.

BUG=chromium:648840
BRANCH=none
TEST=extra/stack_analyzer/stack_analyzer_unittest.py
     make BOARD=elm && extra/stack_analyzer/stack_analyzer.py \
         --objdump=arm-none-eabi-objdump \
         --addr2line=arm-none-eabi-addr2line \
         --export_taskinfo=./build/elm/util/export_taskinfo.so \
         --section=RW \
         ./build/elm/RW/ec.RW.elf
     make BOARD=${BOARD} SECTION=${SECTION} analyzestack

Change-Id: I72f01424142bb0a99c6776a55735557308e2cab6
Signed-off-by: Che-yu Wu <cheyuw@google.com>
Reviewed-on: https://chromium-review.googlesource.com/611693
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
2017-08-15 00:25:20 -07:00
Aseda Aboagye
79ae73477c charge_manager: Consider port in source PDO.
When CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT is defined for a board, as
its name implies, the board can source a higher current if there is
only one port acting as a source.

This commit fixes an issue with selecting the right source capability
message to advertise.  charge_manager_get_source_pdo() was simply
checking if there was more than one sink connected, instead of checking
if there were any *other* sinks connected.  In the event that a sink
was connected to a different port, we would advertise the max source
PDO.

BUG=b:64037926, b:35577509
BRANCH=gru,eve,reef
TEST=Connect sink to port 1.  Connect a AMA to port 0 that claims that
VBUS isn't necessary.  Start sending source caps, verify that the max
PDO is not being advertised in the source caps.

Change-Id: Ie4145ecaf98d5b9070ad3e8b139e5653685fa801
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/610479
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-08-11 20:10:20 -07:00
Vadim Bendebury
1573f257b7 g: signer: unify order of board ID fields
The board ID fields are displayed by the Cr50 console command 'bid' as
follows: <board id>:<board id mask>:<board id flags>.

Make sure the user passes them in the same order when invoking the signer
to sign a board locked image.

BRANCH=none
BUG=none
TEST=verified proper order of the fields when generating and using a
     prod signed image.

Change-Id: Ia4569c5e9e663b26edaa591bae881c719c4f199c
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/604218
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2017-08-09 16:32:02 -07:00
Wei-Ning Huang
25d281a42b ectool: do not try other communication methods for none cros_ec devices
There are none cros_ec devices running EC codebase connected to
chromebook, which can be accessed by ectool with
`cros_ec --name=SOME_DEV ...`.

In the case when SOME_DEV is not found, do not fallback to other
communication methods such as LPC or I2C, since ectool will instead get
the reply of real cros_ec device.

BRANCH=none
BUG=b:64468324
TEST=on poppy, `ectool --name=cros_tp version` should show:
     `Unable to establish host communication
      Couldn't find EC`

Change-Id: I2ac232122e0f928703f7607da365d5c1dc6f7194
Signed-off-by: Wei-Ning Huang <wnhuang@google.com>
Reviewed-on: https://chromium-review.googlesource.com/604977
Commit-Ready: Wei-Ning Huang <wnhuang@chromium.org>
Tested-by: Wei-Ning Huang <wnhuang@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
2017-08-08 10:09:18 -07:00
Vadim Bendebury
640e0d1576 g: signer: use strings instead of numbers for Board ID fields
Recent signer improvements allow to include hex values into the
manifest, this also makes it easier to process values with bid D31
set, let's use strings instead of ints.

BRANCH=none
BUG=none
TEST=verified signing of a prod release

Change-Id: Ia05198991bfdd8dfd831545a9edf70f1e06f24f4
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/604217
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2017-08-07 22:18:50 -07:00
Vijay Hiremath
3bd19634bb Intel GLK-RVP: Add initial board bringup code
Added bare minimum code to bringup the Intel GLK-RVP using
Nuvoton AIC.

BUG=b:64394037
BRANCH=glkrvp
TEST=Intel GLK-RVP2.0 boots to Chrome OS using Nuvoton AIC.

Change-Id: I86816d09fe428091438a16f014e23b2e0c0025b7
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/602515
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>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2017-08-07 22:18:49 -07:00
Aseda Aboagye
9051e6f999 flash_ec: Make sure die works in ec_uart_pty().
If flash_ec was run without `servod` running and servod is needed, an
error message is printed out.

ERROR: Cannot communicate with servo. is servod running ?

However, in the case of flashing an stm32 without servod running,
execution would continue and would lead to claim_pty freezing and
thawing a bunch of unrelated processes.  I believe the reason is that
the "die" was run in a subshell and therefore execution continued.

This commit now changes the way that servo_ec_uart_pty() works.  If no
PTY is found, then flash_ec exits printing out the error message.
Additonally, claim_pty() will now warn if no arguments are passed to it
instead of finding random victims.

BUG=chromium:751386
BRANCH=maybe some fw branches.
TEST=Without servod running, try `./util/flash_ec --board hammer`;
Verify that flash_ec exists after the call to die.

Change-Id: I50784e0c43bbf0e32d408261cb83029377b576a0
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/598506
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
2017-08-03 19:23:17 -07:00
Caveh Jalali
10dab9c7dd ectool: add PD_CHIP_ON support.
this adds CLI support for the new PD_CHIP_ON subcommand of
ec_pd_control_cmd.

TEST=rebuilt ectool to see if "ectool pdcontrol on" does something useful.
	copied new build to electro:

	ec> i2cxfer rlen 0 0x50 1 0x10
	Unknown error
	Usage: i2cxfer r/r16/rlen/w/w16 port addr offset [value | len]
	ec>

	ap$ /tmp/ectool pdcontrol on 0

	ec> i2cxfer rlen 0 0x50 1 0x10
	Data: aa2934ad000000000000010000050500
	ec>

	so, "pdcontrol on" had the desired effect of bringing the chip
	out of sleep mode.

BRANCH=none
BUG=b:35586895

Change-Id: I5275254fe797dda921a352b72f1683e1967efe58
Signed-off-by: Caveh Jalali <caveh@google.com>
Reviewed-on: https://chromium-review.googlesource.com/599361
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-08-03 19:23:13 -07:00