coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
tpm.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 
3 #ifndef __COREBOOT_SRC_DRIVERS_SPI_TPM_TPM_H
4 #define __COREBOOT_SRC_DRIVERS_SPI_TPM_TPM_H
5 
6 #include <drivers/tpm/cr50.h>
7 #include <stddef.h>
8 #include <spi-generic.h>
9 
10 #define TPM_LOCALITY_0_SPI_BASE 0x00d40000
11 
12 /*
13  * A tpm device descriptor, values read from the appropriate device regisrers
14  * are cached here.
15  */
16 struct tpm2_info {
20 };
21 
22 /*
23  * Initialize a TPM2 device: read its id, claim locality of zero, verify that
24  * this indeed is a TPM2 device. Use the passed in handle to access the right
25  * SPI port.
26  *
27  * Return 0 on success, non-zero on failure.
28  */
29 int tpm2_init(struct spi_slave *spi_if);
30 
31 /*
32  * Each command processing consists of sending the command to the TPM, by
33  * writing it into the FIFO register, then polling the status register until
34  * the TPM is ready to respond, then reading the response from the FIFO
35  * regitster. The size of the response can be gleaned from the 6 byte header.
36  *
37  * This function places the response into the tpm2_response buffer and returns
38  * the size of the response.
39  */
40 size_t tpm2_process_command(const void *tpm2_command, size_t command_size,
41  void *tpm2_response, size_t max_response);
42 
43 /* Get information about previously initialized TPM device. */
44 void tpm2_get_info(struct tpm2_info *info);
45 
46 #endif /* ! __COREBOOT_SRC_DRIVERS_SPI_TPM_TPM_H */
int tpm2_init(void)
Definition: tpm.c:175
size_t tpm2_process_command(const void *tpm2_command, size_t command_size, void *tpm2_response, size_t max_response)
Definition: tpm.c:195
void tpm2_get_info(struct tpm2_info *tpm2_info)
Definition: tpm.c:266
static struct smmstore_params_info info
Definition: ramstage.c:12
unsigned short uint16_t
Definition: stdint.h:11
Definition: tpm.h:54
uint16_t device_id
Definition: tpm.h:56
uint16_t revision
Definition: tpm.h:57
uint16_t vendor_id
Definition: tpm.h:55