From 6fd61fa6f17eb06041b0492766d59c67ec4b961d Mon Sep 17 00:00:00 2001 From: Todd Broch Date: Wed, 13 Feb 2013 10:53:22 -0800 Subject: Allow flashing of EC binary from host with multiple servod invocations. Adds argument --port to provide ability to flash from host that has multiple servos running. BRANCH=none BUG=none TEST=manual, ./util/flash_ec --board spring - device connected to servod @ port 9999 is successfully flashed ./util/flash_ec --board spring --port 9902 - device connected to servod @ port 9902 is successfully flashed Signed-off-by: Todd Broch Change-Id: Iecc4b8df51236a1f21be5feca8bb87f5a1d03e97 Reviewed-on: https://gerrit.chromium.org/gerrit/43182 Reviewed-by: Vincent Palatin --- util/flash_ec | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/util/flash_ec b/util/flash_ec index 4031250fd3..192b3efee2 100755 --- a/util/flash_ec +++ b/util/flash_ec @@ -12,10 +12,12 @@ DEFINE_string board "${DEFAULT_BOARD}" \ "The board to run debugger on." DEFINE_string image "" \ "Full pathname of the EC firmware image to flash." -DEFINE_boolean ro "${FLAGS_FALSE}" \ - "Write only the read-only partition" DEFINE_string offset "0" \ "Offset where to program the image from." +DEFINE_integer port 9999 \ + "Port to communicate to servo on." +DEFINE_boolean ro "${FLAGS_FALSE}" \ + "Write only the read-only partition" DEFINE_boolean unprotect "${FLAGS_FALSE}" \ "Clear the protect flag." @@ -76,7 +78,8 @@ function ec_image() { # Find the EC UART on the servo v2 function ec_uart() { SERVOD_FAIL="Cannot communicate with servo. is servod running ?" - (dut-control uart1_pty || die "${SERVOD_FAIL}") | cut -d: -f2 + (dut-control --port=${FLAGS_port} uart1_pty || \ + die "${SERVOD_FAIL}") | cut -d: -f2 } # Servo variables management @@ -85,7 +88,7 @@ SERVO_VARS="uart1_en uart1_parity uart1_baudrate \ jtag_buf_on_flex_en jtag_buf_en spi1_vref" function dut_control() { - dut-control "$1" >/dev/null + dut-control --port=${FLAGS_port} "$1" >/dev/null } function servo_save() { -- cgit v1.2.1