cros_bundle_firmware: Allow setting the write method from cmdline
Add a -M option to set the method used for writing to the board. This
can be 'tegra' or 'exynos' at present. Normally it is in the fdt, but
for upstream U-Boot it is not.
BUG=chromium-os:36112
TEST=manual
Use '-M exynos' and see that it writes an upstream U-Boot to the exynos
board. It does not actually boot on snow due to memory init problems.
Change-Id: I55a9cf47a181293d78453eb6184547343b0f8295
Reviewed-on: https://gerrit.chromium.org/gerrit/37458
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Commit-Ready: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
diff --git a/host/lib/write_firmware.py b/host/lib/write_firmware.py
index 158bd77..2751be7 100644
--- a/host/lib/write_firmware.py
+++ b/host/lib/write_firmware.py
@@ -665,7 +665,8 @@
def DoWriteFirmware(output, tools, fdt, flasher, file_list, image_fname,
bundle, update=True, verify=False, dest=None,
- flash_dest=None, kernel=None, props={}, servo='any'):
+ flash_dest=None, kernel=None, props={}, servo='any',
+ method='tegra'):
"""A simple function to write firmware to a device.
This creates a WriteFirmware object and uses it to write the firmware image
@@ -693,7 +694,7 @@
write.update = update
write.verify = verify
if dest == 'usb':
- method = fdt.GetString('/chromeos-config', 'flash-method', 'tegra')
+ method = fdt.GetString('/chromeos-config', 'flash-method', method)
if method == 'tegra':
tools.CheckTool('tegrarcm')
bootstub = props.get('bootstub')