* [PATCH 1/2] tpm: devicetree: document properties for cr50
[not found] ` <1468549218-19215-1-git-send-email-apronin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2016-07-15 2:20 ` Andrey Pronin
2016-07-15 4:05 ` Guenter Roeck
[not found] ` <1468549218-19215-2-git-send-email-apronin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
[not found] ` <cover.1468985673.git.apronin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
` (2 subsequent siblings)
3 siblings, 2 replies; 17+ messages in thread
From: Andrey Pronin @ 2016-07-15 2:20 UTC (permalink / raw)
To: Jarkko Sakkinen
Cc: Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA,
dianders-F7+t8E8rja9g9hUCZPvPmw, Pawel Moll,
Ian Campbell,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
Rob Herring, smbarber-F7+t8E8rja9g9hUCZPvPmw,
tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
Kumar Gala, groeck-F7+t8E8rja9g9hUCZPvPmw
Add TPM2.0-compatible interface to Cr50. Document its properties
in devicetree.
Signed-off-by: Andrey Pronin <apronin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
.../devicetree/bindings/security/tpm/cr50_spi.txt | 30 ++++++++++++++++++++++
1 file changed, 30 insertions(+)
create mode 100644 Documentation/devicetree/bindings/security/tpm/cr50_spi.txt
diff --git a/Documentation/devicetree/bindings/security/tpm/cr50_spi.txt b/Documentation/devicetree/bindings/security/tpm/cr50_spi.txt
new file mode 100644
index 0000000..1b05e51
--- /dev/null
+++ b/Documentation/devicetree/bindings/security/tpm/cr50_spi.txt
@@ -0,0 +1,30 @@
+* Cr50 Chip on SPI.
+
+TCG PTP FIFO Compliant Interface to Cr50 on SPI bus.
+
+Required properties:
+- compatible: Should be "google,cr50_spi".
+- spi-max-frequency: Maximum SPI frequency.
+
+Optional properties:
+- access-delay-msec: Required delay between subsequent transactions on SPI.
+- sleep-delay-msec: Time after the last SPI activity, after which the chip
+ may go to sleep.
+- wake-start-delay-msec: Time after initiating wake up before the chip is
+ ready to accept commands over SPI.
+
+Example:
+
+&spi0 {
+ status = "okay";
+
+ cr50@0 {
+ compatible = "google,cr50_spi";
+ reg = <0>;
+ spi-max-frequency = <800000>;
+
+ access-delay-msec = <2>;
+ sleep-delay-msec = <1000>;
+ wake-start-delay-msec = <60>;
+ };
+};
--
2.6.6
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 1/2] tpm: devicetree: document properties for cr50
2016-07-15 2:20 ` [PATCH 1/2] tpm: devicetree: document properties for cr50 Andrey Pronin
@ 2016-07-15 4:05 ` Guenter Roeck
[not found] ` <CABXOdTcVcZ10c6uShN2AXUZfOuK=FESeo73Assi0sziMZJ_+Fw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
[not found] ` <1468549218-19215-2-git-send-email-apronin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
1 sibling, 1 reply; 17+ messages in thread
From: Guenter Roeck @ 2016-07-15 4:05 UTC (permalink / raw)
To: Andrey Pronin
Cc: Jarkko Sakkinen, Peter Huewe, Marcel Selhorst, Jason Gunthorpe,
tpmdd-devel, linux-kernel, Guenter Roeck, smbarber,
Douglas Anderson, devicetree, Rob Herring, Pawel Moll,
Mark Rutland, Ian Campbell, Kumar Gala
On Thu, Jul 14, 2016 at 7:20 PM, Andrey Pronin <apronin@chromium.org> wrote:
> Add TPM2.0-compatible interface to Cr50. Document its properties
> in devicetree.
>
> Signed-off-by: Andrey Pronin <apronin@chromium.org>
> ---
> .../devicetree/bindings/security/tpm/cr50_spi.txt | 30 ++++++++++++++++++++++
> 1 file changed, 30 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/security/tpm/cr50_spi.txt
>
> diff --git a/Documentation/devicetree/bindings/security/tpm/cr50_spi.txt b/Documentation/devicetree/bindings/security/tpm/cr50_spi.txt
> new file mode 100644
> index 0000000..1b05e51
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/security/tpm/cr50_spi.txt
> @@ -0,0 +1,30 @@
> +* Cr50 Chip on SPI.
> +
> +TCG PTP FIFO Compliant Interface to Cr50 on SPI bus.
> +
> +Required properties:
> +- compatible: Should be "google,cr50_spi".
google,cr50, maybe ? The "_spi" seems redundant.
Also, I agree with comments from others - the term cr50 really needs
an explanation (Google thinks that it is a motor bike, a scanner, or a
coffee roaster).
Thanks,
Guenter
> +- spi-max-frequency: Maximum SPI frequency.
> +
> +Optional properties:
> +- access-delay-msec: Required delay between subsequent transactions on SPI.
> +- sleep-delay-msec: Time after the last SPI activity, after which the chip
> + may go to sleep.
> +- wake-start-delay-msec: Time after initiating wake up before the chip is
> + ready to accept commands over SPI.
> +
> +Example:
> +
> +&spi0 {
> + status = "okay";
> +
> + cr50@0 {
> + compatible = "google,cr50_spi";
> + reg = <0>;
> + spi-max-frequency = <800000>;
> +
> + access-delay-msec = <2>;
> + sleep-delay-msec = <1000>;
> + wake-start-delay-msec = <60>;
> + };
> +};
> --
> 2.6.6
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/2] tpm: devicetree: document properties for cr50
[not found] ` <CABXOdTcVcZ10c6uShN2AXUZfOuK=FESeo73Assi0sziMZJ_+Fw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2016-07-15 17:31 ` Andrey Pronin
2016-07-15 18:28 ` Guenter Roeck
0 siblings, 1 reply; 17+ messages in thread
From: Andrey Pronin @ 2016-07-15 17:31 UTC (permalink / raw)
To: Guenter Roeck
Cc: Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA, Douglas Anderson,
Pawel Moll, Ian Campbell, linux-kernel,
smbarber-F7+t8E8rja9g9hUCZPvPmw, Rob Herring,
tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Kumar Gala,
Guenter Roeck
On Thu, Jul 14, 2016 at 09:05:53PM -0700, Guenter Roeck wrote:
> On Thu, Jul 14, 2016 at 7:20 PM, Andrey Pronin <apronin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote:
> > +
> > +Required properties:
> > +- compatible: Should be "google,cr50_spi".
>
> google,cr50, maybe ? The "_spi" seems redundant.
>
I believe "_spi" is warranted. It's the driver that handles the SPI
interface for Cr50 specifically.
But if the same firmware ever talks through a different interface (say,
I2C), this driver will not be compatible.
> Also, I agree with comments from others - the term cr50 really needs
> an explanation (Google thinks that it is a motor bike, a scanner, or a
> coffee roaster).
>
Yes, will add a better description of what it is. My original one was
too brief and imprecise at the same time.
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/2] tpm: devicetree: document properties for cr50
2016-07-15 17:31 ` Andrey Pronin
@ 2016-07-15 18:28 ` Guenter Roeck
0 siblings, 0 replies; 17+ messages in thread
From: Guenter Roeck @ 2016-07-15 18:28 UTC (permalink / raw)
To: Andrey Pronin
Cc: Jarkko Sakkinen, Peter Huewe, Marcel Selhorst, Jason Gunthorpe,
tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, linux-kernel,
Guenter Roeck, smbarber-F7+t8E8rja9g9hUCZPvPmw, Douglas Anderson,
devicetree-u79uwXL29TY76Z2rM5mHXA, Rob Herring, Pawel Moll,
Mark Rutland, Ian Campbell, Kumar Gala
On Fri, Jul 15, 2016 at 10:31 AM, Andrey Pronin <apronin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote:
> On Thu, Jul 14, 2016 at 09:05:53PM -0700, Guenter Roeck wrote:
>> On Thu, Jul 14, 2016 at 7:20 PM, Andrey Pronin <apronin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote:
>> > +
>> > +Required properties:
>> > +- compatible: Should be "google,cr50_spi".
>>
>> google,cr50, maybe ? The "_spi" seems redundant.
>>
>
> I believe "_spi" is warranted. It's the driver that handles the SPI
> interface for Cr50 specifically.
> But if the same firmware ever talks through a different interface (say,
> I2C), this driver will not be compatible.
>
I meant in the context of it being attached to a spi device, which
implies that it is connected through a spi bus.
Guenter
>> Also, I agree with comments from others - the term cr50 really needs
>> an explanation (Google thinks that it is a motor bike, a scanner, or a
>> coffee roaster).
>>
>
> Yes, will add a better description of what it is. My original one was
> too brief and imprecise at the same time.
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/2] tpm: devicetree: document properties for cr50
[not found] ` <1468549218-19215-2-git-send-email-apronin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2016-07-17 13:28 ` Rob Herring
0 siblings, 0 replies; 17+ messages in thread
From: Rob Herring @ 2016-07-17 13:28 UTC (permalink / raw)
To: Andrey Pronin
Cc: Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA,
dianders-F7+t8E8rja9g9hUCZPvPmw, Pawel Moll,
Ian Campbell,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
smbarber-F7+t8E8rja9g9hUCZPvPmw,
tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
Kumar Gala, groeck-F7+t8E8rja9g9hUCZPvPmw
On Thu, Jul 14, 2016 at 07:20:17PM -0700, Andrey Pronin wrote:
> Add TPM2.0-compatible interface to Cr50. Document its properties
> in devicetree.
>
> Signed-off-by: Andrey Pronin <apronin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> ---
> .../devicetree/bindings/security/tpm/cr50_spi.txt | 30 ++++++++++++++++++++++
> 1 file changed, 30 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/security/tpm/cr50_spi.txt
>
> diff --git a/Documentation/devicetree/bindings/security/tpm/cr50_spi.txt b/Documentation/devicetree/bindings/security/tpm/cr50_spi.txt
> new file mode 100644
> index 0000000..1b05e51
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/security/tpm/cr50_spi.txt
> @@ -0,0 +1,30 @@
> +* Cr50 Chip on SPI.
> +
> +TCG PTP FIFO Compliant Interface to Cr50 on SPI bus.
> +
> +Required properties:
> +- compatible: Should be "google,cr50_spi".
I agree with dropping '_spi'. The interface is defined by the parent
device.
> +- spi-max-frequency: Maximum SPI frequency.
> +
> +Optional properties:
> +- access-delay-msec: Required delay between subsequent transactions on SPI.
There may be a standard property for this...
> +- sleep-delay-msec: Time after the last SPI activity, after which the chip
> + may go to sleep.
> +- wake-start-delay-msec: Time after initiating wake up before the chip is
> + ready to accept commands over SPI.
Use the standard unit '-ms' instead of '-msec'.
Do these times really vary much and need to be in DT?
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 1/2] tpm: devicetree: document properties for cr50
[not found] ` <cover.1468985673.git.apronin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2016-07-20 3:41 ` Andrey Pronin
2016-07-20 19:03 ` Rob Herring
0 siblings, 1 reply; 17+ messages in thread
From: Andrey Pronin @ 2016-07-20 3:41 UTC (permalink / raw)
To: Jarkko Sakkinen
Cc: Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA,
Christophe Ricard, Pawel Moll, Ian Campbell,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Rob Herring,
tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Kumar Gala
Add TPM2.0 PTP FIFO compatible SPI interface for chips with Cr50
firmware. Several timing-related properties that may differ from
one firmware version to another are added to devicetree.
Document these properties.
Signed-off-by: Andrey Pronin <apronin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
.../devicetree/bindings/security/tpm/cr50_spi.txt | 32 ++++++++++++++++++++++
1 file changed, 32 insertions(+)
create mode 100644 Documentation/devicetree/bindings/security/tpm/cr50_spi.txt
diff --git a/Documentation/devicetree/bindings/security/tpm/cr50_spi.txt b/Documentation/devicetree/bindings/security/tpm/cr50_spi.txt
new file mode 100644
index 0000000..f212b6b
--- /dev/null
+++ b/Documentation/devicetree/bindings/security/tpm/cr50_spi.txt
@@ -0,0 +1,32 @@
+* H1 Secure Microcontroller with Cr50 Firmware on SPI Bus.
+
+H1 Secure Microcontroller running Cr50 firmware provides several
+functions, including TPM-like functionality. It communicates over
+SPI using the FIFO protocol described in the PTP Spec, section 6.
+
+Required properties:
+- compatible: Should be "google,cr50".
+- spi-max-frequency: Maximum SPI frequency.
+
+Optional properties:
+- access-delay-ms: Required delay between subsequent transactions on SPI.
+- sleep-delay-ms: Time after the last SPI activity, after which the chip
+ may go to sleep.
+- wake-start-delay-ms: Time after initiating wake up before the chip is
+ ready to accept commands over SPI.
+
+Example:
+
+&spi0 {
+ status = "okay";
+
+ cr50@0 {
+ compatible = "google,cr50";
+ reg = <0>;
+ spi-max-frequency = <800000>;
+
+ access-delay-ms = <2>;
+ sleep-delay-ms = <1000>;
+ wake-start-delay-ms = <60>;
+ };
+};
--
2.6.6
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH v2 1/2] tpm: devicetree: document properties for cr50
2016-07-20 3:41 ` [PATCH v2 " Andrey Pronin
@ 2016-07-20 19:03 ` Rob Herring
2016-07-20 19:49 ` Andrey Pronin
0 siblings, 1 reply; 17+ messages in thread
From: Rob Herring @ 2016-07-20 19:03 UTC (permalink / raw)
To: Andrey Pronin
Cc: Jarkko Sakkinen, Peter Huewe, Marcel Selhorst, Jason Gunthorpe,
tpmdd-devel, linux-kernel, Christophe Ricard, Pawel Moll,
Mark Rutland, Ian Campbell, Kumar Gala, devicetree
On Tue, Jul 19, 2016 at 08:41:24PM -0700, Andrey Pronin wrote:
> Add TPM2.0 PTP FIFO compatible SPI interface for chips with Cr50
> firmware. Several timing-related properties that may differ from
> one firmware version to another are added to devicetree.
> Document these properties.
>
> Signed-off-by: Andrey Pronin <apronin@chromium.org>
> ---
> .../devicetree/bindings/security/tpm/cr50_spi.txt | 32 ++++++++++++++++++++++
> 1 file changed, 32 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/security/tpm/cr50_spi.txt
>
> diff --git a/Documentation/devicetree/bindings/security/tpm/cr50_spi.txt b/Documentation/devicetree/bindings/security/tpm/cr50_spi.txt
> new file mode 100644
> index 0000000..f212b6b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/security/tpm/cr50_spi.txt
> @@ -0,0 +1,32 @@
> +* H1 Secure Microcontroller with Cr50 Firmware on SPI Bus.
> +
> +H1 Secure Microcontroller running Cr50 firmware provides several
> +functions, including TPM-like functionality. It communicates over
> +SPI using the FIFO protocol described in the PTP Spec, section 6.
> +
> +Required properties:
> +- compatible: Should be "google,cr50".
> +- spi-max-frequency: Maximum SPI frequency.
> +
> +Optional properties:
> +- access-delay-ms: Required delay between subsequent transactions on SPI.
As I mentioned, there may be common properties. It doesn't seem you
looked, so I did:
- spi-rx-delay-us - (optional) Microsecond delay after a read transfer.
- spi-tx-delay-us - (optional) Microsecond delay after a write transfer.
Seems to me setting one or both of these should work for you.
> +- sleep-delay-ms: Time after the last SPI activity, after which the chip
> + may go to sleep.
> +- wake-start-delay-ms: Time after initiating wake up before the chip is
> + ready to accept commands over SPI.
I also asked why these 2 can't be hard-coded in the driver?
> +
> +Example:
> +
> +&spi0 {
> + status = "okay";
> +
> + cr50@0 {
> + compatible = "google,cr50";
> + reg = <0>;
> + spi-max-frequency = <800000>;
> +
> + access-delay-ms = <2>;
> + sleep-delay-ms = <1000>;
> + wake-start-delay-ms = <60>;
> + };
> +};
> --
> 2.6.6
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 1/2] tpm: devicetree: document properties for cr50
2016-07-20 19:03 ` Rob Herring
@ 2016-07-20 19:49 ` Andrey Pronin
2016-07-20 19:54 ` Jason Gunthorpe
2016-07-21 21:03 ` Rob Herring
0 siblings, 2 replies; 17+ messages in thread
From: Andrey Pronin @ 2016-07-20 19:49 UTC (permalink / raw)
To: Rob Herring
Cc: Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA,
Christophe Ricard, Pawel Moll, Ian Campbell,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Kumar Gala
On Wed, Jul 20, 2016 at 02:03:03PM -0500, Rob Herring wrote:
> On Tue, Jul 19, 2016 at 08:41:24PM -0700, Andrey Pronin wrote:
Hi Rob,
> As I mentioned, there may be common properties. It doesn't seem you
> looked, so I did:
>
> - spi-rx-delay-us - (optional) Microsecond delay after a read transfer.
> - spi-tx-delay-us - (optional) Microsecond delay after a write transfer.
>
> Seems to me setting one or both of these should work for you.
>
Yes, good catch, my fault I didn't see those.
But they are not exactly what I mean and need. I don't need delay after
each read or write transfer. What is needed is a guaranteed time
between transfers.
So, if the next transaction doesn't come withing the next X ms (or us),
we don't waste time on inserting a delays after this transaction at all.
Following the description and always inserting a delay must work well
for short microseconds-long delays. For longer milliseconds-long delays
a different strategy of checking the time when the previous transaction
was and only delaying if it was not too long ago is better.
Thus, I won't be able to re-use these properties anyways based on their
current description in bindings/spi/spi-bus.txt.
> > +- sleep-delay-ms: Time after the last SPI activity, after which the chip
> > + may go to sleep.
> > +- wake-start-delay-ms: Time after initiating wake up before the chip is
> > + ready to accept commands over SPI.
>
> I also asked why these 2 can't be hard-coded in the driver?
>
Sorry, I just updated this patch description in v2 to indicate why they are not
hard-coded, but didn't answer explicitly. As the firmware changes, a different
revision of it can have a different time before it sleeps in its configuration,
or the time it takes it to startup may be different. Thus, there's a way to
set it here w/o changing the driver.
Andrey
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 1/2] tpm: devicetree: document properties for cr50
2016-07-20 19:49 ` Andrey Pronin
@ 2016-07-20 19:54 ` Jason Gunthorpe
[not found] ` <20160720195422.GA30947-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-21 21:03 ` Rob Herring
1 sibling, 1 reply; 17+ messages in thread
From: Jason Gunthorpe @ 2016-07-20 19:54 UTC (permalink / raw)
To: Andrey Pronin
Cc: Mark Rutland, Rob Herring, Christophe Ricard, Pawel Moll,
Ian Campbell, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Kumar Gala
On Wed, Jul 20, 2016 at 12:49:12PM -0700, Andrey Pronin wrote:
> Sorry, I just updated this patch description in v2 to indicate why they are not
> hard-coded, but didn't answer explicitly. As the firmware changes, a different
> revision of it can have a different time before it sleeps in its configuration,
> or the time it takes it to startup may be different. Thus, there's a way to
> set it here w/o changing the driver.
This sort of stuff should be read out of the firmware, not DT..
Why has Google created such a non-standard TPM firmware???
Jason
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 1/2] tpm: devicetree: document properties for cr50
2016-07-20 19:49 ` Andrey Pronin
2016-07-20 19:54 ` Jason Gunthorpe
@ 2016-07-21 21:03 ` Rob Herring
2016-07-27 21:00 ` Andrey Pronin
1 sibling, 1 reply; 17+ messages in thread
From: Rob Herring @ 2016-07-21 21:03 UTC (permalink / raw)
To: Andrey Pronin
Cc: Jarkko Sakkinen, Peter Huewe, Marcel Selhorst, Jason Gunthorpe,
tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Christophe Ricard,
Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
devicetree-u79uwXL29TY76Z2rM5mHXA
On Wed, Jul 20, 2016 at 12:49:12PM -0700, Andrey Pronin wrote:
> On Wed, Jul 20, 2016 at 02:03:03PM -0500, Rob Herring wrote:
> > On Tue, Jul 19, 2016 at 08:41:24PM -0700, Andrey Pronin wrote:
>
> Hi Rob,
>
> > As I mentioned, there may be common properties. It doesn't seem you
> > looked, so I did:
> >
> > - spi-rx-delay-us - (optional) Microsecond delay after a read transfer.
> > - spi-tx-delay-us - (optional) Microsecond delay after a write transfer.
> >
> > Seems to me setting one or both of these should work for you.
> >
>
> Yes, good catch, my fault I didn't see those.
> But they are not exactly what I mean and need. I don't need delay after
> each read or write transfer. What is needed is a guaranteed time
> between transfers.
>
> So, if the next transaction doesn't come withing the next X ms (or us),
> we don't waste time on inserting a delays after this transaction at all.
> Following the description and always inserting a delay must work well
> for short microseconds-long delays. For longer milliseconds-long delays
> a different strategy of checking the time when the previous transaction
> was and only delaying if it was not too long ago is better.
I'd guess that the intent is the same for all. A simple delay is
just much easier to implement. I would think implementing the more
sophisticated algorithm would work for all users. Perhaps with some
threshold for a simple delay.
> Thus, I won't be able to re-use these properties anyways based on their
> current description in bindings/spi/spi-bus.txt.
>
> > > +- sleep-delay-ms: Time after the last SPI activity, after which the chip
> > > + may go to sleep.
> > > +- wake-start-delay-ms: Time after initiating wake up before the chip is
> > > + ready to accept commands over SPI.
> >
> > I also asked why these 2 can't be hard-coded in the driver?
> >
>
> Sorry, I just updated this patch description in v2 to indicate why they are not
> hard-coded, but didn't answer explicitly. As the firmware changes, a different
> revision of it can have a different time before it sleeps in its configuration,
> or the time it takes it to startup may be different. Thus, there's a way to
> set it here w/o changing the driver.
The firmware and DT may not be updated in sync especially if you are
loading the firmware from the rootfs. Are you doing DT and firmware
updates without changing the kernel?
Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 1/2] tpm: devicetree: document properties for cr50
2016-07-21 21:03 ` Rob Herring
@ 2016-07-27 21:00 ` Andrey Pronin
0 siblings, 0 replies; 17+ messages in thread
From: Andrey Pronin @ 2016-07-27 21:00 UTC (permalink / raw)
To: Rob Herring
Cc: Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA,
Christophe Ricard, Pawel Moll, Ian Campbell,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Kumar Gala
On Thu, Jul 21, 2016 at 04:03:12PM -0500, Rob Herring wrote:
> On Wed, Jul 20, 2016 at 12:49:12PM -0700, Andrey Pronin wrote:
> > On Wed, Jul 20, 2016 at 02:03:03PM -0500, Rob Herring wrote:
> > > On Tue, Jul 19, 2016 at 08:41:24PM -0700, Andrey Pronin wrote:
> >
> > Hi Rob,
> >
> > > As I mentioned, there may be common properties. It doesn't seem you
> > > looked, so I did:
> > >
> > > - spi-rx-delay-us - (optional) Microsecond delay after a read transfer.
> > > - spi-tx-delay-us - (optional) Microsecond delay after a write transfer.
> > >
> > > Seems to me setting one or both of these should work for you.
> > >
> >
> > Yes, good catch, my fault I didn't see those.
> > But they are not exactly what I mean and need. I don't need delay after
> > each read or write transfer. What is needed is a guaranteed time
> > between transfers.
> >
> > So, if the next transaction doesn't come withing the next X ms (or us),
> > we don't waste time on inserting a delays after this transaction at all.
> > Following the description and always inserting a delay must work well
> > for short microseconds-long delays. For longer milliseconds-long delays
> > a different strategy of checking the time when the previous transaction
> > was and only delaying if it was not too long ago is better.
>
> I'd guess that the intent is the same for all. A simple delay is
> just much easier to implement. I would think implementing the more
> sophisticated algorithm would work for all users. Perhaps with some
> threshold for a simple delay.
>
> > Thus, I won't be able to re-use these properties anyways based on their
> > current description in bindings/spi/spi-bus.txt.
> >
> > > > +- sleep-delay-ms: Time after the last SPI activity, after which the chip
> > > > + may go to sleep.
> > > > +- wake-start-delay-ms: Time after initiating wake up before the chip is
> > > > + ready to accept commands over SPI.
> > >
> > > I also asked why these 2 can't be hard-coded in the driver?
> > >
> >
> > Sorry, I just updated this patch description in v2 to indicate why they are not
> > hard-coded, but didn't answer explicitly. As the firmware changes, a different
> > revision of it can have a different time before it sleeps in its configuration,
> > or the time it takes it to startup may be different. Thus, there's a way to
> > set it here w/o changing the driver.
>
> The firmware and DT may not be updated in sync especially if you are
> loading the firmware from the rootfs. Are you doing DT and firmware
> updates without changing the kernel?
>
> Rob
Hi Rob,
Thanks for the feedback. I will hard-code those parameters in the
driver instead of reading from DT.
Thanks,
Andrey
------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 1/2] tpm: devicetree: document properties for cr50
[not found] ` <20160720195422.GA30947-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
@ 2016-07-27 21:02 ` Andrey Pronin
0 siblings, 0 replies; 17+ messages in thread
From: Andrey Pronin @ 2016-07-27 21:02 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: Mark Rutland, Rob Herring, Christophe Ricard, Pawel Moll,
Ian Campbell, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Kumar Gala
On Wed, Jul 20, 2016 at 01:54:22PM -0600, Jason Gunthorpe wrote:
> On Wed, Jul 20, 2016 at 12:49:12PM -0700, Andrey Pronin wrote:
>
> > Sorry, I just updated this patch description in v2 to indicate why they are not
> > hard-coded, but didn't answer explicitly. As the firmware changes, a different
> > revision of it can have a different time before it sleeps in its configuration,
> > or the time it takes it to startup may be different. Thus, there's a way to
> > set it here w/o changing the driver.
>
> This sort of stuff should be read out of the firmware, not DT..
>
> Why has Google created such a non-standard TPM firmware???
>
> Jason
Thanks, Jason. Will hard-code those in the driver instead of reading
from DT.
Andrey
------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v3 1/2] tpm: devicetree: document properties for cr50
[not found] ` <1469679917-120240-1-git-send-email-apronin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2016-07-28 4:25 ` Andrey Pronin
0 siblings, 0 replies; 17+ messages in thread
From: Andrey Pronin @ 2016-07-28 4:25 UTC (permalink / raw)
To: Jarkko Sakkinen
Cc: Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA,
Christophe Ricard, dianders-F7+t8E8rja9g9hUCZPvPmw, Pawel Moll,
Ian Campbell, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Rob Herring,
smbarber-F7+t8E8rja9g9hUCZPvPmw,
tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Kumar Gala,
dtor-F7+t8E8rja9g9hUCZPvPmw
Add TPM2.0 PTP FIFO compatible SPI interface for chips with Cr50
firmware.
Signed-off-by: Andrey Pronin <apronin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
.../devicetree/bindings/security/tpm/cr50_spi.txt | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 Documentation/devicetree/bindings/security/tpm/cr50_spi.txt
diff --git a/Documentation/devicetree/bindings/security/tpm/cr50_spi.txt b/Documentation/devicetree/bindings/security/tpm/cr50_spi.txt
new file mode 100644
index 0000000..2fbebd3
--- /dev/null
+++ b/Documentation/devicetree/bindings/security/tpm/cr50_spi.txt
@@ -0,0 +1,21 @@
+* H1 Secure Microcontroller with Cr50 Firmware on SPI Bus.
+
+H1 Secure Microcontroller running Cr50 firmware provides several
+functions, including TPM-like functionality. It communicates over
+SPI using the FIFO protocol described in the PTP Spec, section 6.
+
+Required properties:
+- compatible: Should be "google,cr50".
+- spi-max-frequency: Maximum SPI frequency.
+
+Example:
+
+&spi0 {
+ status = "okay";
+
+ cr50@0 {
+ compatible = "google,cr50";
+ reg = <0>;
+ spi-max-frequency = <800000>;
+ };
+};
--
2.6.6
------------------------------------------------------------------------------
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v4 1/2] tpm: devicetree: document properties for cr50
[not found] ` <1469757314-116169-1-git-send-email-apronin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2016-07-29 1:55 ` Andrey Pronin
[not found] ` <1469757314-116169-2-git-send-email-apronin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
0 siblings, 1 reply; 17+ messages in thread
From: Andrey Pronin @ 2016-07-29 1:55 UTC (permalink / raw)
To: Jarkko Sakkinen
Cc: Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA,
Christophe Ricard, dianders-F7+t8E8rja9g9hUCZPvPmw, Pawel Moll,
Ian Campbell, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Rob Herring,
smbarber-F7+t8E8rja9g9hUCZPvPmw,
tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Kumar Gala,
dtor-F7+t8E8rja9g9hUCZPvPmw
Add TPM2.0 PTP FIFO compatible SPI interface for chips with Cr50
firmware.
Signed-off-by: Andrey Pronin <apronin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
.../devicetree/bindings/security/tpm/cr50_spi.txt | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 Documentation/devicetree/bindings/security/tpm/cr50_spi.txt
diff --git a/Documentation/devicetree/bindings/security/tpm/cr50_spi.txt b/Documentation/devicetree/bindings/security/tpm/cr50_spi.txt
new file mode 100644
index 0000000..2fbebd3
--- /dev/null
+++ b/Documentation/devicetree/bindings/security/tpm/cr50_spi.txt
@@ -0,0 +1,21 @@
+* H1 Secure Microcontroller with Cr50 Firmware on SPI Bus.
+
+H1 Secure Microcontroller running Cr50 firmware provides several
+functions, including TPM-like functionality. It communicates over
+SPI using the FIFO protocol described in the PTP Spec, section 6.
+
+Required properties:
+- compatible: Should be "google,cr50".
+- spi-max-frequency: Maximum SPI frequency.
+
+Example:
+
+&spi0 {
+ status = "okay";
+
+ cr50@0 {
+ compatible = "google,cr50";
+ reg = <0>;
+ spi-max-frequency = <800000>;
+ };
+};
--
2.6.6
------------------------------------------------------------------------------
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH v4 1/2] tpm: devicetree: document properties for cr50
[not found] ` <1469757314-116169-2-git-send-email-apronin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2016-07-29 17:27 ` Jason Gunthorpe
[not found] ` <20160729172752.GA7458-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-08-09 10:08 ` Jarkko Sakkinen
1 sibling, 1 reply; 17+ messages in thread
From: Jason Gunthorpe @ 2016-07-29 17:27 UTC (permalink / raw)
To: Andrey Pronin
Cc: Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA,
Christophe Ricard, dianders-F7+t8E8rja9g9hUCZPvPmw, Pawel Moll,
Ian Campbell, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
smbarber-F7+t8E8rja9g9hUCZPvPmw, Rob Herring,
tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Kumar Gala,
dtor-F7+t8E8rja9g9hUCZPvPmw
On Thu, Jul 28, 2016 at 06:55:13PM -0700, Andrey Pronin wrote:
> Add TPM2.0 PTP FIFO compatible SPI interface for chips with Cr50
> firmware.
Since this is now a trivial device, does it still need a dedicated
file?
Jason
------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v4 1/2] tpm: devicetree: document properties for cr50
[not found] ` <20160729172752.GA7458-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
@ 2016-07-29 21:42 ` Rob Herring
0 siblings, 0 replies; 17+ messages in thread
From: Rob Herring @ 2016-07-29 21:42 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA,
Christophe Ricard, dianders-F7+t8E8rja9g9hUCZPvPmw, Pawel Moll,
Ian Campbell, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
smbarber-F7+t8E8rja9g9hUCZPvPmw,
tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Kumar Gala,
dtor-F7+t8E8rja9g9hUCZPvPmw
On Fri, Jul 29, 2016 at 11:27:52AM -0600, Jason Gunthorpe wrote:
> On Thu, Jul 28, 2016 at 06:55:13PM -0700, Andrey Pronin wrote:
> > Add TPM2.0 PTP FIFO compatible SPI interface for chips with Cr50
> > firmware.
>
> Since this is now a trivial device, does it still need a dedicated
> file?
There is no trivial devices file for SPI, only I2C. We could add one,
but this is fine as is for me.
Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v4 1/2] tpm: devicetree: document properties for cr50
[not found] ` <1469757314-116169-2-git-send-email-apronin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2016-07-29 17:27 ` Jason Gunthorpe
@ 2016-08-09 10:08 ` Jarkko Sakkinen
1 sibling, 0 replies; 17+ messages in thread
From: Jarkko Sakkinen @ 2016-08-09 10:08 UTC (permalink / raw)
To: Andrey Pronin
Cc: Peter Huewe, Marcel Selhorst, Jason Gunthorpe,
tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Christophe Ricard,
dtor-F7+t8E8rja9g9hUCZPvPmw, smbarber-F7+t8E8rja9g9hUCZPvPmw,
dianders-F7+t8E8rja9g9hUCZPvPmw, Rob Herring, Pawel Moll,
Mark Rutland, Ian Campbell, Kumar Gala,
devicetree-u79uwXL29TY76Z2rM5mHXA
On Thu, Jul 28, 2016 at 06:55:13PM -0700, Andrey Pronin wrote:
> Add TPM2.0 PTP FIFO compatible SPI interface for chips with Cr50
> firmware.
>
> Signed-off-by: Andrey Pronin <apronin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Acked-by: Jarkko Sakkinen <jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
/Jarkko
> ---
> .../devicetree/bindings/security/tpm/cr50_spi.txt | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/security/tpm/cr50_spi.txt
>
> diff --git a/Documentation/devicetree/bindings/security/tpm/cr50_spi.txt b/Documentation/devicetree/bindings/security/tpm/cr50_spi.txt
> new file mode 100644
> index 0000000..2fbebd3
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/security/tpm/cr50_spi.txt
> @@ -0,0 +1,21 @@
> +* H1 Secure Microcontroller with Cr50 Firmware on SPI Bus.
> +
> +H1 Secure Microcontroller running Cr50 firmware provides several
> +functions, including TPM-like functionality. It communicates over
> +SPI using the FIFO protocol described in the PTP Spec, section 6.
> +
> +Required properties:
> +- compatible: Should be "google,cr50".
> +- spi-max-frequency: Maximum SPI frequency.
> +
> +Example:
> +
> +&spi0 {
> + status = "okay";
> +
> + cr50@0 {
> + compatible = "google,cr50";
> + reg = <0>;
> + spi-max-frequency = <800000>;
> + };
> +};
> --
> 2.6.6
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2016-08-09 10:08 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1468549218-19215-1-git-send-email-apronin@chromium.org>
[not found] ` <1468549218-19215-1-git-send-email-apronin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2016-07-15 2:20 ` [PATCH 1/2] tpm: devicetree: document properties for cr50 Andrey Pronin
2016-07-15 4:05 ` Guenter Roeck
[not found] ` <CABXOdTcVcZ10c6uShN2AXUZfOuK=FESeo73Assi0sziMZJ_+Fw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-07-15 17:31 ` Andrey Pronin
2016-07-15 18:28 ` Guenter Roeck
[not found] ` <1468549218-19215-2-git-send-email-apronin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2016-07-17 13:28 ` Rob Herring
[not found] ` <cover.1468985673.git.apronin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2016-07-20 3:41 ` [PATCH v2 " Andrey Pronin
2016-07-20 19:03 ` Rob Herring
2016-07-20 19:49 ` Andrey Pronin
2016-07-20 19:54 ` Jason Gunthorpe
[not found] ` <20160720195422.GA30947-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-27 21:02 ` Andrey Pronin
2016-07-21 21:03 ` Rob Herring
2016-07-27 21:00 ` Andrey Pronin
[not found] ` <1469679917-120240-1-git-send-email-apronin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2016-07-28 4:25 ` [PATCH v3 " Andrey Pronin
[not found] ` <1469757314-116169-1-git-send-email-apronin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2016-07-29 1:55 ` [PATCH v4 " Andrey Pronin
[not found] ` <1469757314-116169-2-git-send-email-apronin-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2016-07-29 17:27 ` Jason Gunthorpe
[not found] ` <20160729172752.GA7458-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-29 21:42 ` Rob Herring
2016-08-09 10:08 ` Jarkko Sakkinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).