diff mbox series

[v2,2/7] dt-bindings: loongarch: Add Loongson SoC boards compatibles

Message ID 6d8d0d8d21e32e0577565158bc1c4960a92fb216.1692088166.git.zhoubinbin@loongson.cn
State Changes Requested, archived
Headers show
Series LoongArch: Add built-in dtb support | expand

Checks

Context Check Description
robh/checkpatch success
robh/patch-applied success
robh/dtbs-check warning build log
robh/dt-meta-schema success

Commit Message

Binbin Zhou Aug. 15, 2023, 8:50 a.m. UTC
Add Loongson SoC boards binding with DT schema format using json-schema.

Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
---
 .../devicetree/bindings/loongarch/boards.yaml | 34 +++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/loongarch/boards.yaml

Comments

Conor Dooley Aug. 15, 2023, 2:13 p.m. UTC | #1
On Tue, Aug 15, 2023 at 04:50:47PM +0800, Binbin Zhou wrote:
> Add Loongson SoC boards binding with DT schema format using json-schema.
> 
> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
> ---
>  .../devicetree/bindings/loongarch/boards.yaml | 34 +++++++++++++++++++
>  1 file changed, 34 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/loongarch/boards.yaml
> 
> diff --git a/Documentation/devicetree/bindings/loongarch/boards.yaml b/Documentation/devicetree/bindings/loongarch/boards.yaml
> new file mode 100644
> index 000000000000..5092314b7a52
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/loongarch/boards.yaml
> @@ -0,0 +1,34 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/loongarch/boards.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Loongson SoC-based boards
> +
> +maintainers:
> +  - Binbin Zhou <zhoubinbin@loongson.cn>
> +
> +properties:
> +  $nodename:
> +    const: '/'
> +  compatible:
> +    oneOf:
> +      - description: Loongson-2K0500 processor based boards
> +        items:
> +          - const: loongson,ls2k0500-ref
> +          - const: loongson,ls2k0500
> +
> +      - description: Loongson-2K1000 processor based boards
> +        items:
> +          - const: loongson,ls2k1000-ref
> +          - const: loongson,ls2k1000
> +
> +      - description: Loongson-2K2000 processor based boards
> +        items:
> +          - const: loongson,ls2k2000-ref
> +          - const: loongson,ls2k2000

Do all of these SoCs just have a single reference/dev board?

> +
> +additionalProperties: true
> +
> +...
> -- 
> 2.39.3
>
Krzysztof Kozlowski Aug. 15, 2023, 2:49 p.m. UTC | #2
On 15/08/2023 10:50, Binbin Zhou wrote:
> Add Loongson SoC boards binding with DT schema format using json-schema.
> 
> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
> ---
>  .../devicetree/bindings/loongarch/boards.yaml | 34 +++++++++++++++++++
>  1 file changed, 34 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/loongarch/boards.yaml
> 
> diff --git a/Documentation/devicetree/bindings/loongarch/boards.yaml b/Documentation/devicetree/bindings/loongarch/boards.yaml
> new file mode 100644
> index 000000000000..5092314b7a52
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/loongarch/boards.yaml
> @@ -0,0 +1,34 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/loongarch/boards.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Loongson SoC-based boards
> +
> +maintainers:
> +  - Binbin Zhou <zhoubinbin@loongson.cn>
> +
> +properties:
> +  $nodename:
> +    const: '/'
> +  compatible:
> +    oneOf:
> +      - description: Loongson-2K0500 processor based boards
> +        items:
> +          - const: loongson,ls2k0500-ref
> +          - const: loongson,ls2k0500
> +
> +      - description: Loongson-2K1000 processor based boards
> +        items:
> +          - const: loongson,ls2k1000-ref
> +          - const: loongson,ls2k1000
> +
> +      - description: Loongson-2K2000 processor based boards
> +        items:
> +          - const: loongson,ls2k2000-ref
> +          - const: loongson,ls2k2000

This probably is a sign all your bindings are using a bogus compatible.
You were using compatibles like loongson,ls2k-clk so your SoC cannot be
ls2k2000... or your compatible is bogus. The same for:
loongson,ls2k-pm, loongson,ls2k-dwmac, loongson,ls2k-i2c,
loongson,ls2k-chipid, loongson,ls2k-gpio

Best regards,
Krzysztof
Binbin Zhou Aug. 17, 2023, 6:16 a.m. UTC | #3
Hi Conor:

Thanks for your reply.

On Tue, Aug 15, 2023 at 10:13 PM Conor Dooley <conor@kernel.org> wrote:
>
> On Tue, Aug 15, 2023 at 04:50:47PM +0800, Binbin Zhou wrote:
> > Add Loongson SoC boards binding with DT schema format using json-schema.
> >
> > Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
> > ---
> >  .../devicetree/bindings/loongarch/boards.yaml | 34 +++++++++++++++++++
> >  1 file changed, 34 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/loongarch/boards.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/loongarch/boards.yaml b/Documentation/devicetree/bindings/loongarch/boards.yaml
> > new file mode 100644
> > index 000000000000..5092314b7a52
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/loongarch/boards.yaml
> > @@ -0,0 +1,34 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/loongarch/boards.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Loongson SoC-based boards
> > +
> > +maintainers:
> > +  - Binbin Zhou <zhoubinbin@loongson.cn>
> > +
> > +properties:
> > +  $nodename:
> > +    const: '/'
> > +  compatible:
> > +    oneOf:
> > +      - description: Loongson-2K0500 processor based boards
> > +        items:
> > +          - const: loongson,ls2k0500-ref
> > +          - const: loongson,ls2k0500
> > +
> > +      - description: Loongson-2K1000 processor based boards
> > +        items:
> > +          - const: loongson,ls2k1000-ref
> > +          - const: loongson,ls2k1000
> > +
> > +      - description: Loongson-2K2000 processor based boards
> > +        items:
> > +          - const: loongson,ls2k2000-ref
> > +          - const: loongson,ls2k2000
>
> Do all of these SoCs just have a single reference/dev board?

Yes, I have development boards for each Soc on hand now, and it has a
relatively complete interface. My original idea was to use the
development boards as examples to show you the Loongson-2K Soc.
I'm sure more boards will be added in the future.

Thanks.
Binbin
>
> > +
> > +additionalProperties: true
> > +
> > +...
> > --
> > 2.39.3
> >
Binbin Zhou Aug. 17, 2023, 6:24 a.m. UTC | #4
Hi Krzysztof:

Thanks for your reply.

On Tue, Aug 15, 2023 at 10:49 PM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> On 15/08/2023 10:50, Binbin Zhou wrote:
> > Add Loongson SoC boards binding with DT schema format using json-schema.
> >
> > Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
> > ---
> >  .../devicetree/bindings/loongarch/boards.yaml | 34 +++++++++++++++++++
> >  1 file changed, 34 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/loongarch/boards.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/loongarch/boards.yaml b/Documentation/devicetree/bindings/loongarch/boards.yaml
> > new file mode 100644
> > index 000000000000..5092314b7a52
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/loongarch/boards.yaml
> > @@ -0,0 +1,34 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/loongarch/boards.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Loongson SoC-based boards
> > +
> > +maintainers:
> > +  - Binbin Zhou <zhoubinbin@loongson.cn>
> > +
> > +properties:
> > +  $nodename:
> > +    const: '/'
> > +  compatible:
> > +    oneOf:
> > +      - description: Loongson-2K0500 processor based boards
> > +        items:
> > +          - const: loongson,ls2k0500-ref
> > +          - const: loongson,ls2k0500
> > +
> > +      - description: Loongson-2K1000 processor based boards
> > +        items:
> > +          - const: loongson,ls2k1000-ref
> > +          - const: loongson,ls2k1000
> > +
> > +      - description: Loongson-2K2000 processor based boards
> > +        items:
> > +          - const: loongson,ls2k2000-ref
> > +          - const: loongson,ls2k2000
>
> This probably is a sign all your bindings are using a bogus compatible.
> You were using compatibles like loongson,ls2k-clk so your SoC cannot be
> ls2k2000... or your compatible is bogus. The same for:
> loongson,ls2k-pm, loongson,ls2k-dwmac, loongson,ls2k-i2c,
> loongson,ls2k-chipid, loongson,ls2k-gpio
>

I'm not sure I understand correctly, are you saying I should rename
all these ls2k-xx compatibles to Soc-based compatible?

For example, loongson,ls2k-i2c should be renamed to something like this:
loongson,ls2k0500-i2c, loongson,ls2k-i2c
loongson,ls2k1000-i2c, loongson,ls2k-i2c
loongson,ls2k2000-i2c, loongson,ls2k-i2c
Even if their driver code is no different.

Thanks.
Binbin

> Best regards,
> Krzysztof
>
Conor Dooley Aug. 17, 2023, 8:44 a.m. UTC | #5
On Thu, Aug 17, 2023 at 02:16:13PM +0800, Binbin Zhou wrote:
> Hi Conor:
> 
> Thanks for your reply.
> 
> On Tue, Aug 15, 2023 at 10:13 PM Conor Dooley <conor@kernel.org> wrote:
> >
> > On Tue, Aug 15, 2023 at 04:50:47PM +0800, Binbin Zhou wrote:
> > > Add Loongson SoC boards binding with DT schema format using json-schema.
> > >
> > > Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
> > > ---
> > >  .../devicetree/bindings/loongarch/boards.yaml | 34 +++++++++++++++++++
> > >  1 file changed, 34 insertions(+)
> > >  create mode 100644 Documentation/devicetree/bindings/loongarch/boards.yaml
> > >
> > > diff --git a/Documentation/devicetree/bindings/loongarch/boards.yaml b/Documentation/devicetree/bindings/loongarch/boards.yaml
> > > new file mode 100644
> > > index 000000000000..5092314b7a52
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/loongarch/boards.yaml
> > > @@ -0,0 +1,34 @@
> > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/loongarch/boards.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: Loongson SoC-based boards
> > > +
> > > +maintainers:
> > > +  - Binbin Zhou <zhoubinbin@loongson.cn>
> > > +
> > > +properties:
> > > +  $nodename:
> > > +    const: '/'
> > > +  compatible:
> > > +    oneOf:
> > > +      - description: Loongson-2K0500 processor based boards
> > > +        items:
> > > +          - const: loongson,ls2k0500-ref
> > > +          - const: loongson,ls2k0500
> > > +
> > > +      - description: Loongson-2K1000 processor based boards
> > > +        items:
> > > +          - const: loongson,ls2k1000-ref
> > > +          - const: loongson,ls2k1000
> > > +
> > > +      - description: Loongson-2K2000 processor based boards
> > > +        items:
> > > +          - const: loongson,ls2k2000-ref
> > > +          - const: loongson,ls2k2000
> >
> > Do all of these SoCs just have a single reference/dev board?
> 
> Yes, I have development boards for each Soc on hand now, and it has a
> relatively complete interface. My original idea was to use the
> development boards as examples to show you the Loongson-2K Soc.
> I'm sure more boards will be added in the future.

My reason for asking was that "-ref" is quite generic, but if there is
only one reference board produced by Loongson that's not a problem.
Conor Dooley Aug. 17, 2023, 8:46 a.m. UTC | #6
On Thu, Aug 17, 2023 at 09:44:16AM +0100, Conor Dooley wrote:
> On Thu, Aug 17, 2023 at 02:16:13PM +0800, Binbin Zhou wrote:
> > Hi Conor:
> > 
> > Thanks for your reply.
> > 
> > On Tue, Aug 15, 2023 at 10:13 PM Conor Dooley <conor@kernel.org> wrote:
> > >
> > > On Tue, Aug 15, 2023 at 04:50:47PM +0800, Binbin Zhou wrote:
> > > > Add Loongson SoC boards binding with DT schema format using json-schema.
> > > >
> > > > Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
> > > > ---
> > > >  .../devicetree/bindings/loongarch/boards.yaml | 34 +++++++++++++++++++
> > > >  1 file changed, 34 insertions(+)
> > > >  create mode 100644 Documentation/devicetree/bindings/loongarch/boards.yaml
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/loongarch/boards.yaml b/Documentation/devicetree/bindings/loongarch/boards.yaml
> > > > new file mode 100644
> > > > index 000000000000..5092314b7a52
> > > > --- /dev/null
> > > > +++ b/Documentation/devicetree/bindings/loongarch/boards.yaml
> > > > @@ -0,0 +1,34 @@
> > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > > +%YAML 1.2
> > > > +---
> > > > +$id: http://devicetree.org/schemas/loongarch/boards.yaml#
> > > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > > +
> > > > +title: Loongson SoC-based boards
> > > > +
> > > > +maintainers:
> > > > +  - Binbin Zhou <zhoubinbin@loongson.cn>
> > > > +
> > > > +properties:
> > > > +  $nodename:
> > > > +    const: '/'
> > > > +  compatible:
> > > > +    oneOf:
> > > > +      - description: Loongson-2K0500 processor based boards
> > > > +        items:
> > > > +          - const: loongson,ls2k0500-ref
> > > > +          - const: loongson,ls2k0500
> > > > +
> > > > +      - description: Loongson-2K1000 processor based boards
> > > > +        items:
> > > > +          - const: loongson,ls2k1000-ref
> > > > +          - const: loongson,ls2k1000
> > > > +
> > > > +      - description: Loongson-2K2000 processor based boards
> > > > +        items:
> > > > +          - const: loongson,ls2k2000-ref
> > > > +          - const: loongson,ls2k2000
> > >
> > > Do all of these SoCs just have a single reference/dev board?
> > 
> > Yes, I have development boards for each Soc on hand now, and it has a
> > relatively complete interface. My original idea was to use the
> > development boards as examples to show you the Loongson-2K Soc.
> > I'm sure more boards will be added in the future.
> 
> My reason for asking was that "-ref" is quite generic, but if there is
> only one reference board produced by Loongson that's not a problem.

Whoops, I forgot to add this:
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/loongarch/boards.yaml b/Documentation/devicetree/bindings/loongarch/boards.yaml
new file mode 100644
index 000000000000..5092314b7a52
--- /dev/null
+++ b/Documentation/devicetree/bindings/loongarch/boards.yaml
@@ -0,0 +1,34 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/loongarch/boards.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Loongson SoC-based boards
+
+maintainers:
+  - Binbin Zhou <zhoubinbin@loongson.cn>
+
+properties:
+  $nodename:
+    const: '/'
+  compatible:
+    oneOf:
+      - description: Loongson-2K0500 processor based boards
+        items:
+          - const: loongson,ls2k0500-ref
+          - const: loongson,ls2k0500
+
+      - description: Loongson-2K1000 processor based boards
+        items:
+          - const: loongson,ls2k1000-ref
+          - const: loongson,ls2k1000
+
+      - description: Loongson-2K2000 processor based boards
+        items:
+          - const: loongson,ls2k2000-ref
+          - const: loongson,ls2k2000
+
+additionalProperties: true
+
+...