blob: 7dee6a5f65fa6c2c54935154b1bcb4643ffa425a [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.client.common_lib import error
from autotest_lib.server.cros.faft.firmware_test import FirmwareTest
class firmware_ECSharedMem(FirmwareTest):
Servo based EC shared memory test.
version = 1
def initialize(self, host, cmdline_args):
super(firmware_ECSharedMem, self).initialize(host, cmdline_args)
# Only run in normal mode
self.switcher.setup_mode('normal')"chan 0")
def cleanup(self):"chan 0xffffffff")
super(firmware_ECSharedMem, self).cleanup()
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():
raise error.TestNAError("Nothing needs to be tested on this device")"Check shared memory in normal operation and crash EC.")
'custom','crash unaligned'))"Check shared memory after crash and system jump.")
self.check_state([self.shared_mem_checker, self.jump_checker])
self.switcher.mode_aware_reboot('custom', self.sync_and_ec_reboot)