2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 2022 Beckhoff Automation GmbH & Co. KG
5 * Author: Corvin Köhne <c.koehne@beckhoff.com>
12 #include "acpi_device.h"
14 #include "tpm_device.h"
17 #define TPM_INTF_TYPE_FIFO_PTP 0x0
18 #define TPM_INTF_TYPE_CRB 0x1
19 #define TPM_INTF_TYPE_FIFO_TIS 0xF
21 #define TPM_INTF_VERSION_FIFO 0
22 #define TPM_INTF_VERSION_CRB 1
24 #define TPM_INTF_CAP_CRB_DATA_XFER_SIZE_4 0
25 #define TPM_INTF_CAP_CRB_DATA_XFER_SIZE_8 1
26 #define TPM_INTF_CAP_CRB_DATA_XFER_SIZE_32 2
27 #define TPM_INTF_CAP_CRB_DATA_XFER_SIZE_64 3
29 #define TPM_INTF_SELECTOR_FIFO 0
30 #define TPM_INTF_SELECTOR_CRB 1
35 int (*init)(void **sc, struct tpm_emul *emul, void *emul_sc,
36 struct acpi_device *acpi_dev);
37 void (*deinit)(void *sc);
38 int (*build_acpi_table)(void *sc, struct vmctx *vm_ctx);
40 #define TPM_INTF_SET(x) DATA_SET(tpm_intf_set, x)