![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <commonlib/endian.h>
#include <string.h>
#include <types.h>
#include <delay.h>
#include <console/console.h>
#include <device/i2c_simple.h>
#include <endian.h>
#include <timer.h>
#include <security/tpm/tis.h>
#include "tpm.h"
Go to the source code of this file.
Data Structures | |
struct | tpm_inf_dev |
Macros | |
#define | MAX_COUNT 3 |
#define | SLEEP_DURATION 60 /* in usec */ |
#define | SLEEP_DURATION_LONG 210 /* in usec */ |
#define | SLEEP_DURATION_PROBE_MS 1000 /* in msec */ |
#define | MAX_COUNT_LONG 50 |
#define | TPM_TIS_I2C_DID_VID_9635 0x000b15d1L |
#define | TPM_TIS_I2C_DID_VID_9645 0x001a15d1L |
Enumerations | |
enum | i2c_chip_type { SLB9635 , SLB9645 , UNKNOWN } |
Variables | |
static const char *const | chip_name [] |
static struct tpm_inf_dev | tpm_dev |
enum i2c_chip_type |
|
static |
Definition at line 222 of file tpm.c.
References buf, chip, iic_tpm_read(), tpm_vendor_specific::locality, TPM_ACCESS, TPM_ACCESS_ACTIVE_LOCALITY, TPM_ACCESS_VALID, and tpm_chip::vendor.
Referenced by request_locality().
Definition at line 291 of file tpm.c.
References buf, chip, iic_tpm_read(), tpm_vendor_specific::locality, mdelay(), TPM_STS, TPM_TIMEOUT, and tpm_chip::vendor.
Referenced by recv_data(), and tpm_tis_i2c_send().
Definition at line 85 of file tpm.c.
References addr, tpm_inf_dev::addr, buffer, tpm_inf_dev::bus, tpm_inf_dev::chip_type, count, i2c_msg::flags, I2C_M_RD, i2c_read_raw(), i2c_transfer(), i2c_write_raw(), i2c_msg::len, MAX_COUNT, SLB9635, tpm_inf_dev::sleep_short, tpm_dev, udelay(), and UNKNOWN.
Referenced by check_locality(), get_burstcount(), recv_data(), release_locality(), tpm_tis_i2c_status(), tpm_vendor_init(), and tpm_vendor_probe().
Definition at line 206 of file tpm.c.
References addr, buffer, iic_tpm_write_generic(), i2c_msg::len, MAX_COUNT, tpm_inf_dev::sleep_short, and tpm_dev.
Referenced by release_locality(), request_locality(), and tpm_tis_i2c_send().
|
static |
Definition at line 154 of file tpm.c.
References addr, tpm_inf_dev::addr, BIOS_DEBUG, tpm_inf_dev::buf, buffer, tpm_inf_dev::bus, count, i2c_write_raw(), i2c_msg::len, memcpy(), printk, tpm_inf_dev::sleep_short, TPM_BUFSIZE, tpm_dev, and udelay().
Referenced by iic_tpm_write(), and iic_tpm_write_long().
Definition at line 216 of file tpm.c.
References addr, buffer, iic_tpm_write_generic(), i2c_msg::len, MAX_COUNT_LONG, tpm_inf_dev::sleep_long, and tpm_dev.
Referenced by tpm_tis_i2c_ready().
Definition at line 328 of file tpm.c.
References buf, chip, count, get_burstcount(), iic_tpm_read(), tpm_vendor_specific::locality, TPM_DATA_FIFO, and tpm_chip::vendor.
Referenced by tpm_tis_i2c_recv().
Definition at line 238 of file tpm.c.
References buf, iic_tpm_read(), iic_tpm_write(), TPM_ACCESS, TPM_ACCESS_ACTIVE_LOCALITY, TPM_ACCESS_REQUEST_PENDING, and TPM_ACCESS_VALID.
Referenced by tpm_vendor_cleanup(), and tpm_vendor_init().
|
static |
Definition at line 251 of file tpm.c.
References buf, check_locality(), chip, iic_tpm_write(), mdelay(), TPM_ACCESS, TPM_ACCESS_REQUEST_USE, and TPM_TIMEOUT.
Referenced by tpm_vendor_init().
Definition at line 284 of file tpm.c.
References buf, chip, iic_tpm_write_long(), tpm_vendor_specific::locality, TPM_STS, TPM_STS_COMMAND_READY, and tpm_chip::vendor.
Referenced by tpm_tis_i2c_recv(), tpm_tis_i2c_send(), and tpm_vendor_init().
Definition at line 354 of file tpm.c.
References BIOS_DEBUG, buf, chip, count, memcpy(), printk, recv_data(), TPM_HEADER_SIZE, TPM_RSP_SIZE_BYTE, TPM_STS_DATA_AVAIL, TPM_STS_VALID, tpm_tis_i2c_ready(), and wait_for_stat().
Referenced by tpm_vendor_init().
Definition at line 400 of file tpm.c.
References buf, chip, count, get_burstcount(), iic_tpm_write(), i2c_msg::len, tpm_vendor_specific::locality, TPM_BUFSIZE, TPM_DATA_FIFO, TPM_STS, TPM_STS_COMMAND_READY, TPM_STS_DATA_EXPECT, TPM_STS_GO, TPM_STS_VALID, tpm_tis_i2c_ready(), tpm_tis_i2c_status(), tpm_chip::vendor, and wait_for_stat().
Referenced by tpm_vendor_init().
Definition at line 272 of file tpm.c.
References buf, chip, iic_tpm_read(), tpm_vendor_specific::locality, TPM_STS, and tpm_chip::vendor.
Referenced by tpm_tis_i2c_send(), tpm_vendor_init(), and wait_for_stat().
Definition at line 555 of file tpm.c.
References chip, tpm_vendor_specific::locality, release_locality(), and tpm_chip::vendor.
Definition at line 496 of file tpm.c.
References tpm_inf_dev::addr, BIOS_DEBUG, BIOS_ERR, tpm_inf_dev::bus, tpm_vendor_specific::cancel, chip, chip_name, tpm_inf_dev::chip_type, iic_tpm_read(), tpm_chip::is_open, memset(), printk, tpm_vendor_specific::recv, release_locality(), tpm_vendor_specific::req_canceled, tpm_vendor_specific::req_complete_mask, tpm_vendor_specific::req_complete_val, request_locality(), tpm_vendor_specific::send, SLB9635, SLB9645, SLEEP_DURATION, SLEEP_DURATION_LONG, tpm_inf_dev::sleep_long, tpm_inf_dev::sleep_short, tpm_vendor_specific::status, tpm_dev, TPM_DID_VID, TPM_STS_COMMAND_READY, TPM_STS_DATA_AVAIL, TPM_STS_VALID, TPM_TIS_I2C_DID_VID_9635, TPM_TIS_I2C_DID_VID_9645, tpm_tis_i2c_ready(), tpm_tis_i2c_recv(), tpm_tis_i2c_send(), tpm_tis_i2c_status(), UNKNOWN, vendor, and tpm_chip::vendor.
Definition at line 455 of file tpm.c.
References addr, tpm_inf_dev::addr, BIOS_INFO, buf, tpm_inf_dev::bus, tpm_inf_dev::chip_type, iic_tpm_read(), printk, SLEEP_DURATION, SLEEP_DURATION_LONG, SLEEP_DURATION_PROBE_MS, tpm_inf_dev::sleep_long, tpm_inf_dev::sleep_short, stopwatch_duration_msecs(), stopwatch_expired(), stopwatch_init_msecs_expire(), TPM_ACCESS, tpm_dev, TPM_STS_VALID, udelay(), and UNKNOWN.
Definition at line 314 of file tpm.c.
References chip, mask, mdelay(), TPM_TIMEOUT, and tpm_tis_i2c_status().
Referenced by tpm_tis_i2c_recv(), and tpm_tis_i2c_send().
|
static |
|
static |
Definition at line 53 of file tpm.c.
Referenced by iic_tpm_read(), iic_tpm_write(), iic_tpm_write_generic(), iic_tpm_write_long(), tpm_vendor_init(), and tpm_vendor_probe().