aboutsummaryrefslogtreecommitdiff
path: root/hw/tpm/tpm_crb.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-03-08 12:56:39 +0000
committerPeter Maydell <peter.maydell@linaro.org>2018-03-08 12:56:39 +0000
commit0ab4537f08e09b13788db67efd760592fb7db769 (patch)
tree0fd47e86cb4ef9c9147f6beaf731bb3764985f18 /hw/tpm/tpm_crb.c
parent3ef91576b96de7051dacc2132cddfb486b46e863 (diff)
parentfcbed221ff7230c6a5ebfb2ed27dc114ff5a30b0 (diff)
Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2018-03-07-1' into staging
Merge tpm 2018/03/07 # gpg: Signature made Wed 07 Mar 2018 12:42:13 GMT # gpg: using RSA key 75AD65802A0B4211 # gpg: Good signature from "Stefan Berger <stefanb@linux.vnet.ibm.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: B818 B9CA DF90 89C2 D5CE C66B 75AD 6580 2A0B 4211 * remotes/stefanberger/tags/pull-tpm-2018-03-07-1: tpm: convert tpm_tis.c to use trace-events tpm: convert tpm_emulator.c to use trace-events tpm: convert tpm_util.c to use trace-events tpm: convert tpm_passthrough.c to use trace-events tpm: convert tpm_crb.c to use trace-events Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/tpm/tpm_crb.c')
-rw-r--r--hw/tpm/tpm_crb.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/hw/tpm/tpm_crb.c b/hw/tpm/tpm_crb.c
index b5b8256360..d8917cb101 100644
--- a/hw/tpm/tpm_crb.c
+++ b/hw/tpm/tpm_crb.c
@@ -29,6 +29,7 @@
#include "sysemu/reset.h"
#include "tpm_int.h"
#include "tpm_util.h"
+#include "trace.h"
typedef struct CRBState {
DeviceState parent_obj;
@@ -44,14 +45,6 @@ typedef struct CRBState {
#define CRB(obj) OBJECT_CHECK(CRBState, (obj), TYPE_TPM_CRB)
-#define DEBUG_CRB 0
-
-#define DPRINTF(fmt, ...) do { \
- if (DEBUG_CRB) { \
- printf(fmt, ## __VA_ARGS__); \
- } \
- } while (0)
-
#define CRB_INTF_TYPE_CRB_ACTIVE 0b1
#define CRB_INTF_VERSION_CRB 0b1
#define CRB_INTF_CAP_LOCALITY_0_ONLY 0b0
@@ -91,8 +84,8 @@ static uint64_t tpm_crb_mmio_read(void *opaque, hwaddr addr,
unsigned offset = addr & 3;
uint32_t val = *(uint32_t *)regs >> (8 * offset);
- DPRINTF("CRB read 0x" TARGET_FMT_plx " len:%u val: 0x%" PRIx32 "\n",
- addr, size, val);
+ trace_tpm_crb_mmio_read(addr, size, val);
+
return val;
}
@@ -100,8 +93,8 @@ static void tpm_crb_mmio_write(void *opaque, hwaddr addr,
uint64_t val, unsigned size)
{
CRBState *s = CRB(opaque);
- DPRINTF("CRB write 0x" TARGET_FMT_plx " len:%u val: 0x%" PRIx64 "\n",
- addr, size, val);
+
+ trace_tpm_crb_mmio_write(addr, size, val);
switch (addr) {
case A_CRB_CTRL_REQ: