2022-12-07 06:32:41

by Kunihiko Hayashi

[permalink] [raw]
Subject: [PATCH v2 09/16] dt-bindings: soc: socionext: Add UniPhier SoC-glue logic

Add devicetree binding schema for the SoC-glue logic implemented on
Socionext Uniphier SoCs.

This SoC-glue logic is a set of miscellaneous function registers
handling signals for specific devices outside system components,
and also has multiple functions such as I/O pinmux, usb-phy, debug,
clock-mux for a specific SoC, and so on.

Signed-off-by: Kunihiko Hayashi <[email protected]>
---
.../socionext,uniphier-soc-glue.yaml | 113 ++++++++++++++++++
1 file changed, 113 insertions(+)
create mode 100644 Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-soc-glue.yaml

diff --git a/Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-soc-glue.yaml b/Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-soc-glue.yaml
new file mode 100644
index 000000000000..6fc790963660
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-soc-glue.yaml
@@ -0,0 +1,113 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/socionext/socionext,uniphier-soc-glue.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Socionext UniPhier SoC-glue logic
+
+maintainers:
+ - Kunihiko Hayashi <[email protected]>
+
+description: |+
+ SoC-glue logic implemented on Socionext UniPhier SoCs is a collection of
+ miscellaneous function registers handling signals outside system components.
+
+properties:
+ compatible:
+ items:
+ - enum:
+ - socionext,uniphier-ld4-soc-glue
+ - socionext,uniphier-pro4-soc-glue
+ - socionext,uniphier-pro5-soc-glue
+ - socionext,uniphier-pxs2-soc-glue
+ - socionext,uniphier-sld8-soc-glue
+ - socionext,uniphier-ld11-soc-glue
+ - socionext,uniphier-ld20-soc-glue
+ - socionext,uniphier-pxs3-soc-glue
+ - socionext,uniphier-nx1-soc-glue
+ - const: simple-mfd
+ - const: syscon
+
+ reg:
+ maxItems: 1
+
+patternProperties:
+ "^pinctrl(@[0-9a-f]+)?$":
+ $ref: /schemas/pinctrl/socionext,uniphier-pinctrl.yaml#
+
+ "^usb-hub(@[0-9a-f]+)?$":
+ $ref: /schemas/phy/socionext,uniphier-usb2-phy.yaml#
+
+ "^clock-controller(@[0-9a-f]+)?$":
+ $ref: /schemas/clock/socionext,uniphier-clock.yaml#
+
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - socionext,uniphier-pro4-soc-glue
+ - socionext,uniphier-ld11-soc-glue
+ else:
+ patternProperties:
+ "^usb-hub(@[0-9a-f]+)?$": false
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: socionext,uniphier-pro4-soc-glue
+ else:
+ patternProperties:
+ "^clock-controller(@[0-9a-f]+)?$": false
+
+required:
+ - compatible
+ - reg
+
+additionalProperties: false
+
+examples:
+ - |
+ syscon@5f800000 {
+ compatible = "socionext,uniphier-pro4-soc-glue",
+ "simple-mfd", "syscon";
+ reg = <0x5f800000 0x2000>;
+
+ pinctrl {
+ compatible = "socionext,uniphier-pro4-pinctrl";
+ };
+
+ usb-hub {
+ compatible = "socionext,uniphier-pro4-usb2-phy";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ phy@0 {
+ reg = <0>;
+ #phy-cells = <0>;
+ };
+
+ phy@1 {
+ reg = <1>;
+ #phy-cells = <0>;
+ };
+
+ phy@2 {
+ reg = <2>;
+ #phy-cells = <0>;
+ };
+
+ phy@3 {
+ reg = <3>;
+ #phy-cells = <0>;
+ };
+ };
+
+ clock-controller {
+ compatible = "socionext,uniphier-pro4-sg-clock";
+ #clock-cells = <1>;
+ };
+ };
--
2.25.1


2022-12-07 15:48:30

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v2 09/16] dt-bindings: soc: socionext: Add UniPhier SoC-glue logic

On Wed, Dec 07, 2022 at 02:53:58PM +0900, Kunihiko Hayashi wrote:
> Add devicetree binding schema for the SoC-glue logic implemented on
> Socionext Uniphier SoCs.
>
> This SoC-glue logic is a set of miscellaneous function registers
> handling signals for specific devices outside system components,
> and also has multiple functions such as I/O pinmux, usb-phy, debug,
> clock-mux for a specific SoC, and so on.
>
> Signed-off-by: Kunihiko Hayashi <[email protected]>
> ---
> .../socionext,uniphier-soc-glue.yaml | 113 ++++++++++++++++++
> 1 file changed, 113 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-soc-glue.yaml
>
> diff --git a/Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-soc-glue.yaml b/Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-soc-glue.yaml
> new file mode 100644
> index 000000000000..6fc790963660
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-soc-glue.yaml
> @@ -0,0 +1,113 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/soc/socionext/socionext,uniphier-soc-glue.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Socionext UniPhier SoC-glue logic
> +
> +maintainers:
> + - Kunihiko Hayashi <[email protected]>
> +
> +description: |+
> + SoC-glue logic implemented on Socionext UniPhier SoCs is a collection of
> + miscellaneous function registers handling signals outside system components.
> +
> +properties:
> + compatible:
> + items:
> + - enum:
> + - socionext,uniphier-ld4-soc-glue
> + - socionext,uniphier-pro4-soc-glue
> + - socionext,uniphier-pro5-soc-glue
> + - socionext,uniphier-pxs2-soc-glue
> + - socionext,uniphier-sld8-soc-glue
> + - socionext,uniphier-ld11-soc-glue
> + - socionext,uniphier-ld20-soc-glue
> + - socionext,uniphier-pxs3-soc-glue
> + - socionext,uniphier-nx1-soc-glue
> + - const: simple-mfd
> + - const: syscon
> +
> + reg:
> + maxItems: 1
> +
> +patternProperties:
> + "^pinctrl(@[0-9a-f]+)?$":
> + $ref: /schemas/pinctrl/socionext,uniphier-pinctrl.yaml#
> +
> + "^usb-hub(@[0-9a-f]+)?$":
> + $ref: /schemas/phy/socionext,uniphier-usb2-phy.yaml#
> +
> + "^clock-controller(@[0-9a-f]+)?$":
> + $ref: /schemas/clock/socionext,uniphier-clock.yaml#
> +
> +allOf:
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - socionext,uniphier-pro4-soc-glue
> + - socionext,uniphier-ld11-soc-glue
> + else:
> + patternProperties:
> + "^usb-hub(@[0-9a-f]+)?$": false

While just if and else is valid json-schema, we require 'then'. Can you
change this to 'if: { not: {...}, then: {}'.

You should be getting a warning for this. The rest of the warnings from
the bot look like false positives you can ignore.

Rob

2022-12-08 06:46:14

by Kunihiko Hayashi

[permalink] [raw]
Subject: Re: [PATCH v2 09/16] dt-bindings: soc: socionext: Add UniPhier SoC-glue logic

Hi Rob,

On 2022/12/08 0:35, Rob Herring wrote:
> On Wed, Dec 07, 2022 at 02:53:58PM +0900, Kunihiko Hayashi wrote:
>> Add devicetree binding schema for the SoC-glue logic implemented on
>> Socionext Uniphier SoCs.
>>
>> This SoC-glue logic is a set of miscellaneous function registers
>> handling signals for specific devices outside system components,
>> and also has multiple functions such as I/O pinmux, usb-phy, debug,
>> clock-mux for a specific SoC, and so on.
>>
>> Signed-off-by: Kunihiko Hayashi <[email protected]>
>> ---

(snip)

>> +allOf:
>> + - if:
>> + properties:
>> + compatible:
>> + contains:
>> + enum:
>> + - socionext,uniphier-pro4-soc-glue
>> + - socionext,uniphier-ld11-soc-glue
>> + else:
>> + patternProperties:
>> + "^usb-hub(@[0-9a-f]+)?$": false
>
> While just if and else is valid json-schema, we require 'then'. Can you
> change this to 'if: { not: {...}, then: {}'.

I see. I'll rewrite it with invert condition.

> You should be getting a warning for this. The rest of the warnings from
> the bot look like false positives you can ignore.
Hmm, I couldn't see the warning for this condition.

The warnings your bot printed are the results evaluated before
applying the example fixes (PATCH 1-7) or before fixing the
existing devicetree (need to fix but yet).

Thank you,

---
Best Regards
Kunihiko Hayashi

2022-12-08 08:38:46

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v2 09/16] dt-bindings: soc: socionext: Add UniPhier SoC-glue logic

On 07/12/2022 06:53, Kunihiko Hayashi wrote:
> Add devicetree binding schema for the SoC-glue logic implemented on
> Socionext Uniphier SoCs.
>
> This SoC-glue logic is a set of miscellaneous function registers
> handling signals for specific devices outside system components,
> and also has multiple functions such as I/O pinmux, usb-phy, debug,
> clock-mux for a specific SoC, and so on.
>
> Signed-off-by: Kunihiko Hayashi <[email protected]>
> ---
> .../socionext,uniphier-soc-glue.yaml | 113 ++++++++++++++++++
> 1 file changed, 113 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-soc-glue.yaml
>
> diff --git a/Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-soc-glue.yaml b/Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-soc-glue.yaml
> new file mode 100644
> index 000000000000..6fc790963660
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-soc-glue.yaml
> @@ -0,0 +1,113 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/soc/socionext/socionext,uniphier-soc-glue.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Socionext UniPhier SoC-glue logic
> +
> +maintainers:
> + - Kunihiko Hayashi <[email protected]>
> +
> +description: |+
> + SoC-glue logic implemented on Socionext UniPhier SoCs is a collection of
> + miscellaneous function registers handling signals outside system components.
> +
> +properties:
> + compatible:
> + items:
> + - enum:
> + - socionext,uniphier-ld4-soc-glue
> + - socionext,uniphier-pro4-soc-glue
> + - socionext,uniphier-pro5-soc-glue
> + - socionext,uniphier-pxs2-soc-glue
> + - socionext,uniphier-sld8-soc-glue
> + - socionext,uniphier-ld11-soc-glue
> + - socionext,uniphier-ld20-soc-glue
> + - socionext,uniphier-pxs3-soc-glue
> + - socionext,uniphier-nx1-soc-glue
> + - const: simple-mfd
> + - const: syscon
> +
> + reg:
> + maxItems: 1
> +
> +patternProperties:
> + "^pinctrl(@[0-9a-f]+)?$":

Your children cannot have unit address in this binding (not mentioning
that children schema has in example statement that unit address is
invalid: "must be a child of syscon node").

> + $ref: /schemas/pinctrl/socionext,uniphier-pinctrl.yaml#
> +
> + "^usb-hub(@[0-9a-f]+)?$":
> + $ref: /schemas/phy/socionext,uniphier-usb2-phy.yaml#
> +
> + "^clock-controller(@[0-9a-f]+)?$":
> + $ref: /schemas/clock/socionext,uniphier-clock.yaml#
> +
Best regards,
Krzysztof

2022-12-08 15:55:37

by Kunihiko Hayashi

[permalink] [raw]
Subject: Re: [PATCH v2 09/16] dt-bindings: soc: socionext: Add UniPhier SoC-glue logic

On 2022/12/08 17:16, Krzysztof Kozlowski wrote:> On 07/12/2022 06:53, Kunihiko Hayashi wrote:
>> Add devicetree binding schema for the SoC-glue logic implemented on
>> Socionext Uniphier SoCs.
>>
>> This SoC-glue logic is a set of miscellaneous function registers
>> handling signals for specific devices outside system components,
>> and also has multiple functions such as I/O pinmux, usb-phy, debug,
>> clock-mux for a specific SoC, and so on.
>>
>> Signed-off-by: Kunihiko Hayashi <[email protected]>
>> ---
>> .../socionext,uniphier-soc-glue.yaml | 113 ++++++++++++++++++
>> 1 file changed, 113 insertions(+)
>> create mode 100644
>> Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-soc-glue.yaml
>>
>> diff --git
>> a/Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-soc-glue.yaml
>> b/Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-soc-glue.yaml
>> new file mode 100644
>> index 000000000000..6fc790963660
>> --- /dev/null
>> +++
>> b/Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-soc-glue.yaml
>> @@ -0,0 +1,113 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id:
>> http://devicetree.org/schemas/soc/socionext/socionext,uniphier-soc-glue.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Socionext UniPhier SoC-glue logic
>> +
>> +maintainers:
>> + - Kunihiko Hayashi <[email protected]>
>> +
>> +description: |+
>> + SoC-glue logic implemented on Socionext UniPhier SoCs is a collection
>> of
>> + miscellaneous function registers handling signals outside system
>> components.
>> +
>> +properties:
>> + compatible:
>> + items:
>> + - enum:
>> + - socionext,uniphier-ld4-soc-glue
>> + - socionext,uniphier-pro4-soc-glue
>> + - socionext,uniphier-pro5-soc-glue
>> + - socionext,uniphier-pxs2-soc-glue
>> + - socionext,uniphier-sld8-soc-glue
>> + - socionext,uniphier-ld11-soc-glue
>> + - socionext,uniphier-ld20-soc-glue
>> + - socionext,uniphier-pxs3-soc-glue
>> + - socionext,uniphier-nx1-soc-glue
>> + - const: simple-mfd
>> + - const: syscon
>> +
>> + reg:
>> + maxItems: 1
>> +
>> +patternProperties:
>> + "^pinctrl(@[0-9a-f]+)?$":
>
> Your children cannot have unit address in this binding (not mentioning
> that children schema has in example statement that unit address is
> invalid: "must be a child of syscon node").

Same as uniphier-sysctrl, I'll drop the address patterns.

Thank you,

---
Best Regards
Kunihiko Hayashi