![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <timer.h>
#include <console/console.h>
#include <device/mmio.h>
#include <string.h>
#include <soc/pci_devs.h>
#include <device/pci_ops.h>
#include "tpm.h"
Go to the source code of this file.
Data Structures | |
struct | control_area |
Functions | |
static void | crb_readControlArea (void) |
static int | crb_wait_for_reg32 (const void *addr, uint32_t timeoutMs, uint32_t mask, uint32_t expectedValue) |
static int | crb_probe (void) |
static uint8_t | crb_activate_locality (void) |
static int | crb_switch_to_ready (void) |
int | tpm2_init (void) |
size_t | tpm2_process_command (const void *tpm2_command, size_t command_size, void *tpm2_response, size_t max_response) |
void | tpm2_get_info (struct tpm2_info *tpm2_info) |
Variables | |
static struct control_area | control_area |
static uint8_t | cur_loc = 0 |
Definition at line 111 of file tpm.c.
References BIOS_ERR, BIOS_SPEW, CRB_REG, CRB_REG_LOC_CTRL, CRB_REG_LOC_STATE, crb_wait_for_reg32(), LOC_CTRL_REQ_ACCESS, LOC_STATE_LOC_ASSIGN, LOC_STATE_REG_VALID_STS, printk, read8(), and write8().
Referenced by tpm2_process_command().
|
static |
Definition at line 83 of file tpm.c.
References BIOS_DEBUG, BIOS_SPEW, CRB_INTF_REG_CAP_CRB, CRB_INTF_REG_INTF_LOCK, CRB_INTF_REG_INTF_SEL, CRB_REG, CRB_REG_INTF_ID, cur_loc, printk, read64(), and write32().
Referenced by tpm2_init().
Definition at line 39 of file tpm.c.
References control_area::cancel, control_area::command_bfr, control_area::command_size, CRB_REG, CRB_REG_CANCEL, CRB_REG_CMD_ADDR, CRB_REG_CMD_SIZE, CRB_REG_INT_CTRL, CRB_REG_REQUEST, CRB_REG_RESP_ADDR, CRB_REG_RESP_SIZE, CRB_REG_STATUS, cur_loc, control_area::interrupt_control, read32(), read64(), control_area::request, control_area::response_bfr, control_area::response_size, and control_area::status.
Referenced by tpm2_init().
|
static |
Definition at line 144 of file tpm.c.
References BIOS_ERR, CRB_REG, CRB_REG_REQUEST, CRB_REG_REQUEST_CMD_RDY, CRB_REG_STATUS, CRB_REG_STATUS_ERROR, crb_wait_for_reg32(), cur_loc, printk, and write8().
Referenced by tpm2_process_command().
|
static |
Definition at line 54 of file tpm.c.
References addr, BIOS_ERR, mask, printk, read32(), stopwatch_expired(), and stopwatch_init_msecs_expire().
Referenced by crb_activate_locality(), crb_switch_to_ready(), and tpm2_process_command().
Definition at line 266 of file tpm.c.
References CRB_REG, CRB_REG_INTF_ID, cur_loc, tpm2_info::device_id, read64(), tpm2_info::revision, and tpm2_info::vendor_id.
Referenced by tis_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().
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.
References BIOS_DEBUG, BIOS_ERR, control_area::command_bfr, control_area::command_size, crb_activate_locality(), CRB_REG, CRB_REG_START, CRB_REG_START_START, CRB_REG_STATUS, CRB_REG_STATUS_ERROR, crb_switch_to_ready(), crb_wait_for_reg32(), cur_loc, length, memcpy(), printk, read32(), control_area::response_bfr, control_area::response_size, and write8().
Referenced by tis_sendrecv().
|
static |
|
static |
Definition at line 36 of file tpm.c.
Referenced by crb_probe(), crb_readControlArea(), crb_switch_to_ready(), tpm2_get_info(), and tpm2_process_command().