Commit Graph

11 Commits

Author SHA1 Message Date
Vadim Bendebury
5ff463659c cr50: increase console task stack size
The current console stack size prevents using it for even simpler TPM
library invocations. With this increase it is possible to invoke TPM
NV access API from console commands.

BRANCH=Cr50
BUG=b:62537474
TEST=with the rest of the patches verified that FWMP contents can be
     read from a console command.

     shmem console command output shows 6616 bytes of free SRAM space
     when in prod mode and 6624 bytes when in dev mode.

Change-Id: I177af1abde422dab0a9fdb0f4619eaf0ffefa9f6
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/817895
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2017-12-08 20:37:23 -08:00
Bill Richardson
c335895df7 Cr50: Let NVMEM take more time and memory
We were getting occasional stack overflow and watchdog timeouts
when clearing NVMEM. Bump up the stack size a bit in the HOOKS
task, and pet the watchdog before invoking the tpm2 init
functions.

BUG=chrome-os-partner:59419
BRANCH=none
TEST=make buildall, manual

Lock the console, then unlock it. This will reboot the EC & AP,
but should never reboot the Cr50.

Before this CL, it did about half the time.
After, it doesn't.

Change-Id: I33adfeb7360bf7d146a55ef16c923a1a0416393d
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/407847
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-11-05 21:03:06 -07:00
Bill Richardson
e4690f6152 Cr50: Remove HOSTCMD task
This should have been done along with commit fabb15c706.
Nothing invokes the hostcmd task, so let's kill it off.

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

Change-Id: I1f86d21b44392708e0ff7cc9173b47edda129e00
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/339225
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-04-15 21:29:25 -07:00
Bill Richardson
66af587cbc Cr50: Enable RW FW updates over USB
This enables the Cr50 to accept RW firmware updates over USB.

BUG=chrome-os-partner:50707, chrome-os-partner:50712
BRANCH=none
TEST=make buildall; test on Cr50

Build and run the extra/usb_updater utility. Watch the console,
and observe that the Cr50 updates and reboots into the new image
correctly.

Note that you'll have to rebuild the ec.bin image in order for
the update to take effect. Just reflashing the same image doesn't
cause the bootloader to change its selection.

All the previously existing endpoints continue to function normally.

Change-Id: I7bd22eae803c2ceeb14a767c06d3d5c9f1ac7c7a
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/338089
Commit-Ready: Vadim Bendebury <vbendeb@chromium.org>
2016-04-12 19:00:31 -07:00
Mary Ruthven
fa643a9fc7 cr50: add support for creating multiple serial endpoints
CR50 will need three serial endpoints for the streaming AP and EC UART
and exporting its own console through USB. This change adds a macro to
create endpoints that can be recognized by the usb_serial driver.

BUG=chrome-os-partner:50702
BRANCH=none
TEST=Verify "/dev/google/Cr50*/serial/Blob" prints capital letters when
lower case letters are input.

Change-Id: Iddf2c957a00dc3cd5448a6a00de2cf61ef5dd84c
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/336441
Tested-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-04-07 13:00:39 -07:00
nagendra modadugu
7ac69e594b CR50: Add initial elliptic curve crypto implementation.
This change adds support for NIST-P256 curve operations.

BRANCH=none
BUG=chrome-os-partner:43025,chrome-os-partner:47524
TEST=new tests under test/tpm2/ pass.

Change-Id: I03a35ff3ab8af3c52282d882937880bfa2bdcd32
Signed-off-by: nagendra modadugu <ngm@google.com>
Reviewed-on: https://chromium-review.googlesource.com/324540
Commit-Ready: Nagendra Modadugu <ngm@google.com>
Tested-by: Nagendra Modadugu <ngm@google.com>
Reviewed-by: Marius Schilder <mschilder@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-02-08 15:24:29 -08:00
Vadim Bendebury
9b11d70956 cr50: increase tpm task size
Let's increase it to 4K, this seems to be adequate for tests so far,
but with the enabled stack size monitoring we should find out quickly
if in certain cases this is not enough.

BRANCH=none
BUG=chrome-os-partner:43025
TEST=the test involving the use of SHA hardware does not fail in
     mysterious ways any more.

Change-Id: I86da89ccca42d1a60ce7c1dfef08d21bf44f1eee
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/314095
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2015-11-25 11:17:14 -08:00
Vadim Bendebury
6386c37379 cr50: introduce tpm task skeleton
TPM command processing should not be happening on the interrupt
context.

This patch adds a skeleton of the task which handles TPM functions. It
initializes the TPM and then enters endless loop waiting for an event
trigger from interrupt, which happens when a valid FIFO message is
received.

BRANCH=none
BUG=chrome-os-partner:43025
TEST=none yet

Change-Id: I63dce2762cc07370a05bf00bdf144c5d9eb6019b
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/289332
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2015-08-14 21:04:38 +00:00
Bill Richardson
0eb88ff59b Cr50: Enable host commands over SPI bus
This enables the feature that lets the Cr50 receive host commands
via the SPI (slave) interface.

BUG=chrome-os-partner:40969
BRANCH=none
TEST=make buildall
CQ-DEPEND=CL:283998

This CL also adds a test example in the extra/ftdi_hostcmd/
directory. To use it, you need the Cr50 attached to the build
host via an FTDI USB-to-SPI adapter.

  cd extra/ftdi_hostcmd
  make
  ./test_cmds

Change-Id: Ia719b1c898afc45b3105a9cd573a8492178d9be2
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/284001
2015-07-09 12:30:38 +00:00
Bill Richardson
f64945d8d1 Cr50: Enable USB blob handler (and disable USB console)
This enables the USB blob interface. Due to partner issue 40693,
we have to disable one of the other interfaces, instead of just
adding this one.

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

Also, connect to the Cr50 via USB and run

  cd extra/usb_console
  make
  ./usb_console -p 5014 -e 1

Strings typed into this application will be case-swapped and
returned.

Change-Id: If94006490ec9c6033e8520297aa42ed623d4daf6
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/275132
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2015-06-04 19:33:05 +00:00
Bill Richardson
86c7e2e90a Add initial support for cr50 SoC
The serial console works. Nothing else is implemented yet.

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

To build,

  make BOARD=cr50 hex

Testing the result requires a development board. I have one. It
works with HW revision m3.dist_20140918_094011

Change-Id: I718d93572d315d13e96ef6f296c3c2796e928e66
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/226268
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2014-10-31 22:32:50 +00:00