summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2016-09-21 16:58:26 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-09-24 16:22:14 -0700
commit4250da3ba977fd6bfb80b1bf6086cd142c461e5a (patch)
tree486186f63516d68ef1f7738523a640727fb306b7 /core
parente29005abe7497988e14e0ef87f602a5417d003e6 (diff)
downloadchrome-ec-4250da3ba977fd6bfb80b1bf6086cd142c461e5a.tar.gz
Cr50: Add mostly-synchronous tpm_reset() function.
To reset the TPM task, we send it an event so that it will reset only when it's not busy doing actual TPM stuff that might fiddle with the stack or shared memory. But that means that we can't always know when the task finally gets around to resetting itself. This CL adds a tpm_reset() function that blocks until the reset actually occurs. Obviously it can't do that if it's being called in interrupt context or from the TPM task itself, but otherwise it does. BUG=chrome-os-partner:52366 BRANCH=none CQ-DEPEND=CL:361680 TEST=make buildall, test on Gru, manual tests In addition to the normal rebooting, logging in/out, and so forth. I added a temporary console command to call tpm_reset() and scattered a bunch of ccprintfs around it. When called due to SYS_RST_L, it didn't block. When invoked with the console command, it did. Change-Id: I51e8b1299dbdcd1a12273cf48a890e93ed32a8c8 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/388125 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/cortex-m/ec.lds.S10
1 files changed, 9 insertions, 1 deletions
diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S
index 5b756cec58..9e791f0380 100644
--- a/core/cortex-m/ec.lds.S
+++ b/core/cortex-m/ec.lds.S
@@ -300,7 +300,15 @@ SECTIONS
STRINGIFY(OUTDIR/common/tpm_registers.o*)(.data)
__data_libtpm2_end = .;
- *(.data)
+ /*
+ * TPM reset currently only clears BSS for the TPM library. It does
+ * not reset any initialized variables in data. So, make sure there
+ * aren't any.
+ */
+ ASSERT(__data_libtpm2_start == __data_libtpm2_end,
+ "libtpm2 .data section is nonzero");
+
+ *(.data*)
#ifdef CONFIG_MPU
/* It has to be aligned by 32 bytes to be a valid MPU region. */
. = ALIGN(32);