* [PATCH] dt-bindings: rng: convert OMAP and Inside-Secure HWRNG to yaml schema
@ 2021-09-16 18:53 Jayesh Choudhary
2021-09-21 23:31 ` Rob Herring
0 siblings, 1 reply; 2+ messages in thread
From: Jayesh Choudhary @ 2021-09-16 18:53 UTC (permalink / raw)
To: devicetree; +Cc: mpm, herbert, robh+dt, j-choudhary, linux-crypto, linux-kernel
Converts the RNG bindings for OMAP SoCs and Inside-Secure
HWRNG modules to YAML schema.
Signed-off-by: Jayesh Choudhary <j-choudhary@ti.com>
---
.../devicetree/bindings/rng/omap_rng.txt | 38 --------
.../devicetree/bindings/rng/omap_rng.yaml | 94 +++++++++++++++++++
2 files changed, 94 insertions(+), 38 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/rng/omap_rng.txt
create mode 100644 Documentation/devicetree/bindings/rng/omap_rng.yaml
diff --git a/Documentation/devicetree/bindings/rng/omap_rng.txt b/Documentation/devicetree/bindings/rng/omap_rng.txt
deleted file mode 100644
index ea434ce50f36..000000000000
--- a/Documentation/devicetree/bindings/rng/omap_rng.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-OMAP SoC and Inside-Secure HWRNG Module
-
-Required properties:
-
-- compatible : Should contain entries for this and backward compatible
- RNG versions:
- - "ti,omap2-rng" for OMAP2.
- - "ti,omap4-rng" for OMAP4, OMAP5 and AM33XX.
- - "inside-secure,safexcel-eip76" for SoCs with EIP76 IP block
- Note that these two versions are incompatible.
-- ti,hwmods: Name of the hwmod associated with the RNG module
-- reg : Offset and length of the register set for the module
-- interrupts : the interrupt number for the RNG module.
- Used for "ti,omap4-rng" and "inside-secure,safexcel-eip76"
-- clocks: the trng clock source. Only mandatory for the
- "inside-secure,safexcel-eip76" compatible, the second clock is
- needed for the Armada 7K/8K SoCs
-- clock-names: mandatory if there is a second clock, in this case the
- name must be "core" for the first clock and "reg" for the second
- one
-
-
-Example:
-/* AM335x */
-rng: rng@48310000 {
- compatible = "ti,omap4-rng";
- ti,hwmods = "rng";
- reg = <0x48310000 0x2000>;
- interrupts = <111>;
-};
-
-/* SafeXcel IP-76 */
-trng: rng@f2760000 {
- compatible = "inside-secure,safexcel-eip76";
- reg = <0xf2760000 0x7d>;
- interrupts = <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>;
- clocks = <&cpm_syscon0 1 25>;
-};
diff --git a/Documentation/devicetree/bindings/rng/omap_rng.yaml b/Documentation/devicetree/bindings/rng/omap_rng.yaml
new file mode 100644
index 000000000000..86bbc2c53e7d
--- /dev/null
+++ b/Documentation/devicetree/bindings/rng/omap_rng.yaml
@@ -0,0 +1,94 @@
+# SPDX-License-Identifier: (GPL-2.0+ OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rng/omap_rng.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: OMAP SoC and Inside-Secure HWRNG Module
+
+maintainers:
+ - Jayesh Choudhary <j-choudhary@ti.com>
+
+properties:
+ compatible:
+ enum:
+ - ti,omap2-rng
+ - ti,omap4-rng
+ - inside-secure,safexcel-eip76
+
+ ti,hwmods:
+ const: rng
+ deprecated: true
+ description: Name of the hwmod associated with the RNG module
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ clocks:
+ minItems: 1
+ maxItems: 2
+ items:
+ - description: EIP150 gatable clock
+ - description: Main gatable clock
+
+ clock-names:
+ oneOf:
+ - items:
+ - const: core
+ - const: reg
+ - const: core
+
+
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - ti,omap4-rng
+ - inside-secure,safexcel-eip76
+
+ then:
+ required:
+ - interrupts
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - inside-secure,safexcel-eip76
+
+ then:
+ required:
+ - clocks
+
+
+required:
+ - compatible
+ - reg
+
+additionalProperties: false
+
+examples:
+ - |
+ /* AM335x */
+ rng: rng@48310000 {
+ compatible = "ti,omap4-rng";
+ ti,hwmods = "rng";
+ reg = <0x48310000 0x2000>;
+ interrupts = <111>;
+ };
+ - |
+ /* SafeXcel IP-76 */
+ trng: rng@f2760000 {
+ compatible = "inside-secure,safexcel-eip76";
+ reg = <0xf2760000 0x7d>;
+ interrupts = <0 59 4>;
+ clocks = <&cpm_syscon0 1 25>;
+ };
+
+...
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] dt-bindings: rng: convert OMAP and Inside-Secure HWRNG to yaml schema
2021-09-16 18:53 [PATCH] dt-bindings: rng: convert OMAP and Inside-Secure HWRNG to yaml schema Jayesh Choudhary
@ 2021-09-21 23:31 ` Rob Herring
0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2021-09-21 23:31 UTC (permalink / raw)
To: Jayesh Choudhary; +Cc: devicetree, mpm, herbert, linux-crypto, linux-kernel
On Fri, Sep 17, 2021 at 12:23:52AM +0530, Jayesh Choudhary wrote:
> Converts the RNG bindings for OMAP SoCs and Inside-Secure
> HWRNG modules to YAML schema.
>
> Signed-off-by: Jayesh Choudhary <j-choudhary@ti.com>
> ---
> .../devicetree/bindings/rng/omap_rng.txt | 38 --------
> .../devicetree/bindings/rng/omap_rng.yaml | 94 +++++++++++++++++++
> 2 files changed, 94 insertions(+), 38 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/rng/omap_rng.txt
> create mode 100644 Documentation/devicetree/bindings/rng/omap_rng.yaml
>
> diff --git a/Documentation/devicetree/bindings/rng/omap_rng.txt b/Documentation/devicetree/bindings/rng/omap_rng.txt
> deleted file mode 100644
> index ea434ce50f36..000000000000
> --- a/Documentation/devicetree/bindings/rng/omap_rng.txt
> +++ /dev/null
> @@ -1,38 +0,0 @@
> -OMAP SoC and Inside-Secure HWRNG Module
> -
> -Required properties:
> -
> -- compatible : Should contain entries for this and backward compatible
> - RNG versions:
> - - "ti,omap2-rng" for OMAP2.
> - - "ti,omap4-rng" for OMAP4, OMAP5 and AM33XX.
> - - "inside-secure,safexcel-eip76" for SoCs with EIP76 IP block
> - Note that these two versions are incompatible.
> -- ti,hwmods: Name of the hwmod associated with the RNG module
> -- reg : Offset and length of the register set for the module
> -- interrupts : the interrupt number for the RNG module.
> - Used for "ti,omap4-rng" and "inside-secure,safexcel-eip76"
> -- clocks: the trng clock source. Only mandatory for the
> - "inside-secure,safexcel-eip76" compatible, the second clock is
> - needed for the Armada 7K/8K SoCs
> -- clock-names: mandatory if there is a second clock, in this case the
> - name must be "core" for the first clock and "reg" for the second
> - one
> -
> -
> -Example:
> -/* AM335x */
> -rng: rng@48310000 {
> - compatible = "ti,omap4-rng";
> - ti,hwmods = "rng";
> - reg = <0x48310000 0x2000>;
> - interrupts = <111>;
> -};
> -
> -/* SafeXcel IP-76 */
> -trng: rng@f2760000 {
> - compatible = "inside-secure,safexcel-eip76";
> - reg = <0xf2760000 0x7d>;
> - interrupts = <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>;
> - clocks = <&cpm_syscon0 1 25>;
> -};
> diff --git a/Documentation/devicetree/bindings/rng/omap_rng.yaml b/Documentation/devicetree/bindings/rng/omap_rng.yaml
> new file mode 100644
> index 000000000000..86bbc2c53e7d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rng/omap_rng.yaml
> @@ -0,0 +1,94 @@
> +# SPDX-License-Identifier: (GPL-2.0+ OR BSD-2-Clause)
GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/rng/omap_rng.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: OMAP SoC and Inside-Secure HWRNG Module
> +
> +maintainers:
> + - Jayesh Choudhary <j-choudhary@ti.com>
> +
> +properties:
> + compatible:
> + enum:
> + - ti,omap2-rng
> + - ti,omap4-rng
> + - inside-secure,safexcel-eip76
> +
> + ti,hwmods:
> + const: rng
> + deprecated: true
> + description: Name of the hwmod associated with the RNG module
> +
> + reg:
> + maxItems: 1
> +
> + interrupts:
> + maxItems: 1
> +
> + clocks:
> + minItems: 1
> + maxItems: 2
> + items:
> + - description: EIP150 gatable clock
> + - description: Main gatable clock
> +
> + clock-names:
> + oneOf:
> + - items:
> + - const: core
> + - const: reg
> + - const: core
This is better expressed as:
minItems: 1
items:
- const: core
- const: reg
> +
> +
> +allOf:
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - ti,omap4-rng
> + - inside-secure,safexcel-eip76
> +
> + then:
> + required:
> + - interrupts
> +
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - inside-secure,safexcel-eip76
> +
> + then:
> + required:
> + - clocks
> +
> +
> +required:
> + - compatible
> + - reg
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + /* AM335x */
> + rng: rng@48310000 {
> + compatible = "ti,omap4-rng";
> + ti,hwmods = "rng";
> + reg = <0x48310000 0x2000>;
> + interrupts = <111>;
> + };
> + - |
> + /* SafeXcel IP-76 */
> + trng: rng@f2760000 {
> + compatible = "inside-secure,safexcel-eip76";
> + reg = <0xf2760000 0x7d>;
> + interrupts = <0 59 4>;
> + clocks = <&cpm_syscon0 1 25>;
> + };
> +
> +...
> --
> 2.17.1
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-09-21 23:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-16 18:53 [PATCH] dt-bindings: rng: convert OMAP and Inside-Secure HWRNG to yaml schema Jayesh Choudhary
2021-09-21 23:31 ` Rob Herring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).