diff mbox series

[v4,2/3] dt-bindings: rng: add bindings for MediaTek ARMv8 SoCs

Message ID 1561361052-13072-3-git-send-email-neal.liu@mediatek.com (mailing list archive)
State New, archived
Headers show
Series MediaTek Security random number generator support | expand

Commit Message

Neal Liu June 24, 2019, 7:24 a.m. UTC
Document the binding used by the MediaTek ARMv8 SoCs random
number generator with TrustZone enabled.

Signed-off-by: Neal Liu <neal.liu@mediatek.com>
---
 .../devicetree/bindings/rng/mtk-sec-rng.txt        |   10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/rng/mtk-sec-rng.txt

Comments

Rob Herring (Arm) July 22, 2019, 5:13 p.m. UTC | #1
On Mon, Jun 24, 2019 at 03:24:11PM +0800, Neal Liu wrote:
> Document the binding used by the MediaTek ARMv8 SoCs random
> number generator with TrustZone enabled.
> 
> Signed-off-by: Neal Liu <neal.liu@mediatek.com>
> ---
>  .../devicetree/bindings/rng/mtk-sec-rng.txt        |   10 ++++++++++
>  1 file changed, 10 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/rng/mtk-sec-rng.txt
> 
> diff --git a/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt b/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt
> new file mode 100644
> index 0000000..c04ce15
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt
> @@ -0,0 +1,10 @@
> +MediaTek random number generator with TrustZone enabled
> +
> +Required properties:
> +- compatible : Should be "mediatek,mtk-sec-rng"

What's the interface to access this? 

A node with a 'compatible' and nothing else is a sign of something that 
a parent device should instantiate and doesn't need to be in DT. IOW, 
what do complete bindings for firmware functions look like?

> +
> +Example:
> +
> +hwrng: hwrng {
> +	compatible = "mediatek,mtk-sec-rng";
> +}
> -- 
> 1.7.9.5
>
Neal Liu July 23, 2019, 2:21 a.m. UTC | #2
Dear Rob,
	You can check my driver for detail:
	http://patchwork.kernel.org/patch/11012475/ or patchset 3/3

	This driver is registered as hardware random number generator, and
combines with rng-core.
	We want to add one rng hw based on the dts. Is this proper or do you
have other suggestion to meet this requirement?

	Thanks


On Tue, 2019-07-23 at 01:13 +0800, Rob Herring wrote:
> On Mon, Jun 24, 2019 at 03:24:11PM +0800, Neal Liu wrote:
> > Document the binding used by the MediaTek ARMv8 SoCs random
> > number generator with TrustZone enabled.
> > 
> > Signed-off-by: Neal Liu <neal.liu@mediatek.com>
> > ---
> >  .../devicetree/bindings/rng/mtk-sec-rng.txt        |   10 ++++++++++
> >  1 file changed, 10 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/rng/mtk-sec-rng.txt
> > 
> > diff --git a/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt b/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt
> > new file mode 100644
> > index 0000000..c04ce15
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt
> > @@ -0,0 +1,10 @@
> > +MediaTek random number generator with TrustZone enabled
> > +
> > +Required properties:
> > +- compatible : Should be "mediatek,mtk-sec-rng"
> 
> What's the interface to access this? 
> 
> A node with a 'compatible' and nothing else is a sign of something that 
> a parent device should instantiate and doesn't need to be in DT. IOW, 
> what do complete bindings for firmware functions look like?
> 
> > +
> > +Example:
> > +
> > +hwrng: hwrng {
> > +	compatible = "mediatek,mtk-sec-rng";
> > +}
> > -- 
> > 1.7.9.5
> > 
> 
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek
Rob Herring (Arm) July 23, 2019, 2:35 p.m. UTC | #3
On Mon, Jul 22, 2019 at 8:21 PM Neal Liu <neal.liu@mediatek.com> wrote:
>

Please don't top post to lists.

> Dear Rob,
>         You can check my driver for detail:
>         http://patchwork.kernel.org/patch/11012475/ or patchset 3/3

I could, or you could just answer my question.

>
>         This driver is registered as hardware random number generator, and
> combines with rng-core.
>         We want to add one rng hw based on the dts. Is this proper or do you
> have other suggestion to meet this requirement?

It depends. There doesn't appear to be any resource configuration, so
why does it need to be in DT. DT is not the only way instantiate
drivers.

Rob

>
>         Thanks
>
>
> On Tue, 2019-07-23 at 01:13 +0800, Rob Herring wrote:
> > On Mon, Jun 24, 2019 at 03:24:11PM +0800, Neal Liu wrote:
> > > Document the binding used by the MediaTek ARMv8 SoCs random
> > > number generator with TrustZone enabled.
> > >
> > > Signed-off-by: Neal Liu <neal.liu@mediatek.com>
> > > ---
> > >  .../devicetree/bindings/rng/mtk-sec-rng.txt        |   10 ++++++++++
> > >  1 file changed, 10 insertions(+)
> > >  create mode 100644 Documentation/devicetree/bindings/rng/mtk-sec-rng.txt
> > >
> > > diff --git a/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt b/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt
> > > new file mode 100644
> > > index 0000000..c04ce15
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt
> > > @@ -0,0 +1,10 @@
> > > +MediaTek random number generator with TrustZone enabled
> > > +
> > > +Required properties:
> > > +- compatible : Should be "mediatek,mtk-sec-rng"
> >
> > What's the interface to access this?
> >
> > A node with a 'compatible' and nothing else is a sign of something that
> > a parent device should instantiate and doesn't need to be in DT. IOW,
> > what do complete bindings for firmware functions look like?
> >
> > > +
> > > +Example:
> > > +
> > > +hwrng: hwrng {
> > > +   compatible = "mediatek,mtk-sec-rng";
> > > +}
> > > --
> > > 1.7.9.5
> > >
> >
> > _______________________________________________
> > Linux-mediatek mailing list
> > Linux-mediatek@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-mediatek
>
>
Neal Liu July 24, 2019, 5:04 a.m. UTC | #4
On Tue, 2019-07-23 at 08:35 -0600, Rob Herring wrote:
> On Mon, Jul 22, 2019 at 8:21 PM Neal Liu <neal.liu@mediatek.com> wrote:
> >
> 
> Please don't top post to lists.
> 
> > Dear Rob,
> >         You can check my driver for detail:
> >         http://patchwork.kernel.org/patch/11012475/ or patchset 3/3
> 
> I could, or you could just answer my question.
> 
> >
> >         This driver is registered as hardware random number generator, and
> > combines with rng-core.
> >         We want to add one rng hw based on the dts. Is this proper or do you
> > have other suggestion to meet this requirement?
> 
> It depends. There doesn't appear to be any resource configuration, so
> why does it need to be in DT. DT is not the only way instantiate
> drivers.
> 
> Rob

This hwrng is only supported on some chipsets. It needs DT to identify
which platform is supported or not. Is there any better idea to meet
this requirement?

Neal

> >
> >         Thanks
> >
> >
> > On Tue, 2019-07-23 at 01:13 +0800, Rob Herring wrote:
> > > On Mon, Jun 24, 2019 at 03:24:11PM +0800, Neal Liu wrote:
> > > > Document the binding used by the MediaTek ARMv8 SoCs random
> > > > number generator with TrustZone enabled.
> > > >
> > > > Signed-off-by: Neal Liu <neal.liu@mediatek.com>
> > > > ---
> > > >  .../devicetree/bindings/rng/mtk-sec-rng.txt        |   10 ++++++++++
> > > >  1 file changed, 10 insertions(+)
> > > >  create mode 100644 Documentation/devicetree/bindings/rng/mtk-sec-rng.txt
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt b/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt
> > > > new file mode 100644
> > > > index 0000000..c04ce15
> > > > --- /dev/null
> > > > +++ b/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt
> > > > @@ -0,0 +1,10 @@
> > > > +MediaTek random number generator with TrustZone enabled
> > > > +
> > > > +Required properties:
> > > > +- compatible : Should be "mediatek,mtk-sec-rng"
> > >
> > > What's the interface to access this?
> > >
> > > A node with a 'compatible' and nothing else is a sign of something that
> > > a parent device should instantiate and doesn't need to be in DT. IOW,
> > > what do complete bindings for firmware functions look like?
> > >
> > > > +
> > > > +Example:
> > > > +
> > > > +hwrng: hwrng {
> > > > +   compatible = "mediatek,mtk-sec-rng";
> > > > +}
> > > > --
> > > > 1.7.9.5
> > > >
> > >
> > > _______________________________________________
> > > Linux-mediatek mailing list
> > > Linux-mediatek@lists.infradead.org
> > > http://lists.infradead.org/mailman/listinfo/linux-mediatek
> >
> >
Neal Liu Sept. 18, 2019, 1:44 a.m. UTC | #5
On Tue, 2019-07-23 at 22:35 +0800, Rob Herring wrote:
> On Mon, Jul 22, 2019 at 8:21 PM Neal Liu <neal.liu@mediatek.com> wrote:
> >
> 
> Please don't top post to lists.
> 
> > Dear Rob,
> >         You can check my driver for detail:
> >         http://patchwork.kernel.org/patch/11012475/ or patchset 3/3
> 
> I could, or you could just answer my question.
> 
> >
> >         This driver is registered as hardware random number generator, and
> > combines with rng-core.
> >         We want to add one rng hw based on the dts. Is this proper or do you
> > have other suggestion to meet this requirement?
> 
> It depends. There doesn't appear to be any resource configuration, so
> why does it need to be in DT. DT is not the only way instantiate
> drivers.
> 
> Rob
> 

We would like to consult more about this patch.
We cannot figure out what method should be used instead of DT.
The interface to access firmware is "smc" and firmware function only
exists on certain platforms.
Some DT has similar way, like:
http://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts#L470

	firmware {
		optee {
			compatible = "linaro,optee-tz";
			method = "smc";
		};
	};

Is there any way to instantiate driver on certain platforms without DT?
Could you give us some examples?
Thanks

> >
> >         Thanks
> >
> >
> > On Tue, 2019-07-23 at 01:13 +0800, Rob Herring wrote:
> > > On Mon, Jun 24, 2019 at 03:24:11PM +0800, Neal Liu wrote:
> > > > Document the binding used by the MediaTek ARMv8 SoCs random
> > > > number generator with TrustZone enabled.
> > > >
> > > > Signed-off-by: Neal Liu <neal.liu@mediatek.com>
> > > > ---
> > > >  .../devicetree/bindings/rng/mtk-sec-rng.txt        |   10 ++++++++++
> > > >  1 file changed, 10 insertions(+)
> > > >  create mode 100644 Documentation/devicetree/bindings/rng/mtk-sec-rng.txt
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt b/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt
> > > > new file mode 100644
> > > > index 0000000..c04ce15
> > > > --- /dev/null
> > > > +++ b/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt
> > > > @@ -0,0 +1,10 @@
> > > > +MediaTek random number generator with TrustZone enabled
> > > > +
> > > > +Required properties:
> > > > +- compatible : Should be "mediatek,mtk-sec-rng"
> > >
> > > What's the interface to access this?
> > >
> > > A node with a 'compatible' and nothing else is a sign of something that
> > > a parent device should instantiate and doesn't need to be in DT. IOW,
> > > what do complete bindings for firmware functions look like?
> > >
> > > > +
> > > > +Example:
> > > > +
> > > > +hwrng: hwrng {
> > > > +   compatible = "mediatek,mtk-sec-rng";
> > > > +}
> > > > --
> > > > 1.7.9.5
> > > >
> > >
> > > _______________________________________________
> > > Linux-mediatek mailing list
> > > Linux-mediatek@lists.infradead.org
> > > http://lists.infradead.org/mailman/listinfo/linux-mediatek
> >
> >
Neal Liu Oct. 2, 2019, 1:47 p.m. UTC | #6
Dear Rob,

Just a gentle ping.

Neal

On Wed, 2019-09-18 at 09:44 +0800, Neal Liu wrote:
> On Tue, 2019-07-23 at 22:35 +0800, Rob Herring wrote:
> > On Mon, Jul 22, 2019 at 8:21 PM Neal Liu <neal.liu@mediatek.com> wrote:
> > >
> > 
> > Please don't top post to lists.
> > 
> > > Dear Rob,
> > >         You can check my driver for detail:
> > >         http://patchwork.kernel.org/patch/11012475/ or patchset 3/3
> > 
> > I could, or you could just answer my question.
> > 
> > >
> > >         This driver is registered as hardware random number generator, and
> > > combines with rng-core.
> > >         We want to add one rng hw based on the dts. Is this proper or do you
> > > have other suggestion to meet this requirement?
> > 
> > It depends. There doesn't appear to be any resource configuration, so
> > why does it need to be in DT. DT is not the only way instantiate
> > drivers.
> > 
> > Rob
> > 
> 
> We would like to consult more about this patch.
> We cannot figure out what method should be used instead of DT.
> The interface to access firmware is "smc" and firmware function only
> exists on certain platforms.
> Some DT has similar way, like:
> http://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts#L470
> 
> 	firmware {
> 		optee {
> 			compatible = "linaro,optee-tz";
> 			method = "smc";
> 		};
> 	};
> 
> Is there any way to instantiate driver on certain platforms without DT?
> Could you give us some examples?
> Thanks
> 
> > >
> > >         Thanks
> > >
> > >
> > > On Tue, 2019-07-23 at 01:13 +0800, Rob Herring wrote:
> > > > On Mon, Jun 24, 2019 at 03:24:11PM +0800, Neal Liu wrote:
> > > > > Document the binding used by the MediaTek ARMv8 SoCs random
> > > > > number generator with TrustZone enabled.
> > > > >
> > > > > Signed-off-by: Neal Liu <neal.liu@mediatek.com>
> > > > > ---
> > > > >  .../devicetree/bindings/rng/mtk-sec-rng.txt        |   10 ++++++++++
> > > > >  1 file changed, 10 insertions(+)
> > > > >  create mode 100644 Documentation/devicetree/bindings/rng/mtk-sec-rng.txt
> > > > >
> > > > > diff --git a/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt b/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt
> > > > > new file mode 100644
> > > > > index 0000000..c04ce15
> > > > > --- /dev/null
> > > > > +++ b/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt
> > > > > @@ -0,0 +1,10 @@
> > > > > +MediaTek random number generator with TrustZone enabled
> > > > > +
> > > > > +Required properties:
> > > > > +- compatible : Should be "mediatek,mtk-sec-rng"
> > > >
> > > > What's the interface to access this?
> > > >
> > > > A node with a 'compatible' and nothing else is a sign of something that
> > > > a parent device should instantiate and doesn't need to be in DT. IOW,
> > > > what do complete bindings for firmware functions look like?
> > > >
> > > > > +
> > > > > +Example:
> > > > > +
> > > > > +hwrng: hwrng {
> > > > > +   compatible = "mediatek,mtk-sec-rng";
> > > > > +}
> > > > > --
> > > > > 1.7.9.5
> > > > >
> > > >
> > > > _______________________________________________
> > > > Linux-mediatek mailing list
> > > > Linux-mediatek@lists.infradead.org
> > > > http://lists.infradead.org/mailman/listinfo/linux-mediatek
> > >
> > >
>
Neal Liu Oct. 18, 2019, 5:41 a.m. UTC | #7
On Wed, 2019-10-02 at 21:47 +0800, Neal Liu wrote:
> Dear Rob,
> 
> Just a gentle ping.
> 
> Neal
> 
> On Wed, 2019-09-18 at 09:44 +0800, Neal Liu wrote:
> > On Tue, 2019-07-23 at 22:35 +0800, Rob Herring wrote:
> > > On Mon, Jul 22, 2019 at 8:21 PM Neal Liu <neal.liu@mediatek.com> wrote:
> > > >
> > > 
> > > Please don't top post to lists.
> > > 
> > > > Dear Rob,
> > > >         You can check my driver for detail:
> > > >         http://patchwork.kernel.org/patch/11012475/ or patchset 3/3
> > > 
> > > I could, or you could just answer my question.
> > > 
> > > >
> > > >         This driver is registered as hardware random number generator, and
> > > > combines with rng-core.
> > > >         We want to add one rng hw based on the dts. Is this proper or do you
> > > > have other suggestion to meet this requirement?
> > > 
> > > It depends. There doesn't appear to be any resource configuration, so
> > > why does it need to be in DT. DT is not the only way instantiate
> > > drivers.
> > > 
> > > Rob
> > > 
> > 
> > We would like to consult more about this patch.
> > We cannot figure out what method should be used instead of DT.
> > The interface to access firmware is "smc" and firmware function only
> > exists on certain platforms.
> > Some DT has similar way, like:
> > http://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts#L470
> > 
> > 	firmware {
> > 		optee {
> > 			compatible = "linaro,optee-tz";
> > 			method = "smc";
> > 		};
> > 	};
> > 
> > Is there any way to instantiate driver on certain platforms without DT?
> > Could you give us some examples?
> > Thanks
> > 
> > > >
> > > >         Thanks
> > > >
> > > >
> > > > On Tue, 2019-07-23 at 01:13 +0800, Rob Herring wrote:
> > > > > On Mon, Jun 24, 2019 at 03:24:11PM +0800, Neal Liu wrote:
> > > > > > Document the binding used by the MediaTek ARMv8 SoCs random
> > > > > > number generator with TrustZone enabled.
> > > > > >
> > > > > > Signed-off-by: Neal Liu <neal.liu@mediatek.com>
> > > > > > ---
> > > > > >  .../devicetree/bindings/rng/mtk-sec-rng.txt        |   10 ++++++++++
> > > > > >  1 file changed, 10 insertions(+)
> > > > > >  create mode 100644 Documentation/devicetree/bindings/rng/mtk-sec-rng.txt
> > > > > >
> > > > > > diff --git a/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt b/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt
> > > > > > new file mode 100644
> > > > > > index 0000000..c04ce15
> > > > > > --- /dev/null
> > > > > > +++ b/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt
> > > > > > @@ -0,0 +1,10 @@
> > > > > > +MediaTek random number generator with TrustZone enabled
> > > > > > +
> > > > > > +Required properties:
> > > > > > +- compatible : Should be "mediatek,mtk-sec-rng"
> > > > >
> > > > > What's the interface to access this?
> > > > >
> > > > > A node with a 'compatible' and nothing else is a sign of something that
> > > > > a parent device should instantiate and doesn't need to be in DT. IOW,
> > > > > what do complete bindings for firmware functions look like?
> > > > >

We would like to revise our DT node as below:

firmware {
	hwrng {
		compatible = "mediatek,mtk-sec-rng";
		method = "smc";
	};
};

And dt-bindings path would be changed because it's base on ARM TrustZone
Firmware.
From "Documentation/devicetree/bindings/rng/mtk-sec-rng.txt"
To
"Documentation/devicetree/bindings/arm/firmware/mediatek,mtk-sec-rng.txt"

We found some similar examples which also provide an interface to trap
to Secure State through SMC instruction.
Example 1: Documentation/devicetree/bindings/arm/firmware/xxx.txt
Example 2: Documentation/devicetree/bindings/arm/psci.txt

Is that okay for you?

Neal

> > > > > > +
> > > > > > +Example:
> > > > > > +
> > > > > > +hwrng: hwrng {
> > > > > > +   compatible = "mediatek,mtk-sec-rng";
> > > > > > +}
> > > > > > --
> > > > > > 1.7.9.5
> > > > > >
> > > > >
> > > > > _______________________________________________
> > > > > Linux-mediatek mailing list
> > > > > Linux-mediatek@lists.infradead.org
> > > > > http://lists.infradead.org/mailman/listinfo/linux-mediatek
> > > >
> > > >
> > 
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt b/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt
new file mode 100644
index 0000000..c04ce15
--- /dev/null
+++ b/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt
@@ -0,0 +1,10 @@ 
+MediaTek random number generator with TrustZone enabled
+
+Required properties:
+- compatible : Should be "mediatek,mtk-sec-rng"
+
+Example:
+
+hwrng: hwrng {
+	compatible = "mediatek,mtk-sec-rng";
+}