From patchwork Sun Nov 7 21:33:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 518014 Delivered-To: patch@linaro.org Received: by 2002:ad5:5208:0:0:0:0:0 with SMTP id p8csp2739721iml; Sun, 7 Nov 2021 13:33:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJxCjVHi9obKbQWKTnr5no/ZhGuTAy5qV6ux0A73OTSPVRoF3PVpclBGb5O+azRg4L0rZgL3 X-Received: by 2002:a17:906:c015:: with SMTP id e21mr93432953ejz.113.1636320805908; Sun, 07 Nov 2021 13:33:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636320805; cv=none; d=google.com; s=arc-20160816; b=zlXIkwtAED69O5RsRJZOnrXFED29CCQuaRFIZ/5a1M442sK9X7NkxRceDwPuYTPpsv +sMGjDL3jAT0K08A++GldS2u4wa9d9hisHBbyNVPKEPiEmD+7cXlJhfI+ek2zEQfsDRM uztT/I9ddcv3b4fNfRI+hSNY/FWdMjMAcf9rtWhyCuezjvjKY86/1C1Ee9+n9rp3cgQL leDdGvA7vRPwQp1H4s2rpP5Mw8kn3/WJMSQ8OHZtKVNb+qhwg9qa3f+dkA6EJZV/eqDq 1sAKAYpY5LKJ/a1WfW4eMuuXUORbsMFLmWM71TZfgXtVPD1iFOvugQmfS44lY80pO3IX YByQ== 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=VlZdX2nkSnjEyp64AiIyGQhN51wJmZtL5QRLVAa+yK4=; b=Fv6GvnoEIfyLdERXo6f0WmluEINjQVzNH7E9MoMu4LPDViokxdrY0I7lO1lYlrzoYQ zdRrBNeax8vespJ+Ze1XVpH2YeODyAszE5m5R0qNbma15Wod25oEHq7BZ9D/PpLZNT7v AbHk2MB1ih06Y1k2cdKpLKNkKG9Sxqy8vY+KvCMX0ZvDg9/n2liqtQVbB8gZwVPBrLoV /gJxiOKfHt6Wo6eNySgr46cyQ5VT13o6WKKCCsMUBT/lA16vK8O2ukHZ+Rangeq8pIIZ UADkP3Px2KSyZzNIKb2zT2U7Evglz+aiWc3TYD36ekYZCOBCUXlHp+kzMSzCBwm4CMbV 7yvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BiQoKKPx; 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 sg18si28647194ejc.241.2021.11.07.13.33.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 13:33:25 -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=BiQoKKPx; 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 949D5837F3; Sun, 7 Nov 2021 22:33:22 +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="BiQoKKPx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F3458837EF; Sun, 7 Nov 2021 22:33:19 +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-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) (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 4C8AC837B7 for ; Sun, 7 Nov 2021 22:33:16 +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-ed1-x536.google.com with SMTP id r12so54721121edt.6 for ; Sun, 07 Nov 2021 13:33:16 -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=VlZdX2nkSnjEyp64AiIyGQhN51wJmZtL5QRLVAa+yK4=; b=BiQoKKPx2t7Z09OBZSS/J+E0lQqSxNO/7rbOFVepilqgBNPkKxnK4qcYTAXDsE9A11 LXb2GYI1ASs2GBKF96WYpqZLjZcG94gsm/w8o0kPkckovN7spJHNDkjGNjIfA9Bfcle3 Wt0/B4TdjU8w0MvdscUFNSypknRf8GQh63G7cmDltD2mFOOpImXSzsOUGCfphBhgE7ae wm9SRVCQX7LV05cnjb2exXEBq8/AFNDwHA4ySXPk9M7WlsO+q2gBBABUsA8Qqy3YumSP v/pMsAZ1VvKHVIgQSjTfZJ5Ve1eFFejU2Lq+MBKEuedYIRR85aX2Spd+ex4Ll99JKWMt gjYg== 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=VlZdX2nkSnjEyp64AiIyGQhN51wJmZtL5QRLVAa+yK4=; b=j3ohfPlqEb/S0FW9u5sqrYMJ48hzQsJmuSO26H9TS1WODvAJVFhCCp3i7xZLbJSDtL sF48iz58cTXCFHD32wj3QuQXArR36u6DKOpsC311oNQ/7GmJKHxoGBXCRNMGD28X4TbZ j4E9LLu70MQbtZ3nCjI6j4pIaEdgcFNS25V0UlUOCInUJKEzWAjNosntEACN/JOARiI8 prfMMkElCwiXVxMs+tif/hVP0IQMA6pgwKSnIddCUrRd2gEhg1zkid+9hPUfjuZt8F8t tqLtFxRDQMmzwdJAggY+STw/sK63B5i10LXAJ4sDCr+oBujmFcIc+pIOloeZP05GewsI 6kYQ== X-Gm-Message-State: AOAM533zJWWCO0bRjfpAx7MKKVqzWFxx/P8IcU9Qk8mxA7SnWeNemL5u 9uN6EvMvUyZAOUtfQ6S9QAGRhL6h6pTeYg== X-Received: by 2002:a17:906:70c5:: with SMTP id g5mr92755499ejk.63.1636320795919; Sun, 07 Nov 2021 13:33:15 -0800 (PST) Received: from apalos.home ([2a02:587:4680:8a9c:2e56:dcff:fe9a:8f06]) by smtp.gmail.com with ESMTPSA id hw8sm5042150ejc.58.2021.11.07.13.33.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 13:33:15 -0800 (PST) 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 0/8 v6] TPM cleanups and MMIO driver Date: Sun, 7 Nov 2021 23:33:03 +0200 Message-Id: <20211107213312.263357-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 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/20211105190517.233079-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 | 151 ++++++++++ drivers/tpm/tpm2_tis_spi.c | 447 +++-------------------------- drivers/tpm/tpm_tis.h | 128 +++++++++ drivers/tpm/tpm_tis_infineon.c | 34 +-- drivers/tpm/tpm_tis_lpc.c | 4 +- include/tpm-v2.h | 1 + 13 files changed, 838 insertions(+), 436 deletions(-) create mode 100644 drivers/tpm/tpm2_tis_core.c create mode 100644 drivers/tpm/tpm2_tis_mmio.c