summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGurleen Grewal <gurleengrewal@chromium.org>2019-09-13 17:42:48 -0700
committerCommit Bot <commit-bot@chromium.org>2020-08-11 23:38:24 +0000
commitee731638933c0bd34dd4815347e570efe8084b3f (patch)
treee9a9c07a055da5eaa5813fa974311090d35348ee
parentf99b0ad12f4017f2ee3f6079193a5ceb569057fd (diff)
downloadchrome-ec-ee731638933c0bd34dd4815347e570efe8084b3f.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> (cherry picked from commit ad20ea449951e49ecd991ade3a8f3f5a3fd7a227) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2314107 Tested-by: Mary Ruthven <mruthven@chromium.org> Reviewed-by: Mary Ruthven <mruthven@chromium.org> Commit-Queue: Mary Ruthven <mruthven@chromium.org> (cherry picked from commit d350696c949360a5297a589644d2a6d05e2dc6c4) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2350269
-rwxr-xr-xtest/tpm_test/tpmtest.py4
-rw-r--r--test/tpm_test/upgrade_test.py4
2 files changed, 2 insertions, 6 deletions
diff --git a/test/tpm_test/tpmtest.py b/test/tpm_test/tpmtest.py
index a838ce53ad..5e981243b9 100755
--- a/test/tpm_test/tpmtest.py
+++ b/test/tpm_test/tpmtest.py
@@ -58,10 +58,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)