diff options
author | Mathias Leblanc <mathias.leblanc@st.com> | 2012-11-28 12:22:24 -0500 |
---|---|---|
committer | Kent Yoder <key@linux.vnet.ibm.com> | 2013-02-05 10:38:22 -0500 |
commit | 251a7b08213af82e40e4a70cac056e245853c410 (patch) | |
tree | b4dd531fc063612ee7f3f3235605ffa3b7e6ec12 /drivers/char/tpm/tpm_stm_st33_i2c.h | |
parent | 73249695f0cb10bb9fc8b294f3f8c4b001889e42 (diff) |
TPM: STMicroelectronics ST33 I2C KERNEL 3.x
* STMicroelectronics version 1.2.0, Copyright (C) 2010
* STMicroelectronics comes with ABSOLUTELY NO WARRANTY.
* This is free software, and you are welcome to redistribute it
* under certain conditions.
This is the driver for TPM chip from ST Microelectronics.
If you have a TPM security chip from STMicroelectronics working with
an I2C, in menuconfig or .config choose the tpm driver on
device --> tpm and activate the protocol of your choice before compiling
the kernel.
The driver will be accessible from within Linux.
Tested on linux x86/x64 on kernel 3.x
Signed-off-by: Mathias Leblanc <mathias.leblanc@st.com>
Signed-off-by: Kent Yoder <key@linux.vnet.ibm.com>
Diffstat (limited to 'drivers/char/tpm/tpm_stm_st33_i2c.h')
-rw-r--r-- | drivers/char/tpm/tpm_stm_st33_i2c.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/drivers/char/tpm/tpm_stm_st33_i2c.h b/drivers/char/tpm/tpm_stm_st33_i2c.h new file mode 100644 index 000000000000..d390542db869 --- /dev/null +++ b/drivers/char/tpm/tpm_stm_st33_i2c.h | |||
@@ -0,0 +1,81 @@ | |||
1 | /* | ||
2 | * STMicroelectronics TPM I2C Linux driver for TPM ST33ZP24 | ||
3 | * Copyright (C) 2009, 2010 STMicroelectronics | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License along | ||
16 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
18 | * | ||
19 | * STMicroelectronics version 1.2.0, Copyright (C) 2010 | ||
20 | * STMicroelectronics comes with ABSOLUTELY NO WARRANTY. | ||
21 | * This is free software, and you are welcome to redistribute it | ||
22 | * under certain conditions. | ||
23 | * | ||
24 | * @Author: Christophe RICARD tpmsupport@st.com | ||
25 | * | ||
26 | * @File: stm_st33_tpm_i2c.h | ||
27 | * | ||
28 | * @Date: 09/15/2010 | ||
29 | */ | ||
30 | #ifndef __STM_ST33_TPM_I2C_MAIN_H__ | ||
31 | #define __STM_ST33_TPM_I2C_MAIN_H__ | ||
32 | |||
33 | #include <linux/pci.h> | ||
34 | #include <linux/module.h> | ||
35 | #include <linux/platform_device.h> | ||
36 | #include <linux/i2c.h> | ||
37 | #include <linux/fs.h> | ||
38 | #include <linux/miscdevice.h> | ||
39 | #include <linux/module.h> | ||
40 | #include <linux/kernel.h> | ||
41 | #include <linux/delay.h> | ||
42 | #include <linux/init.h> | ||
43 | #include <linux/wait.h> | ||
44 | #include <linux/string.h> | ||
45 | #include <linux/interrupt.h> | ||
46 | #include <linux/spinlock.h> | ||
47 | #include <linux/sysfs.h> | ||
48 | #include <linux/gpio.h> | ||
49 | #include <linux/sched.h> | ||
50 | #include <linux/uaccess.h> | ||
51 | #include <linux/io.h> | ||
52 | #include <linux/slab.h> | ||
53 | #include <linux/sched.h> | ||
54 | |||
55 | #include "tpm.h" | ||
56 | |||
57 | #define MINOR_NUM_I2C 224 | ||
58 | |||
59 | #define TPM_ACCESS (0x0) | ||
60 | #define TPM_STS (0x18) | ||
61 | #define TPM_HASH_END (0x20) | ||
62 | #define TPM_DATA_FIFO (0x24) | ||
63 | #define TPM_HASH_DATA (0x24) | ||
64 | #define TPM_HASH_START (0x28) | ||
65 | #define TPM_INTF_CAPABILITY (0x14) | ||
66 | #define TPM_INT_STATUS (0x10) | ||
67 | #define TPM_INT_ENABLE (0x08) | ||
68 | |||
69 | #define TPM_DUMMY_BYTE 0xAA | ||
70 | #define TPM_WRITE_DIRECTION 0x80 | ||
71 | #define TPM_HEADER_SIZE 10 | ||
72 | #define TPM_BUFSIZE 2048 | ||
73 | |||
74 | #define LOCALITY0 0 | ||
75 | |||
76 | struct st_tpm_hash { | ||
77 | int size; | ||
78 | u8 *data; | ||
79 | }; | ||
80 | |||
81 | #endif /* __STM_ST33_TPM_I2C_MAIN_H__ */ | ||