linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/3] dt-bindings: arm: tegra: flowctrl: Convert to json-schema
@ 2023-07-05 15:52 Thierry Reding
  2023-07-05 15:52 ` [PATCH v2 2/3] dt-bindings: arm: tegra: ahb: " Thierry Reding
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Thierry Reding @ 2023-07-05 15:52 UTC (permalink / raw)
  To: Thierry Reding, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Jon Hunter, devicetree, linux-tegra

From: Thierry Reding <treding@nvidia.com>

Convert the Tegra flow controller bindings from the free-form text
format to json-schema.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
Changes in v2:
- move to soc/tegra directory (Krzysztof)

 .../arm/tegra/nvidia,tegra20-flowctrl.txt     | 18 --------
 .../soc/tegra/nvidia,tegra20-flowctrl.yaml    | 41 +++++++++++++++++++
 2 files changed, 41 insertions(+), 18 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-flowctrl.txt
 create mode 100644 Documentation/devicetree/bindings/soc/tegra/nvidia,tegra20-flowctrl.yaml

diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-flowctrl.txt b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-flowctrl.txt
deleted file mode 100644
index a855c1bffc0f..000000000000
--- a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-flowctrl.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-NVIDIA Tegra Flow Controller
-
-Required properties:
-- compatible: Should contain one of the following:
-  - "nvidia,tegra20-flowctrl": for Tegra20
-  - "nvidia,tegra30-flowctrl": for Tegra30
-  - "nvidia,tegra114-flowctrl": for Tegra114
-  - "nvidia,tegra124-flowctrl": for Tegra124
-  - "nvidia,tegra132-flowctrl", "nvidia,tegra124-flowctrl": for Tegra132
-  - "nvidia,tegra210-flowctrl": for Tegra210
-- reg: Should contain one register range (address and length)
-
-Example:
-
-	flow-controller@60007000 {
-		compatible = "nvidia,tegra20-flowctrl";
-		reg = <0x60007000 0x1000>;
-	};
diff --git a/Documentation/devicetree/bindings/soc/tegra/nvidia,tegra20-flowctrl.yaml b/Documentation/devicetree/bindings/soc/tegra/nvidia,tegra20-flowctrl.yaml
new file mode 100644
index 000000000000..705544b7f98f
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/tegra/nvidia,tegra20-flowctrl.yaml
@@ -0,0 +1,41 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/tegra/nvidia,tegra20-flowctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NVIDIA Tegra Flow Controller
+
+maintainers:
+  - Thierry Reding <thierry.reding@gmail.com>
+  - Jon Hunter <jonathanh@nvidia.com>
+
+properties:
+  compatible:
+    oneOf:
+      - enum:
+          - nvidia,tegra20-flowctrl
+          - nvidia,tegra30-flowctrl
+          - nvidia,tegra114-flowctrl
+          - nvidia,tegra124-flowctrl
+          - nvidia,tegra210-flowctrl
+
+      - items:
+          - const: nvidia,tegra132-flowctrl
+          - const: nvidia,tegra124-flowctrl
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    flow-controller@60007000 {
+        compatible = "nvidia,tegra20-flowctrl";
+        reg = <0x60007000 0x1000>;
+    };
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 2/3] dt-bindings: arm: tegra: ahb: Convert to json-schema
  2023-07-05 15:52 [PATCH v2 1/3] dt-bindings: arm: tegra: flowctrl: Convert to json-schema Thierry Reding
@ 2023-07-05 15:52 ` Thierry Reding
  2023-07-05 20:48   ` Rob Herring
  2023-07-05 15:52 ` [PATCH v2 3/3] dt-bindings: arm: tegra: nvec: " Thierry Reding
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Thierry Reding @ 2023-07-05 15:52 UTC (permalink / raw)
  To: Thierry Reding, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Jon Hunter, devicetree, linux-tegra

From: Thierry Reding <treding@nvidia.com>

Convert the NVIDIA Tegra AHB bindings from the free-form text format to
json-schema.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
Changes in v2:
- collate all single entry compatibles into an enum
- use 4 spaces for indentation in example
- move to soc/tegra directory

 .../bindings/arm/tegra/nvidia,tegra20-ahb.txt | 17 --------
 .../soc/tegra/nvidia,tegra20-ahb.yaml         | 40 +++++++++++++++++++
 2 files changed, 40 insertions(+), 17 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-ahb.txt
 create mode 100644 Documentation/devicetree/bindings/soc/tegra/nvidia,tegra20-ahb.yaml

diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-ahb.txt b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-ahb.txt
deleted file mode 100644
index 9a4295b54539..000000000000
--- a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-ahb.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-NVIDIA Tegra AHB
-
-Required properties:
-- compatible : For Tegra20, must contain "nvidia,tegra20-ahb".  For
-  Tegra30, must contain "nvidia,tegra30-ahb".  Otherwise, must contain
-  '"nvidia,<chip>-ahb", "nvidia,tegra30-ahb"' where <chip> is tegra124,
-  tegra132, or tegra210.
-- reg : Should contain 1 register ranges(address and length).  For
-  Tegra20, Tegra30, and Tegra114 chips, the value must be <0x6000c004
-  0x10c>.  For Tegra124, Tegra132 and Tegra210 chips, the value should
-  be be <0x6000c000 0x150>.
-
-Example (for a Tegra20 chip):
-	ahb: ahb@6000c004 {
-		compatible = "nvidia,tegra20-ahb";
-		reg = <0x6000c004 0x10c>; /* AHB Arbitration + Gizmo Controller */
-	};
diff --git a/Documentation/devicetree/bindings/soc/tegra/nvidia,tegra20-ahb.yaml b/Documentation/devicetree/bindings/soc/tegra/nvidia,tegra20-ahb.yaml
new file mode 100644
index 000000000000..2f7269a26b8e
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/tegra/nvidia,tegra20-ahb.yaml
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/tegra/nvidia,tegra20-ahb.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+maintainers:
+  - Thierry Reding <thierry.reding@gmail.com>
+  - Jon Hunter <jonathanh@nvidia.com>
+
+title: NVIDIA Tegra AHB
+
+properties:
+  compatible:
+    oneOf:
+      - enum:
+          - nvidia,tegra20-ahb
+          - nvidia,tegra30-ahb
+      - items:
+          - enum:
+              - nvidia,tegra114-ahb
+              - nvidia,tegra124-ahb
+              - nvidia,tegra210-ahb
+          - const: nvidia,tegra30-ahb
+
+  reg:
+    maxItems: 1
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    ahb@6000c004 {
+        compatible = "nvidia,tegra20-ahb";
+        reg = <0x6000c004 0x10c>; /* AHB Arbitration + Gizmo Controller */
+    };
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 3/3] dt-bindings: arm: tegra: nvec: Convert to json-schema
  2023-07-05 15:52 [PATCH v2 1/3] dt-bindings: arm: tegra: flowctrl: Convert to json-schema Thierry Reding
  2023-07-05 15:52 ` [PATCH v2 2/3] dt-bindings: arm: tegra: ahb: " Thierry Reding
@ 2023-07-05 15:52 ` Thierry Reding
  2023-07-05 20:50   ` Rob Herring
  2023-07-05 20:47 ` [PATCH v2 1/3] dt-bindings: arm: tegra: flowctrl: " Rob Herring
  2023-07-21 12:41 ` (subset) " Thierry Reding
  3 siblings, 1 reply; 9+ messages in thread
From: Thierry Reding @ 2023-07-05 15:52 UTC (permalink / raw)
  To: Thierry Reding, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Jon Hunter, devicetree, linux-tegra, Marc Dietrich

From: Thierry Reding <treding@nvidia.com>

Convert the NVIDIA embedded controller bindings from the free-form text
format to json-schema.

Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
Changes in v2:
- drop $ref for standard clock-frequency property
- use 4 spaces for indentation in example
- move to soc/tegra directory

 .../bindings/arm/tegra/nvidia,nvec.txt        | 21 -----
 .../bindings/soc/tegra/nvidia,nvec.yaml       | 92 +++++++++++++++++++
 2 files changed, 92 insertions(+), 21 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,nvec.txt
 create mode 100644 Documentation/devicetree/bindings/soc/tegra/nvidia,nvec.yaml

diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,nvec.txt b/Documentation/devicetree/bindings/arm/tegra/nvidia,nvec.txt
deleted file mode 100644
index 5ae601e7f51f..000000000000
--- a/Documentation/devicetree/bindings/arm/tegra/nvidia,nvec.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-NVIDIA compliant embedded controller
-
-Required properties:
-- compatible : should be "nvidia,nvec".
-- reg : the iomem of the i2c slave controller
-- interrupts : the interrupt line of the i2c slave controller
-- clock-frequency : the frequency of the i2c bus
-- gpios : the gpio used for ec request
-- slave-addr: the i2c address of the slave controller
-- clocks : Must contain an entry for each entry in clock-names.
-  See ../clocks/clock-bindings.txt for details.
-- clock-names : Must include the following entries:
-  Tegra20/Tegra30:
-  - div-clk
-  - fast-clk
-  Tegra114:
-  - div-clk
-- resets : Must contain an entry for each entry in reset-names.
-  See ../reset/reset.txt for details.
-- reset-names : Must include the following entries:
-  - i2c
diff --git a/Documentation/devicetree/bindings/soc/tegra/nvidia,nvec.yaml b/Documentation/devicetree/bindings/soc/tegra/nvidia,nvec.yaml
new file mode 100644
index 000000000000..0b4f898b2a1d
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/tegra/nvidia,nvec.yaml
@@ -0,0 +1,92 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/tegra/nvidia,nvec.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NVIDIA compliant embedded controller
+
+maintainers:
+  - Thierry Reding <thierry.reding@gmail.com>
+  - Jon Hunter <jonathanh@nvidia.com>
+
+properties:
+  compatible:
+    const: nvidia,nvec
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    minItems: 1
+    items:
+      - description: divider clock
+      - description: fast clock
+
+  clock-names:
+    minItems: 1
+    items:
+      - const: div-clk
+      - const: fast-clk
+
+  resets:
+    items:
+      - description: module reset
+
+  reset-names:
+    items:
+      - const: i2c
+
+  clock-frequency: true
+
+  request-gpios:
+    description: phandle to the GPIO used for EC request
+
+  slave-addr:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: I2C address of the slave controller
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - resets
+  - reset-names
+  - clock-frequency
+  - request-gpios
+  - slave-addr
+
+examples:
+  - |
+    #include <dt-bindings/clock/tegra20-car.h>
+    #include <dt-bindings/gpio/tegra-gpio.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    nvec@7000c500 {
+        compatible = "nvidia,nvec";
+        reg = <0x7000c500 0x100>;
+        interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>;
+        #address-cells = <1>;
+        #size-cells = <0>;
+        clock-frequency = <80000>;
+        request-gpios = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_HIGH>;
+        slave-addr = <138>;
+        clocks = <&tegra_car TEGRA20_CLK_I2C3>,
+                 <&tegra_car TEGRA20_CLK_PLL_P_OUT3>;
+        clock-names = "div-clk", "fast-clk";
+        resets = <&tegra_car 67>;
+        reset-names = "i2c";
+    };
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 1/3] dt-bindings: arm: tegra: flowctrl: Convert to json-schema
  2023-07-05 15:52 [PATCH v2 1/3] dt-bindings: arm: tegra: flowctrl: Convert to json-schema Thierry Reding
  2023-07-05 15:52 ` [PATCH v2 2/3] dt-bindings: arm: tegra: ahb: " Thierry Reding
  2023-07-05 15:52 ` [PATCH v2 3/3] dt-bindings: arm: tegra: nvec: " Thierry Reding
@ 2023-07-05 20:47 ` Rob Herring
  2023-07-21 12:41 ` (subset) " Thierry Reding
  3 siblings, 0 replies; 9+ messages in thread
From: Rob Herring @ 2023-07-05 20:47 UTC (permalink / raw)
  To: Thierry Reding
  Cc: linux-tegra, Conor Dooley, devicetree, Krzysztof Kozlowski,
	Jon Hunter, Rob Herring


On Wed, 05 Jul 2023 17:52:20 +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> Convert the Tegra flow controller bindings from the free-form text
> format to json-schema.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
> Changes in v2:
> - move to soc/tegra directory (Krzysztof)
> 
>  .../arm/tegra/nvidia,tegra20-flowctrl.txt     | 18 --------
>  .../soc/tegra/nvidia,tegra20-flowctrl.yaml    | 41 +++++++++++++++++++
>  2 files changed, 41 insertions(+), 18 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-flowctrl.txt
>  create mode 100644 Documentation/devicetree/bindings/soc/tegra/nvidia,tegra20-flowctrl.yaml
> 

Reviewed-by: Rob Herring <robh@kernel.org>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 2/3] dt-bindings: arm: tegra: ahb: Convert to json-schema
  2023-07-05 15:52 ` [PATCH v2 2/3] dt-bindings: arm: tegra: ahb: " Thierry Reding
@ 2023-07-05 20:48   ` Rob Herring
  0 siblings, 0 replies; 9+ messages in thread
From: Rob Herring @ 2023-07-05 20:48 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Rob Herring, devicetree, Krzysztof Kozlowski, Jon Hunter,
	Conor Dooley, linux-tegra


On Wed, 05 Jul 2023 17:52:21 +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> Convert the NVIDIA Tegra AHB bindings from the free-form text format to
> json-schema.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
> Changes in v2:
> - collate all single entry compatibles into an enum
> - use 4 spaces for indentation in example
> - move to soc/tegra directory
> 
>  .../bindings/arm/tegra/nvidia,tegra20-ahb.txt | 17 --------
>  .../soc/tegra/nvidia,tegra20-ahb.yaml         | 40 +++++++++++++++++++
>  2 files changed, 40 insertions(+), 17 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-ahb.txt
>  create mode 100644 Documentation/devicetree/bindings/soc/tegra/nvidia,tegra20-ahb.yaml
> 

Reviewed-by: Rob Herring <robh@kernel.org>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 3/3] dt-bindings: arm: tegra: nvec: Convert to json-schema
  2023-07-05 15:52 ` [PATCH v2 3/3] dt-bindings: arm: tegra: nvec: " Thierry Reding
@ 2023-07-05 20:50   ` Rob Herring
  2023-07-06 13:39     ` Thierry Reding
  0 siblings, 1 reply; 9+ messages in thread
From: Rob Herring @ 2023-07-05 20:50 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Krzysztof Kozlowski, Conor Dooley, Jon Hunter, devicetree,
	linux-tegra, Marc Dietrich

On Wed, Jul 05, 2023 at 05:52:22PM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> Convert the NVIDIA embedded controller bindings from the free-form text
> format to json-schema.
> 
> Acked-by: Marc Dietrich <marvin24@gmx.de>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
> Changes in v2:
> - drop $ref for standard clock-frequency property
> - use 4 spaces for indentation in example
> - move to soc/tegra directory
> 
>  .../bindings/arm/tegra/nvidia,nvec.txt        | 21 -----
>  .../bindings/soc/tegra/nvidia,nvec.yaml       | 92 +++++++++++++++++++
>  2 files changed, 92 insertions(+), 21 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,nvec.txt
>  create mode 100644 Documentation/devicetree/bindings/soc/tegra/nvidia,nvec.yaml
> 
> diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,nvec.txt b/Documentation/devicetree/bindings/arm/tegra/nvidia,nvec.txt
> deleted file mode 100644
> index 5ae601e7f51f..000000000000
> --- a/Documentation/devicetree/bindings/arm/tegra/nvidia,nvec.txt
> +++ /dev/null
> @@ -1,21 +0,0 @@
> -NVIDIA compliant embedded controller
> -
> -Required properties:
> -- compatible : should be "nvidia,nvec".
> -- reg : the iomem of the i2c slave controller
> -- interrupts : the interrupt line of the i2c slave controller
> -- clock-frequency : the frequency of the i2c bus
> -- gpios : the gpio used for ec request
> -- slave-addr: the i2c address of the slave controller
> -- clocks : Must contain an entry for each entry in clock-names.
> -  See ../clocks/clock-bindings.txt for details.
> -- clock-names : Must include the following entries:
> -  Tegra20/Tegra30:
> -  - div-clk
> -  - fast-clk
> -  Tegra114:
> -  - div-clk
> -- resets : Must contain an entry for each entry in reset-names.
> -  See ../reset/reset.txt for details.
> -- reset-names : Must include the following entries:
> -  - i2c
> diff --git a/Documentation/devicetree/bindings/soc/tegra/nvidia,nvec.yaml b/Documentation/devicetree/bindings/soc/tegra/nvidia,nvec.yaml
> new file mode 100644
> index 000000000000..0b4f898b2a1d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/soc/tegra/nvidia,nvec.yaml
> @@ -0,0 +1,92 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/soc/tegra/nvidia,nvec.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: NVIDIA compliant embedded controller
> +
> +maintainers:
> +  - Thierry Reding <thierry.reding@gmail.com>
> +  - Jon Hunter <jonathanh@nvidia.com>
> +
> +properties:
> +  compatible:
> +    const: nvidia,nvec
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  clocks:
> +    minItems: 1
> +    items:
> +      - description: divider clock
> +      - description: fast clock
> +
> +  clock-names:
> +    minItems: 1
> +    items:
> +      - const: div-clk
> +      - const: fast-clk
> +
> +  resets:
> +    items:
> +      - description: module reset
> +
> +  reset-names:
> +    items:
> +      - const: i2c
> +
> +  clock-frequency: true
> +
> +  request-gpios:
> +    description: phandle to the GPIO used for EC request
> +
> +  slave-addr:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description: I2C address of the slave controller
> +
> +  "#address-cells":
> +    const: 1
> +
> +  "#size-cells":
> +    const: 0

You don't have any child nodes defined, so these 2 properties are 
pointless.

> +
> +additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - clocks
> +  - clock-names
> +  - resets
> +  - reset-names
> +  - clock-frequency
> +  - request-gpios
> +  - slave-addr
> +
> +examples:
> +  - |
> +    #include <dt-bindings/clock/tegra20-car.h>
> +    #include <dt-bindings/gpio/tegra-gpio.h>
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> +    nvec@7000c500 {
> +        compatible = "nvidia,nvec";
> +        reg = <0x7000c500 0x100>;
> +        interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>;
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        clock-frequency = <80000>;
> +        request-gpios = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_HIGH>;
> +        slave-addr = <138>;
> +        clocks = <&tegra_car TEGRA20_CLK_I2C3>,
> +                 <&tegra_car TEGRA20_CLK_PLL_P_OUT3>;
> +        clock-names = "div-clk", "fast-clk";
> +        resets = <&tegra_car 67>;
> +        reset-names = "i2c";
> +    };
> -- 
> 2.41.0
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 3/3] dt-bindings: arm: tegra: nvec: Convert to json-schema
  2023-07-05 20:50   ` Rob Herring
@ 2023-07-06 13:39     ` Thierry Reding
  2023-07-09 17:19       ` Marc Dietrich
  0 siblings, 1 reply; 9+ messages in thread
From: Thierry Reding @ 2023-07-06 13:39 UTC (permalink / raw)
  To: Rob Herring, Marc Dietrich
  Cc: Krzysztof Kozlowski, Conor Dooley, Jon Hunter, devicetree, linux-tegra

[-- Attachment #1: Type: text/plain, Size: 5627 bytes --]

On Wed, Jul 05, 2023 at 02:50:13PM -0600, Rob Herring wrote:
> On Wed, Jul 05, 2023 at 05:52:22PM +0200, Thierry Reding wrote:
> > From: Thierry Reding <treding@nvidia.com>
> > 
> > Convert the NVIDIA embedded controller bindings from the free-form text
> > format to json-schema.
> > 
> > Acked-by: Marc Dietrich <marvin24@gmx.de>
> > Signed-off-by: Thierry Reding <treding@nvidia.com>
> > ---
> > Changes in v2:
> > - drop $ref for standard clock-frequency property
> > - use 4 spaces for indentation in example
> > - move to soc/tegra directory
> > 
> >  .../bindings/arm/tegra/nvidia,nvec.txt        | 21 -----
> >  .../bindings/soc/tegra/nvidia,nvec.yaml       | 92 +++++++++++++++++++
> >  2 files changed, 92 insertions(+), 21 deletions(-)
> >  delete mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,nvec.txt
> >  create mode 100644 Documentation/devicetree/bindings/soc/tegra/nvidia,nvec.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,nvec.txt b/Documentation/devicetree/bindings/arm/tegra/nvidia,nvec.txt
> > deleted file mode 100644
> > index 5ae601e7f51f..000000000000
> > --- a/Documentation/devicetree/bindings/arm/tegra/nvidia,nvec.txt
> > +++ /dev/null
> > @@ -1,21 +0,0 @@
> > -NVIDIA compliant embedded controller
> > -
> > -Required properties:
> > -- compatible : should be "nvidia,nvec".
> > -- reg : the iomem of the i2c slave controller
> > -- interrupts : the interrupt line of the i2c slave controller
> > -- clock-frequency : the frequency of the i2c bus
> > -- gpios : the gpio used for ec request
> > -- slave-addr: the i2c address of the slave controller
> > -- clocks : Must contain an entry for each entry in clock-names.
> > -  See ../clocks/clock-bindings.txt for details.
> > -- clock-names : Must include the following entries:
> > -  Tegra20/Tegra30:
> > -  - div-clk
> > -  - fast-clk
> > -  Tegra114:
> > -  - div-clk
> > -- resets : Must contain an entry for each entry in reset-names.
> > -  See ../reset/reset.txt for details.
> > -- reset-names : Must include the following entries:
> > -  - i2c
> > diff --git a/Documentation/devicetree/bindings/soc/tegra/nvidia,nvec.yaml b/Documentation/devicetree/bindings/soc/tegra/nvidia,nvec.yaml
> > new file mode 100644
> > index 000000000000..0b4f898b2a1d
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/soc/tegra/nvidia,nvec.yaml
> > @@ -0,0 +1,92 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/soc/tegra/nvidia,nvec.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: NVIDIA compliant embedded controller
> > +
> > +maintainers:
> > +  - Thierry Reding <thierry.reding@gmail.com>
> > +  - Jon Hunter <jonathanh@nvidia.com>
> > +
> > +properties:
> > +  compatible:
> > +    const: nvidia,nvec
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  interrupts:
> > +    maxItems: 1
> > +
> > +  clocks:
> > +    minItems: 1
> > +    items:
> > +      - description: divider clock
> > +      - description: fast clock
> > +
> > +  clock-names:
> > +    minItems: 1
> > +    items:
> > +      - const: div-clk
> > +      - const: fast-clk
> > +
> > +  resets:
> > +    items:
> > +      - description: module reset
> > +
> > +  reset-names:
> > +    items:
> > +      - const: i2c
> > +
> > +  clock-frequency: true
> > +
> > +  request-gpios:
> > +    description: phandle to the GPIO used for EC request
> > +
> > +  slave-addr:
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> > +    description: I2C address of the slave controller
> > +
> > +  "#address-cells":
> > +    const: 1
> > +
> > +  "#size-cells":
> > +    const: 0
> 
> You don't have any child nodes defined, so these 2 properties are 
> pointless.

Good point. Looking at this a bit more, I think perhaps we should also
rename the node representing this to i2c@7000c500 because this is really
only a repurposed I2C controller, which is probably also where these
stray #address-cells and #size-cells come from.

In DT we basically duplicate i2c@7000c500 and nvec@7000c500, but we can
probably also reuse most of i2c@7000c500 and just drop some things that
NVEC can't use (such as dmas and dma-names) and add the slave specific
bits (such as clock-frequency, slave-addr and request-gpios).

Marc, any thoughts?

Thierry

> 
> > +
> > +additionalProperties: false
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - interrupts
> > +  - clocks
> > +  - clock-names
> > +  - resets
> > +  - reset-names
> > +  - clock-frequency
> > +  - request-gpios
> > +  - slave-addr
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/clock/tegra20-car.h>
> > +    #include <dt-bindings/gpio/tegra-gpio.h>
> > +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> > +
> > +    nvec@7000c500 {
> > +        compatible = "nvidia,nvec";
> > +        reg = <0x7000c500 0x100>;
> > +        interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>;
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +        clock-frequency = <80000>;
> > +        request-gpios = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_HIGH>;
> > +        slave-addr = <138>;
> > +        clocks = <&tegra_car TEGRA20_CLK_I2C3>,
> > +                 <&tegra_car TEGRA20_CLK_PLL_P_OUT3>;
> > +        clock-names = "div-clk", "fast-clk";
> > +        resets = <&tegra_car 67>;
> > +        reset-names = "i2c";
> > +    };
> > -- 
> > 2.41.0
> > 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 3/3] dt-bindings: arm: tegra: nvec: Convert to json-schema
  2023-07-06 13:39     ` Thierry Reding
@ 2023-07-09 17:19       ` Marc Dietrich
  0 siblings, 0 replies; 9+ messages in thread
From: Marc Dietrich @ 2023-07-09 17:19 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Rob Herring, Marc Dietrich, Krzysztof Kozlowski, Conor Dooley,
	Jon Hunter, devicetree, linux-tegra

Hi Thierry,

On Thu, 6 Jul 2023, Thierry Reding wrote:

> On Wed, Jul 05, 2023 at 02:50:13PM -0600, Rob Herring wrote:
>> On Wed, Jul 05, 2023 at 05:52:22PM +0200, Thierry Reding wrote:
>>> From: Thierry Reding <treding@nvidia.com>
>>>
>>> Convert the NVIDIA embedded controller bindings from the free-form text
>>> format to json-schema.
>>>
>>> Acked-by: Marc Dietrich <marvin24@gmx.de>
>>> Signed-off-by: Thierry Reding <treding@nvidia.com>
>>> ---
>>> Changes in v2:
>>> - drop $ref for standard clock-frequency property
>>> - use 4 spaces for indentation in example
>>> - move to soc/tegra directory
>>>
>>>  .../bindings/arm/tegra/nvidia,nvec.txt        | 21 -----
>>>  .../bindings/soc/tegra/nvidia,nvec.yaml       | 92 +++++++++++++++++++
>>>  2 files changed, 92 insertions(+), 21 deletions(-)
>>>  delete mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,nvec.txt
>>>  create mode 100644 Documentation/devicetree/bindings/soc/tegra/nvidia,nvec.yaml
>>>
>>> diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,nvec.txt b/Documentation/devicetree/bindings/arm/tegra/nvidia,nvec.txt
>>> deleted file mode 100644
>>> index 5ae601e7f51f..000000000000
>>> --- a/Documentation/devicetree/bindings/arm/tegra/nvidia,nvec.txt
>>> +++ /dev/null
>>> @@ -1,21 +0,0 @@
>>> -NVIDIA compliant embedded controller
>>> -
>>> -Required properties:
>>> -- compatible : should be "nvidia,nvec".
>>> -- reg : the iomem of the i2c slave controller
>>> -- interrupts : the interrupt line of the i2c slave controller
>>> -- clock-frequency : the frequency of the i2c bus
>>> -- gpios : the gpio used for ec request
>>> -- slave-addr: the i2c address of the slave controller
>>> -- clocks : Must contain an entry for each entry in clock-names.
>>> -  See ../clocks/clock-bindings.txt for details.
>>> -- clock-names : Must include the following entries:
>>> -  Tegra20/Tegra30:
>>> -  - div-clk
>>> -  - fast-clk
>>> -  Tegra114:
>>> -  - div-clk
>>> -- resets : Must contain an entry for each entry in reset-names.
>>> -  See ../reset/reset.txt for details.
>>> -- reset-names : Must include the following entries:
>>> -  - i2c
>>> diff --git a/Documentation/devicetree/bindings/soc/tegra/nvidia,nvec.yaml b/Documentation/devicetree/bindings/soc/tegra/nvidia,nvec.yaml
>>> new file mode 100644
>>> index 000000000000..0b4f898b2a1d
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/soc/tegra/nvidia,nvec.yaml
>>> @@ -0,0 +1,92 @@
>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>> +%YAML 1.2
>>> +---
>>> +$id: http://devicetree.org/schemas/soc/tegra/nvidia,nvec.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: NVIDIA compliant embedded controller
>>> +
>>> +maintainers:
>>> +  - Thierry Reding <thierry.reding@gmail.com>
>>> +  - Jon Hunter <jonathanh@nvidia.com>
>>> +
>>> +properties:
>>> +  compatible:
>>> +    const: nvidia,nvec
>>> +
>>> +  reg:
>>> +    maxItems: 1
>>> +
>>> +  interrupts:
>>> +    maxItems: 1
>>> +
>>> +  clocks:
>>> +    minItems: 1
>>> +    items:
>>> +      - description: divider clock
>>> +      - description: fast clock
>>> +
>>> +  clock-names:
>>> +    minItems: 1
>>> +    items:
>>> +      - const: div-clk
>>> +      - const: fast-clk
>>> +
>>> +  resets:
>>> +    items:
>>> +      - description: module reset
>>> +
>>> +  reset-names:
>>> +    items:
>>> +      - const: i2c
>>> +
>>> +  clock-frequency: true
>>> +
>>> +  request-gpios:
>>> +    description: phandle to the GPIO used for EC request
>>> +
>>> +  slave-addr:
>>> +    $ref: /schemas/types.yaml#/definitions/uint32
>>> +    description: I2C address of the slave controller
>>> +
>>> +  "#address-cells":
>>> +    const: 1
>>> +
>>> +  "#size-cells":
>>> +    const: 0
>>
>> You don't have any child nodes defined, so these 2 properties are
>> pointless.
>
> Good point. Looking at this a bit more, I think perhaps we should also
> rename the node representing this to i2c@7000c500 because this is really
> only a repurposed I2C controller, which is probably also where these
> stray #address-cells and #size-cells come from.
>
> In DT we basically duplicate i2c@7000c500 and nvec@7000c500, but we can
> probably also reuse most of i2c@7000c500 and just drop some things that
> NVEC can't use (such as dmas and dma-names) and add the slave specific
> bits (such as clock-frequency, slave-addr and request-gpios).
>
> Marc, any thoughts?

the idea was indeed to convert the driver to the i2c-slave sub-sys and add
the EC sub-functions (keyboard, mouse, power, ...) as children below the
controllers node, which are currently hard-coded. As this didn't happen 
yet these entries could be removed for now.
Using i2c instead of nvec as the node name also makes sense, because that
is the real hardware described by the following properties. On the other 
hand, I'm not sure if it is worth the effort (u-boot would also need this 
change).

Best regards,

Marc

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: (subset) [PATCH v2 1/3] dt-bindings: arm: tegra: flowctrl: Convert to json-schema
  2023-07-05 15:52 [PATCH v2 1/3] dt-bindings: arm: tegra: flowctrl: Convert to json-schema Thierry Reding
                   ` (2 preceding siblings ...)
  2023-07-05 20:47 ` [PATCH v2 1/3] dt-bindings: arm: tegra: flowctrl: " Rob Herring
@ 2023-07-21 12:41 ` Thierry Reding
  3 siblings, 0 replies; 9+ messages in thread
From: Thierry Reding @ 2023-07-21 12:41 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Thierry Reding
  Cc: Jon Hunter, devicetree, linux-tegra

From: Thierry Reding <treding@nvidia.com>


On Wed, 05 Jul 2023 17:52:20 +0200, Thierry Reding wrote:
> Convert the Tegra flow controller bindings from the free-form text
> format to json-schema.
> 
> 

Applied, thanks!

[1/3] dt-bindings: arm: tegra: flowctrl: Convert to json-schema
      commit: 41b97d0c7b467f9db89d4075e9ce8b8a49c65e46
[2/3] dt-bindings: arm: tegra: ahb: Convert to json-schema
      commit: e94c92f886df319bc5388f0bdd1ed4df0aa00b6f

Best regards,
-- 
Thierry Reding <treding@nvidia.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-07-21 12:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-05 15:52 [PATCH v2 1/3] dt-bindings: arm: tegra: flowctrl: Convert to json-schema Thierry Reding
2023-07-05 15:52 ` [PATCH v2 2/3] dt-bindings: arm: tegra: ahb: " Thierry Reding
2023-07-05 20:48   ` Rob Herring
2023-07-05 15:52 ` [PATCH v2 3/3] dt-bindings: arm: tegra: nvec: " Thierry Reding
2023-07-05 20:50   ` Rob Herring
2023-07-06 13:39     ` Thierry Reding
2023-07-09 17:19       ` Marc Dietrich
2023-07-05 20:47 ` [PATCH v2 1/3] dt-bindings: arm: tegra: flowctrl: " Rob Herring
2023-07-21 12:41 ` (subset) " Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).