blob: e6463cae97f35b53d117d716cba35915f411aac3 [file] [log] [blame]
Garry Wang11b5e872020-03-11 15:14:08 -07001# Copyright (c) 2020 The Chromium OS Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5
6from autotest_lib.client.common_lib import global_config
7_CONFIG = global_config.global_config
8
9# Names of the host attributes in the database that represent the values for
10# the servo_host and servo_port for a servo connected to the DUT.
11SERVO_HOST_ATTR = 'servo_host'
12SERVO_PORT_ATTR = 'servo_port'
13SERVO_BOARD_ATTR = 'servo_board'
14# Model is inferred from host labels.
15SERVO_MODEL_ATTR = 'servo_model'
16SERVO_SERIAL_ATTR = 'servo_serial'
Garry Wangcb06f3b2020-10-08 20:56:21 -070017# Indicates what type of servo setup, example value: REGULAR or DUAL_V4.
18SERVO_SETUP_ATTR = 'servo_setup'
19SERVO_SETUP_VALUE_DUAL_V4 = 'DUAL_V4'
Otabek Kasimov1b70e8d2020-12-30 13:51:00 -080020SERVO_RECOVERY_MODE = 'servo_recovery'
Garry Wang11b5e872020-03-11 15:14:08 -070021SERVO_ATTR_KEYS = (
22 SERVO_BOARD_ATTR,
23 SERVO_HOST_ATTR,
24 SERVO_PORT_ATTR,
25 SERVO_SERIAL_ATTR,
Garry Wangcb06f3b2020-10-08 20:56:21 -070026 SERVO_SETUP_ATTR,
Garry Wang11b5e872020-03-11 15:14:08 -070027)
28
Garry Wang6a680062020-11-03 13:40:29 -080029# Additional args that will be appended to servod start command.
30ADDITIONAL_SERVOD_ARGS = 'additional_servod_args'
31
Garry Wang11b5e872020-03-11 15:14:08 -070032# Timeout value for stop/start servod process.
33SERVOD_TEARDOWN_TIMEOUT = 3
34SERVOD_QUICK_STARTUP_TIMEOUT = 20
35SERVOD_STARTUP_TIMEOUT = 60
36
Garry Wangb5cee3e2020-09-16 14:58:13 -070037# Prefix of pools that require servod cr50 config.
38CR50_CONFIG_POOL_PREFIX = 'faft-cr50'
39
Garry Wang11b5e872020-03-11 15:14:08 -070040ENABLE_SSH_TUNNEL_FOR_SERVO = _CONFIG.get_config_value(
41 'CROS', 'enable_ssh_tunnel_for_servo', type=bool, default=False)
42
Otabek Kasimove7565282020-04-14 13:26:12 -070043SERVO_TYPE_LABEL_PREFIX = 'servo_type'
Garry Wang11b5e872020-03-11 15:14:08 -070044SERVO_STATE_LABEL_PREFIX = 'servo_state'
Otabek Kasimov646812c2020-06-23 20:01:36 -070045
46# constants to support whole list of states for servo
Garry Wang11b5e872020-03-11 15:14:08 -070047SERVO_STATE_UNKNOWN = 'UNKNOWN'
Otabek Kasimov646812c2020-06-23 20:01:36 -070048SERVO_STATE_MISSING_CONFIG = 'MISSING_CONFIG'
49SERVO_STATE_WRONG_CONFIG = 'WRONG_CONFIG'
50SERVO_STATE_NO_SSH = 'NO_SSH'
51SERVO_STATE_NOT_CONNECTED = 'NOT_CONNECTED'
52SERVO_STATE_NEED_REPLACEMENT = 'NEED_REPLACEMENT'
Otabek Kasimovbb3bc462020-11-03 16:40:33 -080053SERVO_STATE_CR50_CONSOLE_MISSING = 'CR50_CONSOLE_MISSING'
Otabek Kasimov646812c2020-06-23 20:01:36 -070054SERVO_STATE_CCD_TESTLAB_ISSUE = 'CCD_TESTLAB_ISSUE'
55SERVO_STATE_SERVOD_ISSUE = 'SERVOD_ISSUE'
56SERVO_STATE_LID_OPEN_FAILED = 'LID_OPEN_FAILED'
57SERVO_STATE_BAD_RIBBON_CABLE = 'BAD_RIBBON_CABLE'
Otabek Kasimov01bceb32020-10-28 15:40:28 -070058SERVO_STATE_TOPOLOGY_ISSUE = 'TOPOLOGY_ISSUE'
Otabek Kasimov8e88a742021-01-11 18:03:13 -080059SERVO_STATE_SBU_LOW_VOLTAGE = 'SBU_LOW_VOLTAGE'
60SERVO_STATE_CR50_NOT_ENUMERATED = 'CR50_NOT_ENUMERATED'
Otabek Kasimova7eb4dc2020-09-16 10:25:17 -070061SERVO_STATE_DUT_NOT_CONNECTED = 'DUT_NOT_CONNECTED'
Otabek Kasimov646812c2020-06-23 20:01:36 -070062SERVO_STATE_EC_BROKEN = 'EC_BROKEN'
63SERVO_STATE_BROKEN = 'BROKEN'
64SERVO_STATE_WORKING = 'WORKING'
Garry Wangffbd2162020-04-17 16:13:48 -070065
66# constants to support reset servo via smart usbhub.
Garry Wang000c6c02020-05-11 21:27:23 -070067SMART_USBHUB_LABEL = 'smart_usbhub'
Garry Wangffbd2162020-04-17 16:13:48 -070068SERVO_RESET_TIMEOUT_SECONDS = 20
Garry Wangad245002020-05-15 15:20:23 -070069ERROR_MESSAGE_USB_HUB_NOT_COMPATIBLE = ('Be sure the hub is a supported'
70 ' smart hub')
Garry Wangffbd2162020-04-17 16:13:48 -070071# a servo serial number should be fed to this constant
72ERROR_MESSAGE_DEVICE_NOT_FOUND = 'Device with serial \'%s\' not found.'