Commit Graph

725 Commits

Author SHA1 Message Date
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
Aseda Aboagye
e01813adc7 presubmit_check: Don't include flash_ec.
One of the items that the presubmit check checks is that if any source
file has been modified, the unit tests are run again.  However, flash_ec
is included in the list of files.  This commit removes flash_ec from the
candidates because it's not run in any unit tests anyways and it's a
shell script that is not compiled.

Additionally, ignore changes to the presubmit_check.sh itself.

BUG=None
BRANCH=None
TEST=modify flash_ec, verify that presubmit check doesn't complain about
not running make buildall.

Change-Id: I473f269c7f0bba9be3216fcec39f266d896fb908
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/598505
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
2017-08-03 15:13:58 -07:00
Vadim Bendebury
716b0fcf4f signer: include Board ID fields in the tarball file name
When an image with non-default board ID fields is released, the
generated tarball name should include the Board ID values to allow to
tell between images of the same version locked for different boards.

BRANCH=none
BUG=none
TEST=ran create_released_image.sh with and without specifying Board ID
     fields, observed properly named file generated in both cases

Change-Id: I5f60a0e547d93c78caee34a9c307fc93f824b2ae
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/597121
Reviewed-by: Caveh Jalali <caveh@google.com>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
2017-08-03 15:13:55 -07:00
Vadim Bendebury
5a9d0de240 g: stop converting hex device id values to ints
The new signer (version: 1.2 00840c1b6) allows hex values in the
manifest, which means there is no need to explicitly convert the
values before adding them to the manifest.

A nice side effect of this is the fact that there is no need to care
about the sign of the values any more, the signer does the right
thing.

BRANCH=none
BUG=none
TEST=built an image using the following invocation:

   $ make BOARD=cr50 H1_DEVIDS='0x12009015 0x90e95664' -j

    and successfully ran it on a device. Note that the old signer was
    chocking on hex values exceeding 0x7fffffff, the new one handles
    them properly.

Change-Id: I08c0339f922d287c82d56fb51570bfbf7107531e
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/598728
Reviewed-by: Nick Sanders <nsanders@chromium.org>
2017-08-02 17:26:42 -07:00
Aseda Aboagye
7ed19ed220 flash_ec: Update method of retrieving serial num.
There have been some new methods added to servod to retrieve the serial
numbers of the servos attached.  Prior to this, with a servo micro
connected to a servo v4, retrieving the serial number would always
return that of the servo v4.  This would cause flashing to fail.  This
change updates the method to retrieve the serial numbers.

CQ-DEPEND=CL:597209

BUG=chromium:740026
BRANCH=maybe some fw branches.
TEST=With updated hdctools, flash a kevin using a servo micro connected
to a servo v4.
TEST=Flash kevin with a servo v2.
TEST=Attempt to flash a hammer and verify that the only issue is
stm32mon not being able to determine the startup of the monitor mode
(since I don't actually have a hammer).

Change-Id: I82c2907d689311fe65717a833390b8d0f6e15a94
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/597211
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
2017-08-02 12:47:50 -07:00
Vadim Bendebury
3f2a017f26 signer: do not proceed if usb_updater is not available
The script assumes that usb_updater is present in the PPATH, but it is
not guaranteed to be available.

Use the version from the ec tree or stop if it is not available.

BRANCH=none
BUG=none
TEST=verified that the script uses proper instance of usb_updater

Change-Id: I3b861953e8d5d509b99131685e86aaf7a0693d23
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/597120
Reviewed-by: Caveh Jalali <caveh@google.com>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2017-08-01 22:59:47 -07:00
Vadim Bendebury
bc3d04edd4 signer: refactor to use program name variable
Instead of invoking $(basename $0) multiple times, cache it in a
variable.

BRANCH=none
BUG=none
TEST=verified that the script still reports proper name when printing
      error messages.

Change-Id: Iabdf40592cb4cecc975a48d93169f46614ce84c6
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/597119
Reviewed-by: Caveh Jalali <caveh@google.com>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2017-08-01 22:59:47 -07:00
Vadim Bendebury
cb06c593b4 cr50: prepare to release RW 0.0.22
This version will be bettter sutied for chip manufacturing environment
(no contention with the test rig GPIO settings and formal confirmation
of successful certificate installation).

BRANCH=cr50
BUG=b:63686091
TEST=none

Change-Id: I6d394493b824c9d79bca4785d3d44b33f322b899
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/583990
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2017-07-31 00:40:20 -07:00
Shawn Nematbakhsh
2f09d4adea power: Allow host to request higher-power wakeable S3
Allow host to request a higher-power S3 variant, "wakeable S3", in which
more wakeup sources will be enabled by the EC. The actual implementation
and list of wake sources is left up to the chipset power driver and/or
board code.

BUG=b:63037490
BRANCH=gru
TEST=With subsequent commit, compile on scarlet w/ power sequencing
version = 2.

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I469f0cd969052f173cb176196bb6d05f6f76fdb5
Reviewed-on: https://chromium-review.googlesource.com/572210
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Philip Chen <philipchen@chromium.org>
2017-07-28 15:04:24 -07:00
Sam Hurst
e03e58c745 genvif: Vendor Name not displayed in PD Compliance Software
After the USB-C compliance test software loads the VIF, the
Vendor Name isn't populated and left blank in the Test
Report.

BUG=b:64111221
BRANCH=None
TEST=`make -j buildall`
Signed-off-by: Sam Hurst <shurst@chromium.org>

Change-Id: I672345cc950e78ea4eef973a9929e6eb9f9117d9
Reviewed-on: https://chromium-review.googlesource.com/590347
Commit-Ready: Sam Hurst <shurst@google.com>
Tested-by: Sam Hurst <shurst@google.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-07-27 17:55:44 -07:00
Aseda Aboagye
d703859ba0 flash_ec: Add support for zoombini.
BUG=None
BRANCH=None
TEST=Run flash_ec and verify that fw_up is used when trying to flash and
that the right programmer is selected.

Change-Id: I4d345812c5363895a83b1bdd2e3097148d4ae161
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/587392
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-07-26 22:41:54 -07:00
Aseda Aboagye
15c3bec8a5 flash_ec: Fix common_stm32_VARS definition.
In the recent change to flash_ec, there was a problem with they way that
common_stm32_VARS was defined.  This commit fixes the issue.

BUG=chromium:740026
BRANCH=potentially some FW branches.
TEST=Using servo_v2, flash elm.

Change-Id: I2e14f1f45525f494d9912b420d36d02d89b9dc5a
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/583540
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
2017-07-24 20:32:48 -07:00
CHLin
51d0fbb56c util/openocd: change the _CHIPNAME of npcx ec to a generic name
The original _CHIPNAME for npcx ec in the openocd configuration file
is npcx5m5g. As we introduce more npcx ec SKUs, it is not appropriate
to keep using this name. This CL modifies the _CHIPNAME to a generic
name(npcx_ec).

BRANCH=none
BUG=none
TEST=./util/flash_ec --board=npcx7_evb; check the openocd log and make
sure the _CHIPNAME is npcx_ec now.

Signed-off-by: CHLin <CHLIN56@nuvoton.com>
Change-Id: I49d298de1e43ac29f3e5535702595ee27225ac23
Signed-off-by: CHLin <CHLIN56@nuvoton.com>
Reviewed-on: https://chromium-review.googlesource.com/576604
Commit-Ready: Jun Lin <riverq@gmail.com>
Tested-by: Jun Lin <riverq@gmail.com>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2017-07-22 11:45:00 -07:00
Philip Chen
1339fff853 flash_ec: Add servo support for Scarlet rev1
This will also kill the servo support for Scarlet rev0.

BUG=b:62269890
BRANCH=none
TEST=none

Change-Id: Ibacd8905bf0a07e3787adb7fe1a1daaf2ff98943
Signed-off-by: Philip Chen <philipchen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/578927
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2017-07-21 21:24:13 -07:00
Caesar Wang
31ceb6a6da flash_ec: add nefario for support
BUG=b:63408169
BRANCH=none
TEST=utils/flash_ec --board=nefario

Change-Id: Ic13d6257a548d6c759542f3e8e679b0ce2b4de51
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/578694
Reviewed-by: Philip Chen <philipchen@chromium.org>
2017-07-20 00:36:59 -07:00
Aseda Aboagye
3a7a739b38 flash_ec: Add support for servo micro.
BUG=chromium:740026
BRANCH=maybe some FW branches.
TEST=Use a servo_micro, flash kevin, verify kevin boots.
TEST=Repeat above test with a servo_v2.

Change-Id: I377384f44e85c4a6032871aa4eebd208fd6e3336
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/572142
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
2017-07-19 19:03:54 -07:00
CHLin
e99d9795d5 util: ecst: Add support for chip variant npcx7m6g
This CL adds support for chip variant npcx7m6g in ecst utility.

BRANCH=none
BUG=none
TEST=No build errors for make buildall. Build npcx7_evb board
and upload firmware on EVB. No symptom found.

Change-Id: I156e0a8f183397ad713c7134b3a0ad5fe78b0d83
Signed-off-by: CHLin <CHLIN56@nuvoton.com>
Reviewed-on: https://chromium-review.googlesource.com/567942
Commit-Ready: Jun Lin <riverq@gmail.com>
Tested-by: Jun Lin <riverq@gmail.com>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Mulin Chao <mlchao@nuvoton.com>
2017-07-15 11:39:01 -07:00
Sam Hurst
cb7e26c993 genvif: Prevent undefined referencer when using APIs not provided by genvif
Problem was detected while using ccprintf to debug a data role swap
requests issue. To prevent errors similar to this, surround the API call
as follows:

ifndef VIF_BUILD
ccprints("I won't generate an undefined reference when building genvif");
endif

BUG=b:63664511
BRANCH=None
TEST=`make -j buildall`

Change-Id: Ieab9eaa638320cae67995a67c843d08b54acfbcb
Signed-off-by: Sam Hurst <shurst@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/570820
Commit-Ready: Sam Hurst <shurst@google.com>
Tested-by: Sam Hurst <shurst@google.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-07-14 09:44:37 -07:00
Mulin Chao
1b9a553ece util/flash_ec: Support gang programmer mode for spi flash in npcx ec
This CL adds support for updating FW to the internal spi flash in
npcx ec by enabling gang programmer mode. We also added a new array,
BOARDS_NPCX_INT_SPI, to indicate which boards will update FW through
this mechanism. The preliminary of testing is listed below.

Step 1: Connect npcx7 evb and servo v2 with following pins.
NPCX796F      Servo V2
-----------------------------------------
GP_SEL#  --> (Pin 7, J7)  FW_UP#
VCC1_RST#--> (Pin 4, J7)  DUT_COLD_RESET#
GP_CS#   --> (Pin 1, J11) DUT_SPI1_CS
GP_SCLK  --> (Pin 2, J11) DUT_SPI1_CLK
GP_MISO  --> (Pin 5, J11) DUT_SPI1_DO
GP_MOSI  --> (Pin 6, J11) DUT_SPI1_DI
-----------------------------------------
Step 2: Npcx ec is powered up by PPDUT_SPI1_VREF (Pin 8, J11).
Step 3: Add external PU on FW_UP#.
Step 4: Execute "sudo servod --vendor 0x18d1 --product 0x5002".

BRANCH=none
BUG=none
TEST=Move npcx7_evb from BOARDS_NPCX_7M6X_JTAG to
     BOARDS_NPCX_INT_SPI. Prepare two different ec images.
     Use following script "while :; do ./util/flash_ec
     --board=npcx7_evb --image=../ec1.bin; sleep 1; ./util/flash_ec
     --board=npcx7_evb --image=../ec2.bin; sleep 1; done" to test
     gang programmer mode. No errors occur over 2 hours.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
Change-Id: Ie813bf0191c06bb6e30a5e0dccb824f9f79ada53
Reviewed-on: https://chromium-review.googlesource.com/564742
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-07-13 04:48:39 -07:00
Aseda Aboagye
993a0991d6 driver: tcpm: ps8xxx: Add support for PS8805.
This commit adds support for the PS8805, another Parade Tech TCPC with
integrated superspeed muxes.  This also creates a generic Parade Tech
TCPC driver which supports the PS8xxx series.

The current supported TCPCs are:
  - PS8751
  - PS8805

BUG=b:63508740
BRANCH=None
TEST=`make -j buildall`

Change-Id: I78383af414996e0e8d6220985d286f95267136f8
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/564799
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-07-11 13:13:03 -07:00
Vadim Bendebury
74871a6bcd cr50 signer: provide means of setting board ID
There needs to be a way to set a board ID fields in the Cr50 RW
header. This patch adds this capability to the board signer and
release image creator scripts.

create_released_image.sh is being modified to include chrome OS
command line option parsing bash library, and a new command line
parameter is defined, --cr50_board_id. Its value is a string of three
colon separated fields, <board id>:<board id mask>:<board id flags>,
where
  <board id> is a 4 character ASCII string, the RLZ board code
  <board id mask> and <board id flags> are two hex values, without
     preceding 0x.

This value is passed to the bs script through environment variable
CR50_BOARD_ID (to be in sync with the bs script taking already
optional parameters like H1_DEVIDS from the environment).

The bs script is slightly refactored, code modifying the manifest to
splice in the device ID nodes is put into a function, and code adding
the board ID nodes to the manifest is also included in the new
function.

The three fields of the CR50_BOARD_ID string are converted to integers
and added to three nodes in the manifest (board_id, board_id_mask, and
board_id_flags respectively).

BRANCH=none
BUG=b:62294740
TEST=created a released image image using

   create_released_image.sh --cr50_board_id RXXX:ffffff00:ff00 \
       <rest of parameters>

  using the modified usb_updater (under a different patch) verified
  that the header fields have been created as expected.

Change-Id: I8374024de347f341ac16b72c2fa4a774e8385466
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/562918
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-07-10 15:27:21 -07:00
Vadim Bendebury
f06f6f6d4e signer: clean up signer/bs
This clean up is based on the review of a branch cherry-pick patch
(https://chromium-review.googlesource.com/c/556184).

Most of the comments apart from the suggestion of creating main() and
'workforce'() have been addressed.

BRANCH=cr50
BUG=b:62294740
TEST=verified that images created by running
    H1_DEVIDS='xxx xxx' ./util/signer/bs elves elf.1 elf.2
    H1_DEVIDS='xxx xxx' ./util/signer/bs

    are still bootable on a Cr50.

Change-Id: I370526be060e11b8c640d35b1409a631233b0672
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/557997
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-07-10 15:27:21 -07:00
Daisuke Nojiri
de36e33ecf eCTS: Add I2C suite to run_ects.py
This patch adds i2c suite to run_ects.py. It also adds checks for
return values from i2c_read and i2c_write functions.

BUG=chromium:653183
BRANCH=none
TEST=Run run_ects.py and verify all test pass.

Change-Id: Ie3d6e1e6f131235e2b28f39e1546c9cb4c3b92f6
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/547024
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-06-28 21:50:50 -07:00
Daisuke Nojiri
681b6fdf1f eCTS: Rewrite run_ects.sh in Python
Since the script is expected to upload results and probably send
alerts by e-mail, it's better to be written in Python so that we
can utilize chromite library. It will no longer run outside chroot
because of imports from chromite.lib.

BUG=chromium:735546
BRANCH=none
TEST=Run run_ects.py and verify all tests pass.

Change-Id: I6c79b061cdaef4d30305cf531f37b6734d18b7d9
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/546579
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-06-28 21:50:50 -07:00
Daisuke Nojiri
a66de3e956 eCTS: Convert mutex test suite to current format
This patch updates the mutex test suite so that it can be run
within the current framework.

BUG=chromium:736155
BRANCH=none
TEST=run cts.py -m mutex
test name     TH_RETURN_CODE DUT_RETURN_CODE TH_STR DUT_STR RESULT
lock_unlock_test       SUCCESS       SUCCESS      1       1   PASS

Change-Id: I69ee0857a0c633d7c6c8909f8c6f58ca6fd272ce
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/544790
2017-06-27 15:52:06 -07:00
Daisuke Nojiri
4c23fa01df eCTS: Convert hook test suite to current format
This patch updates the hook test suite so that it can be run
within the current framework.

BUG=chromium:736047
BRANCH=none
TEST=cts.py -m hook
test name    TH_RETURN_CODE DUT_RETURN_CODE TH_STR DUT_STR RESULT
test_init_hook       SUCCESS       SUCCESS      1       1   PASS
test_ticks           SUCCESS       SUCCESS      1       1   PASS
test_priority        SUCCESS       SUCCESS      1       1   PASS
test_deferred        SUCCESS       SUCCESS      1       1   PASS

Change-Id: I3e7f29da61e794b06b03241f3d7706c2db94b5be
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/545084
2017-06-27 15:52:05 -07:00
Shawn Nematbakhsh
7632f7c4ee genvif: Fix uninitialized variable access
Defects reported by Coverity.

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

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I15e0809f8d97e75be522b6160346de6b59316395
Reviewed-on: https://chromium-review.googlesource.com/535837
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-06-23 13:13:15 -07:00
Daisuke Nojiri
9069d0ff28 eCTS: Add script to run tests and publish results
This script will run nightly in the lab and publish the results.
Publishing results will be implemented later.

BUG=chromium:735546
BRANCH=none
TEST=Run run_ects.sh inside & outside chroot and verify all tests pass.

Change-Id: I405ea601eff33f1a4328f2606c8bb4050ff8d253
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/543681
2017-06-23 03:14:51 -07:00
Vadim Bendebury
023a1cb2b3 cr50: prepare to release version 0.0.21
BRANCH=cr50
BUG=None
TEST=built an image, observed version number.

Change-Id: I2717530abb92383e1d0260580bed81e00f4f21bb
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/538162
Reviewed-by: Nick Sanders <nsanders@chromium.org>
2017-06-16 17:09:36 +00:00
Wei-Han Chen
7bfbedc266 flash_ec: fix for SERVO_TYPE=toad
In CL:503475, SERVO_TYPE is initialized *after* toad cable detection.
This make flash_ec failed to update plankton EC.
This CL adjust the timing of SERVO_TYPE detection, so toad cable
detection can work properly.

BUG=b:35648297
BRANCH=plankton
TEST=utils/flash_ec --board=plankton

Change-Id: I08a11b99109454096949b3ff64ed1c4d5f9891df
Reviewed-on: https://chromium-review.googlesource.com/535381
Commit-Ready: Wei-Han Chen <stimim@chromium.org>
Tested-by: Wei-Han Chen <stimim@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2017-06-15 04:39:31 -07:00
Furquan Shaikh
5ed0e0f76f button: Implement emulated debug mode using buttons for detachables
BUG=b:36394093
BRANCH=None
TEST=make -j buildall. Verified following actions:
Vup+Vdn (10 seconds) --> Vdn --> Vup : Warm reset AP
Vup+Vdn (10 seconds) --> Vdn -> Power: Exit debug state

Vup+Vdn (10 seconds) --> Vup --> Vdn : Restart chrome
Vup+Vdn (10 seconds) --> Vup --> Power : Exit debug state

Vup+Vdn (10 seconds) --> Vup --> Vup --> Vdn : No action defined
Vup+Vdn (10 seconds) --> Vup --> Vup --> Power: Exit debug state

Vup+Vdn (10 seconds) --> Vup --> Vup --> Vup --> Vdn : Kernel panic
Vup+Vdn (10 seconds) --> Vup --> Vup --> Vup --> Power: Exit debug state

Vup+Vdn (10 seconds) --> Vup --> Vup --> Vup --> Vup: Exit debug state
Vup+Vdn (10 seconds) --> Vdn --> Vdn : Exit debug state

Change-Id: Ic49cc7463f6d8a00f3b4586754feeb3a7d23c371
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/520564
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
2017-06-15 01:48:26 -07:00
Aseda Aboagye
8ba7c1762c flash_ec: Support servo_v4 w/ CCD for flash_stm32.
Using servo v4 with the captive CCD cable to flash an STM32 requires bit
banging mode to be enabled.  This commit adds that support.

BUG=b:35648297
BRANCH=gru
TEST=Add support for rowan and flash rowan with no issues.

Change-Id: I6317d4acdd569888e20a1e298de7c8b620e94bb1
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/503476
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
2017-06-13 19:36:58 -07:00
Aseda Aboagye
ea6f53ae0c flash_ec: Add concept of servo type.
Not every servo has support for the same controls.  For example, servo
micro doesn't have the JTAG buf on flex elements.  This commit cleans up
the assumptions made and defines some variables which indicate which
controls are supported on a particular servo type.  The servo type is
obtained by the "servo_type" control from servod.

BUG=b:35648297
BRANCH=gru
TEST=With some other patches, try and flash rowan with a servo v4.

Change-Id: Ie10f4f73028a01a81638e9114b48c88941b8bf93
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/503475
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
2017-06-13 19:36:58 -07:00
Wei-Ning Huang
e237092ee9 ectool: fix command tpframeget return value
ec_command returns the length of response if there is no error. Fix the
return value so tpframeget sub command returns 0 on success.

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

Change-Id: I87288a3efcca75dacebae784e731e314e97017ad
Signed-off-by: Wei-Ning Huang <wnhuang@google.com>
Reviewed-on: https://chromium-review.googlesource.com/527766
Commit-Ready: Wei-Ning Huang <wnhuang@chromium.org>
Tested-by: Wei-Ning Huang <wnhuang@chromium.org>
Reviewed-by: Rong Chang <rongchang@chromium.org>
2017-06-09 09:16:27 -07:00
Brian Norris
8bd5696180 flash_ec: add scarlet support
BUG=b:62307687
BRANCH=gru
TEST=`flash_ec --board=scarlet`

Change-Id: Iaee413a3710921c37763ddf620eba558da6e569f
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/448760
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/528060
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Philip Chen <philipchen@chromium.org>
2017-06-08 16:39:38 -07:00
Vadim Bendebury
3639527eb4 bs: add missing codesigner command line argument
The recent change of the code signer is not backwards compatible, a
new command line parameter must be added.

BRANCH=cr50
BUG=none
TEST=verified that

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

  succeeds again.

Change-Id: I9a8e03c20aa4b7b689b1f5e4a1f786cf5857483f
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/527317
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2017-06-07 23:45:41 -07:00
Wei-Ning Huang
5b1d2b878d rose: add touchpad related host commands
Add touchpad related host commands:
1) EC_CMD_TP_SELF_TEST: run open short test.
2) EC_CMD_TP_FRAME_INFO: get number of frame and frame size.
3) EC_CMD_TP_FRAME_SNAPSHOT: make a snapshot of the frame.
4) EC_CMD_TP_FRAME_GET: get frame data.

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

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

Change-Id: I423e4b7f235ee2c9dddf28f4166fca2a74132733
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/511886
Reviewed-by: Alexandru M Stan <amstan@chromium.org>
2017-06-06 17:09:28 -07:00