tegra: Move pinmux enum constants from tegra/pinmux.h to soc-specific pinmux.h
[coreboot.git] / src / include / tpm.h
blob9b4db4ab8dbcc7e9d423d6729d50ce29b93b86f7
1 /*
2 * This file is part of the coreboot project.
4 * Copyright 2011 Google Inc.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
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.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc.
20 #ifndef TPM_H_
21 #define TPM_H_
23 #include <stddef.h>
24 #include <stdint.h>
27 * tis_init()
29 * Initialize the TPM device. Returns 0 on success or -1 on
30 * failure (in case device probing did not succeed).
32 int tis_init(void);
35 * tis_open()
37 * Requests access to locality 0 for the caller. After all commands have been
38 * completed the caller is supposed to call tis_close().
40 * Returns 0 on success, -1 on failure.
42 int tis_open(void);
45 * tis_close()
47 * terminate the currect session with the TPM by releasing the locked
48 * locality. Returns 0 on success of -1 on failure (in case lock
49 * removal did not succeed).
51 int tis_close(void);
54 * tis_sendrecv()
56 * Send the requested data to the TPM and then try to get its response
58 * @sendbuf - buffer of the data to send
59 * @send_size size of the data to send
60 * @recvbuf - memory to save the response to
61 * @recv_len - pointer to the size of the response buffer
63 * Returns 0 on success (and places the number of response bytes at recv_len)
64 * or -1 on failure.
66 int tis_sendrecv(const u8 *sendbuf, size_t send_size, u8 *recvbuf,
67 size_t *recv_len);
69 void init_tpm(int s3resume);
71 #endif /* TPM_H_ */