summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/Include
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2018-05-18 14:23:02 +0200
committerLaszlo Ersek <lersek@redhat.com>2018-05-22 16:30:43 +0200
commit909ac65af11323dc0b412819c72c04f8addf3d63 (patch)
tree338253ccc66cc17890baa7002a763e14af49f8c2 /OvmfPkg/Include
parentfe280ecbee11f91408eaac40efc1e18729518478 (diff)
downloadedk2-909ac65af11323dc0b412819c72c04f8addf3d63.tar.gz
edk2-909ac65af11323dc0b412819c72c04f8addf3d63.tar.bz2
edk2-909ac65af11323dc0b412819c72c04f8addf3d63.zip
OvmfPkg/IndustryStandard: add QemuTpm.h header
Add some common macros and type definitions corresponding to the QEMU TPM interface. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'OvmfPkg/Include')
-rw-r--r--OvmfPkg/Include/IndustryStandard/QemuTpm.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/OvmfPkg/Include/IndustryStandard/QemuTpm.h b/OvmfPkg/Include/IndustryStandard/QemuTpm.h
new file mode 100644
index 0000000000..a342cbc347
--- /dev/null
+++ b/OvmfPkg/Include/IndustryStandard/QemuTpm.h
@@ -0,0 +1,69 @@
+/** @file
+ Macro and type definitions corresponding to the QEMU TPM interface.
+
+ Refer to "docs/specs/tpm.txt" in the QEMU source directory.
+
+ Copyright (C) 2018, Red Hat, Inc.
+ Copyright (c) 2018, IBM Corporation. All rights reserved.<BR>
+
+ This program and the accompanying materials are licensed and made available
+ under the terms and conditions of the BSD License which accompanies this
+ distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
+ WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+**/
+
+#ifndef __QEMU_TPM_H__
+#define __QEMU_TPM_H__
+
+#include <Base.h>
+
+//
+// whether function is blocked by BIOS settings; bits 0, 1, 2
+//
+#define QEMU_TPM_PPI_FUNC_NOT_IMPLEMENTED (0 << 0)
+#define QEMU_TPM_PPI_FUNC_BIOS_ONLY (1 << 0)
+#define QEMU_TPM_PPI_FUNC_BLOCKED (2 << 0)
+#define QEMU_TPM_PPI_FUNC_ALLOWED_USR_REQ (3 << 0)
+#define QEMU_TPM_PPI_FUNC_ALLOWED_USR_NOT_REQ (4 << 0)
+#define QEMU_TPM_PPI_FUNC_MASK (7 << 0)
+
+//
+// The following structure is shared between firmware and ACPI.
+//
+#pragma pack (1)
+typedef struct {
+ UINT8 Func[256]; // func
+ UINT8 In; // ppin
+ UINT32 Ip; // ppip
+ UINT32 Response; // pprp
+ UINT32 Request; // pprq
+ UINT32 RequestParameter; // pprm
+ UINT32 LastRequest; // lppr
+ UINT32 FRet; // fret
+ UINT8 Res1[0x40]; // res1
+ UINT8 NextStep; // next_step
+} QEMU_TPM_PPI;
+#pragma pack ()
+
+//
+// The following structure is for the fw_cfg etc/tpm/config file.
+//
+#pragma pack (1)
+typedef struct {
+ UINT32 PpiAddress;
+ UINT8 TpmVersion;
+ UINT8 PpiVersion;
+} QEMU_FWCFG_TPM_CONFIG;
+#pragma pack ()
+
+#define QEMU_TPM_VERSION_UNSPEC 0
+#define QEMU_TPM_VERSION_1_2 1
+#define QEMU_TPM_VERSION_2 2
+
+#define QEMU_TPM_PPI_VERSION_NONE 0
+#define QEMU_TPM_PPI_VERSION_1_30 1
+
+#endif