diff mbox series

[v2,08/16] dt-bindings: soc: socionext: Add UniPhier system controller

Message ID 20221207055405.30940-9-hayashi.kunihiko@socionext.com
State Accepted
Commit 75c7aaa66f5fdabcbaf1e6775c5f85b35b7debaa
Headers show
Series dt-bindings: soc: Introduce UniPhier miscellaneous register blocks and fix examples | expand

Commit Message

Kunihiko Hayashi Dec. 7, 2022, 5:53 a.m. UTC
Add devicetree binding schema for the system controller implemented on
Socionext Uniphier SoCs.

This system controller has multiple functions such as clock control,
reset control, internal watchdog timer, thermal management, and so on.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 .../socionext/socionext,uniphier-sysctrl.yaml | 105 ++++++++++++++++++
 MAINTAINERS                                   |   1 +
 2 files changed, 106 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-sysctrl.yaml

Comments

Rob Herring (Arm) Dec. 7, 2022, 2:19 p.m. UTC | #1
On Wed, 07 Dec 2022 14:53:57 +0900, Kunihiko Hayashi wrote:
> Add devicetree binding schema for the system controller implemented on
> Socionext Uniphier SoCs.
> 
> This system controller has multiple functions such as clock control,
> reset control, internal watchdog timer, thermal management, and so on.
> 
> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
> ---
>  .../socionext/socionext,uniphier-sysctrl.yaml | 105 ++++++++++++++++++
>  MAINTAINERS                                   |   1 +
>  2 files changed, 106 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-sysctrl.yaml
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/thermal/socionext,uniphier-thermal.example.dtb: sysctrl@61840000: 'thermal' does not match any of the regexes: '^clock-controller(@[0-9a-f]+)?$', '^reset-controller(@[0-9a-f]+)?$', '^thermal-sensor(@[0-9a-f]+)?$', '^watchdog(@[0-9a-f]+)?$', 'pinctrl-[0-9]+'
	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-sysctrl.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20221207055405.30940-9-hayashi.kunihiko@socionext.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.
Kunihiko Hayashi Dec. 8, 2022, 6:37 a.m. UTC | #2
On 2022/12/07 23:19, Rob Herring wrote:
> 
> On Wed, 07 Dec 2022 14:53:57 +0900, Kunihiko Hayashi wrote:
>> Add devicetree binding schema for the system controller implemented on
>> Socionext Uniphier SoCs.
>>
>> This system controller has multiple functions such as clock control,
>> reset control, internal watchdog timer, thermal management, and so on.
>>
>> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
>> ---
>>   .../socionext/socionext,uniphier-sysctrl.yaml | 105 ++++++++++++++++++
>>   MAINTAINERS                                   |   1 +
>>   2 files changed, 106 insertions(+)
>>   create mode 100644
>> Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-sysctrl.yaml
>>
> 
> My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> on your patch (DT_CHECKER_FLAGS is new in v5.13):
> 
> yamllint warnings/errors:
> 
> dtschema/dtc warnings/errors:
> /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/thermal/socionext,uniphier-thermal.example.dtb:
> sysctrl@61840000: 'thermal' does not match any of the regexes:
> '^clock-controller(@[0-9a-f]+)?$', '^reset-controller(@[0-9a-f]+)?$',
> '^thermal-sensor(@[0-9a-f]+)?$', '^watchdog(@[0-9a-f]+)?$', 'pinctrl-[0-9]+'
> 	From schema:
> /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-sysctrl.yaml
> 
> doc reference errors (make refcheckdocs):
> 
> See
> https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20221207055405.30940-9-hayashi.kunihiko@socionext.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.

Already confirmed with example fixes.
This warning is a result evaluated before applying PATCH 5.
   [05/16] dt-bindings: thermal: Fix node descriptions in uniphier-thermal example

Thank you,

---
Best Regards
Kunihiko Hayashi
Krzysztof Kozlowski Dec. 8, 2022, 8:15 a.m. UTC | #3
On 07/12/2022 06:53, Kunihiko Hayashi wrote:
> Add devicetree binding schema for the system controller implemented on
> Socionext Uniphier SoCs.
> 
> This system controller has multiple functions such as clock control,
> reset control, internal watchdog timer, thermal management, and so on.
> 
> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
> ---
>  .../socionext/socionext,uniphier-sysctrl.yaml | 105 ++++++++++++++++++
>  MAINTAINERS                                   |   1 +
>  2 files changed, 106 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-sysctrl.yaml
> 
> diff --git a/Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-sysctrl.yaml b/Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-sysctrl.yaml
> new file mode 100644
> index 000000000000..c1b7cec8def4
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-sysctrl.yaml
> @@ -0,0 +1,105 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/soc/socionext/socionext,uniphier-sysctrl.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Socionext UniPhier system controller
> +
> +maintainers:
> +  - Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
> +
> +description: |+
> +  System controller implemented on Socionext UniPhier SoCs has multiple
> +  functions such as clock control, reset control, internal watchdog timer,
> +  thermal management, and so on.
> +
> +properties:
> +  compatible:
> +    items:
> +      - enum:
> +          - socionext,uniphier-ld4-sysctrl
> +          - socionext,uniphier-pro4-sysctrl
> +          - socionext,uniphier-pro5-sysctrl
> +          - socionext,uniphier-pxs2-sysctrl
> +          - socionext,uniphier-sld8-sysctrl
> +          - socionext,uniphier-ld11-sysctrl
> +          - socionext,uniphier-ld20-sysctrl
> +          - socionext,uniphier-pxs3-sysctrl
> +          - socionext,uniphier-nx1-sysctrl
> +      - const: simple-mfd
> +      - const: syscon
> +
> +  reg:
> +    maxItems: 1
> +
> +patternProperties:
> +  "^clock-controller(@[0-9a-f]+)?$":

I don't remember if we talked about this but: why do you include here
unit address? All your bindings expect these take regmap from the parent
and they do not have separate MMIO address space, so these should be
properties, not pattern properties.

Same in places below.

> +    $ref: /schemas/clock/socionext,uniphier-clock.yaml#
> +
> +  "^reset-controller(@[0-9a-f]+)?$":
> +    $ref: /schemas/reset/socionext,uniphier-reset.yaml#
> +
> +  "^watchdog(@[0-9a-f]+)?$":
> +    $ref: /schemas/watchdog/socionext,uniphier-wdt.yaml#
> +
> +  "^thermal-sensor(@[0-9a-f]+)?$":
> +    $ref: /schemas/thermal/socionext,uniphier-thermal.yaml#
> +
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: socionext,uniphier-ld4-sysctrl
> +    then:
> +      patternProperties:
> +        "^watchdog(@[0-9a-f]+)?$": false
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - socionext,uniphier-ld4-sysctrl
> +              - socionext,uniphier-pro4-sysctrl
> +              - socionext,uniphier-sld8-sysctrl
> +              - socionext,uniphier-ld11-sysctrl
> +    then:
> +      patternProperties:
> +        "^thermal-sensor(@[0-9a-f]+)?$": false
> +
> +additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +

Best regards,
Krzysztof
Kunihiko Hayashi Dec. 8, 2022, 3:09 p.m. UTC | #4
On 2022/12/08 17:15, Krzysztof Kozlowski wrote:
> On 07/12/2022 06:53, Kunihiko Hayashi wrote:
>> Add devicetree binding schema for the system controller implemented on
>> Socionext Uniphier SoCs.
>>
>> This system controller has multiple functions such as clock control,
>> reset control, internal watchdog timer, thermal management, and so on.
>>
>> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
>> ---
>>   .../socionext/socionext,uniphier-sysctrl.yaml | 105 ++++++++++++++++++
>>   MAINTAINERS                                   |   1 +
>>   2 files changed, 106 insertions(+)
>>   create mode 100644
>> Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-sysctrl.yaml
>>
>> diff --git
>> a/Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-sysctrl.yaml
>> b/Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-sysctrl.yaml
>> new file mode 100644
>> index 000000000000..c1b7cec8def4
>> --- /dev/null
>> +++
>> b/Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-sysctrl.yaml
>> @@ -0,0 +1,105 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id:
>> http://devicetree.org/schemas/soc/socionext/socionext,uniphier-sysctrl.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Socionext UniPhier system controller
>> +
>> +maintainers:
>> +  - Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
>> +
>> +description: |+
>> +  System controller implemented on Socionext UniPhier SoCs has multiple
>> +  functions such as clock control, reset control, internal watchdog
>> timer,
>> +  thermal management, and so on.
>> +
>> +properties:
>> +  compatible:
>> +    items:
>> +      - enum:
>> +          - socionext,uniphier-ld4-sysctrl
>> +          - socionext,uniphier-pro4-sysctrl
>> +          - socionext,uniphier-pro5-sysctrl
>> +          - socionext,uniphier-pxs2-sysctrl
>> +          - socionext,uniphier-sld8-sysctrl
>> +          - socionext,uniphier-ld11-sysctrl
>> +          - socionext,uniphier-ld20-sysctrl
>> +          - socionext,uniphier-pxs3-sysctrl
>> +          - socionext,uniphier-nx1-sysctrl
>> +      - const: simple-mfd
>> +      - const: syscon
>> +
>> +  reg:
>> +    maxItems: 1
>> +
>> +patternProperties:
>> +  "^clock-controller(@[0-9a-f]+)?$":
> 
> I don't remember if we talked about this but: why do you include here
> unit address? All your bindings expect these take regmap from the parent
> and they do not have separate MMIO address space, so these should be
> properties, not pattern properties.

I thought this unit address was an option, however, there is no example
of the existing devicetree. It is no longer necessary.

> Same in places below.
 >
>> +    $ref: /schemas/clock/socionext,uniphier-clock.yaml#
>> +
>> +  "^reset-controller(@[0-9a-f]+)?$":
>> +    $ref: /schemas/reset/socionext,uniphier-reset.yaml#
>> +
>> +  "^watchdog(@[0-9a-f]+)?$":
>> +    $ref: /schemas/watchdog/socionext,uniphier-wdt.yaml#
>> +
>> +  "^thermal-sensor(@[0-9a-f]+)?$":
>> +    $ref: /schemas/thermal/socionext,uniphier-thermal.yaml#

I'll drop the address patterns.

Thank you,

---
Best Regards
Kunihiko Hayashi
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-sysctrl.yaml b/Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-sysctrl.yaml
new file mode 100644
index 000000000000..c1b7cec8def4
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-sysctrl.yaml
@@ -0,0 +1,105 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/socionext/socionext,uniphier-sysctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Socionext UniPhier system controller
+
+maintainers:
+  - Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
+
+description: |+
+  System controller implemented on Socionext UniPhier SoCs has multiple
+  functions such as clock control, reset control, internal watchdog timer,
+  thermal management, and so on.
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - socionext,uniphier-ld4-sysctrl
+          - socionext,uniphier-pro4-sysctrl
+          - socionext,uniphier-pro5-sysctrl
+          - socionext,uniphier-pxs2-sysctrl
+          - socionext,uniphier-sld8-sysctrl
+          - socionext,uniphier-ld11-sysctrl
+          - socionext,uniphier-ld20-sysctrl
+          - socionext,uniphier-pxs3-sysctrl
+          - socionext,uniphier-nx1-sysctrl
+      - const: simple-mfd
+      - const: syscon
+
+  reg:
+    maxItems: 1
+
+patternProperties:
+  "^clock-controller(@[0-9a-f]+)?$":
+    $ref: /schemas/clock/socionext,uniphier-clock.yaml#
+
+  "^reset-controller(@[0-9a-f]+)?$":
+    $ref: /schemas/reset/socionext,uniphier-reset.yaml#
+
+  "^watchdog(@[0-9a-f]+)?$":
+    $ref: /schemas/watchdog/socionext,uniphier-wdt.yaml#
+
+  "^thermal-sensor(@[0-9a-f]+)?$":
+    $ref: /schemas/thermal/socionext,uniphier-thermal.yaml#
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: socionext,uniphier-ld4-sysctrl
+    then:
+      patternProperties:
+        "^watchdog(@[0-9a-f]+)?$": false
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - socionext,uniphier-ld4-sysctrl
+              - socionext,uniphier-pro4-sysctrl
+              - socionext,uniphier-sld8-sysctrl
+              - socionext,uniphier-ld11-sysctrl
+    then:
+      patternProperties:
+        "^thermal-sensor(@[0-9a-f]+)?$": false
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    syscon@61840000 {
+        compatible = "socionext,uniphier-ld20-sysctrl",
+                     "simple-mfd", "syscon";
+        reg = <0x61840000 0x4000>;
+
+        clock-controller {
+            compatible = "socionext,uniphier-ld20-clock";
+            #clock-cells = <1>;
+        };
+
+        reset-controller {
+            compatible = "socionext,uniphier-ld20-reset";
+            #reset-cells = <1>;
+        };
+
+        watchdog {
+            compatible = "socionext,uniphier-wdt";
+        };
+
+        thermal-sensor {
+            compatible = "socionext,uniphier-ld20-thermal";
+            interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
+            #thermal-sensor-cells = <0>;
+        };
+    };
diff --git a/MAINTAINERS b/MAINTAINERS
index 0d8faba73fe8..8cec8ea46dd1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3103,6 +3103,7 @@  S:	Maintained
 F:	Documentation/devicetree/bindings/arm/socionext/uniphier.yaml
 F:	Documentation/devicetree/bindings/gpio/socionext,uniphier-gpio.yaml
 F:	Documentation/devicetree/bindings/pinctrl/socionext,uniphier-pinctrl.yaml
+F:	Documentation/devicetree/bindings/soc/socionext/socionext,uniphier*.yaml
 F:	arch/arm/boot/dts/uniphier*
 F:	arch/arm/include/asm/hardware/cache-uniphier.h
 F:	arch/arm/mach-uniphier/