diff mbox series

[3/6] dt-bindings: soc: amlogic: document System Control registers

Message ID 20230209-b4-amlogic-bindings-convert-take2-v1-3-c4fe9049def9@linaro.org
State Handled Elsewhere
Headers show
Series dt-bindings: second batch of dt-schema conversions for Amlogic Meson bindings | expand

Commit Message

Neil Armstrong Feb. 9, 2023, 1:41 p.m. UTC
Document the System Control registers regions found on all Amlogic
SoC families and it's clock, power, pinctrl and phy subnodes.

The regions has various independent registers tied to other
hardware devices, thus the syscon compatible.

Clock controllers and Pinctrl devices are not yet documented, the
definition of those will be updated in a second time.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 .../soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml  | 109 +++++++++++++++++++++
 1 file changed, 109 insertions(+)

Comments

Martin Blumenstingl Feb. 11, 2023, 8:25 p.m. UTC | #1
Hi Neil,

On Thu, Feb 9, 2023 at 2:41 PM Neil Armstrong <neil.armstrong@linaro.org> wrote:
>
> Document the System Control registers regions found on all Amlogic
> SoC families and it's clock, power, pinctrl and phy subnodes.
I understand clock (main clock controller) power (power domain
controller) and PHY (HDMI and CVBS PHYs). Are you sure about pinctrl?

[...]
> +properties:
> +  compatible:
> +    items:
> +      - enum:
> +          - amlogic,meson-gx-hhi-sysctrl
> +          - amlogic,meson-gx-ao-sysctrl
> +          - amlogic,meson-axg-hhi-sysctrl
> +          - amlogic,meson-axg-ao-sysctrl
If you have to re-send this then it would be great if you could add:
          - amlogic,meson-hhi-sysctrl
because we already have that in arch/arm/boot/dts/meson.dtsi for the
32-bit SoCs.

[...]
> +        power-controller {
> +            compatible = "amlogic,meson-gxbb-pwrc";
> +            #power-domain-cells = <1>;
> +            amlogic,ao-sysctrl = <&sysctrl_AO>;
For this node (and similar ones) I have a question to the device-tree
maintainers:
The power controller has a dedicated sub-range of registers. This also
applies to the CVBS and HDMI PHYs.
But the clock controller does not (it has its registers all over the
place - unfortunately that's how the hardware is).
I have been asked to add a "reg" property to child nodes with a
sub-register space.
Does this mean we need to add a reg property here as well (regardless
of whether we're using it in the driver or not)? And what to do in
case of the clock controller though?


Best regards,
Martin
Krzysztof Kozlowski Feb. 13, 2023, 10:59 a.m. UTC | #2
On 09/02/2023 14:41, Neil Armstrong wrote:
> Document the System Control registers regions found on all Amlogic
> SoC families and it's clock, power, pinctrl and phy subnodes.
> 
> The regions has various independent registers tied to other
> hardware devices, thus the syscon compatible.
> 
> Clock controllers and Pinctrl devices are not yet documented, the
> definition of those will be updated in a second time.
> 
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> ---
>  .../soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml  | 109 +++++++++++++++++++++
>  1 file changed, 109 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml b/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml
> new file mode 100644
> index 000000000000..672eabd90c09
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml
> @@ -0,0 +1,109 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Amlogic Meson System Control registers
> +
> +maintainers:
> +  - Neil Armstrong <neil.armstrong@linaro.org>
> +
> +properties:
> +  compatible:
> +    items:
> +      - enum:
> +          - amlogic,meson-gx-hhi-sysctrl
> +          - amlogic,meson-gx-ao-sysctrl
> +          - amlogic,meson-axg-hhi-sysctrl
> +          - amlogic,meson-axg-ao-sysctrl
> +      - const: simple-mfd
> +      - const: syscon
> +
> +  reg:
> +    maxItems: 1
> +
> +  clock-controller:
> +    type: object
> +
> +  power-controller:
> +    $ref: /schemas/power/amlogic,meson-ee-pwrc.yaml
> +
> +  pinctrl:
> +    type: object
> +
> +  phy:
> +    type: object
> +
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          enum:
> +            - amlogic,meson-gx-hhi-sysctrl
> +            - amlogic,meson-axg-hhi-sysctrl
> +    then:
> +      required:
> +        - power-controller
> +
> +  - if:
> +      properties:
> +        compatible:
> +          enum:
> +            - amlogic,meson-gx-ao-sysctrl
> +            - amlogic,meson-axg-ao-sysctrl
> +    then:
> +      required:
> +        - pinctrl
> +
> +  - if:
> +      properties:
> +        compatible:
> +          enum:
> +            - amlogic,meson-axg-hhi-sysctrl
> +    then:
> +      properties:
> +        phy:
> +          oneOf:
> +            - $ref: /schemas/phy/amlogic,g12a-mipi-dphy-analog.yaml
> +            - $ref: /schemas/phy/amlogic,meson-axg-mipi-pcie-analog.yaml

And all other variants? This allows phy/power/pinctrl/clock in any
combination, thus maybe the binding should be just split? Hard to say
without full picture.

> +
> +required:
> +  - compatible
> +  - reg
> +  - clock-controller
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    sysctrl: system-controller@0 {
> +        compatible = "amlogic,meson-gx-hhi-sysctrl", "simple-mfd", "syscon";
> +        reg = <0 0x400>;
> +
> +        clock-controller { };

The example should be complete, so empty node does not look correct. If
you wait for other bindings, send them as patchset when all are ready.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml b/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml
new file mode 100644
index 000000000000..672eabd90c09
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml
@@ -0,0 +1,109 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/amlogic/amlogic,meson-gx-hhi-sysctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic Meson System Control registers
+
+maintainers:
+  - Neil Armstrong <neil.armstrong@linaro.org>
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - amlogic,meson-gx-hhi-sysctrl
+          - amlogic,meson-gx-ao-sysctrl
+          - amlogic,meson-axg-hhi-sysctrl
+          - amlogic,meson-axg-ao-sysctrl
+      - const: simple-mfd
+      - const: syscon
+
+  reg:
+    maxItems: 1
+
+  clock-controller:
+    type: object
+
+  power-controller:
+    $ref: /schemas/power/amlogic,meson-ee-pwrc.yaml
+
+  pinctrl:
+    type: object
+
+  phy:
+    type: object
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          enum:
+            - amlogic,meson-gx-hhi-sysctrl
+            - amlogic,meson-axg-hhi-sysctrl
+    then:
+      required:
+        - power-controller
+
+  - if:
+      properties:
+        compatible:
+          enum:
+            - amlogic,meson-gx-ao-sysctrl
+            - amlogic,meson-axg-ao-sysctrl
+    then:
+      required:
+        - pinctrl
+
+  - if:
+      properties:
+        compatible:
+          enum:
+            - amlogic,meson-axg-hhi-sysctrl
+    then:
+      properties:
+        phy:
+          oneOf:
+            - $ref: /schemas/phy/amlogic,g12a-mipi-dphy-analog.yaml
+            - $ref: /schemas/phy/amlogic,meson-axg-mipi-pcie-analog.yaml
+
+required:
+  - compatible
+  - reg
+  - clock-controller
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    sysctrl: system-controller@0 {
+        compatible = "amlogic,meson-gx-hhi-sysctrl", "simple-mfd", "syscon";
+        reg = <0 0x400>;
+
+        clock-controller { };
+
+        power-controller {
+            compatible = "amlogic,meson-gxbb-pwrc";
+            #power-domain-cells = <1>;
+            amlogic,ao-sysctrl = <&sysctrl_AO>;
+
+            resets = <&reset_viu>,
+                     <&reset_venc>,
+                     <&reset_vcbus>,
+                     <&reset_bt656>,
+                     <&reset_dvin>,
+                     <&reset_rdma>,
+                     <&reset_venci>,
+                     <&reset_vencp>,
+                     <&reset_vdac>,
+                     <&reset_vdi6>,
+                     <&reset_vencl>,
+                     <&reset_vid_lock>;
+            reset-names = "viu", "venc", "vcbus", "bt656", "dvin",
+                          "rdma", "venci", "vencp", "vdac", "vdi6",
+                          "vencl", "vid_lock";
+            clocks = <&clk_vpu>, <&clk_vapb>;
+            clock-names = "vpu", "vapb";
+        };
+    };