From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752477AbcGOCuc (ORCPT ); Thu, 14 Jul 2016 22:50:32 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:35257 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751279AbcGOCu3 (ORCPT ); Thu, 14 Jul 2016 22:50:29 -0400 Date: Thu, 14 Jul 2016 19:50:26 -0700 From: Andrey Pronin To: Peter Huewe Cc: Jarkko Sakkinen , Marcel Selhorst , Jason Gunthorpe , tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, groeck@chromium.org, smbarber@chromium.org, dianders@chromium.org Subject: Re: [PATCH 0/2] tpm: add driver for cr50 on SPI Message-ID: <20160715025026.GA21375@apronin> References: <1468549218-19215-1-git-send-email-apronin@chromium.org> <9A3CFCAE-F2FD-438D-A32B-AD59E0362E71@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9A3CFCAE-F2FD-438D-A32B-AD59E0362E71@gmx.de> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 14, 2016 at 07:28:55PM -0700, Peter Huewe wrote: > Am 14. Juli 2016 19:20:16 GMT-07:00, schrieb Andrey Pronin : > >This patchset adds a TCG TPM2.0 PTP FIFO compliant interface for > >Cr50 chip on SPI. > > > >Depends on the following patches by Andrey Pronin > > > >that add new members to phy_ops in tpm_tis_core: > > - tpm: support driver-specific sysfs attrs in tpm_tis_core > > - tpm_tis_core: add optional max xfer size check > > > >Andrey Pronin (2): > > tpm: devicetree: document properties for cr50 > > tpm: add driver for cr50 on SPI > > > > .../devicetree/bindings/security/tpm/cr50_spi.txt | 30 ++ > > drivers/char/tpm/Kconfig | 9 + > > drivers/char/tpm/Makefile | 1 + > >drivers/char/tpm/cr50_spi.c | 409 > >+++++++++++++++++++++ > > 4 files changed, 449 insertions(+) > >create mode 100644 > >Documentation/devicetree/bindings/security/tpm/cr50_spi.txt > > create mode 100644 drivers/char/tpm/cr50_spi.c > > > Hi, > can you explain a bit more about this device? And why it needs a special driver and cannot be handled by tpm_tis_spi if its tcg compliant? > > Peter > -- > Sent from my mobile Hi Peter, Yes, it has a TCG-compliant interface, however, there are several things specific to this device: - need to ensure a certain delay between spi transactions, or else the chip can miss several first bytes. - if there is no spi activity for this chip, it may go to sleep, and needs to be waken up before sending further commands. - it has some vendor-specific registers accessible from spi bus. All that combined to me seemed to be enough justification to add a device-specific driver rather than adding vendor-specific code to tpm_tis_spi in multiple places. Plus, where it seemed appropriate, I added additional hooks to tpm_tis_core (device-specific sysfs attributes, capping burstcnt in case of chip error) to support this chip specifics. Best regards, Andrey