From nobody Tue Feb 10 15:44:55 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=us.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1680143755; cv=none; d=zohomail.com; s=zohoarc; b=f63CFA7AuNy/mO6MBb+o2i0NoBAzhKQhhoTrIzIzOVz6mpnyYYRcm3nFhqN+vXqBtfzp+J6ZthHcANRnhlKSrRiSsLs4g21GGajZBObDuFdmVhUgQpeIdgxjyOAE9s6Ei95okD4ZOHpCiKFH9N2TdqwtLyL1OCTTjpDtSMQlpQs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680143755; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DLJNZfj27hB0b68npyrJtnyoZEJWZ25EymoZchufdfs=; b=nKTVIYlCKrVU83BwMkeur2yAm/VZWZ2661REpMSiKcZeFkPN1wC/e8AIvDs+fF8P6SjAHi+3Ar6GY1AF1qMbRgEs8US2eRVusCtJH45vNnsmCkRWpXw2Gba6X37lnIf0tLGHUyieTREfroPDlUTFi8sONNlKGEeNSxSN2dn2y54= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1680143755510224.1174442213894; Wed, 29 Mar 2023 19:35:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1phi8F-0004fZ-GV; Wed, 29 Mar 2023 22:35:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1phi8B-0004fM-IU for qemu-devel@nongnu.org; Wed, 29 Mar 2023 22:35:15 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1phi89-0000IP-DB for qemu-devel@nongnu.org; Wed, 29 Mar 2023 22:35:15 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32U0e2aw017845; Thu, 30 Mar 2023 02:34:59 GMT Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pmn83upxd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 30 Mar 2023 02:34:58 +0000 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32U2499U003030; Thu, 30 Mar 2023 02:34:58 GMT Received: from smtprelay05.wdc07v.mail.ibm.com ([9.208.129.117]) by ppma05wdc.us.ibm.com (PPS) with ESMTPS id 3phrk7hmtr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 30 Mar 2023 02:34:58 +0000 Received: from smtpav05.wdc07v.mail.ibm.com (smtpav05.wdc07v.mail.ibm.com [10.39.53.232]) by smtprelay05.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32U2YuaT28770860 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 30 Mar 2023 02:34:56 GMT Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C622D58059; Thu, 30 Mar 2023 02:34:56 +0000 (GMT) Received: from smtpav05.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B11F058043; Thu, 30 Mar 2023 02:34:56 +0000 (GMT) Received: from gfwa601.aus.stglabs.ibm.com (unknown [9.3.62.226]) by smtpav05.wdc07v.mail.ibm.com (Postfix) with ESMTPS; Thu, 30 Mar 2023 02:34:56 +0000 (GMT) Received: by gfwa601.aus.stglabs.ibm.com (Postfix, from userid 155676) id 032D92E5673; Wed, 29 Mar 2023 21:34:55 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pp1; bh=DLJNZfj27hB0b68npyrJtnyoZEJWZ25EymoZchufdfs=; b=jkDXgvXZQ2Yugf5UmcTZ06qTZnIUmljB0GCkfGfKY54DU99eSNER6WVTElpWl5WWnzM3 HfZwXeujGJuxWouczDNWaTrgHwWOqnr4IdemKT82Lzogq67hLRL9jVLCaxfFekqx19cS Ypaq7oQIIg9wPmXTT+b9CE26blzMVI/Q6R57Xq/EoTQkcKdskG2xlLiKWd6eBf2i5Bhv Y60MM7MFlhbAgi1brH426EP609YHVgI2Q6fIIxpPbOiK4KZvrmYu/MrDpqiuhbg5CGoU DmirMx3bEqjQ+oeYC7ToEaXkS/POLacQKiBOcF0Rsg5CBl3M4F6nHxDz1oKOeA6xJo8d fA== From: Ninad Palsule To: qemu-devel@nongnu.org Cc: Ninad Palsule , joel@jms.id.au, andrew@aj.id.au, stefanb@linux.ibm.com, clg@kaod.org Subject: [PATCH v11 1/3] docs: Add support for TPM devices over I2C bus Date: Wed, 29 Mar 2023 21:34:52 -0500 Message-Id: <20230330023454.1998611-2-ninadpalsule@us.ibm.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230330023454.1998611-1-ninadpalsule@us.ibm.com> References: <20230330023454.1998611-1-ninadpalsule@us.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: lDm4JO0bHgbfUL5zNGh_Gk47YXcIPiE0 X-Proofpoint-GUID: lDm4JO0bHgbfUL5zNGh_Gk47YXcIPiE0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-29_16,2023-03-28_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxscore=0 spamscore=0 malwarescore=0 suspectscore=0 impostorscore=0 mlxlogscore=999 priorityscore=1501 phishscore=0 clxscore=1015 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303300017 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=148.163.158.5; envelope-from=ninad@us.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1680143756613100008 From: Ninad Palsule This is a documentation change for I2C TPM device support. Qemu already supports devices attached to ISA and sysbus. This drop adds support for the I2C bus attached TPM devices. Signed-off-by: Ninad Palsule Reviewed-by: Stefan Berger Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Joel Stanley --- V2: Incorporated Stephen's review comments - Added example in the document. --- V4: Incorporate Cedric & Stefan's comments - Added example for ast2600-evb - Corrected statement about arm virtual machine. --- V6: Incorporated review comments from Stefan. --- V8: Incorporate review comments from Joel and Stefan - Removed the rainier example - Added step required to configure on ast2600-evb --- docs/specs/tpm.rst | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/specs/tpm.rst b/docs/specs/tpm.rst index 535912a92b..efe124a148 100644 --- a/docs/specs/tpm.rst +++ b/docs/specs/tpm.rst @@ -21,12 +21,16 @@ QEMU files related to TPM TIS interface: - ``hw/tpm/tpm_tis_common.c`` - ``hw/tpm/tpm_tis_isa.c`` - ``hw/tpm/tpm_tis_sysbus.c`` + - ``hw/tpm/tpm_tis_i2c.c`` - ``hw/tpm/tpm_tis.h`` =20 Both an ISA device and a sysbus device are available. The former is used with pc/q35 machine while the latter can be instantiated in the Arm virt machine. =20 +An I2C device support is also provided which can be instantiated in the Arm +based emulation machines. This device only supports the TPM 2 protocol. + CRB interface ------------- =20 @@ -348,6 +352,23 @@ In case an Arm virt machine is emulated, use the follo= wing command line: -drive if=3Dpflash,format=3Draw,file=3Dflash0.img,readonly=3Don \ -drive if=3Dpflash,format=3Draw,file=3Dflash1.img =20 +In case a ast2600-evb bmc machine is emulated and you want to use a TPM de= vice +attached to I2C bus, use the following command line: + +.. code-block:: console + + qemu-system-arm -M ast2600-evb -nographic \ + -kernel arch/arm/boot/zImage \ + -dtb arch/arm/boot/dts/aspeed-ast2600-evb.dtb \ + -initrd rootfs.cpio \ + -chardev socket,id=3Dchrtpm,path=3D/tmp/mytpm1/swtpm-sock \ + -tpmdev emulator,id=3Dtpm0,chardev=3Dchrtpm \ + -device tpm-tis-i2c,tpmdev=3Dtpm0,bus=3Daspeed.i2c.bus.12,address=3D0x= 2e + + For testing, use this command to load the driver to the correct address + + echo tpm_tis_i2c 0x2e > /sys/bus/i2c/devices/i2c-12/new_device + In case SeaBIOS is used as firmware, it should show the TPM menu item after entering the menu with 'ESC'. =20 --=20 2.37.2