diff options
author | Gurleen Grewal <gurleengrewal@chromium.org> | 2019-09-13 17:42:48 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-09-18 02:20:21 +0000 |
commit | ad20ea449951e49ecd991ade3a8f3f5a3fd7a227 (patch) | |
tree | e78c2009dd56e817b4a4cade7b57cf5ecd530a31 /test | |
parent | 73f6dc7cc71d98789f96f38fc8b636d78ba1e9b4 (diff) | |
download | chrome-ec-ad20ea449951e49ecd991ade3a8f3f5a3fd7a227.tar.gz |
tpmtest: Make it work with current cr50
A couple of changes are needed to make tpmtests run with the
latest cr50:
1. The CRYPTO_TESTS flag turns off the TPM in cr50 build, so
no need to initalize TPM.
2. FW_UPGRADE protocol now uses offset into flash instead of
absolute memory addresses to perform upgrade.
BUG=None
TEST=test/tpm_test/tpmtest.py runs and all tests pass
Change-Id: I2402ba956e4588a7452128e75fbc82c44f8cf04f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1804068
Tested-by: Gurleen Grewal <gurleengrewal@google.com>
Commit-Queue: Gurleen Grewal <gurleengrewal@chromium.org>
Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'test')
-rwxr-xr-x | test/tpm_test/tpmtest.py | 4 | ||||
-rw-r--r-- | test/tpm_test/upgrade_test.py | 4 |
2 files changed, 2 insertions, 6 deletions
diff --git a/test/tpm_test/tpmtest.py b/test/tpm_test/tpmtest.py index a774e4913e..2f915a09d9 100755 --- a/test/tpm_test/tpmtest.py +++ b/test/tpm_test/tpmtest.py @@ -55,10 +55,6 @@ class TPM(object): self._handle = ftdi_spi_tpm if not self._handle.FtdiSpiInit(freq, debug_mode): raise subcmd.TpmTestError('Failed to connect') - response = self.command(''.join('%c' % int('0x%s' % x, 16) - for x in self.STARTUP_CMD.split())) - if ' '.join('%2.2x' % ord(x) for x in response) not in self.STARTUP_RSP: - raise subcmd.TpmTestError('init failed') def validate(self, data_blob, response_mode=False): """Check if a data blob complies with TPM command/response header format.""" diff --git a/test/tpm_test/upgrade_test.py b/test/tpm_test/upgrade_test.py index 2d2c0b7169..69e8630358 100644 --- a/test/tpm_test/upgrade_test.py +++ b/test/tpm_test/upgrade_test.py @@ -37,9 +37,9 @@ def upgrade(tpm): raise subcmd.TpmTestError('Initialization error %d' % ord(base_str[0])) base = struct.unpack_from('>4I', base_str)[3] - if base == 0x84000: + if base == 0x44000: fname = 'build/cr50/RW/ec.RW_B.flat' - elif base == 0x44000: + elif base == 0x4000: fname = 'build/cr50/RW/ec.RW.flat' else: raise subcmd.TpmTestError('Unknown base address 0x%x' % base) |