hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/char/tpm/tpm_tis_core.h
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright (C) 2005, 2006 IBM Corporation
34 * Copyright (C) 2014, 2015 Intel Corporation
....@@ -13,11 +14,6 @@
1314 *
1415 * This device driver implements the TPM interface as defined in
1516 * the TCG TPM Interface Spec version 1.2, revision 1.0.
16
- *
17
- * This program is free software; you can redistribute it and/or
18
- * modify it under the terms of the GNU General Public License as
19
- * published by the Free Software Foundation, version 2 of the
20
- * License.
2117 */
2218
2319 #ifndef __TPM_TIS_CORE_H__
....@@ -38,6 +34,7 @@
3834 TPM_STS_GO = 0x20,
3935 TPM_STS_DATA_AVAIL = 0x10,
4036 TPM_STS_DATA_EXPECT = 0x08,
37
+ TPM_STS_READ_ZERO = 0x23, /* bits that must be zero on read */
4138 };
4239
4340 enum tis_int_flags {
....@@ -57,6 +54,8 @@
5754 TIS_MEM_LEN = 0x5000,
5855 TIS_SHORT_TIMEOUT = 750, /* ms */
5956 TIS_LONG_TIMEOUT = 2000, /* 2 sec */
57
+ TIS_TIMEOUT_MIN_ATML = 14700, /* usecs */
58
+ TIS_TIMEOUT_MAX_ATML = 15000, /* usecs */
6059 };
6160
6261 /* Some timeout values are needed before it is known whether the chip is
....@@ -86,6 +85,7 @@
8685
8786 enum tpm_tis_flags {
8887 TPM_TIS_ITPM_WORKAROUND = BIT(0),
88
+ TPM_TIS_INVALID_STATUS = BIT(1),
8989 };
9090
9191 struct tpm_tis_data {
....@@ -93,13 +93,15 @@
9393 int locality;
9494 int irq;
9595 bool irq_tested;
96
- unsigned int flags;
96
+ unsigned long flags;
9797 void __iomem *ilb_base_addr;
9898 u16 clkrun_enabled;
9999 wait_queue_head_t int_queue;
100100 wait_queue_head_t read_queue;
101101 const struct tpm_tis_phy_ops *phy_ops;
102102 unsigned short rng_quality;
103
+ unsigned int timeout_min; /* usecs */
104
+ unsigned int timeout_max; /* usecs */
103105 };
104106
105107 struct tpm_tis_phy_ops {