Configure servo for A-A mode when programming ARM targets

For proper USB port power distribution when connecting DUT to the host in USB
A-A mode (required for firmware programming), the servo 'dut_hub_sel' control
needs to be set to 'dut_sees_servo'.

Without this state modification programming through servo is not possible, a
separate specially made A-A USB cable is required to connect DUT directly to
the host.

With this change the control's state before programming is retrieved,
then it is modified if necessary, and then restored after programming
is done.

BUG=chromium-os:22475
TEST=manual
  . run the following commands

   $ dut-control dut_hub_sel:dut_sees_servo
   $ cros_write_firmware -b daisy -w usb -d exynos5250-snow -F spi -i /build/daisy/firmware/image-snow.bin -V
   $ dut-control dut_hub_sel
   dut_hub_sel:dut_sees_servo
   $ dut-control dut_hub_sel:dut_sees_hub
   $ cros_write_firmware -b daisy -w usb -d exynos5250-snow -F spi -i /build/daisy/firmware/image-snow.bin -V
   $ dut-control dut_hub_sel
   dut_hub_sel:dut_sees_hub

  observe both programming attempts succeed and the dut_hub_sel control state preserved.

Change-Id: Ib5a2dba1536378b634a24c477a92e06378d35cb4
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42013
1 file changed