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: 516768 Delivered-To: patch@linaro.org Received: by 2002:adf:eccd:0:0:0:0:0 with SMTP id s13csp713320wro; Wed, 3 Nov 2021 08:10:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyx2obkY2y3DgivD7MkNUbb1TmU432I9HfDW+Br4P+8rfBayIMIz0SOa/PLDWUjadlp+bc0 X-Received: by 2002:a17:907:d08:: with SMTP id gn8mr54058345ejc.395.1635952246548; Wed, 03 Nov 2021 08:10:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635952246; cv=none; d=google.com; s=arc-20160816; b=gsWvp98sxfrnJMConMxeThE92bxIY+0ivfV2IUZYw0pnKHiOEIjpU4QeqGoBn6VnaS v+5364O4ud5pQkITE8emLgfcfnjrkkGTI8rXRJNIkfHdaIUzNuV4Yyljujga7vJFq1jR BLetPmdwnFxwqwk4jt5HZHryPF4ci4VGraQjN0DfIlZz60TOoW+bAbtdRN906VJzX09t C/jCrrcrb7CpMrGluMtZ2pJfiS16wdIqrDeozlSZw3nuwL+G0v6zEI+7FyDWD9woINez KB+L7tVl/1dHmwl8mZpQaWiGtx7K4+KUVRNdHPCqSFcXamSidY3xFhFcyo41F/fmujOZ D/nw== 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=WCxbIowzUa629S/FdYL7gevtrOF6/TDQkQgdWB6a8R4=; b=S+BrnNT8HE4UOFleBgKP6+wBAb0goPGDJ/JEbBFm1Ki6odj4s/n2WyZ3ZVJBec2K8U f76AwaCYt1U0PQLqgyJaeZFAV48UDNrU96uHDCnbi8SghAFMBnQN7bPE8F+j/Znwa+24 tPAHbg5dJLQU72YUEGCllGXDMSr0ycF5PXH9mgognoEIIEINrQAXxVfeiExL2uNMZ/cG 03FqxuupSKox9pT3J43hFxFwiS94/d4/o3kJOC7ZccPr8GwasAM0/7aFaTS1kL/b0Bpm FqcelMRXq1PTKoJm97U5WkML90rHrmBoew3W6ikgMlOeaXwL3dxWlawKjgo/vuhEPRQg KkFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UarXavVR; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id di15si4513583ejc.585.2021.11.03.08.10.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Nov 2021 08:10:46 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UarXavVR; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 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-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 --- doc/board/emulation/qemu-arm.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) -- 2.33.1 Reviewed-by: Simon Glass 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 ----------