diff mbox series

[1/3] dt-bindings: crypto: fsl: add entropy delay property

Message ID 20220530180924.1792399-2-vabhav.sharma@nxp.com (mailing list archive)
State Changes Requested
Delegated to: Herbert Xu
Headers show
Series add entropy delay device tree property | expand

Commit Message

Vabhav Sharma May 30, 2022, 6:09 p.m. UTC
Add entropy delay property which defines the length (in system clocks) of
each Entropy sample taken for TRNG configuration.

Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Horia Geanta <horia.geanta@nxp.com>
Reviewed-by: Varun Sethi <v.sethi@nxp.com>
---
 Documentation/devicetree/bindings/crypto/fsl-sec4.txt | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Rob Herring June 5, 2022, 9:21 p.m. UTC | #1
On Mon, May 30, 2022 at 11:39:22PM +0530, Vabhav Sharma wrote:
> Add entropy delay property which defines the length (in system clocks) of
> each Entropy sample taken for TRNG configuration.
> 
> Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
> Reviewed-by: Horia Geanta <horia.geanta@nxp.com>
> Reviewed-by: Varun Sethi <v.sethi@nxp.com>
> ---
>  Documentation/devicetree/bindings/crypto/fsl-sec4.txt | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/crypto/fsl-sec4.txt b/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
> index 8f359f473ada..1477294eda38 100644
> --- a/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
> +++ b/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
> @@ -62,6 +62,12 @@ PROPERTIES
>        Definition: A standard property. Define the 'ERA' of the SEC
>            device.
>  
> +   - entropy-delay
> +      Usage: optional
> +      Value type: <u32>
> +      Definition: A property which specifies the length (in system clocks)
> +          of each Entropy sample taken.
> +

Seems like this could be common, but should be a time value (with unit 
suffix) rather than clocks. If not common, then needs a vendor prefix. 
Is this time to read a value or time between values produced? Not really 
clear from the description.

Rob
Vabhav Sharma June 16, 2022, 5:49 p.m. UTC | #2
Hello Rob,

> -----Original Message-----
> From: Rob Herring <robh@kernel.org>
> Sent: Monday, June 6, 2022 2:51 AM
> To: Vabhav Sharma <vabhav.sharma@nxp.com>
> Cc: Horia Geanta <horia.geanta@nxp.com>; Gaurav Jain
> <gaurav.jain@nxp.com>; Pankaj Gupta <pankaj.gupta@nxp.com>;
> herbert@gondor.apana.org.au; davem@davemloft.net;
> shawnguo@kernel.org; linux-crypto@vger.kernel.org; linux-
> kernel@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>;
> devicetree@vger.kernel.org; linux-arm-kernel@lists.infradead.org; Silvano Di
> Ninno <silvano.dininno@nxp.com>; Varun Sethi <V.Sethi@nxp.com>
> Subject: [EXT] Re: [PATCH 1/3] dt-bindings: crypto: fsl: add entropy delay
> property
> 
> Caution: EXT Email
> 
> On Mon, May 30, 2022 at 11:39:22PM +0530, Vabhav Sharma wrote:
> > Add entropy delay property which defines the length (in system clocks)
> > of each Entropy sample taken for TRNG configuration.
> >
> > Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
> > Reviewed-by: Horia Geanta <horia.geanta@nxp.com>
> > Reviewed-by: Varun Sethi <v.sethi@nxp.com>
> > ---
> >  Documentation/devicetree/bindings/crypto/fsl-sec4.txt | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
> > b/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
> > index 8f359f473ada..1477294eda38 100644
> > --- a/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
> > +++ b/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
> > @@ -62,6 +62,12 @@ PROPERTIES
> >        Definition: A standard property. Define the 'ERA' of the SEC
> >            device.
> >
> > +   - entropy-delay
> > +      Usage: optional
> > +      Value type: <u32>
> > +      Definition: A property which specifies the length (in system clocks)
> > +          of each Entropy sample taken.
> > +
> 
> Seems like this could be common, but should be a time value (with unit
> suffix) rather than clocks. If not common, then needs a vendor prefix.
> Is this time to read a value or time between values produced? Not really clear
> from the description.
CAAM TRNG Configuration includes 16-bit field entropy-delay. This field specifies how long the oscillator is given to freely oscillate and generate a single bit of entropy.
It is specified as number of system clock cycles and this u32 type field already exist in the caam driver code with default value of 3200. However, on some platform this value can vary and support is added to read the value from device tree in order to override default value, Hope this helps to clarify.
> 
> Rob
Rob Herring June 29, 2022, 9:25 p.m. UTC | #3
On Thu, Jun 16, 2022 at 05:49:30PM +0000, Vabhav Sharma wrote:
> Hello Rob,
> 
> > -----Original Message-----
> > From: Rob Herring <robh@kernel.org>
> > Sent: Monday, June 6, 2022 2:51 AM
> > To: Vabhav Sharma <vabhav.sharma@nxp.com>
> > Cc: Horia Geanta <horia.geanta@nxp.com>; Gaurav Jain
> > <gaurav.jain@nxp.com>; Pankaj Gupta <pankaj.gupta@nxp.com>;
> > herbert@gondor.apana.org.au; davem@davemloft.net;
> > shawnguo@kernel.org; linux-crypto@vger.kernel.org; linux-
> > kernel@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>;
> > devicetree@vger.kernel.org; linux-arm-kernel@lists.infradead.org; Silvano Di
> > Ninno <silvano.dininno@nxp.com>; Varun Sethi <V.Sethi@nxp.com>
> > Subject: [EXT] Re: [PATCH 1/3] dt-bindings: crypto: fsl: add entropy delay
> > property
> > 
> > Caution: EXT Email
> > 
> > On Mon, May 30, 2022 at 11:39:22PM +0530, Vabhav Sharma wrote:
> > > Add entropy delay property which defines the length (in system clocks)
> > > of each Entropy sample taken for TRNG configuration.
> > >
> > > Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
> > > Reviewed-by: Horia Geanta <horia.geanta@nxp.com>
> > > Reviewed-by: Varun Sethi <v.sethi@nxp.com>
> > > ---
> > >  Documentation/devicetree/bindings/crypto/fsl-sec4.txt | 6 ++++++
> > >  1 file changed, 6 insertions(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
> > > b/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
> > > index 8f359f473ada..1477294eda38 100644
> > > --- a/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
> > > +++ b/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
> > > @@ -62,6 +62,12 @@ PROPERTIES
> > >        Definition: A standard property. Define the 'ERA' of the SEC
> > >            device.
> > >
> > > +   - entropy-delay
> > > +      Usage: optional
> > > +      Value type: <u32>
> > > +      Definition: A property which specifies the length (in system clocks)
> > > +          of each Entropy sample taken.
> > > +
> > 
> > Seems like this could be common, but should be a time value (with unit
> > suffix) rather than clocks. If not common, then needs a vendor prefix.
> > Is this time to read a value or time between values produced? Not really clear
> > from the description.
> CAAM TRNG Configuration includes 16-bit field entropy-delay. This field specifies how long the oscillator is given to freely oscillate and generate a single bit of entropy.
> It is specified as number of system clock cycles and this u32 type field already exist in the caam driver code with default value of 3200. However, on some platform this value can vary and support is added to read the value from device tree in order to override default value, Hope this helps to clarify.

So that is how often a sample can be read? Or what happens if you read a 
sample too quick (in less than this delay time)?

Look at other h/w and drivers see if something common makes sense here.

Rob
Vabhav Sharma Aug. 1, 2023, 11:21 p.m. UTC | #4
Hello Rob,

> -----Original Message-----
> From: Rob Herring <robh@kernel.org>
> Sent: Thursday, June 30, 2022 2:56 AM
> To: Vabhav Sharma <vabhav.sharma@nxp.com>
> Cc: Horia Geanta <horia.geanta@nxp.com>; Gaurav Jain
> <gaurav.jain@nxp.com>; Pankaj Gupta <pankaj.gupta@nxp.com>;
> herbert@gondor.apana.org.au; davem@davemloft.net;
> shawnguo@kernel.org; linux-crypto@vger.kernel.org; linux-
> kernel@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>;
> devicetree@vger.kernel.org; linux-arm-kernel@lists.infradead.org; Silvano Di
> Ninno <silvano.dininno@nxp.com>; Varun Sethi <V.Sethi@nxp.com>
> Subject: Re: [EXT] Re: [PATCH 1/3] dt-bindings: crypto: fsl: add entropy delay
> property
> 
> Caution: EXT Email
> 
> On Thu, Jun 16, 2022 at 05:49:30PM +0000, Vabhav Sharma wrote:
> > Hello Rob,
> >
> > > -----Original Message-----
> > > From: Rob Herring <robh@kernel.org>
> > > Sent: Monday, June 6, 2022 2:51 AM
> > > To: Vabhav Sharma <vabhav.sharma@nxp.com>
> > > Cc: Horia Geanta <horia.geanta@nxp.com>; Gaurav Jain
> > > <gaurav.jain@nxp.com>; Pankaj Gupta <pankaj.gupta@nxp.com>;
> > > herbert@gondor.apana.org.au; davem@davemloft.net;
> > > shawnguo@kernel.org; linux-crypto@vger.kernel.org; linux-
> > > kernel@vger.kernel.org; dl-linux-imx <linux-imx@nxp.com>;
> > > devicetree@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
> > > Silvano Di Ninno <silvano.dininno@nxp.com>; Varun Sethi
> > > <V.Sethi@nxp.com>
> > > Subject: [EXT] Re: [PATCH 1/3] dt-bindings: crypto: fsl: add entropy
> > > delay property
> > >
> > > Caution: EXT Email
> > >
> > > On Mon, May 30, 2022 at 11:39:22PM +0530, Vabhav Sharma wrote:
> > > > Add entropy delay property which defines the length (in system
> > > > clocks) of each Entropy sample taken for TRNG configuration.
> > > >
> > > > Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
> > > > Reviewed-by: Horia Geanta <horia.geanta@nxp.com>
> > > > Reviewed-by: Varun Sethi <v.sethi@nxp.com>
> > > > ---
> > > >  Documentation/devicetree/bindings/crypto/fsl-sec4.txt | 6 ++++++
> > > >  1 file changed, 6 insertions(+)
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
> > > > b/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
> > > > index 8f359f473ada..1477294eda38 100644
> > > > --- a/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
> > > > +++ b/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
> > > > @@ -62,6 +62,12 @@ PROPERTIES
> > > >        Definition: A standard property. Define the 'ERA' of the SEC
> > > >            device.
> > > >
> > > > +   - entropy-delay
> > > > +      Usage: optional
> > > > +      Value type: <u32>
> > > > +      Definition: A property which specifies the length (in system clocks)
> > > > +          of each Entropy sample taken.
> > > > +
> > >
> > > Seems like this could be common, but should be a time value (with
> > > unit
> > > suffix) rather than clocks. If not common, then needs a vendor prefix.
> > > Is this time to read a value or time between values produced? Not
> > > really clear from the description.
> > CAAM TRNG Configuration includes 16-bit field entropy-delay. This field
> specifies how long the oscillator is given to freely oscillate and generate a
> single bit of entropy.
> > It is specified as number of system clock cycles and this u32 type field
> already exist in the caam driver code with default value of 3200. However, on
> some platform this value can vary and support is added to read the value
> from device tree in order to override default value, Hope this helps to clarify.
> 	
> So that is how often a sample can be read? Or what happens if you read a
> sample too quick (in less than this delay time)?
This is the fixed value that will work always profiled while offline per SoC or SoC family.
Value will work during initialization and run time.

Apologize to miss the email and delayed reply.
> 
> Look at other h/w and drivers see if something common makes sense here.
> 
> Rob
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/crypto/fsl-sec4.txt b/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
index 8f359f473ada..1477294eda38 100644
--- a/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
+++ b/Documentation/devicetree/bindings/crypto/fsl-sec4.txt
@@ -62,6 +62,12 @@  PROPERTIES
       Definition: A standard property. Define the 'ERA' of the SEC
           device.
 
+   - entropy-delay
+      Usage: optional
+      Value type: <u32>
+      Definition: A property which specifies the length (in system clocks)
+          of each Entropy sample taken.
+
    - #address-cells
        Usage: required
        Value type: <u32>