diff mbox series

[1/8] dt-bindings: soc: socionext: Add UniPhier system controller

Message ID 20221129103509.9958-2-hayashi.kunihiko@socionext.com (mailing list archive)
State New, archived
Headers show
Series dt-bidnings: soc: Introduce UniPhier miscelaneous register blocks | expand

Commit Message

Kunihiko Hayashi Nov. 29, 2022, 10:35 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 | 84 +++++++++++++++++++
 MAINTAINERS                                   |  1 +
 2 files changed, 85 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-sysctrl.yaml

Comments

Rob Herring Nov. 29, 2022, 1:32 p.m. UTC | #1
On Tue, 29 Nov 2022 19:35:02 +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 | 84 +++++++++++++++++++
>  MAINTAINERS                                   |  1 +
>  2 files changed, 85 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/reset/socionext,uniphier-reset.example.dtb: sysctrl@61840000: 'reset' 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
/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
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/clock/socionext,uniphier-clock.example.dtb: sysctrl@61840000: 'clock' 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/20221129103509.9958-2-hayashi.kunihiko@socionext.com

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

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.
Krzysztof Kozlowski Nov. 29, 2022, 2:41 p.m. UTC | #2
On 29/11/2022 11:35, 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 | 84 +++++++++++++++++++
>  MAINTAINERS                                   |  1 +
>  2 files changed, 85 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..e966ce1e4b6c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-sysctrl.yaml
> @@ -0,0 +1,84 @@
> +# 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

As Rob's bot pointed, you need to update here examples in other
bindings, so they will pass. Otherwise it is not bisectable change.

> +
> +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-ld6b-sysctrl
> +          - socionext,uniphier-sld8-sysctrl
> +          - socionext,uniphier-ld11-sysctrl
> +          - socionext,uniphier-ld20-sysctrl
> +          - socionext,uniphier-pxs3-sysctrl
> +          - socionext,uniphier-nx1-sysctrl

All of them can have children or only some?

> +          - socionext,uniphier-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#
> +

Best regards,
Krzysztof
Kunihiko Hayashi Nov. 30, 2022, 8:59 a.m. UTC | #3
Hi Krzysztof,

Thank you for reviewing.

On 2022/11/29 23:41, Krzysztof Kozlowski wrote:
> On 29/11/2022 11:35, 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 | 84 +++++++++++++++++++
>>   MAINTAINERS                                   |  1 +
>>   2 files changed, 85 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..e966ce1e4b6c
>> --- /dev/null
>> +++
>> b/Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-sysctrl.yaml
>> @@ -0,0 +1,84 @@
>> +# 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
> 
> As Rob's bot pointed, you need to update here examples in other
> bindings, so they will pass. Otherwise it is not bisectable change.

I've got it. I should also update other examples.

>> +
>> +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-ld6b-sysctrl
>> +          - socionext,uniphier-sld8-sysctrl
>> +          - socionext,uniphier-ld11-sysctrl
>> +          - socionext,uniphier-ld20-sysctrl
>> +          - socionext,uniphier-pxs3-sysctrl
>> +          - socionext,uniphier-nx1-sysctrl
> 
> All of them can have children or only some?

In case of this system controller,
all SoCs has clock-controller, reset-controller and watchdog.

However, some SoCs don't have thermal-sensor and
their register addresses are reserved.

>> +          - socionext,uniphier-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#
>> +
Thank you,

---
Best Regards
Kunihiko Hayashi
Krzysztof Kozlowski Nov. 30, 2022, 3:24 p.m. UTC | #4
On 30/11/2022 09:59, Kunihiko Hayashi wrote:
>>> +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-ld6b-sysctrl
>>> +          - socionext,uniphier-sld8-sysctrl
>>> +          - socionext,uniphier-ld11-sysctrl
>>> +          - socionext,uniphier-ld20-sysctrl
>>> +          - socionext,uniphier-pxs3-sysctrl
>>> +          - socionext,uniphier-nx1-sysctrl
>>
>> All of them can have children or only some?
> 
> In case of this system controller,
> all SoCs has clock-controller, reset-controller and watchdog.
> 
> However, some SoCs don't have thermal-sensor and
> their register addresses are reserved.

OK

> 
>>> +          - socionext,uniphier-sysctrl

What about this one? What SoC is this? Looks too generic.


Best regards,
Krzysztof
Kunihiko Hayashi Dec. 1, 2022, 8:29 a.m. UTC | #5
On 2022/12/01 0:24, Krzysztof Kozlowski wrote:
> On 30/11/2022 09:59, Kunihiko Hayashi wrote:
>>>> +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-ld6b-sysctrl
>>>> +          - socionext,uniphier-sld8-sysctrl
>>>> +          - socionext,uniphier-ld11-sysctrl
>>>> +          - socionext,uniphier-ld20-sysctrl
>>>> +          - socionext,uniphier-pxs3-sysctrl
>>>> +          - socionext,uniphier-nx1-sysctrl
>>>
>>> All of them can have children or only some?
>>
>> In case of this system controller,
>> all SoCs has clock-controller, reset-controller and watchdog.
>>
>> However, some SoCs don't have thermal-sensor and
>> their register addresses are reserved.
> 
> OK
> 
>>
>>>> +          - socionext,uniphier-sysctrl
> 
> What about this one? What SoC is this? Looks too generic.

It's the same one as soc-glue, so it should be placed as follows.

items:
   - enum:
       - ...
       - ...
   - const: socionext,uniphier-sysctrl

However, currently it is no use for now. I'll drop it.

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..e966ce1e4b6c
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/socionext/socionext,uniphier-sysctrl.yaml
@@ -0,0 +1,84 @@ 
+# 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-ld6b-sysctrl
+          - socionext,uniphier-sld8-sysctrl
+          - socionext,uniphier-ld11-sysctrl
+          - socionext,uniphier-ld20-sysctrl
+          - socionext,uniphier-pxs3-sysctrl
+          - socionext,uniphier-nx1-sysctrl
+          - socionext,uniphier-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#
+
+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 1df62c469bd9..366ce3c94d6b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3059,6 +3059,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/