lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 26 Mar 2024 18:20:05 +0000
From: Conor Dooley <conor@...nel.org>
To: Animesh Agarwal <animeshagarwal28@...il.com>
Cc: Herbert Xu <herbert@...dor.apana.org.au>,
	"David S. Miller" <davem@...emloft.net>,
	Rob Herring <robh+dt@...nel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
	Conor Dooley <conor+dt@...nel.org>, linux-crypto@...r.kernel.org,
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] dt-bindings: crypto: ti,omap-sham: Convert to dtschema

On Tue, Mar 26, 2024 at 05:31:00PM +0530, Animesh Agarwal wrote:
> Convert the OMAP SoC SHA crypto Module bindings to DT Schema.
> 
> Signed-off-by: Animesh Agarwal <animeshagarwal28@...il.com>
> ---
>  .../devicetree/bindings/crypto/omap-sham.txt  | 28 ----------
>  .../bindings/crypto/ti,omap-sham.yaml         | 56 +++++++++++++++++++
>  2 files changed, 56 insertions(+), 28 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/crypto/omap-sham.txt
>  create mode 100644 Documentation/devicetree/bindings/crypto/ti,omap-sham.yaml
> 
> diff --git a/Documentation/devicetree/bindings/crypto/omap-sham.txt b/Documentation/devicetree/bindings/crypto/omap-sham.txt
> deleted file mode 100644
> index ad9115569611..000000000000
> --- a/Documentation/devicetree/bindings/crypto/omap-sham.txt
> +++ /dev/null
> @@ -1,28 +0,0 @@
> -OMAP SoC SHA crypto Module
> -
> -Required properties:
> -
> -- compatible : Should contain entries for this and backward compatible
> -  SHAM versions:
> -  - "ti,omap2-sham" for OMAP2 & OMAP3.
> -  - "ti,omap4-sham" for OMAP4 and AM33XX.
> -  - "ti,omap5-sham" for OMAP5, DRA7 and AM43XX.
> -- ti,hwmods: Name of the hwmod associated with the SHAM module
> -- reg : Offset and length of the register set for the module
> -- interrupts : the interrupt-specifier for the SHAM module.
> -
> -Optional properties:
> -- dmas: DMA specifiers for the rx dma. See the DMA client binding,
> -	Documentation/devicetree/bindings/dma/dma.txt
> -- dma-names: DMA request name. Should be "rx" if a dma is present.
> -
> -Example:
> -	/* AM335x */
> -	sham: sham@...00000 {
> -		compatible = "ti,omap4-sham";
> -		ti,hwmods = "sham";
> -		reg = <0x53100000 0x200>;
> -		interrupts = <109>;
> -		dmas = <&edma 36>;
> -		dma-names = "rx";
> -	};
> diff --git a/Documentation/devicetree/bindings/crypto/ti,omap-sham.yaml b/Documentation/devicetree/bindings/crypto/ti,omap-sham.yaml
> new file mode 100644
> index 000000000000..7a2529cc4cae
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/crypto/ti,omap-sham.yaml
> @@ -0,0 +1,56 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/crypto/ti,omap-sham.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: OMAP SoC SHA crypto Module
> +
> +maintainers:
> +  - Animesh Agarwal <animeshagarwal28@...il.com>
> +
> +properties:
> +  compatible:
> +    enum:
> +      - ti,omap2-sham
> +      - ti,omap4-sham
> +      - ti,omap5-sham
> +
> +  ti,hwmods:
> +    description: Name of the hwmod associated with the SHAM module
> +    $ref: /schemas/types.yaml#/definitions/string
> +    enum: [sham]

Is there really only one value possible here?
Also, the convention is to put vendor properties like this after more
common properties like reg, interrupts etc.

> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  dmas:
> +    maxItems: 1
> +
> +  dma-names:
> +    const: rx
> +
> +dependencies:
> +  dmas: [dma-names]

Is this needed? Unless I'm sorely mistaken dt-schema enforces this itself
(and same for any $foo-names).

Thanks,
Conor.

> +
> +additionalProperties: false
> +
> +required:
> +  - compatible
> +  - ti,hwmods
> +  - reg
> +  - interrupts
> +
> +examples:
> +  - |
> +    sham@...00000 {
> +        compatible = "ti,omap4-sham";
> +        ti,hwmods = "sham";
> +        reg = <0x53100000 0x200>;
> +        interrupts = <109>;
> +        dmas = <&edma 36>;
> +        dma-names = "rx";
> +    };
> -- 
> 2.44.0
> 

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ