![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <assert.h>
#include <commonlib/endian.h>
#include <console/console.h>
#include <delay.h>
#include <endian.h>
#include <security/tpm/tis.h>
#include <string.h>
#include <timer.h>
#include <types.h>
#include "tpm.h"
Go to the source code of this file.
Data Structures | |
struct | spi_frame_header |
union | fifo_transfer_buffer |
Macros | |
#define | TPM_ACCESS_REG (TPM_LOCALITY_0_SPI_BASE + 0) |
#define | TPM_STS_REG (TPM_LOCALITY_0_SPI_BASE + 0x18) |
#define | TPM_DATA_FIFO_REG (TPM_LOCALITY_0_SPI_BASE + 0x24) |
#define | TPM_DID_VID_REG (TPM_LOCALITY_0_SPI_BASE + 0xf00) |
#define | TPM_RID_REG (TPM_LOCALITY_0_SPI_BASE + 0xf04) |
#define | TPM_FW_VER (TPM_LOCALITY_0_SPI_BASE + 0xf90) |
#define | CR50_BOARD_CFG (TPM_LOCALITY_0_SPI_BASE + 0xfe0) |
#define | CR50_TIMEOUT_INIT_MS 30000 /* Very long timeout for TPM init */ |
#define | MAX_STATUS_TIMEOUT 120 |
Enumerations | |
enum | fifo_transfer_direction { fifo_transmit = 0 , fifo_receive = 1 } |
Variables | |
static struct spi_slave | spi_slave |
static struct tpm2_info | tpm_info |
static const int | debug_level_ = CONFIG(DEBUG_TPM) |
static const uint32_t | supported_did_vids [] |
#define CR50_BOARD_CFG (TPM_LOCALITY_0_SPI_BASE + 0xfe0) |
#define CR50_TIMEOUT_INIT_MS 30000 /* Very long timeout for TPM init */ |
#define TPM_ACCESS_REG (TPM_LOCALITY_0_SPI_BASE + 0) |
#define TPM_DATA_FIFO_REG (TPM_LOCALITY_0_SPI_BASE + 0x24) |
#define TPM_DID_VID_REG (TPM_LOCALITY_0_SPI_BASE + 0xf00) |
#define TPM_FW_VER (TPM_LOCALITY_0_SPI_BASE + 0xf90) |
#define TPM_RID_REG (TPM_LOCALITY_0_SPI_BASE + 0xf04) |
#define TPM_STS_REG (TPM_LOCALITY_0_SPI_BASE + 0x18) |
|
static |
Definition at line 426 of file tpm.c.
References ARRAY_SIZE, BIOS_ERR, BIOS_INFO, CB_SUCCESS, CONFIG, cr50_get_firmware_version(), cr50_set_board_cfg(), tpm2_info::device_id, mdelay(), memcpy(), NULL, printk, read_tpm_sts(), tpm2_info::revision, supported_did_vids, tis_plat_irq_status(), tpm2_claim_locality(), tpm2_read_reg(), TPM_DID_VID_REG, tpm_first_access_this_boot(), tpm_info, TPM_RID_REG, TPM_STS_FAMILY_MASK, TPM_STS_FAMILY_TPM_2_0, and tpm2_info::vendor_id.
Referenced by tis_vendor_read().
Definition at line 346 of file tpm.c.
References read_tpm_sts(), TPM_STS_BURST_COUNT_MASK, and TPM_STS_BURST_COUNT_SHIFT.
Definition at line 290 of file tpm.c.
References buffer, NULL, and spi_xfer().
Definition at line 290 of file tpm.c.
Referenced by fifo_transfer(), get_burst_count(), and tis_vendor_read().
Definition at line 62 of file tpm.c.
References BIOS_WARNING, mdelay(), and printk.
Definition at line 62 of file tpm.c.
Referenced by fifo_transfer().
Definition at line 593 of file tpm.c.
References BIOS_DEBUG, BIOS_ERR, CB_SUCCESS, debug_level_, fifo_receive, fifo_transfer(), fifo_transmit, printk, read_be32(), read_tpm_sts(), fifo_transfer_buffer::rx_buffer, tpm2_read_reg(), TPM_DATA_FIFO_REG, tpm_info, TPM_STS_COMMAND_READY, TPM_STS_DATA_AVAIL, TPM_STS_GO, TPM_STS_VALID, trace_dump(), fifo_transfer_buffer::tx_buffer, tpm2_info::vendor_id, wait_for_status(), and write_tpm_sts().
Definition at line 362 of file tpm.c.
References assert, tpm2_write_reg(), and TPM_ACCESS_REG.
Referenced by fifo_transfer().
Definition at line 354 of file tpm.c.
References tpm2_read_reg(), TPM_ACCESS_ESTABLISHMENT, and TPM_ACCESS_REG.
Definition at line 290 of file tpm.c.
Referenced by fifo_transfer(), tis_vendor_read(), and tpm2_read_access_reg().
|
static |
Definition at line 290 of file tpm.c.
Referenced by tpm2_claim_locality().
|
static |
Definition at line 224 of file tpm.c.
References BIOS_DEBUG, buffer, debug_level_, printk, and TPM_DATA_FIFO_REG.
Referenced by tis_vendor_read().
Definition at line 426 of file tpm.c.
Referenced by tis_vendor_read().
Definition at line 281 of file tpm.c.
References buffer, NULL, and spi_xfer().
|
static |
Definition at line 290 of file tpm.c.
Referenced by tis_vendor_read().
|
static |
Definition at line 47 of file tpm.c.
Referenced by tis_vendor_read(), and trace_dump().
|
static |
Definition at line 420 of file tpm.c.
Referenced by fifo_transfer().
|
static |
Definition at line 1 of file tpm.c.
Referenced by fifo_transfer(), tis_vendor_read(), and tpm2_get_info().