Re: [PATCH 2/2] tpm: fix byte-order for the value read by tpm2_get_tpm_pt

2016-07-14 Thread Andrey Pronin
On Thu, Jul 14, 2016 at 09:10:46PM -0600, Jason Gunthorpe wrote: > On Thu, Jul 14, 2016 at 06:07:18PM -0700, Andrey Pronin wrote: > > Change-Id: I7d71cd379b1a3b7659d20a1b6008216762596590 > > Signed-off-by: Andrey Pronin > > drivers/char/tpm/tpm2-cmd.c | 2 +- > >

Re: [PATCH 0/2] tpm: add driver for cr50 on SPI

2016-07-14 Thread Andrey Pronin
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 > <apro...@chromium.org>: > >This patchset adds a TCG TPM2.0 PTP FIFO compliant interface for > >Cr50 chip on SPI. > > > >Depends on th

Re: [PATCH 0/2] tpm: add driver for cr50 on SPI

2016-07-14 Thread Andrey Pronin
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 And

[PATCH 2/2] tpm: add driver for cr50 on SPI

2016-07-14 Thread Andrey Pronin
Add TCG TPM2.0 PTP FIFO compatible interface for Cr50 chip on SPI bus. Signed-off-by: Andrey Pronin <apro...@chromium.org> --- drivers/char/tpm/Kconfig| 9 + drivers/char/tpm/Makefile | 1 + drivers/char/tpm/cr50_spi.c | 409 3 files c

[PATCH 1/2] tpm: devicetree: document properties for cr50

2016-07-14 Thread Andrey Pronin
Add TPM2.0-compatible interface to Cr50. Document its properties in devicetree. Signed-off-by: Andrey Pronin <apro...@chromium.org> --- .../devicetree/bindings/security/tpm/cr50_spi.txt | 30 ++ 1 file changed, 30 insertions(+) create mode 100644 Documentation/devi

[PATCH 2/2] tpm: add driver for cr50 on SPI

2016-07-14 Thread Andrey Pronin
Add TCG TPM2.0 PTP FIFO compatible interface for Cr50 chip on SPI bus. Signed-off-by: Andrey Pronin --- drivers/char/tpm/Kconfig| 9 + drivers/char/tpm/Makefile | 1 + drivers/char/tpm/cr50_spi.c | 409 3 files changed, 419 insertions

[PATCH 1/2] tpm: devicetree: document properties for cr50

2016-07-14 Thread Andrey Pronin
Add TPM2.0-compatible interface to Cr50. Document its properties in devicetree. Signed-off-by: Andrey Pronin --- .../devicetree/bindings/security/tpm/cr50_spi.txt | 30 ++ 1 file changed, 30 insertions(+) create mode 100644 Documentation/devicetree/bindings/security/tpm

[PATCH 0/2] tpm: add driver for cr50 on SPI

2016-07-14 Thread 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 <apro...@chromium.org> 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 op

[PATCH 0/2] tpm: add driver for cr50 on SPI

2016-07-14 Thread 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

[PATCH 1/2] tpm: add sysfs attributes for tpm2

2016-07-14 Thread Andrey Pronin
Break sysfs attributes into common and TPM 1.2/2.0-specific, and create sysfs groups for TPM2.0. Signed-off-by: Andrey Pronin <apro...@chromium.org> --- drivers/char/tpm/tpm-chip.c | 48 drivers/char/tpm/tpm-sysfs.c | 24 +++

[PATCH 1/2] tpm: add sysfs attributes for tpm2

2016-07-14 Thread Andrey Pronin
Break sysfs attributes into common and TPM 1.2/2.0-specific, and create sysfs groups for TPM2.0. Signed-off-by: Andrey Pronin --- drivers/char/tpm/tpm-chip.c | 48 drivers/char/tpm/tpm-sysfs.c | 24 -- 2 files changed, 53

[PATCH 0/2] tpm: driver- and tpm2-specific sysfs attributes

2016-07-14 Thread Andrey Pronin
This patchset adds sysfs attributes for the cases not covered by the existing TPM1.2 support: - device-specific attributes provided by drivers like tpm_tis_spi - TPM2.0 Andrey Pronin (2): tpm: add sysfs attributes for tpm2 tpm: support driver-specific sysfs attrs in tpm_tis_core drivers

[PATCH 0/2] tpm: driver- and tpm2-specific sysfs attributes

2016-07-14 Thread Andrey Pronin
This patchset adds sysfs attributes for the cases not covered by the existing TPM1.2 support: - device-specific attributes provided by drivers like tpm_tis_spi - TPM2.0 Andrey Pronin (2): tpm: add sysfs attributes for tpm2 tpm: support driver-specific sysfs attrs in tpm_tis_core drivers

[PATCH 2/2] tpm: support driver-specific sysfs attrs in tpm_tis_core

2016-07-14 Thread Andrey Pronin
Add attr_group to phy_ops that a driver relying on tpm_tis_core_init can set to have its specific attributes registered in sysfs. Signed-off-by: Andrey Pronin <apro...@chromium.org> --- drivers/char/tpm/tpm-sysfs.c| 1 - drivers/char/tpm/tpm.h | 8 +++- drivers/ch

[PATCH 2/2] tpm: support driver-specific sysfs attrs in tpm_tis_core

2016-07-14 Thread Andrey Pronin
Add attr_group to phy_ops that a driver relying on tpm_tis_core_init can set to have its specific attributes registered in sysfs. Signed-off-by: Andrey Pronin --- drivers/char/tpm/tpm-sysfs.c| 1 - drivers/char/tpm/tpm.h | 8 +++- drivers/char/tpm/tpm_tis_core.c | 3

[PATCH 2/2] tpm_tis_spi: add max xfer size

2016-07-14 Thread Andrey Pronin
Signed-off-by: Andrey Pronin <apro...@chromium.org> --- drivers/char/tpm/tpm_tis_spi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/char/tpm/tpm_tis_spi.c b/drivers/char/tpm/tpm_tis_spi.c index dbaad9c..b103373 100644 --- a/drivers/char/tpm/tpm_tis_spi.c +++ b/drivers/ch

[PATCH 0/2] tpm: add optional max xfer size check

2016-07-14 Thread Andrey Pronin
This patchset introduces an optional maximum transfer size that can be specified by a tpm driver. Setting the max_xfer_size helps to catch the cases when burstcnt is incorrectly reported by the device (e.g. >64 for spi - happened in practice) and gracefully handle such situations. Andrey Pro

[PATCH 2/2] tpm_tis_spi: add max xfer size

2016-07-14 Thread Andrey Pronin
Signed-off-by: Andrey Pronin --- drivers/char/tpm/tpm_tis_spi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/char/tpm/tpm_tis_spi.c b/drivers/char/tpm/tpm_tis_spi.c index dbaad9c..b103373 100644 --- a/drivers/char/tpm/tpm_tis_spi.c +++ b/drivers/char/tpm/tpm_tis_spi.c @@ -206,6

[PATCH 0/2] tpm: add optional max xfer size check

2016-07-14 Thread Andrey Pronin
This patchset introduces an optional maximum transfer size that can be specified by a tpm driver. Setting the max_xfer_size helps to catch the cases when burstcnt is incorrectly reported by the device (e.g. >64 for spi - happened in practice) and gracefully handle such situations. Andrey Pro

[PATCH 1/2] tpm_tis_core: add optional max xfer size check

2016-07-14 Thread Andrey Pronin
). Without catching, causes the physical layer to reject xfer, while is easily preventable by re-querying TPM_STS. Signed-off-by: Andrey Pronin <apro...@chromium.org> --- drivers/char/tpm/tpm_tis_core.c | 17 +++-- drivers/char/tpm/tpm_tis_core.h | 13 + 2 files chang

[PATCH 1/2] tpm_tis_core: add optional max xfer size check

2016-07-14 Thread Andrey Pronin
). Without catching, causes the physical layer to reject xfer, while is easily preventable by re-querying TPM_STS. Signed-off-by: Andrey Pronin --- drivers/char/tpm/tpm_tis_core.c | 17 +++-- drivers/char/tpm/tpm_tis_core.h | 13 + 2 files changed, 28 insertions(+), 2

[PATCH 1/2] tpm: define constants for tpm2 properties

2016-07-14 Thread Andrey Pronin
Change-Id: I47cb1793736781fbea93e5bf80b783e0ac9e8628 Signed-off-by: Andrey Pronin <apro...@chromium.org> --- drivers/char/tpm/tpm.h | 26 ++ 1 file changed, 26 insertions(+) diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h index 8890df2..ad3b9d1

[PATCH 2/2] tpm: fix byte-order for the value read by tpm2_get_tpm_pt

2016-07-14 Thread Andrey Pronin
Change-Id: I7d71cd379b1a3b7659d20a1b6008216762596590 Signed-off-by: Andrey Pronin <apro...@chromium.org> --- drivers/char/tpm/tpm2-cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c index a1673dc..a88b31e

[PATCH 1/2] tpm: define constants for tpm2 properties

2016-07-14 Thread Andrey Pronin
Change-Id: I47cb1793736781fbea93e5bf80b783e0ac9e8628 Signed-off-by: Andrey Pronin --- drivers/char/tpm/tpm.h | 26 ++ 1 file changed, 26 insertions(+) diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h index 8890df2..ad3b9d1 100644 --- a/drivers/char/tpm/tpm.h

[PATCH 2/2] tpm: fix byte-order for the value read by tpm2_get_tpm_pt

2016-07-14 Thread Andrey Pronin
Change-Id: I7d71cd379b1a3b7659d20a1b6008216762596590 Signed-off-by: Andrey Pronin --- drivers/char/tpm/tpm2-cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c index a1673dc..a88b31e 100644 --- a/drivers/char/tpm

[PATCH 0/2] tpm: better support for 32-bit tpm2 properties

2016-07-14 Thread Andrey Pronin
These patches help working with 32-bit TPM2.0-specific properties that can be read using TPM2_GetCapability(capability = TPM_CAP_TPM_PROPERTIES): - TPM_PT_PERMANENT - TPM_PT_STARTUP_CLEAR Andrey Pronin (2): tpm: define constants for tpm2 properties tpm: fix byte-order for the value read

[PATCH 0/2] tpm: better support for 32-bit tpm2 properties

2016-07-14 Thread Andrey Pronin
These patches help working with 32-bit TPM2.0-specific properties that can be read using TPM2_GetCapability(capability = TPM_CAP_TPM_PROPERTIES): - TPM_PT_PERMANENT - TPM_PT_STARTUP_CLEAR Andrey Pronin (2): tpm: define constants for tpm2 properties tpm: fix byte-order for the value read

[PATCH] tpm_tis_core: convert max timeouts from msec to jiffies

2016-07-14 Thread Andrey Pronin
tpm_tis_core was missing conversion from msec when assigning max timeouts from constants. Signed-off-by: Andrey Pronin <apro...@chromium.org> --- drivers/char/tpm/tpm_tis_core.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/char/tpm/tpm_tis_core.c b/d

[PATCH] tpm_tis_core: convert max timeouts from msec to jiffies

2016-07-14 Thread Andrey Pronin
tpm_tis_core was missing conversion from msec when assigning max timeouts from constants. Signed-off-by: Andrey Pronin --- drivers/char/tpm/tpm_tis_core.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm

Re: [PATCH 1/4] spi: Add option to wake a device by toggling CS

2016-07-01 Thread Andrey Pronin
On Fri, Jul 01, 2016 at 07:17:08PM +0200, Mark Brown wrote: > On Fri, Jul 01, 2016 at 10:05:50AM -0700, Doug Anderson wrote: > > > I'm curious why you you need a timer at all. Can't you just keep > > track of the jiffies that you last sent and do subtraction? ...or you > > could get even more

Re: [PATCH 1/4] spi: Add option to wake a device by toggling CS

2016-07-01 Thread Andrey Pronin
On Fri, Jul 01, 2016 at 07:17:08PM +0200, Mark Brown wrote: > On Fri, Jul 01, 2016 at 10:05:50AM -0700, Doug Anderson wrote: > > > I'm curious why you you need a timer at all. Can't you just keep > > track of the jiffies that you last sent and do subtraction? ...or you > > could get even more

Re: [PATCH 1/4] spi: Add option to wake a device by toggling CS

2016-07-01 Thread Andrey Pronin
On Fri, Jul 01, 2016 at 09:02:30AM +0100, Mark Brown wrote: > On Wed, Jun 29, 2016 at 08:54:24PM -0700, apro...@chromium.org wrote: > > From: Andrey Pronin <apro...@chromium.org> > > > > Some SPI devices may go to sleep after a period of inactivity > > on SPI. For

Re: [PATCH 1/4] spi: Add option to wake a device by toggling CS

2016-07-01 Thread Andrey Pronin
On Fri, Jul 01, 2016 at 09:02:30AM +0100, Mark Brown wrote: > On Wed, Jun 29, 2016 at 08:54:24PM -0700, apro...@chromium.org wrote: > > From: Andrey Pronin > > > > Some SPI devices may go to sleep after a period of inactivity > > on SPI. For such devices, if e

<    1   2