aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/tpm/tpm_crb.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/tpm/tpm_crb.c b/hw/tpm/tpm_crb.c
index e8c42f6e3d..ef8b80e9aa 100644
--- a/hw/tpm/tpm_crb.c
+++ b/hw/tpm/tpm_crb.c
@@ -84,6 +84,12 @@ static uint64_t tpm_crb_mmio_read(void *opaque, hwaddr addr,
unsigned offset = addr & 3;
uint32_t val = *(uint32_t *)regs >> (8 * offset);
+ switch (addr) {
+ case A_CRB_LOC_STATE:
+ val |= !tpm_backend_get_tpm_established_flag(s->tpmbe);
+ break;
+ }
+
trace_tpm_crb_mmio_read(addr, size, val);
return val;