Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1590655ybl; Mon, 2 Dec 2019 05:40:00 -0800 (PST) X-Google-Smtp-Source: APXvYqy5JbPqzpOBjl13eQQrh8j5Ej3jr4GyBoX+38zuaYKyYD9MEkhNZII9tqNNoxSvRe/MEdhw X-Received: by 2002:a2e:9758:: with SMTP id f24mr47029738ljj.105.1575294000734; Mon, 02 Dec 2019 05:40:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575294000; cv=none; d=google.com; s=arc-20160816; b=WYDpA+N3IdCjTYke0cT95ofpG0+4ybnDl0ErCI0RRvAclpIWMsygI4Q5ayGrQsusIl IIoJF0/lNwfY4hPv6FofxqG9btaHdQxridCFv2HtSnm8B60JvAyhbk55MADCT8IPMv3q z1iiSgM6skIs89kCwg076JNdfL4VXZp3tqUr2/vv+/19Egrng/nLhiq1MQG2lu1bdT2p 0dF2vGd5EJhoGBHCvTTIHPG7i3EevU+nNU3QAjBwPWDf5FLSmXNKDWJTlVOEhZxgMbkv K/54UYox/IJUmGkDmJb4bsLAR+pAT6XtjE/RQNHTKru9YuI0YITi69uNzLKrtYzWGJj3 7uvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=8Z+mTn5bgjzXy8VM3gtSrR2L2yFrGZ8+Ck8BNo05DFU=; b=h3CZ2NqOZk2TyNCHvbmWnUsQ/P1T3DLAfkgVbDJtdVwVUqtoJQvIgF8uR6WbfoFbbH ubgOfhZ+rb0406nFzPd9kImg50ioSg0hWJGZ9Ew0c0RPwgF8GKP7eaylHRMCYEptH3I9 2qEBgm+ra/CABOWjQp8HjlBoJWAvugp6csAYRQNYEQQmX8V9xuisqClywgTxVZtXxtmr e4lFXy7hDNk4vZcpRMgMadGt6D2NPtchmIzFhm+ecoCFRr1kpSc26BnP48o/2WQ/2rTZ euzfCns4tVzL2rpMZhtf5+ZiA/6IEXOYWTMcXbbYWK8t1tEGAM5KoH17FeV+m2j/z+up 3Tfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i10si6600368ejf.44.2019.12.02.05.39.37; Mon, 02 Dec 2019 05:40:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727563AbfLBNfx (ORCPT + 99 others); Mon, 2 Dec 2019 08:35:53 -0500 Received: from 212.199.177.27.static.012.net.il ([212.199.177.27]:45923 "EHLO herzl.nuvoton.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727406AbfLBNfx (ORCPT ); Mon, 2 Dec 2019 08:35:53 -0500 Received: from taln60.nuvoton.co.il (ntil-fw [212.199.177.25]) by herzl.nuvoton.co.il (8.13.8/8.13.8) with ESMTP id xB2DYIId015793; Mon, 2 Dec 2019 15:34:18 +0200 Received: by taln60.nuvoton.co.il (Postfix, from userid 10140) id A95E160275; Mon, 2 Dec 2019 15:34:18 +0200 (IST) From: amirmizi6@gmail.com To: Eyal.Cohen@nuvoton.com, jarkko.sakkinen@linux.intel.com, oshrialkoby85@gmail.com, alexander.steffen@infineon.com, robh+dt@kernel.org, mark.rutland@arm.com, peterhuewe@gmx.de, jgg@ziepe.ca, arnd@arndb.de, gregkh@linuxfoundation.org Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org, oshri.alkoby@nuvoton.com, tmaimon77@gmail.com, gcwilson@us.ibm.com, kgoldman@us.ibm.com, ayna@linux.vnet.ibm.com, Dan.Morav@nuvoton.com, oren.tanami@nuvoton.com, shmulik.hager@nuvoton.com, amir.mizinski@nuvoton.com, Amir Mizinski Subject: [PATCH v2 0/5] add tpm i2c ptp driver Date: Mon, 2 Dec 2019 15:33:27 +0200 Message-Id: <20191202133332.178110-1-amirmizi6@gmail.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Amir Mizinski This patch set adds support for TPM devices that implement the I2C. Interface defined by TCG PTP specification: https://trustedcomputinggroup.org/wp-content/uploads/TCG_PC_Client_Platform_TPM_Profile_PTP_2.0_r1.03_v22.pdf The driver was tested on Raspberry-Pie 3, using Nuvoton NPCT75X TPM. Interupts are not implemented yet, preparing it for the next patch. This patch is based on initial work by oshri Alkoby, Alexander Steffen and Christophe Ricard Addressed comments from: - Jarkko Sakkinen: https://patchwork.kernel.org/patch/11236257/ - Rob Herring: https://patchwork.kernel.org/patch/11236253/ Changes since version 1: - Commit 2/5: - Fixed and extended commit description. - Fixed an issue regarding handeling max retries. - Commit 4/5: - Converted "tpm_tis_i2c.txt" to "tpm-tis-i2c.yaml". - Renamed "tpm_tis-i2c" to "tpm-tis-i2c". - Removed interrupts properties. - Commit 5/5: Replaced "tpm_tis-i2c" with "tpm-tis-i2c" in "tpm_tis_i2c.c". Amir Mizinski (5): char: tpm: Make implementation of read16 read32 write32 optional char: tpm: Add check_data handle to tpm_tis_phy_ops in order to check data integrity char: tpm: rewrite "tpm_tis_req_canceled()" dt-bindings: tpm: Add YAML schema for TPM TIS I2C options char: tpm: add tpm_tis_i2c driver .../bindings/security/tpm/tpm-tis-i2c.yaml | 38 +++ drivers/char/tpm/Kconfig | 12 + drivers/char/tpm/Makefile | 1 + drivers/char/tpm/tpm_tis_core.c | 113 +++++---- drivers/char/tpm/tpm_tis_core.h | 41 +++- drivers/char/tpm/tpm_tis_i2c.c | 272 +++++++++++++++++++++ drivers/char/tpm/tpm_tis_spi.c | 41 ---- 7 files changed, 425 insertions(+), 93 deletions(-) create mode 100644 Documentation/devicetree/bindings/security/tpm/tpm-tis-i2c.yaml create mode 100644 drivers/char/tpm/tpm_tis_i2c.c -- 2.7.4