diff mbox series

dt-bindings: mfd/clock: YAML for Broadcom PMU with ILP clock

Message ID 20230731203309.30278-1-zajec5@gmail.com
State Changes Requested, archived
Headers show
Series dt-bindings: mfd/clock: YAML for Broadcom PMU with ILP clock | expand

Checks

Context Check Description
robh/checkpatch warning total: 0 errors, 2 warnings, 67 lines checked
robh/patch-applied success
robh/dtbs-check warning build log
robh/dt-meta-schema success

Commit Message

Rafał Miłecki July 31, 2023, 8:33 p.m. UTC
From: Rafał Miłecki <rafal@milecki.pl>

BCM53573 SoC has ILP clock that is part of the PMU block. So far PMU
itself didn't have a proper binding and ILP wasn't converted to
json-schema. Fix it up.

Add custom binding for Broadcom's BCM53573 PMU and include ILP's
properties there (it's trivial and non-reusable binding).

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 .../bindings/clock/brcm,bcm53573-ilp.txt      | 36 ----------
 .../bindings/mfd/brcm,bcm53573-pmu.yaml       | 67 +++++++++++++++++++
 2 files changed, 67 insertions(+), 36 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/clock/brcm,bcm53573-ilp.txt
 create mode 100644 Documentation/devicetree/bindings/mfd/brcm,bcm53573-pmu.yaml

Comments

Conor Dooley Aug. 1, 2023, 9:03 p.m. UTC | #1
On Mon, Jul 31, 2023 at 10:33:09PM +0200, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> BCM53573 SoC has ILP clock that is part of the PMU block. So far PMU
> itself didn't have a proper binding and ILP wasn't converted to
> json-schema. Fix it up.
> 
> Add custom binding for Broadcom's BCM53573 PMU and include ILP's
> properties there (it's trivial and non-reusable binding).
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
>  .../bindings/clock/brcm,bcm53573-ilp.txt      | 36 ----------
>  .../bindings/mfd/brcm,bcm53573-pmu.yaml       | 67 +++++++++++++++++++
>  2 files changed, 67 insertions(+), 36 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/clock/brcm,bcm53573-ilp.txt
>  create mode 100644 Documentation/devicetree/bindings/mfd/brcm,bcm53573-pmu.yaml
> 
> diff --git a/Documentation/devicetree/bindings/clock/brcm,bcm53573-ilp.txt b/Documentation/devicetree/bindings/clock/brcm,bcm53573-ilp.txt
> deleted file mode 100644
> index 2ebb107331dd..000000000000
> --- a/Documentation/devicetree/bindings/clock/brcm,bcm53573-ilp.txt
> +++ /dev/null
> @@ -1,36 +0,0 @@
> -Broadcom BCM53573 ILP clock
> -===========================
> -
> -This binding uses the common clock binding:
> -    Documentation/devicetree/bindings/clock/clock-bindings.txt
> -
> -This binding is used for ILP clock (sometimes referred as "slow clock")
> -on Broadcom BCM53573 devices using Cortex-A7 CPU.
> -
> -ILP's rate has to be calculated on runtime and it depends on ALP clock
> -which has to be referenced.
> -
> -This clock is part of PMU (Power Management Unit), a Broadcom's device
> -handing power-related aspects. Its node must be sub-node of the PMU
> -device.
> -
> -Required properties:
> -- compatible: "brcm,bcm53573-ilp"
> -- clocks: has to reference an ALP clock
> -- #clock-cells: should be <0>
> -- clock-output-names: from common clock bindings, should contain clock
> -		      name
> -
> -Example:
> -
> -pmu@18012000 {
> -	compatible = "simple-mfd", "syscon";
> -	reg = <0x18012000 0x00001000>;
> -
> -	ilp {
> -		compatible = "brcm,bcm53573-ilp";
> -		clocks = <&alp>;
> -		#clock-cells = <0>;
> -		clock-output-names = "ilp";
> -	};
> -};
> diff --git a/Documentation/devicetree/bindings/mfd/brcm,bcm53573-pmu.yaml b/Documentation/devicetree/bindings/mfd/brcm,bcm53573-pmu.yaml
> new file mode 100644
> index 000000000000..5b0a12bf4fe4
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/brcm,bcm53573-pmu.yaml
> @@ -0,0 +1,67 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mfd/brcm,bcm53573-pmu.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Broadcom PMU
> +
> +maintainers:
> +  - Rafał Miłecki <rafal@milecki.pl>
> +
> +description: |
> +  Broadcom PMU ("Power Management Unit"?) is a hardware block grouping smaller

Why the ? ? The text binding doesn't have one.

> +  blocks. It contains few clocks and some shared registers (used to power
> +  control more than 1 block).
> +
> +properties:
> +  compatible:
> +    items:
> +      - const: brcm,bcm53573-pmu
> +      - const: simple-mfd
> +      - const: syscon
> +
> +  reg:
> +    maxItems: 1
> +
> +  clock-controller-ilp:

The old text binding didn't have this "-ilp". Why not name the node in a
standard manner & use "clock-controller" alone?

> +    description: ILP clock (sometimes referred as "slow clock")
> +    type: object
> +    allOf:
> +      - $ref: /schemas/clock/clock.yaml
> +      - properties:
> +          compatible:
> +            const: brcm,bcm53573-ilp
> +          clocks:
> +            description: ALP clock
> +            maxItems: 1

Is this description actually helpful, if it only has one clock?

Thanks,
Conor.

> +          clock-output-names:
> +            const: ilp
> +          "#clock-cells":
> +            const: 0
> +        required:
> +          - compatible
> +          - clocks
> +          - clock-output-names
> +          - "#clock-cells"
> +    unevaluatedProperties: false
> +
> +additionalProperties: false
> +
> +required:
> +  - reg
> +  - clock-controller-ilp
> +
> +examples:
> +  - |
> +    pmu@18012000 {
> +        compatible = "brcm,bcm53573-pmu", "simple-mfd", "syscon";
> +        reg = <0x18012000 0x00001000>;
> +
> +        clock-controller-ilp {
> +            compatible = "brcm,bcm53573-ilp";
> +            clocks = <&alp>;
> +            clock-output-names = "ilp";
> +            #clock-cells = <0>;
> +        };
> +    };
> -- 
> 2.35.3
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/clock/brcm,bcm53573-ilp.txt b/Documentation/devicetree/bindings/clock/brcm,bcm53573-ilp.txt
deleted file mode 100644
index 2ebb107331dd..000000000000
--- a/Documentation/devicetree/bindings/clock/brcm,bcm53573-ilp.txt
+++ /dev/null
@@ -1,36 +0,0 @@ 
-Broadcom BCM53573 ILP clock
-===========================
-
-This binding uses the common clock binding:
-    Documentation/devicetree/bindings/clock/clock-bindings.txt
-
-This binding is used for ILP clock (sometimes referred as "slow clock")
-on Broadcom BCM53573 devices using Cortex-A7 CPU.
-
-ILP's rate has to be calculated on runtime and it depends on ALP clock
-which has to be referenced.
-
-This clock is part of PMU (Power Management Unit), a Broadcom's device
-handing power-related aspects. Its node must be sub-node of the PMU
-device.
-
-Required properties:
-- compatible: "brcm,bcm53573-ilp"
-- clocks: has to reference an ALP clock
-- #clock-cells: should be <0>
-- clock-output-names: from common clock bindings, should contain clock
-		      name
-
-Example:
-
-pmu@18012000 {
-	compatible = "simple-mfd", "syscon";
-	reg = <0x18012000 0x00001000>;
-
-	ilp {
-		compatible = "brcm,bcm53573-ilp";
-		clocks = <&alp>;
-		#clock-cells = <0>;
-		clock-output-names = "ilp";
-	};
-};
diff --git a/Documentation/devicetree/bindings/mfd/brcm,bcm53573-pmu.yaml b/Documentation/devicetree/bindings/mfd/brcm,bcm53573-pmu.yaml
new file mode 100644
index 000000000000..5b0a12bf4fe4
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/brcm,bcm53573-pmu.yaml
@@ -0,0 +1,67 @@ 
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/brcm,bcm53573-pmu.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Broadcom PMU
+
+maintainers:
+  - Rafał Miłecki <rafal@milecki.pl>
+
+description: |
+  Broadcom PMU ("Power Management Unit"?) is a hardware block grouping smaller
+  blocks. It contains few clocks and some shared registers (used to power
+  control more than 1 block).
+
+properties:
+  compatible:
+    items:
+      - const: brcm,bcm53573-pmu
+      - const: simple-mfd
+      - const: syscon
+
+  reg:
+    maxItems: 1
+
+  clock-controller-ilp:
+    description: ILP clock (sometimes referred as "slow clock")
+    type: object
+    allOf:
+      - $ref: /schemas/clock/clock.yaml
+      - properties:
+          compatible:
+            const: brcm,bcm53573-ilp
+          clocks:
+            description: ALP clock
+            maxItems: 1
+          clock-output-names:
+            const: ilp
+          "#clock-cells":
+            const: 0
+        required:
+          - compatible
+          - clocks
+          - clock-output-names
+          - "#clock-cells"
+    unevaluatedProperties: false
+
+additionalProperties: false
+
+required:
+  - reg
+  - clock-controller-ilp
+
+examples:
+  - |
+    pmu@18012000 {
+        compatible = "brcm,bcm53573-pmu", "simple-mfd", "syscon";
+        reg = <0x18012000 0x00001000>;
+
+        clock-controller-ilp {
+            compatible = "brcm,bcm53573-ilp";
+            clocks = <&alp>;
+            clock-output-names = "ilp";
+            #clock-cells = <0>;
+        };
+    };