trunks_send: request posted reset when required

The trunks_send utility can now send a new firmware image to the cr50.

Cr50 devices running RW version 19 and above will be properly
restarted on system reboots by the AP firmware, which would send the
cr50 a command to activate the new firmware, if present.

The pre version 19 cr50 images would just ignore this command, so a
different means of rebooting into the newer version is required.

With this patch trunks_send is sending the posted reset request to the
cr50 if the currently running cr50 RW version is below 19, which makes
sure that the new RW cr50 version is activated on the next TPM reset.

BUG=b:35580805
TEST=verified that in case the update happens on a cr50 running
      version 18 or below, the post reset request is sent.

Change-Id: Ib5a4b1518e344f2bafb1b4385409affc3f7ffea9
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/497518
1 file changed