diff mbox series

[4/5] dt-bindings: crypto: add documentation for aspeed hace

Message ID 20220601054204.1522976-5-neal_liu@aspeedtech.com (mailing list archive)
State Superseded
Delegated to: Herbert Xu
Headers show
Series Add Aspeed crypto driver for hardware acceleration | expand

Commit Message

Neal Liu June 1, 2022, 5:42 a.m. UTC
Add device tree binding documentation for the Aspeed Hash
and Crypto Engines (HACE) Controller.

Signed-off-by: Neal Liu <neal_liu@aspeedtech.com>
Signed-off-by: Johnny Huang <johnny_huang@aspeedtech.com>
---
 .../bindings/crypto/aspeed,hace.yaml          | 58 +++++++++++++++++++
 1 file changed, 58 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/crypto/aspeed,hace.yaml

Comments

Krzysztof Kozlowski June 1, 2022, 7:44 a.m. UTC | #1
On 01/06/2022 07:42, Neal Liu wrote:
> Add device tree binding documentation for the Aspeed Hash
> and Crypto Engines (HACE) Controller.
> 
> Signed-off-by: Neal Liu <neal_liu@aspeedtech.com>
> Signed-off-by: Johnny Huang <johnny_huang@aspeedtech.com>
> ---
>  .../bindings/crypto/aspeed,hace.yaml          | 58 +++++++++++++++++++
>  1 file changed, 58 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/crypto/aspeed,hace.yaml
> 
> diff --git a/Documentation/devicetree/bindings/crypto/aspeed,hace.yaml b/Documentation/devicetree/bindings/crypto/aspeed,hace.yaml
> new file mode 100644
> index 000000000000..36b4ad0dc7fa
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/crypto/aspeed,hace.yaml

Filename should be rather from the first compatible, so
"aspeed,ast2500-hace.yaml"

> @@ -0,0 +1,58 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/crypto/aspeed,hace.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: ASPEED HACE hash and crypto Hardware Accelerator Device Tree Bindings

s/Device Tree Bindings//

> +
> +maintainers:
> +  - Neal Liu <neal_liu@aspeedtech.com>
> +
> +description: |
> +  The Hash and Crypto Engine (HACE) is designed to accelerate the throughput
> +  of hash data digest, encryption, and decryption. Basically, HACE can be
> +  divided into two independently engines - Hash Engine and Crypto Engine.
> +
> +properties:
> +  compatible:
> +    enum:
> +      - aspeed,ast2500-hace
> +      - aspeed,ast2600-hace
> +
> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    maxItems: 1
> +
> +  clock-names:
> +    maxItems: 1

You need to list clock names, however usually it does not make sense to
have names for just one main device clock.

> +
> +  interrupts:
> +    maxItems: 1
> +
> +  resets:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +  - clocks
> +  - clock-names
> +  - interrupts
> +  - resets
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/clock/ast2600-clock.h>
> +    hace: hace@1e6d0000 {

Generic node names so "crypto".

> +        compatible = "aspeed,ast2600-hace";
> +        reg = <0x1e6d0000 0x200>;
> +        interrupts = <4>;
> +        clocks = <&syscon ASPEED_CLK_GATE_YCLK>;
> +        clock-names = "yclk";
> +        resets = <&syscon ASPEED_RESET_HACE>;
> +    };


Best regards,
Krzysztof
Neal Liu June 1, 2022, 8:01 a.m. UTC | #2
> On 01/06/2022 07:42, Neal Liu wrote:
> > Add device tree binding documentation for the Aspeed Hash and Crypto
> > Engines (HACE) Controller.
> >
> > Signed-off-by: Neal Liu <neal_liu@aspeedtech.com>
> > Signed-off-by: Johnny Huang <johnny_huang@aspeedtech.com>
> > ---
> >  .../bindings/crypto/aspeed,hace.yaml          | 58
> +++++++++++++++++++
> >  1 file changed, 58 insertions(+)
> >  create mode 100644
> > Documentation/devicetree/bindings/crypto/aspeed,hace.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/crypto/aspeed,hace.yaml
> > b/Documentation/devicetree/bindings/crypto/aspeed,hace.yaml
> > new file mode 100644
> > index 000000000000..36b4ad0dc7fa
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/crypto/aspeed,hace.yaml
> 
> Filename should be rather from the first compatible, so
> "aspeed,ast2500-hace.yaml"
> 
Got it, I'll revise it as you suggested.

> > @@ -0,0 +1,58 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/crypto/aspeed,hace.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: ASPEED HACE hash and crypto Hardware Accelerator Device Tree
> > +Bindings
> 
> s/Device Tree Bindings//
> 
Got it, I'll revise it as you suggested.

> > +
> > +maintainers:
> > +  - Neal Liu <neal_liu@aspeedtech.com>
> > +
> > +description: |
> > +  The Hash and Crypto Engine (HACE) is designed to accelerate the
> > +throughput
> > +  of hash data digest, encryption, and decryption. Basically, HACE
> > +can be
> > +  divided into two independently engines - Hash Engine and Crypto Engine.
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - aspeed,ast2500-hace
> > +      - aspeed,ast2600-hace
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  clocks:
> > +    maxItems: 1
> > +
> > +  clock-names:
> > +    maxItems: 1
> 
> You need to list clock names, however usually it does not make sense to have
> names for just one main device clock.
> 
I think list clock-names is optional, I'll remove it from required list.

> > +
> > +  interrupts:
> > +    maxItems: 1
> > +
> > +  resets:
> > +    maxItems: 1
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - clocks
> > +  - clock-names
> > +  - interrupts
> > +  - resets
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/clock/ast2600-clock.h>
> > +    hace: hace@1e6d0000 {
> 
> Generic node names so "crypto".
> 
Got it, I'll revise it as you suggested.

> > +        compatible = "aspeed,ast2600-hace";
> > +        reg = <0x1e6d0000 0x200>;
> > +        interrupts = <4>;
> > +        clocks = <&syscon ASPEED_CLK_GATE_YCLK>;
> > +        clock-names = "yclk";
> > +        resets = <&syscon ASPEED_RESET_HACE>;
> > +    };
> 
> 
> Best regards,
> Krzysztof
Krzysztof Kozlowski June 1, 2022, 9:19 a.m. UTC | #3
On 01/06/2022 10:01, Neal Liu wrote:
>>> +  clocks:
>>> +    maxItems: 1
>>> +
>>> +  clock-names:
>>> +    maxItems: 1
>>
>> You need to list clock names, however usually it does not make sense to have
>> names for just one main device clock.
>>
> I think list clock-names is optional, I'll remove it from required list.

I actually suggest to remove the clock-names property entirely, if is
has one generic entry called "clk" (or "vclk" - the same). Do you
already expect adding here more clocks?


Best regards,
Krzysztof
Neal Liu June 1, 2022, 9:33 a.m. UTC | #4
> Subject: Re: [PATCH 4/5] dt-bindings: crypto: add documentation for aspeed
> hace
> 
> On 01/06/2022 10:01, Neal Liu wrote:
> >>> +  clocks:
> >>> +    maxItems: 1
> >>> +
> >>> +  clock-names:
> >>> +    maxItems: 1
> >>
> >> You need to list clock names, however usually it does not make sense
> >> to have names for just one main device clock.
> >>
> > I think list clock-names is optional, I'll remove it from required list.
> 
> I actually suggest to remove the clock-names property entirely, if is has one
> generic entry called "clk" (or "vclk" - the same). Do you already expect adding
> here more clocks?
> 

You are right. Currently, it has only one clock. I'll remove both of them.
Thanks

> 
> Best regards,
> Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/crypto/aspeed,hace.yaml b/Documentation/devicetree/bindings/crypto/aspeed,hace.yaml
new file mode 100644
index 000000000000..36b4ad0dc7fa
--- /dev/null
+++ b/Documentation/devicetree/bindings/crypto/aspeed,hace.yaml
@@ -0,0 +1,58 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/crypto/aspeed,hace.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ASPEED HACE hash and crypto Hardware Accelerator Device Tree Bindings
+
+maintainers:
+  - Neal Liu <neal_liu@aspeedtech.com>
+
+description: |
+  The Hash and Crypto Engine (HACE) is designed to accelerate the throughput
+  of hash data digest, encryption, and decryption. Basically, HACE can be
+  divided into two independently engines - Hash Engine and Crypto Engine.
+
+properties:
+  compatible:
+    enum:
+      - aspeed,ast2500-hace
+      - aspeed,ast2600-hace
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  resets:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - interrupts
+  - resets
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/ast2600-clock.h>
+    hace: hace@1e6d0000 {
+        compatible = "aspeed,ast2600-hace";
+        reg = <0x1e6d0000 0x200>;
+        interrupts = <4>;
+        clocks = <&syscon ASPEED_CLK_GATE_YCLK>;
+        clock-names = "yclk";
+        resets = <&syscon ASPEED_RESET_HACE>;
+    };