From patchwork Fri Nov 5 19:05:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 516827 Delivered-To: patch@linaro.org Received: by 2002:ad5:5208:0:0:0:0:0 with SMTP id p8csp366657iml; Fri, 5 Nov 2021 12:06:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytZeCdXy5/RHkfYRHPz4wjVzWOhGD3Guu/SOlRdMb+dWiyeG7xTcNBQcKX4zWtKDiN7hat X-Received: by 2002:a17:906:5804:: with SMTP id m4mr74187511ejq.295.1636139169528; Fri, 05 Nov 2021 12:06:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636139169; cv=none; d=google.com; s=arc-20160816; b=t5NPc1cBvdlYCCbhasRjHLviqEWQ5eNcvPoQ8u/MQDh+PgwivnU6IpqkcltGxNxvU+ YzlpGCZMtoARlhQuk/3IE1DOXb9Z91Kj7fM/nffd70MVuIRFuqt4DL3J8Q9zEnaLslGv cNSidlytDtegSU6rZgUNyxytiI6teJiGwb70XG799elNQpzJnxqRadR9cmXae/w66NeV ZkgHu2rPSxSKEkBT/AWCG+XvXFCpCN81DPzSgfVuZNZRg3HSFKK3KaHmqK9X9WaAKtL+ NYf2HYfGRgZj35U4fi7Eq57ufoKWxr6LaWlwzobt9wNpub+FmCYY/BHs67apsCgpNl/b CAQw== 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=XoLN+gV+4TVF8B4nLjHeNqZy6nu9YLLSpeAJGET2dIs2w41ym3/YX/c1UqrpyffiFs /n6Ggo8URkrhFeUESdP2U4uNkEvW1TqTi+WqXaKIrPVGJeEKi4NIuu2X/3ljVQ8iUPg/ +8P+XBQTevHEHPp+/dAKjFeXHmTqa2tR37eyEaDvnhQzvmBqQtj3aUaTkGsDW4H6A28J 2bNpgui8yms41DmJMyHqcrk+CB2m2NuagEitqw+6lUP2DzWwtmC8eLkdSwDGko7qyMZb K4KqkfTbbIVAq/3VbEnTJT9+F9jntgmO1iupHLa8wrrblPRPZCyJ48bKZuCapkjVup1M 9CCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K6DCbmEv; 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 hr29si18962388ejc.190.2021.11.05.12.06.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Nov 2021 12:06:09 -0700 (PDT) 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=K6DCbmEv; 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 92AD883750; Fri, 5 Nov 2021 20:05:47 +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="K6DCbmEv"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7F32883734; Fri, 5 Nov 2021 20:05:37 +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 62B0C83701 for ; Fri, 5 Nov 2021 20:05:30 +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 77-20020a1c0450000000b0033123de3425so10263662wme.0 for ; Fri, 05 Nov 2021 12:05:30 -0700 (PDT) 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=K6DCbmEvaI4EXwR3eSOqBl4I1cTudMnwZTzHuNFyWNdOJ1xUC79vbdZSBwPPAAUB80 Ze5dEPyiLKvDyxD5YmZDoHmH1KYb8mCJwW439PS4H3e+1j6wckLg/wW/BtOKF4AYg8sP cF3+3GvW0ZAOHGVyccqYOuYzF5PV+UtEsRh3LkIG3OpCvfn7e5dVAMsNcPHwAnRSKI6N lMNdtXkk3OOWkMK23oairddALAY0IV9DtJQx1Mq7qLMEpvlS9XnEF6IyentZuUN9nN8s GUpxPhV9YMZnysU0muZkhRFUBZugMzR1ClN5Ak5xRO0/6215eYrmn7qO1HzXBxqputIg AjWw== 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=e8urCT6m3yjIjjpgFhdOGCJnm1XIgp/UMl2grPkYKVm7eT5mYLSDreCw02+Nxi01Gp tVaqvOBMC13X4t6qtJsJ+GJtMQg+vtJB3v3wwc5OpKSgOrUrXUPA7f+HxmkGkdjxmwky B2ginYxd3rvBUFhr5FNhr84lW8nKQP4m2vIT52I2h+MPEfC+G1CaK8YmE7Fjz6YLHX4m YtHs6bEPZaPAsaMkSk8ZuZeqbmtVpUDsdMnXohDUtByj1WwbPj7x1LjGJR6lv9gFQknv GN/S+1OUlhIoKXoknjbjb3pWmF9SwCXif2tLyhiLPV/HPMF49YA7Z6g9nOWpaN+0n63A XTTA== X-Gm-Message-State: AOAM533VmLuWvGPqNPBw4KIl0Q4iAUR+nMsiIdCMpW3LjYYUVw2fuZFb ysQ0Dm1VUn2fjeEuC38t+U8l32ltlmtYOQ== X-Received: by 2002:a05:600c:c1:: with SMTP id u1mr32376000wmm.163.1636139129989; Fri, 05 Nov 2021 12:05:29 -0700 (PDT) Received: from apalos.home ([2a02:587:4682:26e0:2e56:dcff:fe9a:8f06]) by smtp.gmail.com with ESMTPSA id m125sm11832350wmm.39.2021.11.05.12.05.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Nov 2021 12:05:29 -0700 (PDT) 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 5/6 v5] doc: qemu: Add instructions for swtpm usage Date: Fri, 5 Nov 2021 21:05:15 +0200 Message-Id: <20211105190517.233079-6-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211105190517.233079-1-ilias.apalodimas@linaro.org> References: <20211105190517.233079-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(+) -- 2.33.1 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 ----------