write_firmware: Work around tegrarcm bug with cold_reset

There's a weird bug with tegrarcm or the miniloader included with it on
our Nyan boards: when you enter recovery mode via cold_reset (instead of
warm_reset), the first invocation will fail at the "retrieving platform
info" stage. Just running it again (without another reset) seems to then
make it work. This patch works around that problem by identifying the
error and retrying tegrarcm. While we normally warm_reset anyway, this
is still important for people trying to flash without Servo, since
there's only a cold_reset button on the mainboard.

TEST=Make sure Nyan can be flashed without a Servo on the first try.

Change-Id: I22c90a863dbc34bf1b190e570731aa77ba310e30
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/177841
Reviewed-by: Simon Glass <sjg@chromium.org>
1 file changed