linux/drivers/char/tpm/tpm_tis_core.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (C) 2005, 2006 IBM Corporation
 * Copyright (C) 2014, 2015 Intel Corporation
 *
 * Authors:
 * Leendert van Doorn <[email protected]>
 * Kylene Hall <[email protected]>
 *
 * Maintained by: <[email protected]>
 *
 * Device driver for TCG/TCPA TPM (trusted platform module).
 * Specifications at www.trustedcomputinggroup.org
 *
 * This device driver implements the TPM interface as defined in
 * the TCG TPM Interface Spec version 1.2, revision 1.0.
 */

#ifndef __TPM_TIS_CORE_H__
#define __TPM_TIS_CORE_H__

#include "tpm.h"

enum tis_access {};

enum tis_status {};

enum tis_int_flags {};

enum tis_defaults {};

/* Some timeout values are needed before it is known whether the chip is
 * TPM 1.0 or TPM 2.0.
 */
#define TIS_TIMEOUT_A_MAX
#define TIS_TIMEOUT_B_MAX
#define TIS_TIMEOUT_C_MAX
#define TIS_TIMEOUT_D_MAX

#define TPM_ACCESS(l)
#define TPM_INT_ENABLE(l)
#define TPM_INT_VECTOR(l)
#define TPM_INT_STATUS(l)
#define TPM_INTF_CAPS(l)
#define TPM_STS(l)
#define TPM_STS3(l)
#define TPM_DATA_FIFO(l)

#define TPM_DID_VID(l)
#define TPM_RID(l)

#define LPC_CNTRL_OFFSET
#define LPC_CLKRUN_EN
#define INTEL_LEGACY_BLK_BASE_ADDR
#define ILB_REMAP_SIZE

enum tpm_tis_flags {};

struct tpm_tis_data {};

/*
 * IO modes to indicate how many bytes should be read/written at once in the
 * tpm_tis_phy_ops read_bytes/write_bytes calls. Use TPM_TIS_PHYS_8 to
 * receive/transmit byte-wise, TPM_TIS_PHYS_16 for two bytes etc.
 */
enum tpm_tis_io_mode {};

struct tpm_tis_phy_ops {};

static inline int tpm_tis_read_bytes(struct tpm_tis_data *data, u32 addr,
				     u16 len, u8 *result)
{}

static inline int tpm_tis_read8(struct tpm_tis_data *data, u32 addr, u8 *result)
{}

static inline int tpm_tis_read16(struct tpm_tis_data *data, u32 addr,
				 u16 *result)
{}

static inline int tpm_tis_read32(struct tpm_tis_data *data, u32 addr,
				 u32 *result)
{}

static inline int tpm_tis_write_bytes(struct tpm_tis_data *data, u32 addr,
				      u16 len, const u8 *value)
{}

static inline int tpm_tis_write8(struct tpm_tis_data *data, u32 addr, u8 value)
{}

static inline int tpm_tis_write32(struct tpm_tis_data *data, u32 addr,
				  u32 value)
{}

static inline int tpm_tis_verify_crc(struct tpm_tis_data *data, size_t len,
				     const u8 *value)
{}

static inline bool is_bsw(void)
{}

void tpm_tis_remove(struct tpm_chip *chip);
int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
		      const struct tpm_tis_phy_ops *phy_ops,
		      acpi_handle acpi_dev_handle);

#ifdef CONFIG_PM_SLEEP
int tpm_tis_resume(struct device *dev);
#endif

#endif