8 #define CR50_DID_VID 0x00281ae0L
9 #define TI50_DID_VID 0x504a6666L
11 #define CR50_BOARD_CFG_LOCKBIT_MASK 0x80000000U
12 #define CR50_BOARD_CFG_FEATUREBITS_MASK 0x3FFFFFFFU
14 #define CR50_BOARD_CFG_100US_READY_PULSE 0x00000001U
15 #define CR50_BOARD_CFG_VALUE \
16 (CONFIG(CR50_USE_LONG_INTERRUPT_PULSES) \
17 ? CR50_BOARD_CFG_100US_READY_PULSE : 0)
24 #define CR50_FW_VER_REG_SPI (TPM_LOCALITY_0_SPI_BASE + 0xf90)
25 #define CR50_BOARD_CFG_REG_SPI (TPM_LOCALITY_0_SPI_BASE + 0xfe0)
27 #define CR50_FW_VER_REG_I2C 0x0f
28 #define CR50_BOARD_CFG_REG_I2C 0x1c
66 printk(
BIOS_INFO,
"Cr50 firmware does not support CR50_BOARD_CFG, version: %d.%d.%d\n",
104 if (!
CONFIG(TPM_GOOGLE_CR50))
125 printk(
BIOS_INFO,
"Current CR50_BOARD_CFG = 0x%08x, matches desired = 0x%08x\n",
133 printk(
BIOS_ERR,
"Current CR50_BOARD_CFG = 0x%08x, does not match"
138 printk(
BIOS_INFO,
"Current CR50_BOARD_CFG = 0x%08x, setting to 0x%08x\n",
153 if (
CONFIG(TPM_GOOGLE_CR50))
195 size_t chunk_size = 50;
196 char version_str[301];
211 if (!version_str[++chunk_count * chunk_size - 1])
215 }
while (chunk_count * chunk_size <
sizeof(version_str) - chunk_size);
217 version_str[chunk_count * chunk_size] =
'\0';
cb_err
coreboot error codes
@ CB_ERR
Generic error code.
@ CB_ERR_ARG
Invalid argument.
@ CB_SUCCESS
Call completed successfully.
#define printk(level,...)
enum cb_err tis_vendor_read(unsigned int addr, void *buffer, size_t bytes)
enum cb_err tis_vendor_write(unsigned int addr, const void *buffer, size_t bytes)
#define CR50_BOARD_CFG_LOCKBIT_MASK
static uint32_t cr50_get_board_cfg(void)
enum cb_err cr50_get_firmware_version(struct cr50_firmware_version *version)
static bool cr50_fw_supports_board_cfg(struct cr50_firmware_version *version)
#define CR50_FW_VER_REG_I2C
#define CR50_BOARD_CFG_100US_READY_PULSE
static enum cb_err cr50_parse_fw_version(const char *version_str, struct cr50_firmware_version *ver)
static int get_reg_addr(enum cr50_register reg)
#define CR50_BOARD_CFG_REG_I2C
#define CR50_BOARD_CFG_VALUE
enum cb_err cr50_set_board_cfg(void)
Set the BOARD_CFG register on the TPM chip to a particular compile-time constant value.
#define CR50_FW_VER_REG_SPI
#define CR50_BOARD_CFG_REG_SPI
bool cr50_is_long_interrupt_pulse_enabled(void)
#define CR50_BOARD_CFG_FEATUREBITS_MASK
#define BIOS_INFO
BIOS_INFO - Expected events.
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
unsigned int skip_atoi(char **s)
char * strstr(const char *haystack, const char *needle)
static int number(void(*tx_byte)(unsigned char byte, void *data), unsigned long long inum, int base, int size, int precision, int type, void *data)