19 #include <soc/pci_devs.h>
67 if ((regValue &
mask) == expectedValue)
72 "CRB_WAIT: Error - Returning Zero with RegValue: %08x, Mask: %08x, Expected: %08x\n",
73 regValue,
mask, expectedValue);
93 if ((tpmStatus & (0xf)) != 1) {
95 "TPM: CRB Interface is not active. System needs reboot in order to active TPM.\n");
119 if (!rc && (locality == 0))
128 printk(
BIOS_ERR,
"TPM: Error - No Locality has been assigned TPM-wise.\n");
135 printk(
BIOS_ERR,
"TPM: Error - LOC_STATE Register %u contains errors.\n",
152 "TPM: Error - TPM did not transition into ready state in time.\n");
static void write8(void *addr, uint8_t val)
static void write32(void *addr, uint32_t val)
static uint32_t read32(const void *addr)
uint64_t read64(const void *addr)
static uint8_t read8(const void *addr)
void * memcpy(void *dest, const void *src, size_t n)
#define printk(level,...)
static void crb_readControlArea(void)
static struct control_area control_area
static int crb_probe(void)
static uint8_t crb_activate_locality(void)
static int crb_switch_to_ready(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)
static int crb_wait_for_reg32(const void *addr, uint32_t timeoutMs, uint32_t mask, uint32_t expectedValue)
#define CRB_REG_LOC_STATE
#define CRB_INTF_REG_INTF_SEL
#define LOC_STATE_REG_VALID_STS
#define CRB_REG_RESP_SIZE
#define LOC_STATE_LOC_ASSIGN
#define CRB_REG_REQUEST_CMD_RDY
#define LOC_CTRL_REQ_ACCESS
#define CRB_REG(LOCTY, REG)
#define CRB_INTF_REG_INTF_LOCK
#define CRB_REG_STATUS_ERROR
#define CRB_REG_START_START
#define CRB_REG_RESP_ADDR
#define CRB_INTF_REG_CAP_CRB
static int stopwatch_expired(struct stopwatch *sw)
static void stopwatch_init_msecs_expire(struct stopwatch *sw, long ms)
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
#define BIOS_SPEW
BIOS_SPEW - Excessively verbose output.
unsigned long long uint64_t
uint64_t interrupt_control