From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44291) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIZ6K-00087r-FP for qemu-devel@nongnu.org; Tue, 15 May 2018 08:30:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fIZ6J-0003ie-66 for qemu-devel@nongnu.org; Tue, 15 May 2018 08:30:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43616) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fIZ6I-0003iD-TW for qemu-devel@nongnu.org; Tue, 15 May 2018 08:30:43 -0400 From: marcandre.lureau@redhat.com Date: Tue, 15 May 2018 14:30:05 +0200 Message-Id: <20180515123007.10164-3-marcandre.lureau@redhat.com> In-Reply-To: <20180515123007.10164-1-marcandre.lureau@redhat.com> References: <20180515123007.10164-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 2/4] ovmf: add QemuTpm.h header List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: edk2-devel@lists.01.org Cc: pjones@redhat.com, jiewen.yao@intel.com, stefanb@linux.vnet.ibm.com, lersek@redhat.com, qemu-devel@nongnu.org, javierm@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= From: Marc-Andr=C3=A9 Lureau Add some common macros and type definitions corresponding to the QEMU TPM interface. Signed-off-by: Marc-Andr=C3=A9 Lureau --- OvmfPkg/Include/IndustryStandard/QemuTpm.h | 67 ++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 OvmfPkg/Include/IndustryStandard/QemuTpm.h diff --git a/OvmfPkg/Include/IndustryStandard/QemuTpm.h b/OvmfPkg/Include= /IndustryStandard/QemuTpm.h new file mode 100644 index 000000000000..054cf79374b5 --- /dev/null +++ b/OvmfPkg/Include/IndustryStandard/QemuTpm.h @@ -0,0 +1,67 @@ +/** @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.
+ + This program and the accompanying materials are licensed and made avai= lable + under the terms and conditions of the BSD License which accompanies th= is + 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 + +/* 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 --=20 2.17.0.253.g3dd125b46d