From patchwork Sun Nov 7 21:33:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 518019 Delivered-To: patch@linaro.org Received: by 2002:ad5:5208:0:0:0:0:0 with SMTP id p8csp2740275iml; Sun, 7 Nov 2021 13:34:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJyIxXPvWcqQ57iTvKP1ZF3Ca0vvVvcZd+QTi0Q1Bf1+LQvQa4Y8lKJh65V5T+Ew68JaJuFG X-Received: by 2002:a17:906:684:: with SMTP id u4mr45782167ejb.48.1636320854540; Sun, 07 Nov 2021 13:34:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636320854; cv=none; d=google.com; s=arc-20160816; b=OuFE5WHkeWNpFJ9QqSFXPFhPonO91uaAysO9oUzJ6t7poZaoAHbMubS6RbXYzBjUEx g6ykzFwI6YGahAc9q4ooBsfhT4RR/bIHe9nLhZviXuGLjJ+Y9ICuEytujVWnOMLdbsbt YtVg8SXcTxdDzLdMTc/RxQZxJvGbxCHKuRhT+Z87Shyf8HLKF66W9jNjePRqrDH9hLTx tbmAoI5hgYr4aV6wKCkXY0b8rE1aUX9wBBhGzwZGaTEM0TU/NFnmYx+ympBh5d9kjTme QCZ53NTlTAl3PZkwmJjphBtujbtuRtowoxQHJ37nm3h/EgyGi8h2n9c5dED2tbPrzS1c HM0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gVxITKNNyabd+K7xCPMvJ/lgGw/5PpSnX0szDoDYjKE=; b=FqdOVIy+6UwDLO9bKsbcbwZQPmGvM9BHiKbynkbZ7xl+866WRrHRv/RJaNl8AZH34D tfOQsfnM18Smo/vlBMjZHmBFbXsnomSknvb8I5Z23G+j9zPSdNX2BLBhfr9DYX1YB6k6 pvPh0xqs5FgeeA9+H1oFXHOHwI0BTNzmDzF8T7ilEhlrFX4F4RPcr1KPHrJX99QobKT+ uMyDbklhY4x4RzEnw5sHwpbVynZzwoDffPW5nLV90jHT9LpRsAe50rQOQGiEIdTKe0xB 3hgKQh0Fw78lZqW4XWmK4xpFC+66A99sGvXbvSispcEJnI+POqakm64iyDmPUFI0PqD7 KY0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wiTz+EJF; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id k3si24882905edk.215.2021.11.07.13.34.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 13:34:14 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wiTz+EJF; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BAB268380B; Sun, 7 Nov 2021 22:33:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="wiTz+EJF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 03B0D837FD; Sun, 7 Nov 2021 22:33:34 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A1DD183805 for ; Sun, 7 Nov 2021 22:33:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-ed1-x531.google.com with SMTP id j21so54544746edt.11 for ; Sun, 07 Nov 2021 13:33:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gVxITKNNyabd+K7xCPMvJ/lgGw/5PpSnX0szDoDYjKE=; b=wiTz+EJFA22fEFH+jY88ssNW93O8s0TCCJwvDrrB8P//hsDRXCQOsV/y1kQB/YHftK kc5qPdQyd4mlb/wueStjxComIDucFodcS2FpQM16RHso+ess8w2M+txVt/CgG75IUbKL CWifujk7qhUUpii5PHzl9cZj1h4DU5+bojz0eyDEboJgt+B4eXwb7qJnV4HlbFOvROAx ZcuLD3OzsWO91ug4t6I0a96hs5JqUL6s+WOudgNS7DVMve4EHFkL5eHdr/oB08TyV93/ mJWMgMF1iVK1D3V1eHmWVqcoDSoaoF03hLqbTLPM4HagOg/vq9gSEXsUlQYdianacmE8 jeXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gVxITKNNyabd+K7xCPMvJ/lgGw/5PpSnX0szDoDYjKE=; b=O28jkvKZ3SMyL1AkEjl4itMq6v6KRIQZ4DtDmBXdLIBOmIVr2i/KG/WdUZi1OJBBi9 fqSXfWAP9TgkwktDHsJMrRWvAWohCm2VgBSWXW5fdy+puN65YdnuAeBH0QPfgC1bNeJW V1w45im7A3f+ug5laynWTxYla/haPyH+vv0ypdHWlWAx7jZsOzz1zwqQ3IwPoeGc3tAW LQPUogi0IcuoCKSdcQrret13HLnabPvAVHA/i8/hEfDoy4hiCOLFFfq3GueBvpv6+ux2 /42jfNPgNxfVSeoZtgrk3kblWbjpTJU6Glz2ui4C0yO5jfJuqP+fAIvgm3avMFQMjiC7 gJwA== X-Gm-Message-State: AOAM533EPOxkpMar7cTbfvPawP+yh1aIwkxjVetm4K8dYlL3p/1ll/m+ gvpi3uSsCphmOtZL5q92SE4GE4dfgbJiHg== X-Received: by 2002:aa7:c391:: with SMTP id k17mr77054578edq.263.1636320809119; Sun, 07 Nov 2021 13:33:29 -0800 (PST) Received: from apalos.home ([2a02:587:4680:8a9c:2e56:dcff:fe9a:8f06]) by smtp.gmail.com with ESMTPSA id hw8sm5042150ejc.58.2021.11.07.13.33.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 13:33:28 -0800 (PST) From: Ilias Apalodimas To: u-boot@lists.denx.de Cc: trini@konsulko.com, Ilias Apalodimas , Simon Glass , Rick Chen , Sean Anderson , Heinrich Schuchardt , Masahisa Kojima Subject: [PATCH 7/8 v6] doc: qemu: Add instructions for swtpm usage Date: Sun, 7 Nov 2021 23:33:10 +0200 Message-Id: <20211107213312.263357-8-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211107213312.263357-1-ilias.apalodimas@linaro.org> References: <20211107213312.263357-1-ilias.apalodimas@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean A previous patch added support for an mmio based TPM. Add an example in QEMU on it's usage Reviewed-by: Simon Glass Signed-off-by: Ilias Apalodimas --- doc/board/emulation/qemu-arm.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/doc/board/emulation/qemu-arm.rst b/doc/board/emulation/qemu-arm.rst index 8d7fda10f15e..584ef0a7e150 100644 --- a/doc/board/emulation/qemu-arm.rst +++ b/doc/board/emulation/qemu-arm.rst @@ -81,6 +81,31 @@ can be enabled with the following command line parameters: These have been tested in QEMU 2.9.0 but should work in at least 2.5.0 as well. +Enabling TPMv2 support +---------------------- + +To emulate a TPM the swtpm package may be used. It can be built from the +following repositories: + + https://github.com/stefanberger/swtpm.git + +Swtpm provides a socket for the TPM emulation which can be consumed by QEMU. + +In a first console invoke swtpm with:: + + swtpm socket --tpmstate dir=/tmp/mytpm1 \ + --ctrl type=unixio,path=/tmp/mytpm1/swtpm-sock --log level=20 + +In a second console invoke qemu-system-aarch64 with:: + + -chardev socket,id=chrtpm,path=/tmp/mytpm1/swtpm-sock \ + -tpmdev emulator,id=tpm0,chardev=chrtpm \ + -device tpm-tis-device,tpmdev=tpm0 + +Enable the TPM on U-Boot's command line with:: + + tpm2 startup TPM2_SU_CLEAR + Debug UART ----------