diff mbox series

[v5,2/3] dt-bindings: crypto: Add Inside Secure SafeXcel EIP-93 crypto engine

Message ID 20241028124206.24321-2-ansuelsmth@gmail.com (mailing list archive)
State Superseded
Delegated to: Herbert Xu
Headers show
Series [v5,1/3] spinlock: extend guard with spinlock_bh variants | expand

Commit Message

Christian Marangi Oct. 28, 2024, 12:41 p.m. UTC
Add bindings for the Inside Secure SafeXcel EIP-93 crypto engine.

The IP is present on Airoha SoC and on various Mediatek devices and
other SoC under different names like mtk-eip93 or PKTE.

All the compatible that currently doesn't have any user are left there
commented for reference.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
Changes v5:
- Comment out compatible with no current user
Changes v4:
- Out of RFC
Changes v3:
- Add SoC compatible with generic one
Changes v2:
- Change to better compatible
- Add description for EIP93 models

 .../crypto/inside-secure,safexcel-eip93.yaml  | 67 +++++++++++++++++++
 1 file changed, 67 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/crypto/inside-secure,safexcel-eip93.yaml

Comments

Rob Herring (Arm) Oct. 28, 2024, 2:35 p.m. UTC | #1
On Mon, Oct 28, 2024 at 01:41:42PM +0100, Christian Marangi wrote:
> Add bindings for the Inside Secure SafeXcel EIP-93 crypto engine.
> 
> The IP is present on Airoha SoC and on various Mediatek devices and
> other SoC under different names like mtk-eip93 or PKTE.
> 
> All the compatible that currently doesn't have any user are left there
> commented for reference.
> 
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> ---
> Changes v5:
> - Comment out compatible with no current user
> Changes v4:
> - Out of RFC
> Changes v3:
> - Add SoC compatible with generic one
> Changes v2:
> - Change to better compatible
> - Add description for EIP93 models
> 
>  .../crypto/inside-secure,safexcel-eip93.yaml  | 67 +++++++++++++++++++
>  1 file changed, 67 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/crypto/inside-secure,safexcel-eip93.yaml
> 
> diff --git a/Documentation/devicetree/bindings/crypto/inside-secure,safexcel-eip93.yaml b/Documentation/devicetree/bindings/crypto/inside-secure,safexcel-eip93.yaml
> new file mode 100644
> index 000000000000..188240b74110
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/crypto/inside-secure,safexcel-eip93.yaml
> @@ -0,0 +1,67 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/crypto/inside-secure,safexcel-eip93.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Inside Secure SafeXcel EIP-93 cryptographic engine
> +
> +maintainers:
> +  - Christian Marangi <ansuelsmth@gmail.com>
> +
> +description: |
> +  The Inside Secure SafeXcel EIP-93 is a cryptographic engine IP block
> +  integrated in varios devices with very different and generic name from
> +  PKTE to simply vendor+EIP93. The real IP under the hood is actually
> +  developed by Inside Secure and given to license to vendors.
> +
> +  The IP block is sold with different model based on what feature are
> +  needed and are identified with the final letter. Each letter correspond
> +  to a specific set of feature and multiple letter reflect the sum of the
> +  feature set.
> +
> +  EIP-93 models:
> +    - EIP-93i: (basic) DES/Triple DES, AES, PRNG, IPsec ESP, SRTP, SHA1
> +    - EIP-93ie: i + SHA224/256, AES-192/256
> +    - EIP-93is: i + SSL/DTLS/DTLS, MD5, ARC4
> +    - EIP-93ies: i + e + s
> +    - EIP-93iw: i + AES-XCB-MAC, AES-CCM
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - items:
> +          - const: airoha,crypto-eip93

Still doesn't look SoC specific...

> +          - const: inside-secure,safexcel-eip93ies
> +      # Compatible that doesn't have any current user.
> +      # - items:
> +      #     - const: SoC specific compatible
> +      #     - enum:
> +      #         - inside-secure,safexcel-eip93i
> +      #         - inside-secure,safexcel-eip93ie
> +      #         - inside-secure,safexcel-eip93is
> +      #         - inside-secure,safexcel-eip93iw

I should have looked at the driver before commenting before, but since 
you are using these compatibles, you should go with my other suggestion 
or these will be listed as undocumented.

Rob
Christian Marangi Oct. 28, 2024, 2:43 p.m. UTC | #2
On Mon, Oct 28, 2024 at 09:35:15AM -0500, Rob Herring wrote:
> On Mon, Oct 28, 2024 at 01:41:42PM +0100, Christian Marangi wrote:
> > Add bindings for the Inside Secure SafeXcel EIP-93 crypto engine.
> > 
> > The IP is present on Airoha SoC and on various Mediatek devices and
> > other SoC under different names like mtk-eip93 or PKTE.
> > 
> > All the compatible that currently doesn't have any user are left there
> > commented for reference.
> > 
> > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> > ---
> > Changes v5:
> > - Comment out compatible with no current user
> > Changes v4:
> > - Out of RFC
> > Changes v3:
> > - Add SoC compatible with generic one
> > Changes v2:
> > - Change to better compatible
> > - Add description for EIP93 models
> > 
> >  .../crypto/inside-secure,safexcel-eip93.yaml  | 67 +++++++++++++++++++
> >  1 file changed, 67 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/crypto/inside-secure,safexcel-eip93.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/crypto/inside-secure,safexcel-eip93.yaml b/Documentation/devicetree/bindings/crypto/inside-secure,safexcel-eip93.yaml
> > new file mode 100644
> > index 000000000000..188240b74110
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/crypto/inside-secure,safexcel-eip93.yaml
> > @@ -0,0 +1,67 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/crypto/inside-secure,safexcel-eip93.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Inside Secure SafeXcel EIP-93 cryptographic engine
> > +
> > +maintainers:
> > +  - Christian Marangi <ansuelsmth@gmail.com>
> > +
> > +description: |
> > +  The Inside Secure SafeXcel EIP-93 is a cryptographic engine IP block
> > +  integrated in varios devices with very different and generic name from
> > +  PKTE to simply vendor+EIP93. The real IP under the hood is actually
> > +  developed by Inside Secure and given to license to vendors.
> > +
> > +  The IP block is sold with different model based on what feature are
> > +  needed and are identified with the final letter. Each letter correspond
> > +  to a specific set of feature and multiple letter reflect the sum of the
> > +  feature set.
> > +
> > +  EIP-93 models:
> > +    - EIP-93i: (basic) DES/Triple DES, AES, PRNG, IPsec ESP, SRTP, SHA1
> > +    - EIP-93ie: i + SHA224/256, AES-192/256
> > +    - EIP-93is: i + SSL/DTLS/DTLS, MD5, ARC4
> > +    - EIP-93ies: i + e + s
> > +    - EIP-93iw: i + AES-XCB-MAC, AES-CCM
> > +
> > +properties:
> > +  compatible:
> > +    oneOf:
> > +      - items:
> > +          - const: airoha,crypto-eip93
> 
> Still doesn't look SoC specific...
>

Oh ok I didn't understand that I had to drop it.

> > +          - const: inside-secure,safexcel-eip93ies
> > +      # Compatible that doesn't have any current user.
> > +      # - items:
> > +      #     - const: SoC specific compatible
> > +      #     - enum:
> > +      #         - inside-secure,safexcel-eip93i
> > +      #         - inside-secure,safexcel-eip93ie
> > +      #         - inside-secure,safexcel-eip93is
> > +      #         - inside-secure,safexcel-eip93iw
> 
> I should have looked at the driver before commenting before, but since 
> you are using these compatibles, you should go with my other suggestion 
> or these will be listed as undocumented.
>

The other suggestion you mean with the false or not: {} ? I tried that
first with 

- items:
	- not: {}
	- enum:
		- ...

But make dt_binding_check always complained. and False had some problem
is compiling the yaml schema.

Sorry if I'm making this very confusing. We can also consider using SoC
specific compatible in the driver directly and just declare the generic
one here.
Rob Herring (Arm) Nov. 1, 2024, 7:12 p.m. UTC | #3
On Mon, Oct 28, 2024 at 03:43:34PM +0100, Christian Marangi wrote:
> On Mon, Oct 28, 2024 at 09:35:15AM -0500, Rob Herring wrote:
> > On Mon, Oct 28, 2024 at 01:41:42PM +0100, Christian Marangi wrote:
> > > Add bindings for the Inside Secure SafeXcel EIP-93 crypto engine.
> > > 
> > > The IP is present on Airoha SoC and on various Mediatek devices and
> > > other SoC under different names like mtk-eip93 or PKTE.
> > > 
> > > All the compatible that currently doesn't have any user are left there
> > > commented for reference.
> > > 
> > > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> > > ---
> > > Changes v5:
> > > - Comment out compatible with no current user
> > > Changes v4:
> > > - Out of RFC
> > > Changes v3:
> > > - Add SoC compatible with generic one
> > > Changes v2:
> > > - Change to better compatible
> > > - Add description for EIP93 models
> > > 
> > >  .../crypto/inside-secure,safexcel-eip93.yaml  | 67 +++++++++++++++++++
> > >  1 file changed, 67 insertions(+)
> > >  create mode 100644 Documentation/devicetree/bindings/crypto/inside-secure,safexcel-eip93.yaml
> > > 
> > > diff --git a/Documentation/devicetree/bindings/crypto/inside-secure,safexcel-eip93.yaml b/Documentation/devicetree/bindings/crypto/inside-secure,safexcel-eip93.yaml
> > > new file mode 100644
> > > index 000000000000..188240b74110
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/crypto/inside-secure,safexcel-eip93.yaml
> > > @@ -0,0 +1,67 @@
> > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/crypto/inside-secure,safexcel-eip93.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: Inside Secure SafeXcel EIP-93 cryptographic engine
> > > +
> > > +maintainers:
> > > +  - Christian Marangi <ansuelsmth@gmail.com>
> > > +
> > > +description: |
> > > +  The Inside Secure SafeXcel EIP-93 is a cryptographic engine IP block
> > > +  integrated in varios devices with very different and generic name from
> > > +  PKTE to simply vendor+EIP93. The real IP under the hood is actually
> > > +  developed by Inside Secure and given to license to vendors.
> > > +
> > > +  The IP block is sold with different model based on what feature are
> > > +  needed and are identified with the final letter. Each letter correspond
> > > +  to a specific set of feature and multiple letter reflect the sum of the
> > > +  feature set.
> > > +
> > > +  EIP-93 models:
> > > +    - EIP-93i: (basic) DES/Triple DES, AES, PRNG, IPsec ESP, SRTP, SHA1
> > > +    - EIP-93ie: i + SHA224/256, AES-192/256
> > > +    - EIP-93is: i + SSL/DTLS/DTLS, MD5, ARC4
> > > +    - EIP-93ies: i + e + s
> > > +    - EIP-93iw: i + AES-XCB-MAC, AES-CCM
> > > +
> > > +properties:
> > > +  compatible:
> > > +    oneOf:
> > > +      - items:
> > > +          - const: airoha,crypto-eip93
> > 
> > Still doesn't look SoC specific...
> >
> 
> Oh ok I didn't understand that I had to drop it.

Not drop, but something with the SoC name in it. What's the SoC you are 
using?

> 
> > > +          - const: inside-secure,safexcel-eip93ies
> > > +      # Compatible that doesn't have any current user.
> > > +      # - items:
> > > +      #     - const: SoC specific compatible
> > > +      #     - enum:
> > > +      #         - inside-secure,safexcel-eip93i
> > > +      #         - inside-secure,safexcel-eip93ie
> > > +      #         - inside-secure,safexcel-eip93is
> > > +      #         - inside-secure,safexcel-eip93iw
> > 
> > I should have looked at the driver before commenting before, but since 
> > you are using these compatibles, you should go with my other suggestion 
> > or these will be listed as undocumented.
> >
> 
> The other suggestion you mean with the false or not: {} ? I tried that
> first with 
> 
> - items:
> 	- not: {}
> 	- enum:
> 		- ...
> 
> But make dt_binding_check always complained. and False had some problem
> is compiling the yaml schema.

Either way should work with main branch now.

> Sorry if I'm making this very confusing. We can also consider using SoC
> specific compatible in the driver directly and just declare the generic
> one here.

How would that work for the cases without an SoC specific compatible 
yet? Of course, if you can't test the i, ie, is or iw variants, how do 
you know they work. Just relying on them being a subset of functionality 
I guess.

Rob
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/crypto/inside-secure,safexcel-eip93.yaml b/Documentation/devicetree/bindings/crypto/inside-secure,safexcel-eip93.yaml
new file mode 100644
index 000000000000..188240b74110
--- /dev/null
+++ b/Documentation/devicetree/bindings/crypto/inside-secure,safexcel-eip93.yaml
@@ -0,0 +1,67 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/crypto/inside-secure,safexcel-eip93.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Inside Secure SafeXcel EIP-93 cryptographic engine
+
+maintainers:
+  - Christian Marangi <ansuelsmth@gmail.com>
+
+description: |
+  The Inside Secure SafeXcel EIP-93 is a cryptographic engine IP block
+  integrated in varios devices with very different and generic name from
+  PKTE to simply vendor+EIP93. The real IP under the hood is actually
+  developed by Inside Secure and given to license to vendors.
+
+  The IP block is sold with different model based on what feature are
+  needed and are identified with the final letter. Each letter correspond
+  to a specific set of feature and multiple letter reflect the sum of the
+  feature set.
+
+  EIP-93 models:
+    - EIP-93i: (basic) DES/Triple DES, AES, PRNG, IPsec ESP, SRTP, SHA1
+    - EIP-93ie: i + SHA224/256, AES-192/256
+    - EIP-93is: i + SSL/DTLS/DTLS, MD5, ARC4
+    - EIP-93ies: i + e + s
+    - EIP-93iw: i + AES-XCB-MAC, AES-CCM
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - const: airoha,crypto-eip93
+          - const: inside-secure,safexcel-eip93ies
+      # Compatible that doesn't have any current user.
+      # - items:
+      #     - const: SoC specific compatible
+      #     - enum:
+      #         - inside-secure,safexcel-eip93i
+      #         - inside-secure,safexcel-eip93ie
+      #         - inside-secure,safexcel-eip93is
+      #         - inside-secure,safexcel-eip93iw
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    crypto@1e004000 {
+      compatible = "airoha,crypto-eip93", "inside-secure,safexcel-eip93ies";
+      reg = <0x1fb70000 0x1000>;
+
+      interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
+    };