cros_write_firmware: Extract FDT from image automatically

It is a pain to have to specify the board and FDT when writing an image.
Extract the FDT from the image instead, while still allowing an override
if required.

BUG=chromium:245311
BRANCH=none
TEST=manual
Using any image build from ToT, this command should flash it over USB:

$ cros_write_firmware /path/to/image.bin -F spi

For x86, this command should write it to em100:

$ cros_write_firmware /path/to/image.bin

Tested on pit and link.

Change-Id: I6fedec0ee6a6f877f72abe963b4b92bff82345eb
Signed-off-by: Simon Glass <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/66922
Reviewed-by: Julius Werner <[email protected]>
Reviewed-by: Randall Spangler <[email protected]>
3 files changed