xref: /openbmc/qemu/hw/tpm/tpm_ppi.h (revision 709395f8)
1 /*
2  * TPM Physical Presence Interface
3  *
4  * Copyright (C) 2018 IBM Corporation
5  *
6  * Authors:
7  *  Stefan Berger    <stefanb@us.ibm.com>
8  *
9  * This work is licensed under the terms of the GNU GPL, version 2 or later.
10  * See the COPYING file in the top-level directory.
11  */
12 #ifndef TPM_TPM_PPI_H
13 #define TPM_TPM_PPI_H
14 
15 #include "hw/acpi/tpm.h"
16 #include "exec/address-spaces.h"
17 
18 typedef struct TPMPPI {
19     MemoryRegion ram;
20     uint8_t *buf;
21 } TPMPPI;
22 
23 /**
24  * tpm_ppi_init:
25  * @tpmppi: a TPMPPI
26  * @m: the address-space / MemoryRegion to use
27  * @addr: the address of the PPI region
28  * @obj: the owner object
29  *
30  * Register the TPM PPI memory region at @addr on the given address
31  * space for the object @obj.
32  **/
33 void tpm_ppi_init(TPMPPI *tpmppi, struct MemoryRegion *m,
34                   hwaddr addr, Object *obj);
35 
36 /**
37  * tpm_ppi_reset:
38  * @tpmppi: a TPMPPI
39  *
40  * Function to call on machine reset. It will check if the "Memory
41  * overwrite" variable is set, and perform a memory clear on volatile
42  * memory if requested.
43  **/
44 void tpm_ppi_reset(TPMPPI *tpmppi);
45 
46 #endif /* TPM_TPM_PPI_H */
47