coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
tpm.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  tpm2_info
 

Macros

#define TPM_CRB_BASE_ADDRESS   CONFIG_CRB_TPM_BASE_ADDRESS
 
#define CRB_REG(LOCTY, REG)    (void *)(uintptr_t)(CONFIG_CRB_TPM_BASE_ADDRESS + (LOCTY << 12) + REG)
 
#define CRB_REG_LOC_STATE   0x00
 
#define CRB_REG_LOC_CTRL   0x08
 
#define CRB_REG_LOC_STS   0x0C
 
#define LOC_CTRL_REQ_ACCESS   0x01
 
#define LOC_STATE_LOC_ASSIGN   0x02
 
#define LOC_STATE_REG_VALID_STS   0x80
 
#define LOC_STS_GRANTED   0x01
 
#define CRB_REG_INTF_ID   0x30
 
#define CRB_REG_REQUEST   0x40
 
#define CRB_REG_STATUS   0x44
 
#define CRB_REG_CANCEL   0x48
 
#define CRB_REG_START   0x4C
 
#define CRB_REG_INT_CTRL   0x50
 
#define CRB_REG_CMD_SIZE   0x58
 
#define CRB_REG_CMD_ADDR   0x5C
 
#define CRB_REG_RESP_SIZE   0x64
 
#define CRB_REG_RESP_ADDR   0x68
 
#define CRB_INTF_REG_CAP_CRB   (1<<14)
 
#define CRB_INTF_REG_INTF_SEL   (1<<17)
 
#define CRB_INTF_REG_INTF_LOCK   (1<<19)
 
#define CRB_REG_REQUEST_CMD_RDY   0x01
 
#define CRB_REG_REQUEST_GO_IDLE   0x02
 
#define CRB_REG_STATUS_ERROR   0x01
 
#define CRB_REG_STATUS_IDLE   0x02
 
#define CRB_REG_START_START   0x01
 

Functions

int tpm2_init (void)
 
void tpm2_get_info (struct tpm2_info *tpm2_info)
 
size_t tpm2_process_command (const void *tpm2_command, size_t command_size, void *tpm2_response, size_t max_response)
 

Macro Definition Documentation

◆ CRB_INTF_REG_CAP_CRB

#define CRB_INTF_REG_CAP_CRB   (1<<14)

Definition at line 38 of file tpm.h.

◆ CRB_INTF_REG_INTF_LOCK

#define CRB_INTF_REG_INTF_LOCK   (1<<19)

Definition at line 40 of file tpm.h.

◆ CRB_INTF_REG_INTF_SEL

#define CRB_INTF_REG_INTF_SEL   (1<<17)

Definition at line 39 of file tpm.h.

◆ CRB_REG

#define CRB_REG (   LOCTY,
  REG 
)     (void *)(uintptr_t)(CONFIG_CRB_TPM_BASE_ADDRESS + (LOCTY << 12) + REG)

Definition at line 8 of file tpm.h.

◆ CRB_REG_CANCEL

#define CRB_REG_CANCEL   0x48

Definition at line 29 of file tpm.h.

◆ CRB_REG_CMD_ADDR

#define CRB_REG_CMD_ADDR   0x5C

Definition at line 33 of file tpm.h.

◆ CRB_REG_CMD_SIZE

#define CRB_REG_CMD_SIZE   0x58

Definition at line 32 of file tpm.h.

◆ CRB_REG_INT_CTRL

#define CRB_REG_INT_CTRL   0x50

Definition at line 31 of file tpm.h.

◆ CRB_REG_INTF_ID

#define CRB_REG_INTF_ID   0x30

Definition at line 26 of file tpm.h.

◆ CRB_REG_LOC_CTRL

#define CRB_REG_LOC_CTRL   0x08

Definition at line 13 of file tpm.h.

◆ CRB_REG_LOC_STATE

#define CRB_REG_LOC_STATE   0x00

Definition at line 12 of file tpm.h.

◆ CRB_REG_LOC_STS

#define CRB_REG_LOC_STS   0x0C

Definition at line 14 of file tpm.h.

◆ CRB_REG_REQUEST

#define CRB_REG_REQUEST   0x40

Definition at line 27 of file tpm.h.

◆ CRB_REG_REQUEST_CMD_RDY

#define CRB_REG_REQUEST_CMD_RDY   0x01

Definition at line 43 of file tpm.h.

◆ CRB_REG_REQUEST_GO_IDLE

#define CRB_REG_REQUEST_GO_IDLE   0x02

Definition at line 44 of file tpm.h.

◆ CRB_REG_RESP_ADDR

#define CRB_REG_RESP_ADDR   0x68

Definition at line 35 of file tpm.h.

◆ CRB_REG_RESP_SIZE

#define CRB_REG_RESP_SIZE   0x64

Definition at line 34 of file tpm.h.

◆ CRB_REG_START

#define CRB_REG_START   0x4C

Definition at line 30 of file tpm.h.

◆ CRB_REG_START_START

#define CRB_REG_START_START   0x01

Definition at line 51 of file tpm.h.

◆ CRB_REG_STATUS

#define CRB_REG_STATUS   0x44

Definition at line 28 of file tpm.h.

◆ CRB_REG_STATUS_ERROR

#define CRB_REG_STATUS_ERROR   0x01

Definition at line 47 of file tpm.h.

◆ CRB_REG_STATUS_IDLE

#define CRB_REG_STATUS_IDLE   0x02

Definition at line 48 of file tpm.h.

◆ LOC_CTRL_REQ_ACCESS

#define LOC_CTRL_REQ_ACCESS   0x01

Definition at line 17 of file tpm.h.

◆ LOC_STATE_LOC_ASSIGN

#define LOC_STATE_LOC_ASSIGN   0x02

Definition at line 20 of file tpm.h.

◆ LOC_STATE_REG_VALID_STS

#define LOC_STATE_REG_VALID_STS   0x80

Definition at line 21 of file tpm.h.

◆ LOC_STS_GRANTED

#define LOC_STS_GRANTED   0x01

Definition at line 24 of file tpm.h.

◆ TPM_CRB_BASE_ADDRESS

#define TPM_CRB_BASE_ADDRESS   CONFIG_CRB_TPM_BASE_ADDRESS

Definition at line 6 of file tpm.h.

Function Documentation

◆ tpm2_get_info()

void tpm2_get_info ( struct tpm2_info tpm2_info)

Definition at line 266 of file tpm.c.

◆ tpm2_init()

int tpm2_init ( void  )

Definition at line 175 of file tpm.c.

References BIOS_ERR, BIOS_SPEW, crb_probe(), crb_readControlArea(), and printk.

Referenced by tis_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tpm2_process_command()

size_t tpm2_process_command ( const void tpm2_command,
size_t  command_size,
void tpm2_response,
size_t  max_response 
)

Definition at line 195 of file tpm.c.