]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Include/IndustryStandard/QemuTpm.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / OvmfPkg / Include / IndustryStandard / QemuTpm.h
1 /** @file
2 Macro and type definitions corresponding to the QEMU TPM interface.
3
4 Refer to "docs/specs/tpm.txt" in the QEMU source directory.
5
6 Copyright (C) 2018, Red Hat, Inc.
7 Copyright (c) 2018, IBM Corporation. All rights reserved.<BR>
8
9 SPDX-License-Identifier: BSD-2-Clause-Patent
10 **/
11
12 #ifndef __QEMU_TPM_H__
13 #define __QEMU_TPM_H__
14
15 #include <Base.h>
16
17 //
18 // whether function is blocked by BIOS settings; bits 0, 1, 2
19 //
20 #define QEMU_TPM_PPI_FUNC_NOT_IMPLEMENTED (0 << 0)
21 #define QEMU_TPM_PPI_FUNC_BIOS_ONLY (1 << 0)
22 #define QEMU_TPM_PPI_FUNC_BLOCKED (2 << 0)
23 #define QEMU_TPM_PPI_FUNC_ALLOWED_USR_REQ (3 << 0)
24 #define QEMU_TPM_PPI_FUNC_ALLOWED_USR_NOT_REQ (4 << 0)
25 #define QEMU_TPM_PPI_FUNC_MASK (7 << 0)
26
27 //
28 // The following structure is shared between firmware and ACPI.
29 //
30 #pragma pack (1)
31 typedef struct {
32 UINT8 Func[256]; // func
33 UINT8 In; // ppin
34 UINT32 Ip; // ppip
35 UINT32 Response; // pprp
36 UINT32 Request; // pprq
37 UINT32 RequestParameter; // pprm
38 UINT32 LastRequest; // lppr
39 UINT32 FRet; // fret
40 UINT8 Res1[0x40]; // res1
41 UINT8 NextStep; // next_step
42 } QEMU_TPM_PPI;
43 #pragma pack ()
44
45 //
46 // The following structure is for the fw_cfg etc/tpm/config file.
47 //
48 #pragma pack (1)
49 typedef struct {
50 UINT32 PpiAddress;
51 UINT8 TpmVersion;
52 UINT8 PpiVersion;
53 } QEMU_FWCFG_TPM_CONFIG;
54 #pragma pack ()
55
56 #define QEMU_TPM_VERSION_UNSPEC 0
57 #define QEMU_TPM_VERSION_1_2 1
58 #define QEMU_TPM_VERSION_2 2
59
60 #define QEMU_TPM_PPI_VERSION_NONE 0
61 #define QEMU_TPM_PPI_VERSION_1_30 1
62
63 #endif