All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv3 0/2] Convert TI dmtimer binding to yaml
@ 2022-04-12 13:16 ` Tony Lindgren
  0 siblings, 0 replies; 16+ messages in thread
From: Tony Lindgren @ 2022-04-12 13:16 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-arm-kernel, linux-omap, Daniel Lezcano,
	Keerthy, Krzysztof Kozlowski, Nishanth Menon,
	Vignesh Raghavendra

Hi all,

Here's v3 changes for TI dmtimer changes.

Regards,

Tony


Changes since v1:

- Improve yaml for various checks based on comments from Krzysztof
  and Nishanth

- Add checks for am4 timer as pointed out by Krzysztof and Rob

- Split am6 additions into a separate patch as suggested by Krzysztof

Changes since v2:

- Improve yaml for more checks based on comments from Grygorii and
  Krzysztof


Tony Lindgren (2):
  dt-bindings: timer: Update TI timer to yaml
  dt-bindings: timer: Add compatible for am6 for TI timer-dm

 .../bindings/pwm/pwm-omap-dmtimer.txt         |   2 +-
 .../bindings/timer/ti,timer-dm.yaml           | 171 ++++++++++++++++++
 .../devicetree/bindings/timer/ti,timer.txt    |  44 -----
 3 files changed, 172 insertions(+), 45 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/timer/ti,timer-dm.yaml
 delete mode 100644 Documentation/devicetree/bindings/timer/ti,timer.txt

-- 
2.35.1

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCHv3 0/2] Convert TI dmtimer binding to yaml
@ 2022-04-12 13:16 ` Tony Lindgren
  0 siblings, 0 replies; 16+ messages in thread
From: Tony Lindgren @ 2022-04-12 13:16 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-arm-kernel, linux-omap, Daniel Lezcano,
	Keerthy, Krzysztof Kozlowski, Nishanth Menon,
	Vignesh Raghavendra

Hi all,

Here's v3 changes for TI dmtimer changes.

Regards,

Tony


Changes since v1:

- Improve yaml for various checks based on comments from Krzysztof
  and Nishanth

- Add checks for am4 timer as pointed out by Krzysztof and Rob

- Split am6 additions into a separate patch as suggested by Krzysztof

Changes since v2:

- Improve yaml for more checks based on comments from Grygorii and
  Krzysztof


Tony Lindgren (2):
  dt-bindings: timer: Update TI timer to yaml
  dt-bindings: timer: Add compatible for am6 for TI timer-dm

 .../bindings/pwm/pwm-omap-dmtimer.txt         |   2 +-
 .../bindings/timer/ti,timer-dm.yaml           | 171 ++++++++++++++++++
 .../devicetree/bindings/timer/ti,timer.txt    |  44 -----
 3 files changed, 172 insertions(+), 45 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/timer/ti,timer-dm.yaml
 delete mode 100644 Documentation/devicetree/bindings/timer/ti,timer.txt

-- 
2.35.1

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

* [PATCH 1/2] dt-bindings: timer: Update TI timer to yaml
  2022-04-12 13:16 ` Tony Lindgren
@ 2022-04-12 13:16   ` Tony Lindgren
  -1 siblings, 0 replies; 16+ messages in thread
From: Tony Lindgren @ 2022-04-12 13:16 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-arm-kernel, linux-omap, Daniel Lezcano,
	Keerthy, Nishanth Menon, Vignesh Raghavendra,
	Krzysztof Kozlowski

Let's update the TI timer binding to use yaml. As this binding is specific
to the TI dual-mode timers also known as dm-timers, let's use file name
ti,timer-dm.yaml to avoid confusion with other timers.

We also correct the issue with the old binding that was out of date for
several properties.

The am43 related timers are undocumented, but compatible with the am3
timers. Let's add the am43 timers too.

The dm814 and dm816 timers are missing, let's add them.

Some timers on some SoCs are dual mapped, like the ABE timers on omap4
and 5. The reg property maxItems must be updated to 2.

The timer clocks can be managed by the parent interconnect target module
with no clocks assigned for the timer node. And in some cases the SoC may
need to configure additional clocks for the timer in addition to the
functional clock.

The clock names are optional and not specific to the comptible property.
For example, dra7 timers on l3 interconnect do not need clock-names,while
the timers on dra7 l4 interconnect need them with both being compatible
with ti,omap5430-timer.

Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Keerthy <j-keerthy@ti.com>
Cc: Nishanth Menon <nm@ti.com>
Cc: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 .../bindings/pwm/pwm-omap-dmtimer.txt         |   2 +-
 .../bindings/timer/ti,timer-dm.yaml           | 161 ++++++++++++++++++
 .../devicetree/bindings/timer/ti,timer.txt    |  44 -----
 3 files changed, 162 insertions(+), 45 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/timer/ti,timer-dm.yaml
 delete mode 100644 Documentation/devicetree/bindings/timer/ti,timer.txt

diff --git a/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt b/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
--- a/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
+++ b/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
@@ -2,7 +2,7 @@
 
 Required properties:
 - compatible: Shall contain "ti,omap-dmtimer-pwm".
-- ti,timers: phandle to PWM capable OMAP timer. See timer/ti,timer.txt for info
+- ti,timers: phandle to PWM capable OMAP timer. See timer/ti,timer-dm.yaml for info
   about these timers.
 - #pwm-cells: Should be 3. See pwm.yaml in this directory for a description of
   the cells format.
diff --git a/Documentation/devicetree/bindings/timer/ti,timer-dm.yaml b/Documentation/devicetree/bindings/timer/ti,timer-dm.yaml
new file mode 100644
--- /dev/null
+++ b/Documentation/devicetree/bindings/timer/ti,timer-dm.yaml
@@ -0,0 +1,161 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/timer/ti,timer-dm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TI dual-mode timer
+
+maintainers:
+  - Tony Lindgren <tony@atomide.com>
+
+description: |
+  The TI dual-mode timer is a general purpose timer with PWM capabilities.
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - ti,am335x-timer
+              - ti,am335x-timer-1ms
+              - ti,dm814-timer
+              - ti,dm816-timer
+              - ti,omap2420-timer
+              - ti,omap3430-timer
+              - ti,omap4430-timer
+              - ti,omap5430-timer
+      - items:
+          - const: ti,am4372-timer
+          - const: ti,am335x-timer
+      - items:
+          - const: ti,am4372-timer-1ms
+          - const: ti,am335x-timer-1ms
+
+  reg:
+    minItems: 1
+    maxItems: 2
+
+  clocks:
+    minItems: 1
+    maxItems: 2
+
+  clock-names:
+    minItems: 1
+    maxItems: 2
+
+  interrupts:
+    description:
+      Interrupt if available. The timer PWM features may be usable
+      in a limited way even without interrupts.
+    maxItems: 1
+
+  ti,timer-alwon:
+    description:
+      Timer is always enabled when the SoC is powered. Note that some SoCs like
+      am335x can suspend to PM coprocessor RTC only mode and in that case the
+      SoC power is cut including timers.
+    type: boolean
+
+  ti,timer-dsp:
+    description:
+      Timer is routable to the DSP in addition to the operating system.
+    type: boolean
+
+  ti,timer-pwm:
+    description:
+      Timer has been wired for PWM capability.
+    type: boolean
+
+  ti,timer-secure:
+    description:
+      Timer access has been limited to secure mode only.
+    type: boolean
+
+  ti,hwmods:
+    description:
+      Name of the HWMOD associated with timer. This is for legacy
+      omap2/3 platforms only.
+    $ref: /schemas/types.yaml#/definitions/string
+    deprecated: true
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+additionalProperties: false
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - ti,omap3430-timer
+              - ti,omap4430-timer
+              - ti,omap5430-timer
+    then:
+      properties:
+        reg:
+          oneOf:
+            - items:
+                - description: IO address
+            - items:
+                - description: CPU to L4 ABE IO address
+                - description: L3 to L4 ABE IO address
+        clocks:
+          oneOf:
+            - items:
+                - description: Functional clock
+            - items:
+                - description: Functional clock
+                - description: System clock
+        clock-names:
+          oneOf:
+            - items:
+                - const: fck
+            - items:
+                - const: fck
+                - const: timer_sys_ck
+    else:
+      properties:
+        reg:
+          items:
+            - description: IO address
+        clocks:
+          items:
+            - description: Functional clock
+        clock-names:
+          items:
+            - const: fck
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - ti,dm814-timer
+              - ti,dm816-timer
+              - ti,omap2420-timer
+              - ti,omap3430-timer
+    then:
+      properties:
+        ti,hwmods:
+          items:
+            - pattern: "^timer([1-9]|1[0-2])$"
+    else:
+      properties:
+        ti,hwmods: false
+
+examples:
+  - |
+    timer1: timer@0 {
+      compatible = "ti,am335x-timer-1ms";
+      reg = <0x0 0x400>;
+      interrupts = <67>;
+      ti,timer-alwon;
+      clocks = <&timer1_fck>;
+      clock-names = "fck";
+    };
+...
diff --git a/Documentation/devicetree/bindings/timer/ti,timer.txt b/Documentation/devicetree/bindings/timer/ti,timer.txt
deleted file mode 100644
--- a/Documentation/devicetree/bindings/timer/ti,timer.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-OMAP Timer bindings
-
-Required properties:
-- compatible:		Should be set to one of the below. Please note that
-			OMAP44xx devices have timer instances that are 100%
-			register compatible with OMAP3xxx devices as well as
-			newer timers that are not 100% register compatible.
-			So for OMAP44xx devices timer instances may use
-			different compatible strings.
-
-			ti,omap2420-timer (applicable to OMAP24xx devices)
-			ti,omap3430-timer (applicable to OMAP3xxx/44xx devices)
-			ti,omap4430-timer (applicable to OMAP44xx devices)
-			ti,omap5430-timer (applicable to OMAP543x devices)
-			ti,am335x-timer	(applicable to AM335x devices)
-			ti,am335x-timer-1ms (applicable to AM335x devices)
-
-- reg:			Contains timer register address range (base address and
-			length).
-- interrupts: 		Contains the interrupt information for the timer. The
-			format is being dependent on which interrupt controller
-			the OMAP device uses.
-- ti,hwmods:		Name of the hwmod associated to the timer, "timer<X>",
-			where <X> is the instance number of the timer from the
-			HW spec.
-
-Optional properties:
-- ti,timer-alwon:	Indicates the timer is in an alway-on power domain.
-- ti,timer-dsp:		Indicates the timer can interrupt the on-chip DSP in
-			addition to the ARM CPU.
-- ti,timer-pwm: 	Indicates the timer can generate a PWM output.
-- ti,timer-secure: 	Indicates the timer is reserved on a secure OMAP device
-			and therefore cannot be used by the kernel.
-
-Example:
-
-timer12: timer@48304000 {
-	compatible = "ti,omap3430-timer";
-	reg = <0x48304000 0x400>;
-	interrupts = <95>;
-	ti,hwmods = "timer12"
-	ti,timer-alwon;
-	ti,timer-secure;
-};
-- 
2.35.1

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 1/2] dt-bindings: timer: Update TI timer to yaml
@ 2022-04-12 13:16   ` Tony Lindgren
  0 siblings, 0 replies; 16+ messages in thread
From: Tony Lindgren @ 2022-04-12 13:16 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-arm-kernel, linux-omap, Daniel Lezcano,
	Keerthy, Nishanth Menon, Vignesh Raghavendra,
	Krzysztof Kozlowski

Let's update the TI timer binding to use yaml. As this binding is specific
to the TI dual-mode timers also known as dm-timers, let's use file name
ti,timer-dm.yaml to avoid confusion with other timers.

We also correct the issue with the old binding that was out of date for
several properties.

The am43 related timers are undocumented, but compatible with the am3
timers. Let's add the am43 timers too.

The dm814 and dm816 timers are missing, let's add them.

Some timers on some SoCs are dual mapped, like the ABE timers on omap4
and 5. The reg property maxItems must be updated to 2.

The timer clocks can be managed by the parent interconnect target module
with no clocks assigned for the timer node. And in some cases the SoC may
need to configure additional clocks for the timer in addition to the
functional clock.

The clock names are optional and not specific to the comptible property.
For example, dra7 timers on l3 interconnect do not need clock-names,while
the timers on dra7 l4 interconnect need them with both being compatible
with ti,omap5430-timer.

Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Keerthy <j-keerthy@ti.com>
Cc: Nishanth Menon <nm@ti.com>
Cc: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 .../bindings/pwm/pwm-omap-dmtimer.txt         |   2 +-
 .../bindings/timer/ti,timer-dm.yaml           | 161 ++++++++++++++++++
 .../devicetree/bindings/timer/ti,timer.txt    |  44 -----
 3 files changed, 162 insertions(+), 45 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/timer/ti,timer-dm.yaml
 delete mode 100644 Documentation/devicetree/bindings/timer/ti,timer.txt

diff --git a/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt b/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
--- a/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
+++ b/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
@@ -2,7 +2,7 @@
 
 Required properties:
 - compatible: Shall contain "ti,omap-dmtimer-pwm".
-- ti,timers: phandle to PWM capable OMAP timer. See timer/ti,timer.txt for info
+- ti,timers: phandle to PWM capable OMAP timer. See timer/ti,timer-dm.yaml for info
   about these timers.
 - #pwm-cells: Should be 3. See pwm.yaml in this directory for a description of
   the cells format.
diff --git a/Documentation/devicetree/bindings/timer/ti,timer-dm.yaml b/Documentation/devicetree/bindings/timer/ti,timer-dm.yaml
new file mode 100644
--- /dev/null
+++ b/Documentation/devicetree/bindings/timer/ti,timer-dm.yaml
@@ -0,0 +1,161 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/timer/ti,timer-dm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TI dual-mode timer
+
+maintainers:
+  - Tony Lindgren <tony@atomide.com>
+
+description: |
+  The TI dual-mode timer is a general purpose timer with PWM capabilities.
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - ti,am335x-timer
+              - ti,am335x-timer-1ms
+              - ti,dm814-timer
+              - ti,dm816-timer
+              - ti,omap2420-timer
+              - ti,omap3430-timer
+              - ti,omap4430-timer
+              - ti,omap5430-timer
+      - items:
+          - const: ti,am4372-timer
+          - const: ti,am335x-timer
+      - items:
+          - const: ti,am4372-timer-1ms
+          - const: ti,am335x-timer-1ms
+
+  reg:
+    minItems: 1
+    maxItems: 2
+
+  clocks:
+    minItems: 1
+    maxItems: 2
+
+  clock-names:
+    minItems: 1
+    maxItems: 2
+
+  interrupts:
+    description:
+      Interrupt if available. The timer PWM features may be usable
+      in a limited way even without interrupts.
+    maxItems: 1
+
+  ti,timer-alwon:
+    description:
+      Timer is always enabled when the SoC is powered. Note that some SoCs like
+      am335x can suspend to PM coprocessor RTC only mode and in that case the
+      SoC power is cut including timers.
+    type: boolean
+
+  ti,timer-dsp:
+    description:
+      Timer is routable to the DSP in addition to the operating system.
+    type: boolean
+
+  ti,timer-pwm:
+    description:
+      Timer has been wired for PWM capability.
+    type: boolean
+
+  ti,timer-secure:
+    description:
+      Timer access has been limited to secure mode only.
+    type: boolean
+
+  ti,hwmods:
+    description:
+      Name of the HWMOD associated with timer. This is for legacy
+      omap2/3 platforms only.
+    $ref: /schemas/types.yaml#/definitions/string
+    deprecated: true
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+additionalProperties: false
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - ti,omap3430-timer
+              - ti,omap4430-timer
+              - ti,omap5430-timer
+    then:
+      properties:
+        reg:
+          oneOf:
+            - items:
+                - description: IO address
+            - items:
+                - description: CPU to L4 ABE IO address
+                - description: L3 to L4 ABE IO address
+        clocks:
+          oneOf:
+            - items:
+                - description: Functional clock
+            - items:
+                - description: Functional clock
+                - description: System clock
+        clock-names:
+          oneOf:
+            - items:
+                - const: fck
+            - items:
+                - const: fck
+                - const: timer_sys_ck
+    else:
+      properties:
+        reg:
+          items:
+            - description: IO address
+        clocks:
+          items:
+            - description: Functional clock
+        clock-names:
+          items:
+            - const: fck
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - ti,dm814-timer
+              - ti,dm816-timer
+              - ti,omap2420-timer
+              - ti,omap3430-timer
+    then:
+      properties:
+        ti,hwmods:
+          items:
+            - pattern: "^timer([1-9]|1[0-2])$"
+    else:
+      properties:
+        ti,hwmods: false
+
+examples:
+  - |
+    timer1: timer@0 {
+      compatible = "ti,am335x-timer-1ms";
+      reg = <0x0 0x400>;
+      interrupts = <67>;
+      ti,timer-alwon;
+      clocks = <&timer1_fck>;
+      clock-names = "fck";
+    };
+...
diff --git a/Documentation/devicetree/bindings/timer/ti,timer.txt b/Documentation/devicetree/bindings/timer/ti,timer.txt
deleted file mode 100644
--- a/Documentation/devicetree/bindings/timer/ti,timer.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-OMAP Timer bindings
-
-Required properties:
-- compatible:		Should be set to one of the below. Please note that
-			OMAP44xx devices have timer instances that are 100%
-			register compatible with OMAP3xxx devices as well as
-			newer timers that are not 100% register compatible.
-			So for OMAP44xx devices timer instances may use
-			different compatible strings.
-
-			ti,omap2420-timer (applicable to OMAP24xx devices)
-			ti,omap3430-timer (applicable to OMAP3xxx/44xx devices)
-			ti,omap4430-timer (applicable to OMAP44xx devices)
-			ti,omap5430-timer (applicable to OMAP543x devices)
-			ti,am335x-timer	(applicable to AM335x devices)
-			ti,am335x-timer-1ms (applicable to AM335x devices)
-
-- reg:			Contains timer register address range (base address and
-			length).
-- interrupts: 		Contains the interrupt information for the timer. The
-			format is being dependent on which interrupt controller
-			the OMAP device uses.
-- ti,hwmods:		Name of the hwmod associated to the timer, "timer<X>",
-			where <X> is the instance number of the timer from the
-			HW spec.
-
-Optional properties:
-- ti,timer-alwon:	Indicates the timer is in an alway-on power domain.
-- ti,timer-dsp:		Indicates the timer can interrupt the on-chip DSP in
-			addition to the ARM CPU.
-- ti,timer-pwm: 	Indicates the timer can generate a PWM output.
-- ti,timer-secure: 	Indicates the timer is reserved on a secure OMAP device
-			and therefore cannot be used by the kernel.
-
-Example:
-
-timer12: timer@48304000 {
-	compatible = "ti,omap3430-timer";
-	reg = <0x48304000 0x400>;
-	interrupts = <95>;
-	ti,hwmods = "timer12"
-	ti,timer-alwon;
-	ti,timer-secure;
-};
-- 
2.35.1

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

* [PATCH 2/2] dt-bindings: timer: Add compatible for am6 for TI timer-dm
  2022-04-12 13:16 ` Tony Lindgren
@ 2022-04-12 13:16   ` Tony Lindgren
  -1 siblings, 0 replies; 16+ messages in thread
From: Tony Lindgren @ 2022-04-12 13:16 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-arm-kernel, linux-omap, Daniel Lezcano,
	Keerthy, Nishanth Menon, Vignesh Raghavendra,
	Krzysztof Kozlowski

Let's add compatible for ti,am654-timer for TI am64, am65 and j72 SoCs.
As the timer hardware is the same between am64, am65 and j72 we use the
compatible name for the earliest SoC with this timer.

The timer interrupts are not routable for the operating system for some
timers on am6. Let's make sure the interrupts are configured for the
timers on all other SoCs.

Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Keerthy <j-keerthy@ti.com>
Cc: Nishanth Menon <nm@ti.com>
Cc: Vignesh Raghavendra <vigneshr@ti.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 .../devicetree/bindings/timer/ti,timer-dm.yaml       | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/timer/ti,timer-dm.yaml b/Documentation/devicetree/bindings/timer/ti,timer-dm.yaml
--- a/Documentation/devicetree/bindings/timer/ti,timer-dm.yaml
+++ b/Documentation/devicetree/bindings/timer/ti,timer-dm.yaml
@@ -19,6 +19,7 @@ properties:
           - enum:
               - ti,am335x-timer
               - ti,am335x-timer-1ms
+              - ti,am654-timer
               - ti,dm814-timer
               - ti,dm816-timer
               - ti,omap2420-timer
@@ -82,11 +83,20 @@ properties:
 required:
   - compatible
   - reg
-  - interrupts
 
 additionalProperties: false
 
 allOf:
+  - if:
+      not:
+        properties:
+          compatible:
+            contains:
+              const: ti,am654-timer
+    then:
+      required:
+        - interrupts
+
   - if:
       properties:
         compatible:
-- 
2.35.1

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 2/2] dt-bindings: timer: Add compatible for am6 for TI timer-dm
@ 2022-04-12 13:16   ` Tony Lindgren
  0 siblings, 0 replies; 16+ messages in thread
From: Tony Lindgren @ 2022-04-12 13:16 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-arm-kernel, linux-omap, Daniel Lezcano,
	Keerthy, Nishanth Menon, Vignesh Raghavendra,
	Krzysztof Kozlowski

Let's add compatible for ti,am654-timer for TI am64, am65 and j72 SoCs.
As the timer hardware is the same between am64, am65 and j72 we use the
compatible name for the earliest SoC with this timer.

The timer interrupts are not routable for the operating system for some
timers on am6. Let's make sure the interrupts are configured for the
timers on all other SoCs.

Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Keerthy <j-keerthy@ti.com>
Cc: Nishanth Menon <nm@ti.com>
Cc: Vignesh Raghavendra <vigneshr@ti.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 .../devicetree/bindings/timer/ti,timer-dm.yaml       | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/timer/ti,timer-dm.yaml b/Documentation/devicetree/bindings/timer/ti,timer-dm.yaml
--- a/Documentation/devicetree/bindings/timer/ti,timer-dm.yaml
+++ b/Documentation/devicetree/bindings/timer/ti,timer-dm.yaml
@@ -19,6 +19,7 @@ properties:
           - enum:
               - ti,am335x-timer
               - ti,am335x-timer-1ms
+              - ti,am654-timer
               - ti,dm814-timer
               - ti,dm816-timer
               - ti,omap2420-timer
@@ -82,11 +83,20 @@ properties:
 required:
   - compatible
   - reg
-  - interrupts
 
 additionalProperties: false
 
 allOf:
+  - if:
+      not:
+        properties:
+          compatible:
+            contains:
+              const: ti,am654-timer
+    then:
+      required:
+        - interrupts
+
   - if:
       properties:
         compatible:
-- 
2.35.1

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

* Re: [PATCH 1/2] dt-bindings: timer: Update TI timer to yaml
  2022-04-12 13:16   ` Tony Lindgren
@ 2022-04-12 17:06     ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 16+ messages in thread
From: Krzysztof Kozlowski @ 2022-04-12 17:06 UTC (permalink / raw)
  To: Tony Lindgren, Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-arm-kernel, linux-omap, Daniel Lezcano,
	Keerthy, Nishanth Menon, Vignesh Raghavendra

On 12/04/2022 15:16, Tony Lindgren wrote:
> Let's update the TI timer binding to use yaml. As this binding is specific
> to the TI dual-mode timers also known as dm-timers, let's use file name
> ti,timer-dm.yaml to avoid confusion with other timers.
> 
> We also correct the issue with the old binding that was out of date for
> several properties.
> 
> The am43 related timers are undocumented, but compatible with the am3
> timers. Let's add the am43 timers too.
> 
> The dm814 and dm816 timers are missing, let's add them.
> 
> Some timers on some SoCs are dual mapped, like the ABE timers on omap4
> and 5. The reg property maxItems must be updated to 2.
> 
> The timer clocks can be managed by the parent interconnect target module
> with no clocks assigned for the timer node. And in some cases the SoC may
> need to configure additional clocks for the timer in addition to the
> functional clock.
> 
> The clock names are optional and not specific to the comptible property.
> For example, dra7 timers on l3 interconnect do not need clock-names,while
> the timers on dra7 l4 interconnect need them with both being compatible
> with ti,omap5430-timer.
> 
> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> Cc: Keerthy <j-keerthy@ti.com>
> Cc: Nishanth Menon <nm@ti.com>
> Cc: Vignesh Raghavendra <vigneshr@ti.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  .../bindings/pwm/pwm-omap-dmtimer.txt         |   2 +-
>  .../bindings/timer/ti,timer-dm.yaml           | 161 ++++++++++++++++++
>  .../devicetree/bindings/timer/ti,timer.txt    |  44 -----
>  3 files changed, 162 insertions(+), 45 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/timer/ti,timer-dm.yaml
>  delete mode 100644 Documentation/devicetree/bindings/timer/ti,timer.txt
> 
> diff --git a/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt b/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
> --- a/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
> +++ b/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
> @@ -2,7 +2,7 @@
>  
>  Required properties:
>  - compatible: Shall contain "ti,omap-dmtimer-pwm".
> -- ti,timers: phandle to PWM capable OMAP timer. See timer/ti,timer.txt for info
> +- ti,timers: phandle to PWM capable OMAP timer. See timer/ti,timer-dm.yaml for info
>    about these timers.
>  - #pwm-cells: Should be 3. See pwm.yaml in this directory for a description of
>    the cells format.
> diff --git a/Documentation/devicetree/bindings/timer/ti,timer-dm.yaml b/Documentation/devicetree/bindings/timer/ti,timer-dm.yaml
> new file mode 100644
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/timer/ti,timer-dm.yaml
> @@ -0,0 +1,161 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/timer/ti,timer-dm.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: TI dual-mode timer
> +
> +maintainers:
> +  - Tony Lindgren <tony@atomide.com>
> +
> +description: |
> +  The TI dual-mode timer is a general purpose timer with PWM capabilities.
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - items:
> +          - enum:
> +              - ti,am335x-timer
> +              - ti,am335x-timer-1ms
> +              - ti,dm814-timer
> +              - ti,dm816-timer
> +              - ti,omap2420-timer
> +              - ti,omap3430-timer
> +              - ti,omap4430-timer
> +              - ti,omap5430-timer
> +      - items:
> +          - const: ti,am4372-timer
> +          - const: ti,am335x-timer
> +      - items:
> +          - const: ti,am4372-timer-1ms
> +          - const: ti,am335x-timer-1ms
> +
> +  reg:
> +    minItems: 1
> +    maxItems: 2
> +
> +  clocks:
> +    minItems: 1
> +    maxItems: 2
> +
> +  clock-names:
> +    minItems: 1
> +    maxItems: 2
> +
> +  interrupts:
> +    description:
> +      Interrupt if available. The timer PWM features may be usable
> +      in a limited way even without interrupts.
> +    maxItems: 1
> +
> +  ti,timer-alwon:
> +    description:
> +      Timer is always enabled when the SoC is powered. Note that some SoCs like
> +      am335x can suspend to PM coprocessor RTC only mode and in that case the
> +      SoC power is cut including timers.
> +    type: boolean
> +
> +  ti,timer-dsp:
> +    description:
> +      Timer is routable to the DSP in addition to the operating system.
> +    type: boolean
> +
> +  ti,timer-pwm:
> +    description:
> +      Timer has been wired for PWM capability.
> +    type: boolean
> +
> +  ti,timer-secure:
> +    description:
> +      Timer access has been limited to secure mode only.
> +    type: boolean
> +
> +  ti,hwmods:
> +    description:
> +      Name of the HWMOD associated with timer. This is for legacy
> +      omap2/3 platforms only.
> +    $ref: /schemas/types.yaml#/definitions/string
> +    deprecated: true
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +
> +additionalProperties: false
> +
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - ti,omap3430-timer
> +              - ti,omap4430-timer
> +              - ti,omap5430-timer
> +    then:
> +      properties:
> +        reg:
> +          oneOf:
> +            - items:
> +                - description: IO address
> +            - items:
> +                - description: CPU to L4 ABE IO address
> +                - description: L3 to L4 ABE IO address
> +        clocks:
> +          oneOf:
> +            - items:
> +                - description: Functional clock
> +            - items:
> +                - description: Functional clock
> +                - description: System clock

I think this can be made simpler, without oneOf:

  clocks:
    items:
      - description: Functional clock
      - description: System clock
    minItems: 1


and similar for clock-names.

> +        clock-names:
> +          oneOf:
> +            - items:
> +                - const: fck
> +            - items:
> +                - const: fck
> +                - const: timer_sys_ck
> +    else:
> +      properties:
> +        reg:
> +          items:
> +            - description: IO address
> +        clocks:
> +          items:
> +            - description: Functional clock
> +        clock-names:
> +          items:
> +            - const: fck

Hmmm, in your previous version I had impression that first clock is not
the same on every flavor. Now it looks the same, so clocks you could
simplify even more:
1. Define full list in main properties (not in allOf) with minItems:1
2. Use maxItems:1, for this "else:" case.

This could greatly reduce amount of code you need and keep the actual
definition of clocks in main properties (not in allOf; allOf are only to
constrain it).

Best regards,
Krzysztof

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

* Re: [PATCH 1/2] dt-bindings: timer: Update TI timer to yaml
@ 2022-04-12 17:06     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 16+ messages in thread
From: Krzysztof Kozlowski @ 2022-04-12 17:06 UTC (permalink / raw)
  To: Tony Lindgren, Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-arm-kernel, linux-omap, Daniel Lezcano,
	Keerthy, Nishanth Menon, Vignesh Raghavendra

On 12/04/2022 15:16, Tony Lindgren wrote:
> Let's update the TI timer binding to use yaml. As this binding is specific
> to the TI dual-mode timers also known as dm-timers, let's use file name
> ti,timer-dm.yaml to avoid confusion with other timers.
> 
> We also correct the issue with the old binding that was out of date for
> several properties.
> 
> The am43 related timers are undocumented, but compatible with the am3
> timers. Let's add the am43 timers too.
> 
> The dm814 and dm816 timers are missing, let's add them.
> 
> Some timers on some SoCs are dual mapped, like the ABE timers on omap4
> and 5. The reg property maxItems must be updated to 2.
> 
> The timer clocks can be managed by the parent interconnect target module
> with no clocks assigned for the timer node. And in some cases the SoC may
> need to configure additional clocks for the timer in addition to the
> functional clock.
> 
> The clock names are optional and not specific to the comptible property.
> For example, dra7 timers on l3 interconnect do not need clock-names,while
> the timers on dra7 l4 interconnect need them with both being compatible
> with ti,omap5430-timer.
> 
> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> Cc: Keerthy <j-keerthy@ti.com>
> Cc: Nishanth Menon <nm@ti.com>
> Cc: Vignesh Raghavendra <vigneshr@ti.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  .../bindings/pwm/pwm-omap-dmtimer.txt         |   2 +-
>  .../bindings/timer/ti,timer-dm.yaml           | 161 ++++++++++++++++++
>  .../devicetree/bindings/timer/ti,timer.txt    |  44 -----
>  3 files changed, 162 insertions(+), 45 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/timer/ti,timer-dm.yaml
>  delete mode 100644 Documentation/devicetree/bindings/timer/ti,timer.txt
> 
> diff --git a/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt b/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
> --- a/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
> +++ b/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
> @@ -2,7 +2,7 @@
>  
>  Required properties:
>  - compatible: Shall contain "ti,omap-dmtimer-pwm".
> -- ti,timers: phandle to PWM capable OMAP timer. See timer/ti,timer.txt for info
> +- ti,timers: phandle to PWM capable OMAP timer. See timer/ti,timer-dm.yaml for info
>    about these timers.
>  - #pwm-cells: Should be 3. See pwm.yaml in this directory for a description of
>    the cells format.
> diff --git a/Documentation/devicetree/bindings/timer/ti,timer-dm.yaml b/Documentation/devicetree/bindings/timer/ti,timer-dm.yaml
> new file mode 100644
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/timer/ti,timer-dm.yaml
> @@ -0,0 +1,161 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/timer/ti,timer-dm.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: TI dual-mode timer
> +
> +maintainers:
> +  - Tony Lindgren <tony@atomide.com>
> +
> +description: |
> +  The TI dual-mode timer is a general purpose timer with PWM capabilities.
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - items:
> +          - enum:
> +              - ti,am335x-timer
> +              - ti,am335x-timer-1ms
> +              - ti,dm814-timer
> +              - ti,dm816-timer
> +              - ti,omap2420-timer
> +              - ti,omap3430-timer
> +              - ti,omap4430-timer
> +              - ti,omap5430-timer
> +      - items:
> +          - const: ti,am4372-timer
> +          - const: ti,am335x-timer
> +      - items:
> +          - const: ti,am4372-timer-1ms
> +          - const: ti,am335x-timer-1ms
> +
> +  reg:
> +    minItems: 1
> +    maxItems: 2
> +
> +  clocks:
> +    minItems: 1
> +    maxItems: 2
> +
> +  clock-names:
> +    minItems: 1
> +    maxItems: 2
> +
> +  interrupts:
> +    description:
> +      Interrupt if available. The timer PWM features may be usable
> +      in a limited way even without interrupts.
> +    maxItems: 1
> +
> +  ti,timer-alwon:
> +    description:
> +      Timer is always enabled when the SoC is powered. Note that some SoCs like
> +      am335x can suspend to PM coprocessor RTC only mode and in that case the
> +      SoC power is cut including timers.
> +    type: boolean
> +
> +  ti,timer-dsp:
> +    description:
> +      Timer is routable to the DSP in addition to the operating system.
> +    type: boolean
> +
> +  ti,timer-pwm:
> +    description:
> +      Timer has been wired for PWM capability.
> +    type: boolean
> +
> +  ti,timer-secure:
> +    description:
> +      Timer access has been limited to secure mode only.
> +    type: boolean
> +
> +  ti,hwmods:
> +    description:
> +      Name of the HWMOD associated with timer. This is for legacy
> +      omap2/3 platforms only.
> +    $ref: /schemas/types.yaml#/definitions/string
> +    deprecated: true
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +
> +additionalProperties: false
> +
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - ti,omap3430-timer
> +              - ti,omap4430-timer
> +              - ti,omap5430-timer
> +    then:
> +      properties:
> +        reg:
> +          oneOf:
> +            - items:
> +                - description: IO address
> +            - items:
> +                - description: CPU to L4 ABE IO address
> +                - description: L3 to L4 ABE IO address
> +        clocks:
> +          oneOf:
> +            - items:
> +                - description: Functional clock
> +            - items:
> +                - description: Functional clock
> +                - description: System clock

I think this can be made simpler, without oneOf:

  clocks:
    items:
      - description: Functional clock
      - description: System clock
    minItems: 1


and similar for clock-names.

> +        clock-names:
> +          oneOf:
> +            - items:
> +                - const: fck
> +            - items:
> +                - const: fck
> +                - const: timer_sys_ck
> +    else:
> +      properties:
> +        reg:
> +          items:
> +            - description: IO address
> +        clocks:
> +          items:
> +            - description: Functional clock
> +        clock-names:
> +          items:
> +            - const: fck

Hmmm, in your previous version I had impression that first clock is not
the same on every flavor. Now it looks the same, so clocks you could
simplify even more:
1. Define full list in main properties (not in allOf) with minItems:1
2. Use maxItems:1, for this "else:" case.

This could greatly reduce amount of code you need and keep the actual
definition of clocks in main properties (not in allOf; allOf are only to
constrain it).

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCHv3 0/2] Convert TI dmtimer binding to yaml
  2022-04-12 13:16 ` Tony Lindgren
@ 2022-04-12 21:26   ` Rob Herring
  -1 siblings, 0 replies; 16+ messages in thread
From: Rob Herring @ 2022-04-12 21:26 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Krzysztof Kozlowski, devicetree, linux-arm-kernel, linux-omap,
	Daniel Lezcano, Keerthy, Krzysztof Kozlowski, Nishanth Menon,
	Vignesh Raghavendra

On Tue, Apr 12, 2022 at 04:16:42PM +0300, Tony Lindgren wrote:
> Hi all,
> 
> Here's v3 changes for TI dmtimer changes.

You missed 'v3' on the patches.

> 
> Regards,
> 
> Tony
> 
> 
> Changes since v1:
> 
> - Improve yaml for various checks based on comments from Krzysztof
>   and Nishanth
> 
> - Add checks for am4 timer as pointed out by Krzysztof and Rob
> 
> - Split am6 additions into a separate patch as suggested by Krzysztof
> 
> Changes since v2:
> 
> - Improve yaml for more checks based on comments from Grygorii and
>   Krzysztof
> 
> 
> Tony Lindgren (2):
>   dt-bindings: timer: Update TI timer to yaml
>   dt-bindings: timer: Add compatible for am6 for TI timer-dm
> 
>  .../bindings/pwm/pwm-omap-dmtimer.txt         |   2 +-
>  .../bindings/timer/ti,timer-dm.yaml           | 171 ++++++++++++++++++
>  .../devicetree/bindings/timer/ti,timer.txt    |  44 -----
>  3 files changed, 172 insertions(+), 45 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/timer/ti,timer-dm.yaml
>  delete mode 100644 Documentation/devicetree/bindings/timer/ti,timer.txt
> 
> -- 
> 2.35.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCHv3 0/2] Convert TI dmtimer binding to yaml
@ 2022-04-12 21:26   ` Rob Herring
  0 siblings, 0 replies; 16+ messages in thread
From: Rob Herring @ 2022-04-12 21:26 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Krzysztof Kozlowski, devicetree, linux-arm-kernel, linux-omap,
	Daniel Lezcano, Keerthy, Krzysztof Kozlowski, Nishanth Menon,
	Vignesh Raghavendra

On Tue, Apr 12, 2022 at 04:16:42PM +0300, Tony Lindgren wrote:
> Hi all,
> 
> Here's v3 changes for TI dmtimer changes.

You missed 'v3' on the patches.

> 
> Regards,
> 
> Tony
> 
> 
> Changes since v1:
> 
> - Improve yaml for various checks based on comments from Krzysztof
>   and Nishanth
> 
> - Add checks for am4 timer as pointed out by Krzysztof and Rob
> 
> - Split am6 additions into a separate patch as suggested by Krzysztof
> 
> Changes since v2:
> 
> - Improve yaml for more checks based on comments from Grygorii and
>   Krzysztof
> 
> 
> Tony Lindgren (2):
>   dt-bindings: timer: Update TI timer to yaml
>   dt-bindings: timer: Add compatible for am6 for TI timer-dm
> 
>  .../bindings/pwm/pwm-omap-dmtimer.txt         |   2 +-
>  .../bindings/timer/ti,timer-dm.yaml           | 171 ++++++++++++++++++
>  .../devicetree/bindings/timer/ti,timer.txt    |  44 -----
>  3 files changed, 172 insertions(+), 45 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/timer/ti,timer-dm.yaml
>  delete mode 100644 Documentation/devicetree/bindings/timer/ti,timer.txt
> 
> -- 
> 2.35.1
> 

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

* Re: [PATCH 1/2] dt-bindings: timer: Update TI timer to yaml
  2022-04-12 17:06     ` Krzysztof Kozlowski
@ 2022-04-13  6:04       ` Tony Lindgren
  -1 siblings, 0 replies; 16+ messages in thread
From: Tony Lindgren @ 2022-04-13  6:04 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Rob Herring, Krzysztof Kozlowski, devicetree, linux-arm-kernel,
	linux-omap, Daniel Lezcano, Keerthy, Nishanth Menon,
	Vignesh Raghavendra

* Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [220412 17:04]:
> On 12/04/2022 15:16, Tony Lindgren wrote:
> > +allOf:
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            enum:
> > +              - ti,omap3430-timer
> > +              - ti,omap4430-timer
> > +              - ti,omap5430-timer
> > +    then:
> > +      properties:
> > +        reg:
> > +          oneOf:
> > +            - items:
> > +                - description: IO address
> > +            - items:
> > +                - description: CPU to L4 ABE IO address
> > +                - description: L3 to L4 ABE IO address
> > +        clocks:
> > +          oneOf:
> > +            - items:
> > +                - description: Functional clock
> > +            - items:
> > +                - description: Functional clock
> > +                - description: System clock
> 
> I think this can be made simpler, without oneOf:
> 
>   clocks:
>     items:
>       - description: Functional clock
>       - description: System clock
>     minItems: 1
> 
> 
> and similar for clock-names.

OK simpler sure sounds good to me considering the file path starts with
"Documentation" :)

> > +        clock-names:
> > +          oneOf:
> > +            - items:
> > +                - const: fck
> > +            - items:
> > +                - const: fck
> > +                - const: timer_sys_ck
> > +    else:
> > +      properties:
> > +        reg:
> > +          items:
> > +            - description: IO address
> > +        clocks:
> > +          items:
> > +            - description: Functional clock
> > +        clock-names:
> > +          items:
> > +            - const: fck
> 
> Hmmm, in your previous version I had impression that first clock is not
> the same on every flavor. Now it looks the same, so clocks you could
> simplify even more:
> 1. Define full list in main properties (not in allOf) with minItems:1
> 2. Use maxItems:1, for this "else:" case.
> 
> This could greatly reduce amount of code you need and keep the actual
> definition of clocks in main properties (not in allOf; allOf are only to
> constrain it).

OK thanks I'll check. I think we can assume the first clock is "fck" if
it is configured at all.

Regards,

Tony

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

* Re: [PATCH 1/2] dt-bindings: timer: Update TI timer to yaml
@ 2022-04-13  6:04       ` Tony Lindgren
  0 siblings, 0 replies; 16+ messages in thread
From: Tony Lindgren @ 2022-04-13  6:04 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Rob Herring, Krzysztof Kozlowski, devicetree, linux-arm-kernel,
	linux-omap, Daniel Lezcano, Keerthy, Nishanth Menon,
	Vignesh Raghavendra

* Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [220412 17:04]:
> On 12/04/2022 15:16, Tony Lindgren wrote:
> > +allOf:
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            enum:
> > +              - ti,omap3430-timer
> > +              - ti,omap4430-timer
> > +              - ti,omap5430-timer
> > +    then:
> > +      properties:
> > +        reg:
> > +          oneOf:
> > +            - items:
> > +                - description: IO address
> > +            - items:
> > +                - description: CPU to L4 ABE IO address
> > +                - description: L3 to L4 ABE IO address
> > +        clocks:
> > +          oneOf:
> > +            - items:
> > +                - description: Functional clock
> > +            - items:
> > +                - description: Functional clock
> > +                - description: System clock
> 
> I think this can be made simpler, without oneOf:
> 
>   clocks:
>     items:
>       - description: Functional clock
>       - description: System clock
>     minItems: 1
> 
> 
> and similar for clock-names.

OK simpler sure sounds good to me considering the file path starts with
"Documentation" :)

> > +        clock-names:
> > +          oneOf:
> > +            - items:
> > +                - const: fck
> > +            - items:
> > +                - const: fck
> > +                - const: timer_sys_ck
> > +    else:
> > +      properties:
> > +        reg:
> > +          items:
> > +            - description: IO address
> > +        clocks:
> > +          items:
> > +            - description: Functional clock
> > +        clock-names:
> > +          items:
> > +            - const: fck
> 
> Hmmm, in your previous version I had impression that first clock is not
> the same on every flavor. Now it looks the same, so clocks you could
> simplify even more:
> 1. Define full list in main properties (not in allOf) with minItems:1
> 2. Use maxItems:1, for this "else:" case.
> 
> This could greatly reduce amount of code you need and keep the actual
> definition of clocks in main properties (not in allOf; allOf are only to
> constrain it).

OK thanks I'll check. I think we can assume the first clock is "fck" if
it is configured at all.

Regards,

Tony

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCHv3 0/2] Convert TI dmtimer binding to yaml
  2022-04-12 21:26   ` Rob Herring
@ 2022-04-13  6:11     ` Tony Lindgren
  -1 siblings, 0 replies; 16+ messages in thread
From: Tony Lindgren @ 2022-04-13  6:11 UTC (permalink / raw)
  To: Rob Herring
  Cc: Krzysztof Kozlowski, devicetree, linux-arm-kernel, linux-omap,
	Daniel Lezcano, Keerthy, Krzysztof Kozlowski, Nishanth Menon,
	Vignesh Raghavendra

* Rob Herring <robh@kernel.org> [220412 21:24]:
> On Tue, Apr 12, 2022 at 04:16:42PM +0300, Tony Lindgren wrote:
> > Hi all,
> > 
> > Here's v3 changes for TI dmtimer changes.
> 
> You missed 'v3' on the patches.

Sounds like I need to start using git format-patch with -v option :)

Regards,

Tony

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

* Re: [PATCHv3 0/2] Convert TI dmtimer binding to yaml
@ 2022-04-13  6:11     ` Tony Lindgren
  0 siblings, 0 replies; 16+ messages in thread
From: Tony Lindgren @ 2022-04-13  6:11 UTC (permalink / raw)
  To: Rob Herring
  Cc: Krzysztof Kozlowski, devicetree, linux-arm-kernel, linux-omap,
	Daniel Lezcano, Keerthy, Krzysztof Kozlowski, Nishanth Menon,
	Vignesh Raghavendra

* Rob Herring <robh@kernel.org> [220412 21:24]:
> On Tue, Apr 12, 2022 at 04:16:42PM +0300, Tony Lindgren wrote:
> > Hi all,
> > 
> > Here's v3 changes for TI dmtimer changes.
> 
> You missed 'v3' on the patches.

Sounds like I need to start using git format-patch with -v option :)

Regards,

Tony

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/2] dt-bindings: timer: Update TI timer to yaml
  2022-04-13  6:04       ` Tony Lindgren
@ 2022-04-13  8:09         ` Tony Lindgren
  -1 siblings, 0 replies; 16+ messages in thread
From: Tony Lindgren @ 2022-04-13  8:09 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Rob Herring, Krzysztof Kozlowski, devicetree, linux-arm-kernel,
	linux-omap, Daniel Lezcano, Keerthy, Nishanth Menon,
	Vignesh Raghavendra

* Tony Lindgren <tony@atomide.com> [220413 06:08]:
> * Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [220412 17:04]:
> > Hmmm, in your previous version I had impression that first clock is not
> > the same on every flavor. Now it looks the same, so clocks you could
> > simplify even more:
> > 1. Define full list in main properties (not in allOf) with minItems:1
> > 2. Use maxItems:1, for this "else:" case.
> > 
> > This could greatly reduce amount of code you need and keep the actual
> > definition of clocks in main properties (not in allOf; allOf are only to
> > constrain it).
> 
> OK thanks I'll check. I think we can assume the first clock is "fck" if
> it is configured at all.

Yup, this works nicely :) Will send out v4 set.

Thanks,

Tony

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

* Re: [PATCH 1/2] dt-bindings: timer: Update TI timer to yaml
@ 2022-04-13  8:09         ` Tony Lindgren
  0 siblings, 0 replies; 16+ messages in thread
From: Tony Lindgren @ 2022-04-13  8:09 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Rob Herring, Krzysztof Kozlowski, devicetree, linux-arm-kernel,
	linux-omap, Daniel Lezcano, Keerthy, Nishanth Menon,
	Vignesh Raghavendra

* Tony Lindgren <tony@atomide.com> [220413 06:08]:
> * Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [220412 17:04]:
> > Hmmm, in your previous version I had impression that first clock is not
> > the same on every flavor. Now it looks the same, so clocks you could
> > simplify even more:
> > 1. Define full list in main properties (not in allOf) with minItems:1
> > 2. Use maxItems:1, for this "else:" case.
> > 
> > This could greatly reduce amount of code you need and keep the actual
> > definition of clocks in main properties (not in allOf; allOf are only to
> > constrain it).
> 
> OK thanks I'll check. I think we can assume the first clock is "fck" if
> it is configured at all.

Yup, this works nicely :) Will send out v4 set.

Thanks,

Tony

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-04-13  8:10 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-12 13:16 [PATCHv3 0/2] Convert TI dmtimer binding to yaml Tony Lindgren
2022-04-12 13:16 ` Tony Lindgren
2022-04-12 13:16 ` [PATCH 1/2] dt-bindings: timer: Update TI timer " Tony Lindgren
2022-04-12 13:16   ` Tony Lindgren
2022-04-12 17:06   ` Krzysztof Kozlowski
2022-04-12 17:06     ` Krzysztof Kozlowski
2022-04-13  6:04     ` Tony Lindgren
2022-04-13  6:04       ` Tony Lindgren
2022-04-13  8:09       ` Tony Lindgren
2022-04-13  8:09         ` Tony Lindgren
2022-04-12 13:16 ` [PATCH 2/2] dt-bindings: timer: Add compatible for am6 for TI timer-dm Tony Lindgren
2022-04-12 13:16   ` Tony Lindgren
2022-04-12 21:26 ` [PATCHv3 0/2] Convert TI dmtimer binding to yaml Rob Herring
2022-04-12 21:26   ` Rob Herring
2022-04-13  6:11   ` Tony Lindgren
2022-04-13  6:11     ` Tony Lindgren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.