Commit Graph

6135 Commits

Author SHA1 Message Date
Nick Sanders
155b8d6100 servo_v4: update uservo port init for tca6416
Make sure that ioexpander is set to output,
and that the uservo usb power enable is set.

BUG=chromium:651860
TEST=check that servo micro is initialized properly
BRANCH=None

Change-Id: Iff994c63cd333933d51db38202a41b7b6fc86d66
Signed-off-by: Nick Sanders <nsanders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/395186
Reviewed-by: Kevin Cheng <kevcheng@chromium.org>
2016-10-07 21:51:38 -07:00
Bill Richardson
ed9356e9e9 Cr50: Add board-specific "sysinfo" command
The EC firmware already has a default sysinfo command, but it's
not relevant for Cr50 and is disabled. This CL adds a sysinfo
command that IS relevant to the Cr50.

BUG=none
BRANCH=none
TEST=make buildall; try on Gru

> sysinfo
Reset flags: 0x00000800 (hard)
Chip:        g cr50 B2
RO keyid:    0x3716ee6b
RW keyid:    0xb93d6539
DEV_ID:      0x017a30b0 0x04656742
>

Change-Id: I251f86c1192aee373f1399ea4146ad355c592861
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/395567
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2016-10-07 21:51:34 -07:00
Bill Richardson
00fdda91a4 Cr50: Disable sysinfo, sysjump, syslock
The sysjump capability is not used in Cr50 (it either does
nothing or causes a hard reboot), so just disable these commands.

BUG=none
BRANCH=none
TEST=make buildall; test on Gru

Build with and without CR50_DEV=1, confirm that these commands
aren't present.

Change-Id: Idf882f10a2f750ac0d04cb3d35bb1d6f45cb6cee
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/395566
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-10-07 21:51:33 -07:00
Gwendal Grignou
f11271c8ee driver: bmi160: Fix logic issue when accelerometer is not first sensor
BMI160 driver assumes accel, gyro, compass are next to each other.
It was also assuming accel was sensor 0, which is wrong.

BUG=none
BRANCH=glados
TEST=On Cave, check sensors 1 (accel) and 2 (gyro) are working properly.

Change-Id: I37402e1d48070caaecbd7e32bbf53754616ee8cb
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/394067
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2016-10-07 21:51:24 -07:00
Gwendal Grignou
0ea4603143 driver: bmi160: Add config variable for INT2 setting
BMI INT2 can be input or output.
It is not used currently, but configure it properly nevertheless.

BUG=none
BRANCH=none
TEST=On cave, (int2 is output), ensure FIFO headers are free of
interrupt information.

Change-Id: I9c058689a8676593aad542e33601cc11da105838
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/394066
2016-10-07 21:51:22 -07:00
Bill Richardson
afcfb4b998 g: Upgrade protocol returns the keyid for RO/RW
The keyid field of struct SignedHeader is what distinguishes prod
keys from dev keys. This may be useful someday, so let's have the
update protocol return those values for the active RO and RW
images.

Bump the UPGRADE_PROTOCOL_VERSION accordingly.

Note: This doesn't enforce any keyid matches, it just returns the
current values as part of the initial upgrade handshake in case
we want to know.

BUG=chrome-os-partner:57956
BRANCH=none
TEST=make buildall; try on Gru

Make sure that Cr50 can be freely updated and downgraded between
firmwares that speak either v4 or v5 of the protocol, by using
the v5-aware usb_updater tool.

And of course, make sure that v5 images report their keyids. Duh.

Change-Id: If2cc0d4023dca2078b9398fd899618dc2cd409b9
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/394732
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-10-07 16:47:09 -07:00
Bill Richardson
5681c83244 Add CONFIG_CMD_SYSINFO and CONFIG_CMD_SYSLOCK
The sysinfo and syslock commands aren't needed by all boards that
compile common/system.c, so let's make them individually
selectable.

BUG=none
BRANCH=none
TEST=make buildall; try on Gru

Confirm that by default these commands are still present
everywhere that they were before (since they're #defined by
default). Also confirm that it's possible to #undef them and
still build.

Change-Id: I7a5d21d1f0b9887f3562b9410063616ed8f41163
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/395366
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-10-07 16:47:06 -07:00
Bill Richardson
1e930f49c8 Put a newline at the end of PRESUBMIT.cfg
Every time I run "cat PRESUBMIT.cfg" to see what's in here, it
annoys me that there's no newline at the end. This adds one.

BUG=none
BRANCH=none
TEST=make buildall

Just adding whitespace; no functional change.

Change-Id: I7629312c987696fd6c7bbc986ad63222186729c0
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/395347
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2016-10-07 16:47:02 -07:00
Shawn Nematbakhsh
3f6232f2d3 hibernate: Re-init GPIO levels on hibernate wake
Reset-on-hibernate wake performs a soft-reset, which re-initializes GPIO
states to ROM POR values. Therefore, it is necessary to re-init GPIO
states once again based on board-level GPIO settings.

BUG=chrome-os-partner:58077
BRANCH=gru
TEST=Run `hibernate` on gru, wake, then run `bd99955_dump`. Verify
actual register values are printed rather than zeros.

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: Ib3eb1dd6aa264d00d42d8e386bfd1ef7f6cf7717
Reviewed-on: https://chromium-review.googlesource.com/395426
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-10-07 16:47:00 -07:00
Vadim Bendebury
16da748424 usb_updater: always reboot cr50 in the end of the update
With the recent modification of the tpm reset processing the only way
to get the cr50 restart is to reset it internally.

Make sure that usb_updater triggers the cr50 reset in the end of the
update.

BRANCH=none
BUG=none

TEST=with the corresponding init script changes the update on reef
     happens as expected.

Change-Id: Ib49b81c4ef6d12d0b877a8a63493cf4d6d5aaeb0
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/394255
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2016-10-06 23:31:41 -07:00
Vadim Bendebury
c0813cddb0 usb_updater: add missing help message section
The previously added '-b' command line option was left out from the
help message. This patch fixes it.

BRANCH=none
BUG=none
TEST=verified that -b command line option description is included in
     the help message.

Change-Id: I71117a8653ae5094fd0bf3909c8715d6ec25259d
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/394254
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-10-06 23:31:39 -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
Vadim Bendebury
9b56b51b0d tpm: do not try running endorsement commands before nvram is available
Recent tpm2 repository changes introduced more strict checks of the NV
RAM operations' return status. The problem is that in case TPM is not
manufactured tpm_endorse() is invoked before nvram is declared
available, and this causes endorsement operation failure.

Make sure NVRAM initialization is complete before endorsement is
attempted.

BRANCH=none
BUG=none
TEST=tpm manufacturing now succeeds again.

Change-Id: I2217f33915ab8b4d872a9498def6d6862f4b1913
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/394129
Tested-by: Marius Schilder <mschilder@chromium.org>
Reviewed-by: Marius Schilder <mschilder@chromium.org>
2016-10-06 03:42:14 -07:00
Mary Ruthven
2e4d4e2e05 cr50: add console commands to have parity with servo
This change adds apreset, ecreset, ec_rst, sys_rst and powerbtn options
to the ccd console command.

BUG=chrome-os-partner:58123
BUG=chrome-os-partner:56835
BRANCH=none
TEST=manual
	sysrst resets the AP
	sysrst on/off controls SYS_RST_L

	ecrst resets the ec
	ecrst on/off controls EC_RST_L

	powerbtn 500 will simulate a power button press for 500 ms

Change-Id: I89adc88eb407730c9d57811a07bfef8fcf63c5b9
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/393809
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-10-05 20:58:47 -07:00
philipchen
84db5ed037 Enable spi_flash_read to read > SPI_FLASH_MAX_READ_SIZE
BUG=chromium:542789
BRANCH=none
TEST=make buildall

Change-Id: I55bf5bdb09b10be1c522ea4d843690abcc45abb2
Reviewed-on: https://chromium-review.googlesource.com/391867
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2016-10-05 20:58:37 -07:00
Daisuke Nojiri
3afd683d68 cts: Add I2C tests for read8/16/32 and write8/16/32
This patch adds tests for i2c_read8/16/32 and i2c_write8/16/32.

BUG=chromium:653183
BRANCH=none
TEST=make buildall. Run cts.py -m i2c for 100kHz with 10k ohms
pull-up registers on SCL and SDA. TH=stm32l476g-eval DUT=nucleo-f072rb.

Change-Id: I8121b1c5dc7542da45141543e35036ef41364c38
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/393331
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-10-05 20:58:20 -07:00
Daisuke Nojiri
8c22c2dcd7 cts: Add a return code indicating timeout
This patch adds CTS_RC_TIMEOUT, which is returned when test
encounters some sort of timeout.

BUG=none
BRANCH=none
TEST=Run cts.py -m i2c. Make buildall

Change-Id: I6d5cbcdde40f24e797e795f30f002da7621d089e
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/393330
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-10-05 20:58:18 -07:00
Daisuke Nojiri
c0c66cdd12 stm32l4: Add i2c driver
This patch adds master and slave drivers for stm32l4 family. Only slave
functionality is tested.

BUG=none
BRANCH=none
TEST=Run cts.py -m i2c. Make buildall.

Change-Id: Ied77081ca0333ab3fec055cd4f0fcbdf8a79d388
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/393329
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-10-05 20:58:17 -07:00
David Hendricks
9b57c61ff7 reef: Enable CONFIG_HOSTCMD_FLASH_SPI_INFO
BUG=none (similar to chrome-os-partner:56765, though)
BRANCH=none
TEST=flashrom's "--flash-name" shows SPI chip info instead of EC info
on reef

Change-Id: I1090dd5d4079ff94201fce9fd3e03a384eb3cb7b
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/392349
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-10-05 17:11:49 -07:00
Daisuke Nojiri
5f70312a26 i2c: Move I2C_MAX_HOST_PACKET_SIZE to i2c.h
This patch moves I2C_MAX_HOST_PACKET_SIZE to include/i2c.h. It's currently
used only by i2c-stm32*.c but should be commonly available for other chips.
It also moves i2c_get_protocol_info to common/i2c.c for the same reason.

BUG=none
BRANCH=none
TEST=make runtest

Change-Id: I28d8bca0167bb7b2ce99574601a6efb62fc20eca
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/393328
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-10-05 17:11:37 -07:00
Daisuke Nojiri
cab4ccf3f9 cts: Fix error message for uart port being occupied
This patch fixes the error messages displayed when a UART port connected
to DUT or TH is being occupied.

BUG=none
BRANCH=none
TEST=run cts.py -m i2c

Change-Id: I3fbb4068e8ee3af7a1b04f70ae70b3d870a19d2e
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/393327
2016-10-05 17:11:35 -07:00
Daisuke Nojiri
a51cee362a cts: Fail script when build or flash fails
This change makes cts.py fail when building or flashing a module for
DUT or TH fails.

BUG=none
BRANCH=none
TEST=Made cts.py fail by injecting build and flash error

Change-Id: Iec1e11f4a8c261eb4c989b118df218e86cb6f5f1
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/393326
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-10-05 14:33:33 -07: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
Aseda Aboagye
701223cf09 i2c_passthru: Return NAK when battery not present.
virtual_battery_read() returns a cached value for some of the supported
smart battery parameters.  If a value isn't supported, it calls out to
the actual battery.  In the case of a battery that's not present, but a
supported battery parameter is queried, we would still return
_something_.  This seems to confuse powerd and causes slow boot.

This commit changes the i2c passthru command to return a NAK when the
virtual battery is enabled but the battery is not present.

BUG=chrome-os-partner:55954
BRANCH=gru
TEST=Build and flash kevin.  Unplug battery.  Verify boot is nice and
quick.

Change-Id: Ib3ab768504c29904f01b91e6194a9689bfdb1e1e
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/392926
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Trybot-Ready: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
(cherry picked from commit b5eb2d93820c9e1a162cb1b390b3563bf9effcd5)
Reviewed-on: https://chromium-review.googlesource.com/393187
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2016-10-04 21:19:39 -07:00
Shawn Nematbakhsh
03857a3b35 spi: Add lock around spi_transaction
spi_transaction() can be called from motionsense, hooks, hostcmd,
console, and chipset tasks, so add a mutex to ensure an in-process
transaction isn't preempted by another transaction.

BUG=chrome-os-partner:57912
BRANCH=gru
TEST=On kevin, run "while true; do ectool motionsense odr 0 0; sleep 1;
ectool motionsense odr 0 1000000; sleep 1; done", verify watchdog crash
not encountered after 20 minutes.

Change-Id: I7ec495bab295dc03ce02372c20e5c7c5c196715d
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/391892
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
(cherry picked from commit eabdea443775fab834aaabbb7afae871306c7530)
Reviewed-on: https://chromium-review.googlesource.com/392226
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-10-04 16:33:21 -07:00
Scott
9cd10a5a47 Cr50: Removed Reef EVT workarounds
- changed the pad assignment for plt_rst_l from DIOA13 to DIOM3;
- removed the board property used to keep uart rx disabled, Uart0 is
  now enabled by default on Cr50.
- removed resetting fallback counter on USB updates for reef boards,
  they are going to use the same mechanism as kevin and gru.

BRANCH=none
BUG=chrome-os-partner:56540
TEST=Tested on Reef Board ID 1 and Gru Board ID 1. Verfied that
     plt_rst_l signal is being detected and that there are no
     interrupt storms related to not having a pullup resistor on the
     uart rx line. Verified that both platforms successfully boot into
     chrome OS using cr50 TPM.

Change-Id: I300a0c75e60acbecf93500b46aced303955a192a
Signed-off-by: Scott <scollyer@chromium.org>
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/391140
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-10-04 05:55:50 -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
Vadim Bendebury
0f7d6806b7 i2cs: reset local variables when reinitializing.
When tpm is reset the i2c slave interface initialization function is
called, but it does not quite re-initialize the interface.

This patch adds both a hardware pulse to make sure that the i2c slave
interface state machine is set into the initial state, and code to
zero static variables of the driver.

BRANCH=none
BUG=none
TEST=with the change on the AP firmware side which prevents losing i2c
     ready interrupts early in the process tpm reset became much more
     reliable. Resetting from EC, AP of cr50 consoles reliably
     restarts reef without any TPM communications problems.

Change-Id: I604607c32d4dfc554b245d3d3d82b9ad38271962
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/392306
Reviewed-by: Scott Collyer <scollyer@chromium.org>
2016-10-04 00:33:58 -07:00
Bill Richardson
240d03b780 Cr50: lock down the console a bit more
This removes some console commands that shouldn't be present in
production builds, even when the console is unlocked.

BUG=chrome-os-partner:57408
BRANCH=none
CQ-DEPEND=CL:391045
CQ-DEPEND=CL:391188
CQ-DEPEND=CL:391244
CQ-DEPEND=CL:391314
CQ-DEPEND=CL:391611
CQ-DEPEND=CL:391612
CQ-DEPEND=CL:391613
CQ-DEPEND=CL:391614
CQ-DEPEND=CL:391127
TEST=make buildall; try on Gru with and without CR50_DEV=1

Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: Ic5034a87ba032b14a7e613e6debdbb635a7c1c9a
Reviewed-on: https://chromium-review.googlesource.com/391046
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-10-03 23:45:34 +00:00
Bill Richardson
b5b06e4ac9 Cr50: fix CR50_DEV=1 override
Commit 9e7c12b added a command-line option to "make" to build
development versions of the Cr50 board. This makes the symbol
definition useful in makefiles and not just C code.

BUG=chrome-os-partner:57408
BRANCH=none
TEST=make buildall; try on Gru with and without CR50_DEV=1

Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: Id0719d63263b00e192a2e4866dbe1551ae49e23c
Reviewed-on: https://chromium-review.googlesource.com/391127
Commit-Ready: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-10-02 18:59:22 -07:00
Bill Richardson
fd88db3e9a g: CONFIG_FLASH should be optional
The application may need to read/write/erase the flash memory,
but we not want console users to do so. This CL adds
CONFIG_FLASH_PHYSICAL, which allows the higher-level CONFIG_FLASH
to be undefined while still providing the chip-specific
flash_physical_* accessor functions.

There aren't many board.h files that needed changes, since
CONFIG_FLASH_PHYSICAL is enabled by default, just like CONFIG_FLASH.

BUG=chrome-os-partner:57408
BRANCH=none
TEST=make buildall; try on Gru with and without CR50_DEV=1

See that it still boots, updates, wipes, restores, etc. without
linking common/flash.o in the production image; and that the
flash commands are still there in the dev build.

Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: I7eb1bbcb414b1c70ee427c4fcb5cea899dbb9e93
Reviewed-on: https://chromium-review.googlesource.com/391188
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-10-02 15:19:21 -07:00
Bill Richardson
0a4bb34bcd Add more CONFIG_CMD_* options for console commands
We have a large number of config.h options to enable/disable
specific console commands. This adds a few more that we will want
to control.

BUG=chrome-os-partner:57408
BRANCH=none
TEST=make buildall; try on Gru with and without CR50_DEV=1

Change-Id: Id41f0e9f44fc77feaf56853f357a6b33bb685b0c
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/391614
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-10-01 00:02:01 -07:00
Bill Richardson
f715b8b865 Sort CONFIG_CMD_* options in config.h
We have a bunch of options to enable/disable individual console
commands, but they're not quite sorted. Now they are.

BUG=none
BRANCH=none
TEST=make buildall

Change-Id: I186b9f82dc40c2f9fc66f493b4b6cccda020224c
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/391613
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-10-01 00:02:00 -07:00
Bill Richardson
6356e17eef g: The hid command is only useful for debugging
And even that's a bit of a stretch. This entire endpoint will
probably be deactivated until it's more useful. In the meantime,
we can just leave the one little debug command for debug builds.

BUG=chrome-os-partner:57408
BRANCH=none
TEST=make buildall; try on Gru with and without CR50_DEV=1

Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: Id4c185fe66d52fa49fcbee6a549df41d297c41af
Reviewed-on: https://chromium-review.googlesource.com/391045
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-10-01 03:14:28 +00:00
Bill Richardson
fa7f71cd84 g: Remove the test_rdd command
The rdd features are working (and it's better to test with
hardware anyway), so just delete this command.

BUG=chrome-os-partner:57408
BRANCH=none
TEST=make buildall; try on Gru with and without CR50_DEV=1

Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: Ifcfc8c8a0e61a9fe31d28f0c96bcb50c3e2b93b5
Reviewed-on: https://chromium-review.googlesource.com/391314
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-10-01 03:14:17 +00:00
Bill Richardson
468dd6988e Cr50: The panicinfo command is not safe
It's possible the register values could be sensitive.

BUG=chrome-os-partner:57408
BRANCH=none
TEST=make buildall; try on Gru with and without CR50_DEV=1

Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: Id3d4df3aaca116a638332f092d4727accd0cbbcd
Reviewed-on: https://chromium-review.googlesource.com/391612
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-10-01 03:14:07 +00:00
Bill Richardson
b94fa83a4c Cr50: The devices command is safe.
All it does is show the AP/EC/Servo state

BUG=chrome-os-partner:57408
BRANCH=none
TEST=make buildall; try on Gru with and without CR50_DEV=1

Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: I375be8e4d9c6f01aa90d0830da1927732740ed92
Reviewed-on: https://chromium-review.googlesource.com/391611
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-10-01 03:13:54 +00:00
Bill Richardson
08e8310a87 Cr50: The chan command is not safe.
It could be used to sniff TPM commands.

BUG=chrome-os-partner:57408
BRANCH=none
TEST=make buildall; try on Gru with and without CR50_DEV=1

Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: Ia2e11fb8e01002c2cf5e53b175e3e8b2741e4585
Reviewed-on: https://chromium-review.googlesource.com/391244
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-10-01 03:13:43 +00:00
Shawn Nematbakhsh
710f4ff4ca power: rk3399: Enable PP900_PCIE earlier to prevent leakage
Enable PP90_PCIE along with PPVAR_LOGIC and PP900_AP to avoid leakage.

BUG=chrome-os-partner:57952
BRANCH=Gru
TEST=Verify kevin powers up / down successfully.

Change-Id: I6fa47edcdde482d3fa2f249cfdff6e060a445f42
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/390896
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
(cherry picked from commit b41006ba84bc86e453c241296309fadf9a864032)
Reviewed-on: https://chromium-review.googlesource.com/391037
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-09-30 18:04:33 -07:00
Sam Hurst
ece9996136 ec: Remove fusb302 rev.A support
We're using fusb302 rev. >= B now, so let's remove rev. A support.

BUG=chrome-os-partner:57492
BRANCH=none
TEST=Manuel
- plug USBC->DP cable into TV then into kevin
localhost ~ # ectool usbpdmuxinfo
Port 0: DP INV

- plug USBC->DP cable into kevin then into TV
localhost ~ # ectool usbpdmuxinfo
Port 0: DP INV

- unplug USBC->DP cable from TV
Port 0: OPEN INV

- plug USBC->ETHERNET into kevin and verified that network
displayed ethernet

Change-Id: Ia84dc2480c1a8b003ab8dfdcdaa9f82f6d429e4b
Reviewed-on: https://chromium-review.googlesource.com/388925
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Sam Hurst <shurst@google.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-09-29 19:14:52 -07:00
Sam Hurst
c0f9e3f411 npcx: pwm: Fix prescaler calculation
The pwm prescaler wasn't being calculated properly when used with
the 32 Khz clock.

BUG=chrome-os-partner:57526
BRANCH=none
TEST=Manuel
- With PWM frequency set to 100Hz, I verified on the scope that
  the duty cycle changed from 0 to 100% in 10% increments.

- Verified on the scope that PWM frequency could be set to 100Hz,
  200Hz, 300Hz, 400Hz, and  2600Hz.

Change-Id: Idf8ffb6b20d469c9ea58e5a34e944f79d475eb15
Reviewed-on: https://chromium-review.googlesource.com/388814
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Sam Hurst <shurst@google.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-09-29 19:14:41 -07:00
Shawn Nematbakhsh
7f70ae4585 charger: bd9995x: Reset map command set on failed set operation
If BD9995X_CMD_MAP_SET fails, the charger's internal map command set
may be the old set (if the charger failed to process the command) or the
new set (if the EC failed to receive the response). Therefore, reset the
EC's known map command state on failure, so that it will always be
re-set on the next transaction.

BUG=None
TEST=Build + boot kevin.
BRANCH=Kevin

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: Id16273ccf2e39b5aae7776d626aae8863e713df5
Reviewed-on: https://chromium-review.googlesource.com/390318
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2016-09-28 22:09:27 -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
Vadim Bendebury
d2ee66555a nvmem: fix partition number assignment in nvmem.c
Partition number must be set before partition lock is attempted.

BRANCH=none
BUG=none
TEST=the cert installation image does not crash on gru any more

Change-Id: Ibc81e2e741fafb75f4e4bb5dbfc0dae32d354646
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/390416
Reviewed-by: Scott Collyer <scollyer@chromium.org>
2016-09-28 16:00:00 -07:00
Chris Chen
91d23fa94d stm32: Fixed bugs with stm32l4 register masks
Also filled out rest of CCIPR register defs
for stm32l4 chip family

BRANCH=None
BUG=None
TEST=make buildall

Change-Id: Ic9d1f966068915e304a0994c49fa9bbafec6cdf4
Reviewed-on: https://chromium-review.googlesource.com/367830
Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
2016-09-27 20:34:13 -07:00
Sam Hurst
f8c7be9fa9 kevin: hotplugging DP not working
Some Type-C to DP adapters generate two or more HPD events while
others generate only one HPD event. Currently hotplugging only
works with the former adapter. Now hotplugging is triggered on
one or more HPD events.

BUG=chrome-os-partner:57198
BRANCH=none
TEST=Manuel
- plug USBC->DP cable into TV then into kevin
localhost ~ # ectool usbpdmuxinfo
Port 0: DP INV

- plug USBC->DP cable into kevin then into TV
localhost ~ # ectool usbpdmuxinfo
Port 0: DP INV

- unplug USBC->DP cable from TV
Port 0: OPEN INV

Change-Id: Ied30f1eb3e1186b52067ffc9a37ed22a9012b457
Reviewed-on: https://chromium-review.googlesource.com/388737
Reviewed-by: Shawn N <shawnn@chromium.org>
Commit-Queue: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/388531
Commit-Ready: Shawn N <shawnn@chromium.org>
2016-09-27 20:33:55 -07:00
Shawn Nematbakhsh
77a96c4b4d npcx: watchdog: Log watchdog panic information
On EC panic events such as assertion fail, watchdog, etc. log the EC
state to our persistent panic log so that it can be retrieved later.

BUG=chrome-os-partner:57794
BRANCH=Kevin
TEST=Run `crash watchdog` on kevin, then `panicinfo` on subsequent boot.
Verify saved panic log matches watchdog dump.

Change-Id: I06414f986458af1426b9b9720025144cd38a7a59
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389591
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389957
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-09-27 20:33:54 -07:00
Vadim Bendebury
d6d12ec67b cr50: tpm: ignore sys_rst_l/plt_rst_l when TPM reset is in progress
There is no point in invoking TPM reset while the current invocation
is in progress. One of the cases when this is happening is early start
up on Kevin/Gru: the device starts booting, the EC comes around to
pulsing sys_rst_l when TPM is already busy installing endorsement
certificates.

There is no point in issuing another reset at that point, just let the
process continue.

BRANCH=none
BUG=chrome-os-partner:52366
TEST=firmware_TPMKernelVersion firmware_TPMExtend autotests still pass
     on kevin. Certificate installation during startup does not get
     interrupted any more.

Change-Id: Ibdface9f7a76186e210ef0f4111cd5fe9905bba9
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389811
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-09-27 00:27:37 -07:00
philipchen
98541217df bd9995x: Disable fast/pre-charging watchdog timer
BUG=chrome-os-partner:55771
BRANCH=none
TEST=make -j buildall
TEST=bd9995x r 0x0f 1; verify 0x00.

Change-Id: Ibfca44599b8a6d631215b2c9a50e810312559f3a
Reviewed-on: https://chromium-review.googlesource.com/388819
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2016-09-26 22:16:51 -07:00
Vadim Bendebury
5a6bb19a88 tpm: reset communications channels when resetting TPM
TPM resets happen asynchronously, conceivably there is some interface
(i2cs or sps) activity under way when TPM is reset.

Sps driver provides a means of disconnecting the client of the driver,
while the i2cs driver does not. Come to think of it, there is no real
need to provide a special function to disconnect a client, this makes
API simpler and allows to add driver initialization to the client
registration function.

To make tpm_registers.c more flexible - allow to register a callback
for interface initialization, this way when TPM is reset, the
interface can be also re-initialized and is guaranteed to start from
scratch after reset.

BRANCH=none
BUG=chrome-os-partner:52366
TEST=both firmware_TPMExtend and firmware_TPMKernelVersion autotests
     pass

Change-Id: I212166a23f9cd512d8f75315377d1f5620aea070
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/388886
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-09-26 22:16:45 -07:00