15 #define RECV_TIMEOUT (1 * 1000)
16 #define XMIT_TIMEOUT (1 * 1000)
17 #define SLEEP_DURATION 1000
41 uint8_t *recvbuf,
size_t *rbuf_len)
45 size_t max_recv_bytes;
51 if (
CONFIG(DRIVER_TPM_DISPLAY_TIS_BYTES)) {
64 CONFIG_DRIVER_TPM_I2C_ADDR, (
uint8_t *)sendbuf,
74 max_recv_bytes = *rbuf_len;
76 hdr_bytes =
sizeof(*header);
81 CONFIG_DRIVER_TPM_I2C_ADDR, recvbuf, hdr_bytes);
86 if (status !=
sizeof(*
header))
94 if (recv_bytes > hdr_bytes) {
96 if (
CONFIG(DRIVER_TPM_DISPLAY_TIS_BYTES))
101 CONFIG_DRIVER_TPM_I2C_ADDR, recvbuf, recv_bytes);
110 if (
CONFIG(DRIVER_TPM_DISPLAY_TIS_BYTES)) {
struct arm64_kernel_header header
static uint32_t read_at_be32(const void *src, size_t offset)
#define printk(level,...)
static int i2c_write_raw(unsigned int bus, uint8_t slave, uint8_t *data, int len)
static int i2c_read_raw(unsigned int bus, uint8_t slave, uint8_t *data, int len)
static int stopwatch_expired(struct stopwatch *sw)
static void stopwatch_init_msecs_expire(struct stopwatch *sw, long ms)
void hexdump(const void *memory, size_t length)
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
struct tpm_output_header __packed
int tis_sendrecv(const uint8_t *sendbuf, size_t sbuf_size, uint8_t *recvbuf, size_t *rbuf_len)