Modify cros_write_firmware to control servo when programming Tegra targets

When flashing a Tegra based DUT, cros_write_firmware does not set the
target into a proper state, expecting the operator to run dut-control
to set the target into a programming state and then to take it back to
normal.

Modify the utility to have it issue the required dit-control commands
(the way Exynos flasher does). Also correct the doc string and in case
the servo is used suppress the request to connect the A-A cable and
restart the DUT.

Refactor the code which preserves the dut_hub_sel control state
BUG=none
TEST=manual
  . disconnect the DUT console port on the host and run the following commands

   $ emerge-nyan chromeos-bootimage
   $ emerge-peach_pit chromeos-bootimage
   $ cros_write_firmware -b nyan -d /build/nyan/firmware/dtb/tegra124-venice2.dtb \
           -i /build/nyan/firmware/nv_image-venice2.bin -F spi:1
   $ cros_write_firmware -b peach_pit \
     -d /build/peach_pit/firmware/dtb/exynos5420-peach-pit.dtb \
     -i /build/peach_pit/firmware/image-peach-pit.bin -F spi

  . observe both cros_write_firmware invocations succeed

  . repeat the above firmware write attempts with dut_hub_sel set to
    'dut_sees_servo' and 'dut_sees_hub'. Observe that the control
    state is preserved over the programming session.

Cannot find /iram, using default
Missing properties in /config, using defaults
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>

Change-Id: Iabc5a4e6789a4ff02c5978c3e7b5e0798e87205f
Reviewed-on: https://chromium-review.googlesource.com/175505
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Vadim Bendebury <vbendeb@chromium.org>
1 file changed