diff mbox series

[v3,1/3] dt-bindings: mips: add CPU bindings for MIPS architecture

Message ID 20220929072004.874795-2-sergio.paracuellos@gmail.com (mailing list archive)
State Superseded
Headers show
Series dt-bindings: mips: add CPU bindings for MIPS architecture | expand

Commit Message

Sergio Paracuellos Sept. 29, 2022, 7:20 a.m. UTC
Add the yaml binding for available CPUs in MIPS architecture.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 .../devicetree/bindings/mips/cpus.yaml        | 66 +++++++++++++++++++
 1 file changed, 66 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mips/cpus.yaml

Comments

Rob Herring (Arm) Sept. 30, 2022, 5:16 p.m. UTC | #1
On Thu, Sep 29, 2022 at 09:20:02AM +0200, Sergio Paracuellos wrote:
> Add the yaml binding for available CPUs in MIPS architecture.
> 
> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> ---
>  .../devicetree/bindings/mips/cpus.yaml        | 66 +++++++++++++++++++
>  1 file changed, 66 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mips/cpus.yaml
> 
> diff --git a/Documentation/devicetree/bindings/mips/cpus.yaml b/Documentation/devicetree/bindings/mips/cpus.yaml
> new file mode 100644
> index 000000000000..4f8891f0755b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mips/cpus.yaml
> @@ -0,0 +1,66 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mips/cpus.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: MIPS CPUs bindings
> +
> +maintainers:
> +  - Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> +
> +description: |
> +  The device tree allows to describe the layout of CPUs in a system through
> +  the "cpus" node, which in turn contains a number of subnodes (ie "cpu")
> +  defining properties for every CPU.
> +
> +properties:
> +  compatible:
> +    enum:
> +      - brcm,bmips3300
> +      - brcm,bmips4350
> +      - brcm,bmips4380
> +      - brcm,bmips5000
> +      - brcm,bmips5200

Need to remove 
Documentation/devicetree/bindings/mips/brcm/brcm,bmips.txt.

> +      - ingenic,xburst-mxu1.0
> +      - ingenic,xburst-fpu1.0-mxu1.1
> +      - ingenic,xburst-fpu2.0-mxu2.0

So we should remove 
Documentation/devicetree/bindings/mips/ingenic/ingenic,cpu.yaml?

> +      - loongson,gs264
> +      - mips,m14Kc
> +      - mips,mips4Kc
> +      - mips,mips4KEc
> +      - mips,mips24Kc
> +      - mips,mips24KEc
> +      - mips,mips74Kc
> +      - mips,mips1004Kc
> +      - mti,interaptiv
> +      - mti,mips24KEc
> +      - mti,mips14KEc
> +      - mti,mips14Kc
> +
> +  reg:
> +    maxItems: 1

Does the numbering have some basis in the h/w?

> +
> +required:
> +  - compatible
> +
> +additionalProperties: true

Do you need this to be true? What's missing besides 'device_type'?

We've got the same issue for Arm cpu schema, so fine for now if there's 
not an easy fix.

Rob
Sergio Paracuellos Oct. 1, 2022, 3:39 a.m. UTC | #2
Hi Rob,

On Fri, Sep 30, 2022 at 7:16 PM Rob Herring <robh@kernel.org> wrote:
>
> On Thu, Sep 29, 2022 at 09:20:02AM +0200, Sergio Paracuellos wrote:
> > Add the yaml binding for available CPUs in MIPS architecture.
> >
> > Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> > ---
> >  .../devicetree/bindings/mips/cpus.yaml        | 66 +++++++++++++++++++
> >  1 file changed, 66 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/mips/cpus.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/mips/cpus.yaml b/Documentation/devicetree/bindings/mips/cpus.yaml
> > new file mode 100644
> > index 000000000000..4f8891f0755b
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/mips/cpus.yaml
> > @@ -0,0 +1,66 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/mips/cpus.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: MIPS CPUs bindings
> > +
> > +maintainers:
> > +  - Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> > +
> > +description: |
> > +  The device tree allows to describe the layout of CPUs in a system through
> > +  the "cpus" node, which in turn contains a number of subnodes (ie "cpu")
> > +  defining properties for every CPU.
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - brcm,bmips3300
> > +      - brcm,bmips4350
> > +      - brcm,bmips4380
> > +      - brcm,bmips5000
> > +      - brcm,bmips5200
>
> Need to remove
> Documentation/devicetree/bindings/mips/brcm/brcm,bmips.txt.

This is removed in the BMIPS CPUs related PATCH.

>
> > +      - ingenic,xburst-mxu1.0
> > +      - ingenic,xburst-fpu1.0-mxu1.1
> > +      - ingenic,xburst-fpu2.0-mxu2.0
>
> So we should remove
> Documentation/devicetree/bindings/mips/ingenic/ingenic,cpu.yaml?

Oh, I missed that documentation, thanks. I guess I can include that
info in this schema and remove the file? Or maybe just drop this
ingenic compatible from here? I wonder what is the best approach.

>
> > +      - loongson,gs264
> > +      - mips,m14Kc
> > +      - mips,mips4Kc
> > +      - mips,mips4KEc
> > +      - mips,mips24Kc
> > +      - mips,mips24KEc
> > +      - mips,mips74Kc
> > +      - mips,mips1004Kc
> > +      - mti,interaptiv
> > +      - mti,mips24KEc
> > +      - mti,mips14KEc
> > +      - mti,mips14Kc
> > +
> > +  reg:
> > +    maxItems: 1
>
> Does the numbering have some basis in the h/w?

Looking into the current mainlined dts files I ended up with this.
Other than that I don't really know.

>
> > +
> > +required:
> > +  - compatible
> > +
> > +additionalProperties: true
>
> Do you need this to be true? What's missing besides 'device_type'?

As I tried to explain in the cover letter of this series, current
'arch/mips/boot/dts' folder dts files are a bit messy
for cpu nodes, so I set additionalProperties to true and only make
them required for 'compatible' in this schema.
Just to avoid surprises.  I guess I can try to set this to false and
add clock and other properties required for some compatibles, if that
is preferred.

> We've got the same issue for Arm cpu schema, so fine for now if there's
> not an easy fix.
>
> Rob

Thanks,
    Sergio Paracuellos
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/mips/cpus.yaml b/Documentation/devicetree/bindings/mips/cpus.yaml
new file mode 100644
index 000000000000..4f8891f0755b
--- /dev/null
+++ b/Documentation/devicetree/bindings/mips/cpus.yaml
@@ -0,0 +1,66 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mips/cpus.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MIPS CPUs bindings
+
+maintainers:
+  - Thomas Bogendoerfer <tsbogend@alpha.franken.de>
+
+description: |
+  The device tree allows to describe the layout of CPUs in a system through
+  the "cpus" node, which in turn contains a number of subnodes (ie "cpu")
+  defining properties for every CPU.
+
+properties:
+  compatible:
+    enum:
+      - brcm,bmips3300
+      - brcm,bmips4350
+      - brcm,bmips4380
+      - brcm,bmips5000
+      - brcm,bmips5200
+      - ingenic,xburst-mxu1.0
+      - ingenic,xburst-fpu1.0-mxu1.1
+      - ingenic,xburst-fpu2.0-mxu2.0
+      - loongson,gs264
+      - mips,m14Kc
+      - mips,mips4Kc
+      - mips,mips4KEc
+      - mips,mips24Kc
+      - mips,mips24KEc
+      - mips,mips74Kc
+      - mips,mips1004Kc
+      - mti,interaptiv
+      - mti,mips24KEc
+      - mti,mips14KEc
+      - mti,mips14Kc
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+
+additionalProperties: true
+
+examples:
+  - |
+    cpus {
+      #size-cells = <0>;
+      #address-cells = <1>;
+
+      cpu@0 {
+        device_type = "cpu";
+        compatible = "mips,mips1004Kc";
+        reg = <0>;
+      };
+
+      cpu@1 {
+        device_type = "cpu";
+        compatible = "mips,mips1004Kc";
+        reg = <1>;
+      };
+    };