blob: b912ab4fe9601c982cc6cf9ba9f53f3d2ef2cecb [file] [log] [blame]
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import time
from autotest_lib.server.cros.faftsequence import FAFTSequence
class firmware_ECSharedMem(FAFTSequence):
Servo based EC shared memory test.
version = 1
def setup(self):
super(firmware_ECSharedMem, self).setup()
# Only run in normal mode
def shared_mem_checker(self):
match ="shmem",
shmem_size = int(match[1])"EC shared memory size if %d bytes", shmem_size)
if shmem_size <= 0:
return False
elif shmem_size <= 256:
logging.warning("EC shared memory is less than 256 bytes")
return True
def jump_checker(self):"sysjump RW")
return self.shared_mem_checker()
def run_once(self):
if not self.check_ec_capability():
{ # Step 1, check shared memory in normal operation and crash EC
'state_checker': self.shared_mem_checker,
'reboot_action': (, "crash unaligned")
{ # Step 2, Check shared memory after crash and system jump
'state_checker': [self.shared_mem_checker, self.jump_checker],
'reboot_action': self.sync_and_ec_reboot,
{ # Step 3, dummy step to make step 2 reboot so as to clean EC
# state.