From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=marcandre.lureau@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A2266207E4DE8 for ; Thu, 17 May 2018 07:47:22 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EADC07D65F; Thu, 17 May 2018 14:47:21 +0000 (UTC) Received: from localhost (ovpn-112-71.ams2.redhat.com [10.36.112.71]) by smtp.corp.redhat.com (Postfix) with ESMTP id A07092024CBB; Thu, 17 May 2018 14:47:21 +0000 (UTC) From: marcandre.lureau@redhat.com 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?= Date: Thu, 17 May 2018 16:47:11 +0200 Message-Id: <20180517144713.18647-3-marcandre.lureau@redhat.com> In-Reply-To: <20180517144713.18647-1-marcandre.lureau@redhat.com> References: <20180517144713.18647-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 17 May 2018 14:47:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 17 May 2018 14:47:21 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'marcandre.lureau@redhat.com' RCPT:'' Subject: [PATCH v2 2/4] OvmfPkg/IndustryStandard: add QemuTpm.h header X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 14:47:22 -0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Marc-André Lureau 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 --- OvmfPkg/Include/IndustryStandard/QemuTpm.h | 69 ++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/OvmfPkg/Include/IndustryStandard/QemuTpm.h b/OvmfPkg/Include/IndustryStandard/QemuTpm.h new file mode 100644 index 000000000000..19e96238f553 --- /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.
+ + 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 + +// +// 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 -- 2.17.0.253.g3dd125b46d