diff mbox series

[1/2] dt-bindings: rng: add binding for BCM74110 RNG

Message ID 20241030213400.802264-2-mmayer@broadcom.com (mailing list archive)
State Superseded
Delegated to: Herbert Xu
Headers show
Series hwrng: bcm74110 - Add Broadcom BCM74110 RNG driver | expand

Commit Message

Markus Mayer Oct. 30, 2024, 9:33 p.m. UTC
Add a binding for the random number generator used on the BCM74110.

Signed-off-by: Markus Mayer <mmayer@broadcom.com>
---
 .../bindings/rng/brcm,bcm74110.yaml           | 35 +++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml

Comments

Florian Fainelli Oct. 30, 2024, 9:42 p.m. UTC | #1
On 10/30/24 14:33, Markus Mayer wrote:
> Add a binding for the random number generator used on the BCM74110.
> 
> Signed-off-by: Markus Mayer <mmayer@broadcom.com>
> ---
>   .../bindings/rng/brcm,bcm74110.yaml           | 35 +++++++++++++++++++
>   1 file changed, 35 insertions(+)
>   create mode 100644 Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml

This file should be named, brcm,bcm74110-rng.yaml, I believe.
--
Florian
Rob Herring (Arm) Oct. 30, 2024, 10:36 p.m. UTC | #2
On Wed, 30 Oct 2024 14:33:54 -0700, Markus Mayer wrote:
> Add a binding for the random number generator used on the BCM74110.
> 
> Signed-off-by: Markus Mayer <mmayer@broadcom.com>
> ---
>  .../bindings/rng/brcm,bcm74110.yaml           | 35 +++++++++++++++++++
>  1 file changed, 35 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/rng/brcm,bcm74110.example.dtb: /example-0/rng@83ba000: failed to match any schema with compatible: ['brcm,bcm74110-trng']

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20241030213400.802264-2-mmayer@broadcom.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
Krzysztof Kozlowski Oct. 31, 2024, 7:29 a.m. UTC | #3
On 30/10/2024 22:33, Markus Mayer wrote:
> Add a binding for the random number generator used on the BCM74110.
> 
> Signed-off-by: Markus Mayer <mmayer@broadcom.com>
> ---
>  .../bindings/rng/brcm,bcm74110.yaml           | 35 +++++++++++++++++++
>  1 file changed, 35 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml
> 
> diff --git a/Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml b/Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml
> new file mode 100644
> index 000000000000..acd0856cee72
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml

Filename as compatible.

> @@ -0,0 +1,35 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/rng/brcm,bcm74110.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: BCM74110 Random number generator
> +
> +description: |

Do not need '|' unless you need to preserve formatting.

> +  Random number generator used on the BCM74110.
> +
> +maintainers:
> +  - Markus Mayer <mmayer@broadcom.com>
> +  - Florian Fainelli <florian.fainelli@broadcom.com>
> +
> +properties:
> +  compatible:
> +    enum:
> +      - brcm,bcm74110-rng

That's not what you have in DTS.

> +
> +  reg:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    rng: rng@83ba000 {

Drop unused label.



Best regards,
Krzysztof
Markus Mayer Oct. 31, 2024, 6:55 p.m. UTC | #4
On Thu, 31 Oct 2024 at 00:29, Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> On 30/10/2024 22:33, Markus Mayer wrote:
> > Add a binding for the random number generator used on the BCM74110.
> >
> > Signed-off-by: Markus Mayer <mmayer@broadcom.com>
> > ---
> >  .../bindings/rng/brcm,bcm74110.yaml           | 35 +++++++++++++++++++
> >  1 file changed, 35 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml b/Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml
> > new file mode 100644
> > index 000000000000..acd0856cee72
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml
>
> Filename as compatible.

I am not sure what you mean by this. That the filename should match
the compatible string? I did change the filename to
brcm,bcm74110-rng.yaml the ID to
http://devicetree.org/schemas/rng/brcm,bcm74110-rng.yaml# in response
to Florian's comment from yesterday.

> > @@ -0,0 +1,35 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/rng/brcm,bcm74110.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: BCM74110 Random number generator
> > +
> > +description: |
>
> Do not need '|' unless you need to preserve formatting.

Removed.

> > +  Random number generator used on the BCM74110.
> > +
> > +maintainers:
> > +  - Markus Mayer <mmayer@broadcom.com>
> > +  - Florian Fainelli <florian.fainelli@broadcom.com>
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - brcm,bcm74110-rng
>
> That's not what you have in DTS.

Fixed in the DTS to be "brcm,bcm74110-rng" everywhere.

> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    rng: rng@83ba000 {
>
> Drop unused label.

Done.

I am giving it a bit more time for additional feedback (on the driver
and the binding) and will send v2 in a few days. Meanwhile, the
generated DTS (with the changes incorporated) is now looking like
this:

$ cat ./Documentation/devicetree/bindings/rng/brcm,bcm74110-rng.example.dts
/dts-v1/;
/plugin/; // silence any missing phandle references

/{
    compatible = "foo";
    model = "foo";
    #address-cells = <1>;
    #size-cells = <1>;

    example-0 {
        #address-cells = <1>;
        #size-cells = <1>;

        rng@83ba000 {
            compatible = "brcm,bcm74110-rng";
            reg = <0x83ba000 0x14>;
        };
    };
};

Thanks,
-Markus
Krzysztof Kozlowski Nov. 1, 2024, 6:50 a.m. UTC | #5
On 31/10/2024 19:55, Markus Mayer wrote:
> On Thu, 31 Oct 2024 at 00:29, Krzysztof Kozlowski
> <krzysztof.kozlowski@linaro.org> wrote:
>>
>> On 30/10/2024 22:33, Markus Mayer wrote:
>>> Add a binding for the random number generator used on the BCM74110.
>>>
>>> Signed-off-by: Markus Mayer <mmayer@broadcom.com>
>>> ---
>>>  .../bindings/rng/brcm,bcm74110.yaml           | 35 +++++++++++++++++++
>>>  1 file changed, 35 insertions(+)
>>>  create mode 100644 Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml
>>>
>>> diff --git a/Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml b/Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml
>>> new file mode 100644
>>> index 000000000000..acd0856cee72
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml
>>
>> Filename as compatible.
> 
> I am not sure what you mean by this. That the filename should match
> the compatible string? I did change the filename to

Yes.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml b/Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml
new file mode 100644
index 000000000000..acd0856cee72
--- /dev/null
+++ b/Documentation/devicetree/bindings/rng/brcm,bcm74110.yaml
@@ -0,0 +1,35 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rng/brcm,bcm74110.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: BCM74110 Random number generator
+
+description: |
+  Random number generator used on the BCM74110.
+
+maintainers:
+  - Markus Mayer <mmayer@broadcom.com>
+  - Florian Fainelli <florian.fainelli@broadcom.com>
+
+properties:
+  compatible:
+    enum:
+      - brcm,bcm74110-rng
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    rng: rng@83ba000 {
+        compatible = "brcm,bcm74110-trng";
+        reg = <0x83ba000 0x14>;
+    };