13b97c01eSStefan Berger /* 23b97c01eSStefan Berger * TPM Physical Presence Interface 33b97c01eSStefan Berger * 43b97c01eSStefan Berger * Copyright (C) 2018 IBM Corporation 53b97c01eSStefan Berger * 63b97c01eSStefan Berger * Authors: 73b97c01eSStefan Berger * Stefan Berger <stefanb@us.ibm.com> 83b97c01eSStefan Berger * 93b97c01eSStefan Berger * This work is licensed under the terms of the GNU GPL, version 2 or later. 103b97c01eSStefan Berger * See the COPYING file in the top-level directory. 113b97c01eSStefan Berger */ 123b97c01eSStefan Berger #ifndef TPM_TPM_PPI_H 133b97c01eSStefan Berger #define TPM_TPM_PPI_H 143b97c01eSStefan Berger 15*b05b6e36SPhilippe Mathieu-Daudé #include "exec/memory.h" 163b97c01eSStefan Berger 173b97c01eSStefan Berger typedef struct TPMPPI { 183b97c01eSStefan Berger MemoryRegion ram; 193b97c01eSStefan Berger uint8_t *buf; 203b97c01eSStefan Berger } TPMPPI; 213b97c01eSStefan Berger 223b97c01eSStefan Berger /** 233b97c01eSStefan Berger * tpm_ppi_init: 243b97c01eSStefan Berger * @tpmppi: a TPMPPI 253b97c01eSStefan Berger * @m: the address-space / MemoryRegion to use 263b97c01eSStefan Berger * @addr: the address of the PPI region 273b97c01eSStefan Berger * @obj: the owner object 283b97c01eSStefan Berger * 293b97c01eSStefan Berger * Register the TPM PPI memory region at @addr on the given address 303b97c01eSStefan Berger * space for the object @obj. 313b97c01eSStefan Berger **/ 32*b05b6e36SPhilippe Mathieu-Daudé void tpm_ppi_init(TPMPPI *tpmppi, MemoryRegion *m, 333b97c01eSStefan Berger hwaddr addr, Object *obj); 343b97c01eSStefan Berger 35ffab1be7SMarc-André Lureau /** 36ffab1be7SMarc-André Lureau * tpm_ppi_reset: 37ffab1be7SMarc-André Lureau * @tpmppi: a TPMPPI 38ffab1be7SMarc-André Lureau * 39ffab1be7SMarc-André Lureau * Function to call on machine reset. It will check if the "Memory 40ffab1be7SMarc-André Lureau * overwrite" variable is set, and perform a memory clear on volatile 41ffab1be7SMarc-André Lureau * memory if requested. 42ffab1be7SMarc-André Lureau **/ 43ffab1be7SMarc-André Lureau void tpm_ppi_reset(TPMPPI *tpmppi); 44ffab1be7SMarc-André Lureau 453b97c01eSStefan Berger #endif /* TPM_TPM_PPI_H */ 46