trunks_send: add cr50 firmware update capability

This patch extends trunks_send functionality with the capability to
upload cr50 firmware update using the same protocol as one used by
./extra/usb_updater/usb_updater.c.

This allows to update cr50 in the background over both I2C and SPI tpm
interfaces without disrupting trunksd.

The new code prints notices to stdout and errors to stderr, so that
when ran from the command line the progress is visible to the operator.
When run from the script the output will have to be redirected into the
log.

BUG=b:35580805
TEST=verified updates on both gru(SPI) and pyro(I2C)

Change-Id: Id3e89326e7358cf4831a35397a42cd2d680e9a97
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Signed-off-by: Andrey Pronin <apronin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/459702
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
1 file changed