From patchwork Tue Nov 9 07:02:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 518032 Delivered-To: patch@linaro.org Received: by 2002:ad5:5208:0:0:0:0:0 with SMTP id p8csp1319799iml; Mon, 8 Nov 2021 23:02:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJzxPgLDy+So+10qM7eWSpGsDHk31E+CNpHQTyabZ4gICOJBHwHGIQNy5vfUGwlBQRSz1Blc X-Received: by 2002:a50:d50c:: with SMTP id u12mr6973922edi.118.1636441356399; Mon, 08 Nov 2021 23:02:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636441356; cv=none; d=google.com; s=arc-20160816; b=Yi1VEjxBkn7aofw0T9pq06lFmoyXwxqPVbPtw9PxTkKXjdYxpwwDGpwnntSICksBTt ucggmHpA8fE34A97CXLyg6qCCLxfHd5cEPFVSCCTW79eyEfd40wKuCGyDvX9MCw6ZQYw hb2mhhHvYzIqAL4DjHeLGkOldpnO9DxPwp5Ygu1HSCtvVhHJcjaSnG7m/PZX316C49iJ 9CpyvmRuCWYJAtHCboI4rrFAEToeMauQSLZVOw9hYMOJSEKR+RvErtp84J3w6U2cUxWG nqCjl596puvXvp+xiWzqNV1rcKmmmkICcQv5hkp3vj7eqJlBlQ+gmZRAoOnW7VgV5pvc 6CGQ== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=HAJD3o/vKvDpsmHoT3ZrtZo0LOR5wAVxUiLC1ZjWnos=; b=bE+vSQ7gbRDHR7ACbhPm5m30nxp2+A7Zc41z2tdUi3jWr1MrpK1KhOOv1x1CLYidjN eMY/UAqpsq0ugJ38hrNL48jp+vytzXByeVNaaLDaDblHTnjmKv6A4+SRXs1nEdXaSWNK 8pdbF7XK6MBC7cY5hIwy7nUOtQnNKS2O9xmUiTgCYjVgqutO8yjTIiMpF4lPVrabz+LS xXymakPXdb0xPUsDrGZ5wBvE3Bz8f1v2Erbn1o99p4a6ZtSNauWsg1JcfibNg4ipq5/Q NQMYtDcgi/p7rh1TluG51UcomTQ6Uhiwlrz29Kp2QUs9jjZRwUX7rm3yK+rKljnLdU3j 6raA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N9a+T7hy; 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 e1si39049046edl.569.2021.11.08.23.02.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 23:02:36 -0800 (PST) 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=N9a+T7hy; 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 3C33383816; Tue, 9 Nov 2021 08:02:32 +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="N9a+T7hy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2FC99836F8; Tue, 9 Nov 2021 08:02:30 +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-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) (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 8780083695 for ; Tue, 9 Nov 2021 08:02:26 +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-x42a.google.com with SMTP id t30so31160503wra.10 for ; Mon, 08 Nov 2021 23:02:26 -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:mime-version :content-transfer-encoding; bh=HAJD3o/vKvDpsmHoT3ZrtZo0LOR5wAVxUiLC1ZjWnos=; b=N9a+T7hyrnF9QZfBA4L2iK4kpxIoHhTBfxU6oLxspzJ2mMfbgljbHBvdksoPi6dA8B /UAK/fjKEJoLrjffPw5n5DdN/Sg7nzQWKDjzfuFRI0mwmGLrOjTmF4urtRdDfoRROYlT OuXQg/7aiVbOrxvzUfUTNOelrp+4W8m23lCZOW0bD/5WpbfpJHqAUgLtfV9aaO5u8yIK ipwiQ7ARpTtmYHwYgjtM2RIQSydlJXwrUw3pKMBEjGf9E1UM7jdLJuFl/0yysrkDytvh MBC0wLzRQVHlTAfQsZ1ic/LrT/1ILtzq9dODu+BjxTCsaBM2Vr9Q/r7p+BsVLYvxnTzI ztsQ== 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:mime-version :content-transfer-encoding; bh=HAJD3o/vKvDpsmHoT3ZrtZo0LOR5wAVxUiLC1ZjWnos=; b=av55dD+QbMW9Q7hgp0aMmt44Y/wajtNi9FnQzDmwfOPc76uUz6A9f6jWst2Zo9hkDa Sx6vduwiGaqpr5ZtHgSTDeJOD0ox9sfRNJoqGdU2tOMYRTSVFS/PnzLFO4GRNlZNzvqe NgIxob81tPeMywobUcuZK3laWccbyCSUrZEV7DkkrOM4BRQcno5Yt22KbU3jb1I55MHS EabKrqP84pra2/NUdR+/UucU7u7yk4sLWQflM/sZeyFQeXO1PhwEVYw1CKXFchNsuEji ZJhrwQPJnCE5SM9cdFkESz8gYkic19Vo7FtAyWJnkSt7mA7SFE3mix85I044v0Bb/yJs 1zVQ== X-Gm-Message-State: AOAM533ZIxHOhiN4ZkiNnXBk8YmrSu2+FDBnKVwZZ6WYDy5i6NNxQjkB TrcnzhjFl9EUsbMu+sZ0mIsOMZ6i5ICJuA== X-Received: by 2002:a5d:6691:: with SMTP id l17mr6424880wru.227.1636441345952; Mon, 08 Nov 2021 23:02:25 -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.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 23:02:25 -0800 (PST) From: Ilias Apalodimas To: u-boot@lists.denx.de Cc: trini@konsulko.com, Ilias Apalodimas , Rick Chen , Simon Glass , Sean Anderson , Masahisa Kojima , Heinrich Schuchardt Subject: [PATCH 0/8 v7] TPM cleanups and MMIO driver Date: Tue, 9 Nov 2021 09:02:14 +0200 Message-Id: <20211109070223.76456-1-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.33.1 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 Hi! This is the update for [1]. Changes since v6: - added a few missing @return in function documentation - switched TPM1_ defines to TPM_INFINEON_ Changes since v5: - Fixed 2 tpmv1.2 drivers. Some of the internal driver functions were conflicting with the new API Changes since v4: - renamed struct udevice *udev -> struct udevice *dev - added comments on struct tpm_tis_phy_ops - removed duplicate defines from tpm2_tis_spi driver (now in tpm_tis.h) - moved API function description for the .c to the .h file - added Reviewed-by tags from Simon and Heinrich Changes since v3: - Coverted SPI TPM to use the API as well - moved some log_info to log_debug - Added documentation on how to run QEMU and enabled TPM by default o arm qemu builds Changes since v2: - Add myself as a maintainer on TPM drivers Changes since v1: - split off the tis core code into a different file Ilias Apalodimas (6): tpm2: Introduce TIS tpm core tpm2: Add a TPMv2 MMIO TIS driver tpm: Use the new API on tpm2 spi driver configs: Enable tpmv2 mmio on qemu for arm/arm64 doc: qemu: Add instructions for swtpm usage MAINTAINERS: Add entry for TPM drivers [1] https://lore.kernel.org/u-boot/20211107213312.263357-1-ilias.apalodimas@linaro.org/ Ilias Apalodimas (8): tpm: refactor function names and macros for infineon v1.2 TPM tpm: refactor function names for LPC based TPMs tpm2: Introduce TIS tpm core tpm2: Add a TPMv2 MMIO TIS driver tpm: Use the new API on tpm2 spi driver configs: Enable tpmv2 mmio on qemu for arm/arm64 doc: qemu: Add instructions for swtpm usage MAINTAINERS: Add entry for TPM drivers MAINTAINERS | 5 + configs/qemu_arm64_defconfig | 2 + configs/qemu_arm_defconfig | 2 + doc/board/emulation/qemu-arm.rst | 25 ++ drivers/tpm/Kconfig | 9 + drivers/tpm/Makefile | 3 +- drivers/tpm/tpm2_tis_core.c | 463 +++++++++++++++++++++++++++++++ drivers/tpm/tpm2_tis_mmio.c | 157 +++++++++++ drivers/tpm/tpm2_tis_spi.c | 447 +++-------------------------- drivers/tpm/tpm_tis.h | 136 +++++++++ drivers/tpm/tpm_tis_infineon.c | 34 +-- drivers/tpm/tpm_tis_lpc.c | 4 +- include/tpm-v2.h | 1 + 13 files changed, 852 insertions(+), 436 deletions(-) create mode 100644 drivers/tpm/tpm2_tis_core.c create mode 100644 drivers/tpm/tpm2_tis_mmio.c