]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Include/IndustryStandard/QemuTpm.h
OvmfPkg/Virtio10Dxe: convert to PciCapLib
[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 This program and the accompanying materials are licensed and made available
10 under the terms and conditions of the BSD License which accompanies this
11 distribution. The full text of the license may be found at
12 http://opensource.org/licenses/bsd-license.php
13
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
15 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 **/
17
18 #ifndef __QEMU_TPM_H__
19 #define __QEMU_TPM_H__
20
21 #include <Base.h>
22
23 //
24 // whether function is blocked by BIOS settings; bits 0, 1, 2
25 //
26 #define QEMU_TPM_PPI_FUNC_NOT_IMPLEMENTED (0 << 0)
27 #define QEMU_TPM_PPI_FUNC_BIOS_ONLY (1 << 0)
28 #define QEMU_TPM_PPI_FUNC_BLOCKED (2 << 0)
29 #define QEMU_TPM_PPI_FUNC_ALLOWED_USR_REQ (3 << 0)
30 #define QEMU_TPM_PPI_FUNC_ALLOWED_USR_NOT_REQ (4 << 0)
31 #define QEMU_TPM_PPI_FUNC_MASK (7 << 0)
32
33 //
34 // The following structure is shared between firmware and ACPI.
35 //
36 #pragma pack (1)
37 typedef struct {
38 UINT8 Func[256]; // func
39 UINT8 In; // ppin
40 UINT32 Ip; // ppip
41 UINT32 Response; // pprp
42 UINT32 Request; // pprq
43 UINT32 RequestParameter; // pprm
44 UINT32 LastRequest; // lppr
45 UINT32 FRet; // fret
46 UINT8 Res1[0x40]; // res1
47 UINT8 NextStep; // next_step
48 } QEMU_TPM_PPI;
49 #pragma pack ()
50
51 //
52 // The following structure is for the fw_cfg etc/tpm/config file.
53 //
54 #pragma pack (1)
55 typedef struct {
56 UINT32 PpiAddress;
57 UINT8 TpmVersion;
58 UINT8 PpiVersion;
59 } QEMU_FWCFG_TPM_CONFIG;
60 #pragma pack ()
61
62 #define QEMU_TPM_VERSION_UNSPEC 0
63 #define QEMU_TPM_VERSION_1_2 1
64 #define QEMU_TPM_VERSION_2 2
65
66 #define QEMU_TPM_PPI_VERSION_NONE 0
67 #define QEMU_TPM_PPI_VERSION_1_30 1
68
69 #endif