linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] dt-bindings: mips: add CPU bindings for MIPS architecture
@ 2022-09-29  7:20 Sergio Paracuellos
  2022-09-29  7:20 ` [PATCH v3 1/3] " Sergio Paracuellos
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Sergio Paracuellos @ 2022-09-29  7:20 UTC (permalink / raw)
  To: devicetree
  Cc: robh+dt, krzysztof.kozlowski+dt, hauke, zajec5, tsbogend,
	linux-mips, arinc.unal

Hi all,

This series tries to make the correct thing to represent in schema
all the current documentation related with MIPS CPUs.

Current 'arch/mips/boot/dts' folder dts files are a bit messy 
for cpu nodes, so I set additionalProperties to true and only
make required for 'compatible' in mips/cpus.yaml schema.

Broadcom cpus node is a bit special and need to use the property
'mips-hpt-frequency'. Since 'compatible' string is not in the
'cpus' parent node itself, we need a way to filter this to be valid
only for Broadcom SoCs. To make this possible I have introduced two
new schemas:
 - One to describe the Broadcom SoCs and its compatibles.
 - One to describe the BMIPS CPU's referring inside to 'brcm/soc.yaml'
   and 'mips/cpus.yaml' schemas.

Another thing to notice is that the root-node schema requires 'model'
as property and there is no model at all in any real DTS file for any
cpus node in 'arch/mips/boot/dts'. I have just added it in the schema
sample to avoid the following check fail:

/: 'model' is a required property
From schema: /home/sergio/.local/lib/python3.8/site-packages/dtschema/schemas/root-node.yaml

Don't really know if this is a way to go.

Thanks in advance for your time and comments.

Best regards,
    Sergio Paracuellos

Changes in v3:
- cpus.yaml: 
    * address Krzysztof comment in v2:
       * add Thomas as maintainer since this is architecture binding.
       * s/cpu/CPU
       * compatible goes first
   * Add compatible 'mips,mips4Kc' as per Thomas request.
- Introduce two new schemas for Broadcom BMIPS:
    * soc.yaml: describing the BRCM SoC's
    * brcm,bmips-cpus.yaml: describing the cpu nodes for this platform.

Previous series:
v1: https://lore.kernel.org/all/CAMhs-H-eUTOHjAXAbywOXQJgc_j5Ex-1sB7eBZU_bWt1fpNVzA@mail.gmail.com/T/
v2: https://lore.kernel.org/all/20220918112245.GA5555@alpha.franken.de/T/

Thanks,
    Sergio Paracuellos

Sergio Paracuellos (3):
  dt-bindings: mips: add CPU bindings for MIPS architecture
  dt-bindings: mips: brcm: convert Broadcom SoCs to schema
  dt-bindings: mips: brcm: convert CPU bindings for BMIPS architecture

 .../bindings/mips/brcm/brcm,bmips-cpus.yaml   | 102 ++++++++++++++++++
 .../bindings/mips/brcm/brcm,bmips.txt         |   8 --
 .../devicetree/bindings/mips/brcm/soc.yaml    |  97 +++++++++++++++++
 .../devicetree/bindings/mips/cpus.yaml        |  66 ++++++++++++
 4 files changed, 265 insertions(+), 8 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mips/brcm/brcm,bmips-cpus.yaml
 delete mode 100644 Documentation/devicetree/bindings/mips/brcm/brcm,bmips.txt
 create mode 100644 Documentation/devicetree/bindings/mips/brcm/soc.yaml
 create mode 100644 Documentation/devicetree/bindings/mips/cpus.yaml

-- 
2.25.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v3 1/3] dt-bindings: mips: add CPU bindings for MIPS architecture
  2022-09-29  7:20 [PATCH v3 0/3] dt-bindings: mips: add CPU bindings for MIPS architecture Sergio Paracuellos
@ 2022-09-29  7:20 ` Sergio Paracuellos
  2022-09-30 17:16   ` Rob Herring
  2022-09-29  7:20 ` [PATCH v3 2/3] dt-bindings: mips: brcm: convert Broadcom SoCs to schema Sergio Paracuellos
  2022-09-29  7:20 ` [PATCH v3 3/3] dt-bindings: mips: brcm: convert CPU bindings for BMIPS architecture Sergio Paracuellos
  2 siblings, 1 reply; 8+ messages in thread
From: Sergio Paracuellos @ 2022-09-29  7:20 UTC (permalink / raw)
  To: devicetree
  Cc: robh+dt, krzysztof.kozlowski+dt, hauke, zajec5, tsbogend,
	linux-mips, arinc.unal

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
+      - 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>;
+      };
+    };
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v3 2/3] dt-bindings: mips: brcm: convert Broadcom SoCs to schema
  2022-09-29  7:20 [PATCH v3 0/3] dt-bindings: mips: add CPU bindings for MIPS architecture Sergio Paracuellos
  2022-09-29  7:20 ` [PATCH v3 1/3] " Sergio Paracuellos
@ 2022-09-29  7:20 ` Sergio Paracuellos
  2022-09-29  7:20 ` [PATCH v3 3/3] dt-bindings: mips: brcm: convert CPU bindings for BMIPS architecture Sergio Paracuellos
  2 siblings, 0 replies; 8+ messages in thread
From: Sergio Paracuellos @ 2022-09-29  7:20 UTC (permalink / raw)
  To: devicetree
  Cc: robh+dt, krzysztof.kozlowski+dt, hauke, zajec5, tsbogend,
	linux-mips, arinc.unal

Convert Broadcom cable/DSL/settop platforms to YAML schema.

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

diff --git a/Documentation/devicetree/bindings/mips/brcm/soc.yaml b/Documentation/devicetree/bindings/mips/brcm/soc.yaml
new file mode 100644
index 000000000000..37353709b5a7
--- /dev/null
+++ b/Documentation/devicetree/bindings/mips/brcm/soc.yaml
@@ -0,0 +1,97 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mips/brcm/soc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Broadcom cable/DSL/settop platforms Device Tree Bindings
+
+maintainers:
+  - Hauke Mehrtens <hauke@hauke-m.de>
+  - Rafał Miłecki <zajec5@gmail.com>
+
+description: |
+    Boards Broadcom cable/DSL/settop SoC shall have the following properties.
+    The experimental -viper variants are for running Linux on the 3384's
+    BMIPS4355 cable modem CPU instead of the BMIPS5000 application processor.
+
+properties:
+  $nodename:
+    const: '/'
+  compatible:
+    oneOf:
+      - description: Boards with Broadcom bcm3368 SoC
+        items:
+          - const: brcm,bcm3368
+
+      - description: Boards with Broadcom bcm3384 SoC
+        items:
+          - const: brcm,bcm3384
+
+      - description: Boards with Broadcom bcm33843 SoC
+        items:
+          - const: brcm,bcm33843
+
+      - description: Boards with Broadcom bcm3384-viper SoC
+        items:
+          - const: brcm,bcm3384-viper
+
+      - description: Boards with Broadcom bcm33843-viper SoC
+        items:
+          - const: brcm,bcm33843-viper
+
+      - description: Boards with Broadcom bcm6328 SoC
+        items:
+          - const: brcm,bcm6328
+
+      - description: Boards with Broadcom bcm6358 SoC
+        items:
+          - const: brcm,bcm6358
+
+      - description: Boards with Broadcom bcm6362 SoC
+        items:
+          - const: brcm,bcm6362
+
+      - description: Boards with Broadcom bcm6368 SoC
+        items:
+          - const: brcm,bcm6368
+
+      - description: Boards with Broadcom bcm63168 SoC
+        items:
+          - const: brcm,bcm63168
+
+      - description: Boards with Broadcom bcm63268 SoC
+        items:
+          - const: brcm,bcm63268
+
+      - description: Boards with Broadcom bcm7125 SoC
+        items:
+          - const: brcm,bcm7125
+
+      - description: Boards with Broadcom bcm7346 SoC
+        items:
+          - const: brcm,bcm7346
+
+      - description: Boards with Broadcom bcm7358 SoC
+        items:
+          - const: brcm,bcm7358
+
+      - description: Boards with Broadcom bcm7360 SoC
+        items:
+          - const: brcm,bcm7360
+
+      - description: Boards with Broadcom bcm7362 SoC
+        items:
+          - const: brcm,bcm7362
+
+      - description: Boards with Broadcom bcm7420 SoC
+        items:
+          - const: brcm,bcm7420
+
+      - description: Boards with Broadcom bcm7425 SoC
+        items:
+          - const: brcm,bcm7425
+
+additionalProperties: true
+
+...
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v3 3/3] dt-bindings: mips: brcm: convert CPU bindings for BMIPS architecture
  2022-09-29  7:20 [PATCH v3 0/3] dt-bindings: mips: add CPU bindings for MIPS architecture Sergio Paracuellos
  2022-09-29  7:20 ` [PATCH v3 1/3] " Sergio Paracuellos
  2022-09-29  7:20 ` [PATCH v3 2/3] dt-bindings: mips: brcm: convert Broadcom SoCs to schema Sergio Paracuellos
@ 2022-09-29  7:20 ` Sergio Paracuellos
  2022-09-30 17:43   ` Rob Herring
  2 siblings, 1 reply; 8+ messages in thread
From: Sergio Paracuellos @ 2022-09-29  7:20 UTC (permalink / raw)
  To: devicetree
  Cc: robh+dt, krzysztof.kozlowski+dt, hauke, zajec5, tsbogend,
	linux-mips, arinc.unal

Convert the yaml binding for available CPUs in BMIPS architecture.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 .../bindings/mips/brcm/brcm,bmips-cpus.yaml   | 102 ++++++++++++++++++
 .../bindings/mips/brcm/brcm,bmips.txt         |   8 --
 2 files changed, 102 insertions(+), 8 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mips/brcm/brcm,bmips-cpus.yaml
 delete mode 100644 Documentation/devicetree/bindings/mips/brcm/brcm,bmips.txt

diff --git a/Documentation/devicetree/bindings/mips/brcm/brcm,bmips-cpus.yaml b/Documentation/devicetree/bindings/mips/brcm/brcm,bmips-cpus.yaml
new file mode 100644
index 000000000000..60aa7df9a543
--- /dev/null
+++ b/Documentation/devicetree/bindings/mips/brcm/brcm,bmips-cpus.yaml
@@ -0,0 +1,102 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mips/brcm/brcm,bmips-cpus.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MIPS CPUs bindings
+
+maintainers:
+  - Hauke Mehrtens <hauke@hauke-m.de>
+  - Rafał Miłecki <zajec5@gmail.com>
+
+description: |
+  The device tree allows to describe the layout of BMIPS CPUs.
+
+patternProperties:
+  "^/":
+    type: object
+    $ref: "/schemas/mips/brcm/soc.yaml#"
+
+properties:
+  cpus:
+    type: object
+    additionalProperties: true
+    properties:
+      '#address-cells':
+        const: 1
+
+      '#size-cells':
+        const: 0
+
+      mips-hpt-frequency:
+        description: This is common to all CPUs in the system so it lives
+          under the "cpus" node.
+        $ref: /schemas/types.yaml#/definitions/uint32
+
+    patternProperties:
+      "^cpu@[0-9]$":
+        type: object
+        $ref: "/schemas/mips/cpus.yaml#"
+
+    required:
+      - '#address-cells'
+      - '#size-cells'
+
+    allOf:
+      - if:
+          properties:
+            compatible:
+              contains:
+                enum:
+                  - "brcm,bcm3368"
+                  - "brcm,bcm3384"
+                  - "brcm,bcm33843"
+                  - "brcm,bcm3384-viper"
+                  - "brcm,bcm33843-viper"
+                  - "brcm,bcm6328"
+                  - "brcm,bcm6358"
+                  - "brcm,bcm6362"
+                  - "brcm,bcm6368"
+                  - "brcm,bcm63168"
+                  - "brcm,bcm63268"
+                  - "brcm,bcm7125"
+                  - "brcm,bcm7346"
+                  - "brcm,bcm7358"
+                  - "brcm,bcm7360"
+                  - "brcm,bcm7362"
+                  - "brcm,bcm7420"
+                  - "brcm,bcm7425"
+        then:
+          required:
+            - mips-hpt-frequency
+
+additionalProperties: true
+
+examples:
+  - |
+     / {
+         compatible = "brcm,bcm3368";
+         #address-cells = <1>;
+         #size-cells = <1>;
+         model = "Broadcom 3368";
+
+         cpus {
+           #address-cells = <1>;
+           #size-cells = <0>;
+
+           mips-hpt-frequency = <150000000>;
+
+           cpu@0 {
+             compatible = "brcm,bmips4350";
+             device_type = "cpu";
+             reg = <0>;
+           };
+
+           cpu@1 {
+             compatible = "brcm,bmips4350";
+             device_type = "cpu";
+             reg = <1>;
+           };
+         };
+       };
diff --git a/Documentation/devicetree/bindings/mips/brcm/brcm,bmips.txt b/Documentation/devicetree/bindings/mips/brcm/brcm,bmips.txt
deleted file mode 100644
index 8ef71b4085ca..000000000000
--- a/Documentation/devicetree/bindings/mips/brcm/brcm,bmips.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-* Broadcom MIPS (BMIPS) CPUs
-
-Required properties:
-- compatible: "brcm,bmips3300", "brcm,bmips4350", "brcm,bmips4380",
-  "brcm,bmips5000"
-
-- mips-hpt-frequency: This is common to all CPUs in the system so it lives
-  under the "cpus" node.
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 1/3] dt-bindings: mips: add CPU bindings for MIPS architecture
  2022-09-29  7:20 ` [PATCH v3 1/3] " Sergio Paracuellos
@ 2022-09-30 17:16   ` Rob Herring
  2022-10-01  3:39     ` Sergio Paracuellos
  0 siblings, 1 reply; 8+ messages in thread
From: Rob Herring @ 2022-09-30 17:16 UTC (permalink / raw)
  To: Sergio Paracuellos
  Cc: devicetree, krzysztof.kozlowski+dt, hauke, zajec5, tsbogend,
	linux-mips, arinc.unal

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 3/3] dt-bindings: mips: brcm: convert CPU bindings for BMIPS architecture
  2022-09-29  7:20 ` [PATCH v3 3/3] dt-bindings: mips: brcm: convert CPU bindings for BMIPS architecture Sergio Paracuellos
@ 2022-09-30 17:43   ` Rob Herring
  2022-10-01  3:44     ` Sergio Paracuellos
  0 siblings, 1 reply; 8+ messages in thread
From: Rob Herring @ 2022-09-30 17:43 UTC (permalink / raw)
  To: Sergio Paracuellos
  Cc: devicetree, krzysztof.kozlowski+dt, hauke, zajec5, tsbogend,
	linux-mips, arinc.unal

On Thu, Sep 29, 2022 at 09:20:04AM +0200, Sergio Paracuellos wrote:
> Convert the yaml binding for available CPUs in BMIPS architecture.
> 
> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> ---
>  .../bindings/mips/brcm/brcm,bmips-cpus.yaml   | 102 ++++++++++++++++++
>  .../bindings/mips/brcm/brcm,bmips.txt         |   8 --

Ah, here it is.

>  2 files changed, 102 insertions(+), 8 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/mips/brcm/brcm,bmips-cpus.yaml
>  delete mode 100644 Documentation/devicetree/bindings/mips/brcm/brcm,bmips.txt
> 
> diff --git a/Documentation/devicetree/bindings/mips/brcm/brcm,bmips-cpus.yaml b/Documentation/devicetree/bindings/mips/brcm/brcm,bmips-cpus.yaml
> new file mode 100644
> index 000000000000..60aa7df9a543
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mips/brcm/brcm,bmips-cpus.yaml
> @@ -0,0 +1,102 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mips/brcm/brcm,bmips-cpus.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: MIPS CPUs bindings
> +
> +maintainers:
> +  - Hauke Mehrtens <hauke@hauke-m.de>
> +  - Rafał Miłecki <zajec5@gmail.com>
> +
> +description: |

Don't need '|' if no formatting to preserve.

> +  The device tree allows to describe the layout of BMIPS CPUs.
> +
> +patternProperties:
> +  "^/":
> +    type: object
> +    $ref: "/schemas/mips/brcm/soc.yaml#"

This is doesn't do anything.

Your schema is never applied either as 'select' defaults to false if 
there's not 'compaatible' or '$nodename' in the schema.

> +
> +properties:
> +  cpus:
> +    type: object
> +    additionalProperties: true
> +    properties:
> +      '#address-cells':
> +        const: 1
> +
> +      '#size-cells':
> +        const: 0
> +
> +      mips-hpt-frequency:
> +        description: This is common to all CPUs in the system so it lives
> +          under the "cpus" node.
> +        $ref: /schemas/types.yaml#/definitions/uint32
> +
> +    patternProperties:
> +      "^cpu@[0-9]$":
> +        type: object
> +        $ref: "/schemas/mips/cpus.yaml#"
> +
> +    required:
> +      - '#address-cells'
> +      - '#size-cells'
> +
> +    allOf:
> +      - if:
> +          properties:
> +            compatible:
> +              contains:
> +                enum:
> +                  - "brcm,bcm3368"
> +                  - "brcm,bcm3384"
> +                  - "brcm,bcm33843"
> +                  - "brcm,bcm3384-viper"
> +                  - "brcm,bcm33843-viper"
> +                  - "brcm,bcm6328"
> +                  - "brcm,bcm6358"
> +                  - "brcm,bcm6362"
> +                  - "brcm,bcm6368"
> +                  - "brcm,bcm63168"
> +                  - "brcm,bcm63268"
> +                  - "brcm,bcm7125"
> +                  - "brcm,bcm7346"
> +                  - "brcm,bcm7358"
> +                  - "brcm,bcm7360"
> +                  - "brcm,bcm7362"
> +                  - "brcm,bcm7420"
> +                  - "brcm,bcm7425"
> +        then:
> +          required:
> +            - mips-hpt-frequency

Other than this property, the cpus.yaml schema in dtschema covers all 
this.

You allow mips-hpt-frequency on any platform including non-MIPS if this 
schema actually got applied. Is this intended for all MIPS platforms or 
just for Broadcom platforms? The former is hard to support as how do we 
express which platforms are MIPS in schemas. In the latter case, 
brcm/soc.yaml could have something like this:

properties:
  cpus:
    $ref: /schemas/cpus.yaml#
    unevaluatedProperties: false

    properties:
      mips-hpt-frequency:
        ...

    required:
      - mips-hpt-frequency

Rob

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 1/3] dt-bindings: mips: add CPU bindings for MIPS architecture
  2022-09-30 17:16   ` Rob Herring
@ 2022-10-01  3:39     ` Sergio Paracuellos
  0 siblings, 0 replies; 8+ messages in thread
From: Sergio Paracuellos @ 2022-10-01  3:39 UTC (permalink / raw)
  To: Rob Herring
  Cc: open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Krzysztof Kozlowski, Hauke Mehrtens, zajec5, Thomas Bogendoerfer,
	open list:MIPS, Arınç ÜNAL

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 3/3] dt-bindings: mips: brcm: convert CPU bindings for BMIPS architecture
  2022-09-30 17:43   ` Rob Herring
@ 2022-10-01  3:44     ` Sergio Paracuellos
  0 siblings, 0 replies; 8+ messages in thread
From: Sergio Paracuellos @ 2022-10-01  3:44 UTC (permalink / raw)
  To: Rob Herring
  Cc: open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Krzysztof Kozlowski, Hauke Mehrtens, zajec5, Thomas Bogendoerfer,
	open list:MIPS, Arınç ÜNAL

Hi Rob,

On Fri, Sep 30, 2022 at 7:43 PM Rob Herring <robh@kernel.org> wrote:
>
> On Thu, Sep 29, 2022 at 09:20:04AM +0200, Sergio Paracuellos wrote:
> > Convert the yaml binding for available CPUs in BMIPS architecture.
> >
> > Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> > ---
> >  .../bindings/mips/brcm/brcm,bmips-cpus.yaml   | 102 ++++++++++++++++++
> >  .../bindings/mips/brcm/brcm,bmips.txt         |   8 --
>
> Ah, here it is.

Yes, this has to be removed :)

>
> >  2 files changed, 102 insertions(+), 8 deletions(-)
> >  create mode 100644 Documentation/devicetree/bindings/mips/brcm/brcm,bmips-cpus.yaml
> >  delete mode 100644 Documentation/devicetree/bindings/mips/brcm/brcm,bmips.txt
> >
> > diff --git a/Documentation/devicetree/bindings/mips/brcm/brcm,bmips-cpus.yaml b/Documentation/devicetree/bindings/mips/brcm/brcm,bmips-cpus.yaml
> > new file mode 100644
> > index 000000000000..60aa7df9a543
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/mips/brcm/brcm,bmips-cpus.yaml
> > @@ -0,0 +1,102 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/mips/brcm/brcm,bmips-cpus.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: MIPS CPUs bindings
> > +
> > +maintainers:
> > +  - Hauke Mehrtens <hauke@hauke-m.de>
> > +  - Rafał Miłecki <zajec5@gmail.com>
> > +
> > +description: |
>
> Don't need '|' if no formatting to preserve.

Understood.

>
> > +  The device tree allows to describe the layout of BMIPS CPUs.
> > +
> > +patternProperties:
> > +  "^/":
> > +    type: object
> > +    $ref: "/schemas/mips/brcm/soc.yaml#"
>
> This is doesn't do anything.
>
> Your schema is never applied either as 'select' defaults to false if
> there's not 'compaatible' or '$nodename' in the schema.

I see, I thought referring to this was enough since 'compatible' and
$nodename are defined in soc.yaml schema.

>
> > +
> > +properties:
> > +  cpus:
> > +    type: object
> > +    additionalProperties: true
> > +    properties:
> > +      '#address-cells':
> > +        const: 1
> > +
> > +      '#size-cells':
> > +        const: 0
> > +
> > +      mips-hpt-frequency:
> > +        description: This is common to all CPUs in the system so it lives
> > +          under the "cpus" node.
> > +        $ref: /schemas/types.yaml#/definitions/uint32
> > +
> > +    patternProperties:
> > +      "^cpu@[0-9]$":
> > +        type: object
> > +        $ref: "/schemas/mips/cpus.yaml#"
> > +
> > +    required:
> > +      - '#address-cells'
> > +      - '#size-cells'
> > +
> > +    allOf:
> > +      - if:
> > +          properties:
> > +            compatible:
> > +              contains:
> > +                enum:
> > +                  - "brcm,bcm3368"
> > +                  - "brcm,bcm3384"
> > +                  - "brcm,bcm33843"
> > +                  - "brcm,bcm3384-viper"
> > +                  - "brcm,bcm33843-viper"
> > +                  - "brcm,bcm6328"
> > +                  - "brcm,bcm6358"
> > +                  - "brcm,bcm6362"
> > +                  - "brcm,bcm6368"
> > +                  - "brcm,bcm63168"
> > +                  - "brcm,bcm63268"
> > +                  - "brcm,bcm7125"
> > +                  - "brcm,bcm7346"
> > +                  - "brcm,bcm7358"
> > +                  - "brcm,bcm7360"
> > +                  - "brcm,bcm7362"
> > +                  - "brcm,bcm7420"
> > +                  - "brcm,bcm7425"
> > +        then:
> > +          required:
> > +            - mips-hpt-frequency
>
> Other than this property, the cpus.yaml schema in dtschema covers all
> this.
>
> You allow mips-hpt-frequency on any platform including non-MIPS if this
> schema actually got applied. Is this intended for all MIPS platforms or
> just for Broadcom platforms? The former is hard to support as how do we
> express which platforms are MIPS in schemas. In the latter case,
> brcm/soc.yaml could have something like this:
>
> properties:
>   cpus:
>     $ref: /schemas/cpus.yaml#
>     unevaluatedProperties: false
>
>     properties:
>       mips-hpt-frequency:
>         ...
>
>     required:
>       - mips-hpt-frequency

Ok, since this is only for Broadcom platforms, I will move this
information to the soc.yaml schema and completely drop this patch in
v4.

Thanks for reviewing, Rob.

Best regards,
    Sergio Paracuellos

>
> Rob

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-10-01  3:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-29  7:20 [PATCH v3 0/3] dt-bindings: mips: add CPU bindings for MIPS architecture Sergio Paracuellos
2022-09-29  7:20 ` [PATCH v3 1/3] " Sergio Paracuellos
2022-09-30 17:16   ` Rob Herring
2022-10-01  3:39     ` Sergio Paracuellos
2022-09-29  7:20 ` [PATCH v3 2/3] dt-bindings: mips: brcm: convert Broadcom SoCs to schema Sergio Paracuellos
2022-09-29  7:20 ` [PATCH v3 3/3] dt-bindings: mips: brcm: convert CPU bindings for BMIPS architecture Sergio Paracuellos
2022-09-30 17:43   ` Rob Herring
2022-10-01  3:44     ` Sergio Paracuellos

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).