blob: 9d66f8ca21c3acf6be3104ecfabeca085c58b4f6 [file] [log] [blame]
Vic Yang38d48852012-08-28 10:40:02 +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
Tom Wai-Hong Tam9233ebb2012-09-28 19:37:48 +08005from autotest_lib.server import utils
6
Vic Yang38d48852012-08-28 10:40:02 +08007AUTHOR = "Chrome OS Team"
8NAME = "firmware_ECWriteProtect"
9PURPOSE = "Servo based EC write protect test"
10CRITERIA = "This test will fail if EC write protect misbehaved"
Tom Wai-Hong Tamb6da6c32013-01-24 14:19:20 +080011SUITE = "faft,faft_ec"
Tom Wai-Hong Tamf6367522013-01-23 09:44:56 +080012TIME = "SHORT"
Vic Yang38d48852012-08-28 10:40:02 +080013TEST_CATEGORY = "Functional"
14TEST_CLASS = "firmware"
15TEST_TYPE = "server"
16
17DOC = """
18This test starts with RO normal mode and enables EC write protect. Software sync
19supposed to write protect the entire EC flash, so we expect the following
20write protect flags:
21 - wp_gpio_asserted
22 - ro_at_boot
23 - ro_now
24 - all_now
25These flags are checked under following situations:
26 - Cold reset. RO normal.
27 - Cold reset. Two stop.
28 - Cold reset by ectool. Two stop.
29At the end of the test, write protect is deactivated and firmware is restored to
30RO normal mode.
31"""
32
Tom Wai-Hong Tam9233ebb2012-09-28 19:37:48 +080033args_dict = utils.args_to_dict(args)
Fang Deng0ca40e22013-08-27 17:47:44 -070034servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
Tom Wai-Hong Tam9233ebb2012-09-28 19:37:48 +080035
Vic Yang38d48852012-08-28 10:40:02 +080036def run_ecwriteprotect(machine):
J. Richard Barnette964fba02012-10-24 17:34:29 -070037 host = hosts.create_host(machine, servo_args=servo_args)
Vic Yang38d48852012-08-28 10:40:02 +080038 job.run_test("firmware_ECWriteProtect", host=host, cmdline_args=args,
Tom Wai-Hong Tam54f4c582013-07-18 12:05:27 +080039 disable_sysinfo=True, dev_mode=True, tag="dev")
Vic Yang38d48852012-08-28 10:40:02 +080040
41parallel_simple(run_ecwriteprotect, machines)