diff options
-rw-r--r-- | futility/updater_utils.c | 6 | ||||
-rw-r--r-- | futility/updater_utils.h | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/futility/updater_utils.c b/futility/updater_utils.c index 238a7bc4..50a33267 100644 --- a/futility/updater_utils.c +++ b/futility/updater_utils.c @@ -459,6 +459,7 @@ static int host_get_platform_version(void) char *host_detect_servo(int *need_prepare_ptr) { const char *servo_port = getenv(ENV_SERVOD_PORT); + const char *servo_name = getenv(ENV_SERVOD_NAME); char *servo_type = host_shell("dut-control -o servo_type 2>/dev/null"); const char *programmer = NULL; char *ret = NULL; @@ -466,10 +467,11 @@ char *host_detect_servo(int *need_prepare_ptr) char *servo_serial = NULL; /* Get serial name if servo port is provided. */ - if (servo_port && *servo_port) { + if ((servo_port && *servo_port) || (servo_name && *servo_name)) { const char *cmd = "dut-control -o serialname 2>/dev/null"; - VB2_DEBUG("Select servod using port: %s\n", servo_port); + VB2_DEBUG("Select servod using port: %s or name: %s\n", + servo_port, servo_name); if (strstr(servo_type, "with_servo_micro")) cmd = ("dut-control -o servo_micro_serialname" " 2>/dev/null"); diff --git a/futility/updater_utils.h b/futility/updater_utils.h index ca6771e5..2ab6f071 100644 --- a/futility/updater_utils.h +++ b/futility/updater_utils.h @@ -180,6 +180,9 @@ enum wp_state flashrom_get_wp(const char *programmer); /* The environment variable name for setting servod port. */ #define ENV_SERVOD_PORT "SERVOD_PORT" +/* The environment variable name for setting servod name. */ +#define ENV_SERVOD_NAME "SERVOD_NAME" + /* * Helper function to detect type of Servo board attached to host. * Returns a string as programmer parameter on success, otherwise NULL. |