From patchwork Tue Nov 9 07:02:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 518039 Delivered-To: patch@linaro.org Received: by 2002:ad5:5208:0:0:0:0:0 with SMTP id p8csp1320889iml; Mon, 8 Nov 2021 23:03:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJyMP9eo96P37eC3cbGquz3Je9pY6xvMKC+0XOYBSszMGNZTT9IGHkUtVHJIux7XkTtRkMvZ X-Received: by 2002:a17:907:d08:: with SMTP id gn8mr6509791ejc.395.1636441427292; Mon, 08 Nov 2021 23:03:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636441427; cv=none; d=google.com; s=arc-20160816; b=0SvUHP8LrlUH9NeC1/Yvmb3tIB5jyqzQbp6v5Deww5/dA6ScXRU4MyEm2YoLw9dXdW tCugxfpPtbSegUB0A376BccCZ7+ZqrV7nplZt5lNJwnvRGSHvpq/Flqvo1qKAwmL+m4c EqkI+KDfmHkknIUtO3Kofous6tEY+S1FdgtsDzPS+4p2BShBzF2n3ZaK477XpFA6wsNC S2QVlfLAkQ7XJvPZGogJ0oT6uw9H9/CelFPW8UoLKSVZ4CkjTekVSpJ1QvMMsBCmDKpP oD0VGm+u/dw6LjhCVZ/PCT+OJ6bzzlpTUgwSnyOFAcOO6Tqn8PjIEgXuTC+9h1424pPe 6KSw== 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=WQLg1YFUVCjqYGepTQycHi/TgUjonR18aLy1ARC/bJuBJk///ZZGtqHKZ/nLhU9pS1 VLM3fiA9MZJCIyDsXXwnuHJeirK+Lp3ZttXfgRhvNZKvMtx7anh3yxIxvnp9akG3UsAO EFQWHHV+UbCy48U3980h3sMmrkrJyJb/lMWRkYIeo9hSfxQmlq3JMMcpTUErL+y0kA9e cTrFQIxu4CiiLb1i0w56+fhh5l/AlXog+tvyxayXh0i95xTBSr7NfnbsZoc7Qkv6Y99z W2FKezY7yFCxzxuKtoB6ga+7e+nZ89fMb8czofijq/t9NVEAq/zx6EyDZ12PFL/2DvTQ ShGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zm99FJb0; 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 v21si27311060eji.11.2021.11.08.23.03.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 23:03:47 -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=zm99FJb0; 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 040A983906; Tue, 9 Nov 2021 08:02:58 +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="zm99FJb0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1EC7D83883; Tue, 9 Nov 2021 08:02:48 +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-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) (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 C2519838F3 for ; Tue, 9 Nov 2021 08:02:40 +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-wm1-x329.google.com with SMTP id g191-20020a1c9dc8000000b0032fbf912885so1481728wme.4 for ; Mon, 08 Nov 2021 23:02:40 -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=zm99FJb0iUFyEKIuA2jBrsFWgthj2lCljn742ISZZkZ8axJYbqYb83sBbkgJyp1y4E SSugWoeKykVE54UIDlz4LihbYRh+sRmWeGBVGSidQqpDpQnGCF063Nds+kbeZxeT1No0 E4xNYrUCJsdQDt6DKeYzPkZE1dRYnfTVd0F98SRLuRmwwlTahzohEXTdcf/6vFjV6vOu UsCQsUQ607mPNuylazKI/XaIS1qxHqvyo/pG2JAkIVE9hA0TXzBsQHEQxbMRrikWdOkI /fPPMFaL5pj1YwxmuxG3acI+SvO5cFpc3gYJtHclbtG7gTkGk0f/njfFjsKoRieneHzo iEeg== 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=BU7dZJ4dy9lesJdulAG3dVZj92KkKRPrcAgf9T3Eo/Z2Xu1YofuXg21JczYxIzBsGx ALRjbP54/tH2bUHrTmxWw8uzyaxf12JbVlO2RTp+m6nKkhR4O8SJLXF69mEdGQW9yhog Hw07H3kMMMs5L3uVne2EUC148mQQIXYZMbNVbVNSBOt0tjkKz+bD0CnygWYUB7YslgBH Qf4QYXJqA4czXj5NROzOju4lXbYC6bUg5IgzETTWy20f/bUTX2SNmBSAvRJu28eiMx7+ 3XEx/Xe15qNqQlbUW0G0srYAcXeA+jTgI3VHh6aEAoUPjozHz37iDD8OEVP9YZAVEfV4 bjSA== X-Gm-Message-State: AOAM530bFyH/VVHvd7TJ1T2LSjItxUl2Scdoyufi4+1PED8yfkpqUzGw qmAPomhOc05V2hANBEra8eGVWAOCpwxJHQ== X-Received: by 2002:a05:600c:1d0e:: with SMTP id l14mr4658599wms.64.1636441360316; Mon, 08 Nov 2021 23:02:40 -0800 (PST) Received: from apalos.home ([2a02:587:4627:18c0:2e56:dcff:fe9a:8f06]) by smtp.gmail.com with ESMTPSA id g5sm20897229wri.45.2021.11.08.23.02.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 23:02:39 -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 v7] doc: qemu: Add instructions for swtpm usage Date: Tue, 9 Nov 2021 09:02:21 +0200 Message-Id: <20211109070223.76456-8-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211109070223.76456-1-ilias.apalodimas@linaro.org> References: <20211109070223.76456-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 ----------