blob: d10e3b4f8473b4a428952999bc670439c8d4b3d5 [file] [log] [blame]
Tom Wai-Hong Tam41738762012-10-29 14:32:39 +08001# Copyright (c) 2012 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
5class FAFTDelayConstants(object):
6 """Class that contains the delay constants for FAFT."""
7 version = 1
8
Vic Yangf1fdf712012-10-31 12:09:22 +08009 # Delay between power-on and firmware screen
10 firmware_screen = 10
Tom Wai-Hong Tam56977782012-11-23 16:13:28 +080011 # Delay between power-on and dev screen
12 dev_screen = 7
Vic Yang0dc84b82012-10-31 12:29:39 +080013 # Delay between keypresses in firmware screen
14 confirm_screen = 3
Vic Yangf1fdf712012-10-31 12:09:22 +080015 # Delay between passing firmware screen and text mode warning screen
16 legacy_text_screen = 20
17 # The developer screen timeouts fit our spec
18 dev_screen_timeout = 30
19 # Delay for waiting beep done
20 beep = 1
21 # Delay of loading the USB kernel
22 load_usb = 10
23 # Delay between USB plug-out and plug-in
24 between_usb_plug = 10
25 # Delay after running the 'sync' command
Tom Wai-Hong Tam56977782012-11-23 16:13:28 +080026 sync = 2
Vic Yangf1fdf712012-10-31 12:09:22 +080027 # Delay for waiting client to shutdown
28 shutdown = 30
29 # Delay for waiting client to return before sending EC reboot command
Tom Wai-Hong Tam4c9684a2012-12-11 10:48:05 +080030 ec_reboot_cmd = 1.8
Vic Yangf1fdf712012-10-31 12:09:22 +080031 # Delay between EC boot and ChromeEC console functional
Tom Wai-Hong Tam4c9684a2012-12-11 10:48:05 +080032 ec_boot_to_console = 1.2
Vic Yangf1fdf712012-10-31 12:09:22 +080033 # Delay between EC boot and pressing power button
34 ec_boot_to_pwr_button = 0.5
35 # Delay of EC software sync hash calculating time
36 software_sync = 6
37 # Duration of holding cold_reset to reset device
38 hold_cold_reset = 0.1
39 # devserver startup time
40 devserver = 10
41 # Delay of waiting factory install shim to reset TPM
42 install_shim_done = 120
Gediminas Ramanauskasba352ad2012-11-09 09:43:32 -080043 # Delay for user to power cycle the device
44 user_power_cycle = 20
Tom Wai-Hong Tam41738762012-10-29 14:32:39 +080045
46 def __init__(self, platform=None):
47 """Initialized.
48
49 Args:
50 platform: Optional, platform name returned by FAFT client. If not
51 given, use the default delay values.
52 """
Tom Wai-Hong Tam41738762012-10-29 14:32:39 +080053 if platform:
Vic Yangf1fdf712012-10-31 12:09:22 +080054 self._update_platform_delay(platform)
Tom Wai-Hong Tam41738762012-10-29 14:32:39 +080055
56
Vic Yangf1fdf712012-10-31 12:09:22 +080057 def _update_platform_delay(self, platform):
58 """Set platform dependent delay."""
Tom Wai-Hong Tam41738762012-10-29 14:32:39 +080059
60 # Add the platform-specific delay values here.
61
Vic Yangc79c3712012-10-31 13:37:06 +080062 if platform == 'Link':
63 self.firmware_screen = 7
Tom Wai-Hong Tam56977782012-11-23 16:13:28 +080064 self.dev_screen = 4
Tom Wai-Hong Tam4c9684a2012-12-11 10:48:05 +080065
66 if platform == 'Snow':
67 self.ec_reboot_cmd = 1
68 self.ec_boot_to_console = 0.4