blob: 6bfbf6ced58c86b12c0a832e603ef514176a354a [file] [log] [blame]
Abhi.Singhc8c5faf2024-08-28 14:17:52 -05001/*
2 * Copyright (c) 2025, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef TPM2_INTERFACE_H
8#define TPM2_INTERFACE_H
9
10#include "tpm2_chip.h"
11
12typedef struct interface_ops {
13 int (*get_info)(struct tpm_chip_data *chip_data, uint8_t locality);
14 int (*send)(struct tpm_chip_data *chip_data, const tpm_cmd *buf);
15 int (*receive)(struct tpm_chip_data *chip_data, tpm_cmd *buf);
16 int (*request_access)(struct tpm_chip_data *chip_data, uint8_t locality);
17 int (*release_locality)(struct tpm_chip_data *chip_data, uint8_t locality);
18} interface_ops_t;
19
20struct interface_ops *tpm_interface_getops(struct tpm_chip_data *chip_data, uint8_t locality);
21
22int tpm2_fifo_write_byte(uint16_t tpm_reg, uint8_t val);
23
24int tpm2_fifo_read_byte(uint16_t tpm_reg, uint8_t *val);
25
26int tpm2_fifo_read_chunk(uint16_t tpm_reg, uint8_t len, void *val);
27
28#endif /* TPM2_INTERFACE_H */