From patchwork Wed Nov 3 15:09:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 1550352 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=UarXavVR; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Hkqvk05nTz9sX3 for ; Thu, 4 Nov 2021 02:10:25 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7D0DD83658; Wed, 3 Nov 2021 16:09:52 +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="UarXavVR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3C7ED8347E; Wed, 3 Nov 2021 16:09:47 +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-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) (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 5EACC8363C for ; Wed, 3 Nov 2021 16:09:42 +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-wr1-x431.google.com with SMTP id d13so4045724wrf.11 for ; Wed, 03 Nov 2021 08:09:42 -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=WCxbIowzUa629S/FdYL7gevtrOF6/TDQkQgdWB6a8R4=; b=UarXavVRYaI5n3LHTbWeOruE83ix3Gl1lTs4II1eHsVZE2kZ8BdgGUTdenqK1DMmgh 2pTDBhu0xYWn50E7HgoojR4QBGNRp2yzJMEtno22tTrGhu6s8UswiJmk7NULkmcjbTpF qGBUqBNGxmwkn+4r4n2cvmrViRzIK0T1NQXW891f6wveBz1FZCIyxPVK118TN97WVI2j u5a3uJBt/g+3tPxoHMQLdVhsTh/LfG05R+PY8CQNR86WZLnpcv/Xjow5sSauaJLL4kT3 o5qI48reJfg+f2OR2gUJMkRS7q2Zf8BC0Zw0TXLJVo9XdrtST1BjacNGS2XTT42P9Lg4 z6Ig== 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=WCxbIowzUa629S/FdYL7gevtrOF6/TDQkQgdWB6a8R4=; b=YZ9FH0SHjIn5d6pGP7qvXzcjRIWDn2KHuwhnG/5XutMfn9R55FtKRELhmKrmFYJXj/ MDPr+FHdqsgHqkB9iBgGX2Vjk0Sz68gzf9GGKzkEabdqU7nwqQsCXC5rd4ZTwBgmstr7 5X0TnPUxzJktqCRHO0AxP7vD3ZO4HW3TocBctBbnq6ykDmLSZ7e5NB1w026/2LKdkKBo jZy77FspZ+qTDbmEebrAlklYRGjU6eYtCPeDl8+VaJF4FND9aaGEpbjBDiQ931oLpGBV wkSUliCUGSj8TQ7TRrUvy3/Ppl46winZZoIHIm7lwazxi/XUJuUu0u9wSURjULqzhHwH +hdA== X-Gm-Message-State: AOAM531Yv/UQbZdKdW7X3oZV64M+DZtYiyJq0D1uNjYr5T0WgP9f+u63 zD2kJI9Fj/0U08Gvl5ssx0E4BnqngxrAPw== X-Google-Smtp-Source: ABdhPJzQHYJDq1oQ7YkB+2Pqv2KFirCJn4Dvp1KnNWMbWefE0oep9xYXGoL8Vmjh+Ah6cW4pJSun6A== X-Received: by 2002:a5d:6d07:: with SMTP id e7mr22161501wrq.311.1635952181911; Wed, 03 Nov 2021 08:09:41 -0700 (PDT) Received: from apalos.home ([2a02:587:4682:26e0:2e56:dcff:fe9a:8f06]) by smtp.gmail.com with ESMTPSA id f19sm2094947wmq.34.2021.11.03.08.09.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Nov 2021 08:09:41 -0700 (PDT) From: Ilias Apalodimas To: u-boot@lists.denx.de Cc: trini@konsulko.com, Ilias Apalodimas , Rick Chen , Sean Anderson , Simon Glass , Heinrich Schuchardt , Masahisa Kojima Subject: [PATCH 5/6 v4] doc: qemu: Add instructions for swtpm usage Date: Wed, 3 Nov 2021 17:09:08 +0200 Message-Id: <20211103150910.69732-6-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211103150910.69732-1-ilias.apalodimas@linaro.org> References: <20211103150910.69732-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 Signed-off-by: Ilias Apalodimas Reviewed-by: Simon Glass --- 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 ----------