Vic Yang | 38d4885 | 2012-08-28 10:40:02 +0800 | [diff] [blame] | 1 | # 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 Tam | 9233ebb | 2012-09-28 19:37:48 +0800 | [diff] [blame] | 5 | from autotest_lib.server import utils |
| 6 | |
Vic Yang | 38d4885 | 2012-08-28 10:40:02 +0800 | [diff] [blame] | 7 | AUTHOR = "Chrome OS Team" |
| 8 | NAME = "firmware_ECWriteProtect" |
| 9 | PURPOSE = "Servo based EC write protect test" |
| 10 | CRITERIA = "This test will fail if EC write protect misbehaved" |
Tom Wai-Hong Tam | b6da6c3 | 2013-01-24 14:19:20 +0800 | [diff] [blame] | 11 | SUITE = "faft,faft_ec" |
Tom Wai-Hong Tam | f636752 | 2013-01-23 09:44:56 +0800 | [diff] [blame] | 12 | TIME = "SHORT" |
Vic Yang | 38d4885 | 2012-08-28 10:40:02 +0800 | [diff] [blame] | 13 | TEST_CATEGORY = "Functional" |
| 14 | TEST_CLASS = "firmware" |
| 15 | TEST_TYPE = "server" |
| 16 | |
| 17 | DOC = """ |
| 18 | This test starts with RO normal mode and enables EC write protect. Software sync |
| 19 | supposed to write protect the entire EC flash, so we expect the following |
| 20 | write protect flags: |
| 21 | - wp_gpio_asserted |
| 22 | - ro_at_boot |
| 23 | - ro_now |
| 24 | - all_now |
| 25 | These flags are checked under following situations: |
| 26 | - Cold reset. RO normal. |
| 27 | - Cold reset. Two stop. |
| 28 | - Cold reset by ectool. Two stop. |
| 29 | At the end of the test, write protect is deactivated and firmware is restored to |
| 30 | RO normal mode. |
| 31 | """ |
| 32 | |
Tom Wai-Hong Tam | 9233ebb | 2012-09-28 19:37:48 +0800 | [diff] [blame] | 33 | args_dict = utils.args_to_dict(args) |
Fang Deng | 0ca40e2 | 2013-08-27 17:47:44 -0700 | [diff] [blame^] | 34 | servo_args = hosts.CrosHost.get_servo_arguments(args_dict) |
Tom Wai-Hong Tam | 9233ebb | 2012-09-28 19:37:48 +0800 | [diff] [blame] | 35 | |
Vic Yang | 38d4885 | 2012-08-28 10:40:02 +0800 | [diff] [blame] | 36 | def run_ecwriteprotect(machine): |
J. Richard Barnette | 964fba0 | 2012-10-24 17:34:29 -0700 | [diff] [blame] | 37 | host = hosts.create_host(machine, servo_args=servo_args) |
Vic Yang | 38d4885 | 2012-08-28 10:40:02 +0800 | [diff] [blame] | 38 | job.run_test("firmware_ECWriteProtect", host=host, cmdline_args=args, |
Tom Wai-Hong Tam | 54f4c58 | 2013-07-18 12:05:27 +0800 | [diff] [blame] | 39 | disable_sysinfo=True, dev_mode=True, tag="dev") |
Vic Yang | 38d4885 | 2012-08-28 10:40:02 +0800 | [diff] [blame] | 40 | |
| 41 | parallel_simple(run_ecwriteprotect, machines) |