mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-29 18:11:05 +00:00
It is necessary to be able to access Cr50 using usb_updater without stopping trunksd services. This patch adds another option for usb_updater to communicate with Cr50, using the trunks_send command. A new command line option '-t' is added to allow to choose the new interface. When communicating over trunks_send the same processing is used as when communicating over /dev/tpm0, just instead of talking to the hardware device, popen() function is used to run trunks_send --raw command and to gain access to its console output. BRANCH=none BUG=none TEST=ran various commands using the new '-t' option: # ./usb_updater -t /opt/google/cr50/firmware/cr50.bin.prod read 524288(0x80000) bytes from /opt/google/cr50/firmware/cr50.bin.prod start target running protocol version 6 keyids: RO 0xaa66150f, RW 0xb93d6539 offsets: backup RO at 0x40000, backup RW at 0x4000 sending 0x32288 bytes to 0x4000 ------- update complete reboot requested image updated [reboot...] # ./usb_updater -t -f start target running protocol version 6 keyids: RO 0xaa66150f, RW 0xb93d6539 offsets: backup RO at 0x40000, backup RW at 0x4000 Current versions: RO 0.0.10 RW 0.0.23 Change-Id: I9c7481c30c2f6908e0d1ac4f204654d2fd1b3b2e Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/634629 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org>
This directory is for experiments only. It is not built automatically, required, supported, guaranteed to work, or necessarily well-documented. The contents may change without warning at any time.