linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/12] dt-bindings: watchdog: qcom-wdt: require fallback for IPQ4019
@ 2022-12-12 16:35 Krzysztof Kozlowski
  2022-12-12 16:35 ` [PATCH 02/12] dt-bindings: watchdog: qcom-wdt: do not allow fallback alone Krzysztof Kozlowski
                   ` (13 more replies)
  0 siblings, 14 replies; 34+ messages in thread
From: Krzysztof Kozlowski @ 2022-12-12 16:35 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Wim Van Sebroeck,
	Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Prakash Ranjan
  Cc: Krzysztof Kozlowski, linux-arm-msm, linux-watchdog, devicetree,
	linux-kernel

The device specific compatibles ("qcom,kpss-wdt-ipq4019") should be
follwed by fallback "qcom,kpss-wdt", which is actually used by Linux
driver for binding.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
index a1f17c9e02db..e76364c52fc7 100644
--- a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
+++ b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
@@ -17,6 +17,7 @@ properties:
     oneOf:
       - items:
           - enum:
+              - qcom,kpss-wdt-ipq4019
               - qcom,apss-wdt-msm8994
               - qcom,apss-wdt-qcs404
               - qcom,apss-wdt-sc7180
@@ -35,7 +36,6 @@ properties:
               - qcom,kpss-wdt
               - qcom,kpss-timer
               - qcom,kpss-wdt-apq8064
-              - qcom,kpss-wdt-ipq4019
               - qcom,kpss-wdt-ipq8064
               - qcom,kpss-wdt-msm8960
               - qcom,scss-timer
-- 
2.34.1


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

* [PATCH 02/12] dt-bindings: watchdog: qcom-wdt: do not allow fallback alone
  2022-12-12 16:35 [PATCH 01/12] dt-bindings: watchdog: qcom-wdt: require fallback for IPQ4019 Krzysztof Kozlowski
@ 2022-12-12 16:35 ` Krzysztof Kozlowski
  2022-12-13 15:35   ` Rob Herring
  2023-01-31 17:31   ` Guenter Roeck
  2022-12-12 16:35 ` [PATCH 03/12] dt-bindings: watchdog: qcom-wdt: fix list of MSM timer compatibles Krzysztof Kozlowski
                   ` (12 subsequent siblings)
  13 siblings, 2 replies; 34+ messages in thread
From: Krzysztof Kozlowski @ 2022-12-12 16:35 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Wim Van Sebroeck,
	Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Prakash Ranjan
  Cc: Krzysztof Kozlowski, linux-arm-msm, linux-watchdog, devicetree,
	linux-kernel

The compatible "qcom,kpss-wdt" is too generic and should not be used
alone.  Mark it as deprecated when not prepended by specific compatible.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
index e76364c52fc7..3e0b30a817d6 100644
--- a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
+++ b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
@@ -31,9 +31,10 @@ properties:
               - qcom,apss-wdt-sm8150
               - qcom,apss-wdt-sm8250
           - const: qcom,kpss-wdt
+      - const: qcom,kpss-wdt
+        deprecated: true
       - items:
           - enum:
-              - qcom,kpss-wdt
               - qcom,kpss-timer
               - qcom,kpss-wdt-apq8064
               - qcom,kpss-wdt-ipq8064
-- 
2.34.1


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

* [PATCH 03/12] dt-bindings: watchdog: qcom-wdt: fix list of MSM timer compatibles
  2022-12-12 16:35 [PATCH 01/12] dt-bindings: watchdog: qcom-wdt: require fallback for IPQ4019 Krzysztof Kozlowski
  2022-12-12 16:35 ` [PATCH 02/12] dt-bindings: watchdog: qcom-wdt: do not allow fallback alone Krzysztof Kozlowski
@ 2022-12-12 16:35 ` Krzysztof Kozlowski
  2022-12-13 15:37   ` Rob Herring
  2023-01-31 17:31   ` Guenter Roeck
  2022-12-12 16:35 ` [PATCH 04/12] dt-bindings: watchdog: qcom-wdt: add qcom,kpss-wdt-mdm9615 Krzysztof Kozlowski
                   ` (11 subsequent siblings)
  13 siblings, 2 replies; 34+ messages in thread
From: Krzysztof Kozlowski @ 2022-12-12 16:35 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Wim Van Sebroeck,
	Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Prakash Ranjan
  Cc: Krzysztof Kozlowski, linux-arm-msm, linux-watchdog, devicetree,
	linux-kernel

The MSM timer ("qcom,msm-timer") is a bit different timer and watchdog
device than KPSS watchdog.  It has its own generic and specific
compatibles, so fix the list to reflect this.  Adjust the example to
show the newer KPSS watchdog.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 .../devicetree/bindings/watchdog/qcom-wdt.yaml    | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
index 3e0b30a817d6..93e4381067dd 100644
--- a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
+++ b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
@@ -33,13 +33,16 @@ properties:
           - const: qcom,kpss-wdt
       - const: qcom,kpss-wdt
         deprecated: true
+      - items:
+          - const: qcom,scss-timer
+          - const: qcom,msm-timer
       - items:
           - enum:
-              - qcom,kpss-timer
               - qcom,kpss-wdt-apq8064
               - qcom,kpss-wdt-ipq8064
               - qcom,kpss-wdt-msm8960
-              - qcom,scss-timer
+          - const: qcom,kpss-timer
+          - const: qcom,msm-timer
 
   reg:
     maxItems: 1
@@ -56,9 +59,11 @@ unevaluatedProperties: false
 
 examples:
   - |
-    watchdog@208a038 {
-      compatible = "qcom,kpss-wdt-ipq8064";
-      reg = <0x0208a038 0x40>;
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    watchdog@17c10000 {
+      compatible = "qcom,apss-wdt-sm8150", "qcom,kpss-wdt";
+      reg = <0x17c10000 0x1000>;
       clocks = <&sleep_clk>;
       timeout-sec = <10>;
     };
-- 
2.34.1


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

* [PATCH 04/12] dt-bindings: watchdog: qcom-wdt: add qcom,kpss-wdt-mdm9615
  2022-12-12 16:35 [PATCH 01/12] dt-bindings: watchdog: qcom-wdt: require fallback for IPQ4019 Krzysztof Kozlowski
  2022-12-12 16:35 ` [PATCH 02/12] dt-bindings: watchdog: qcom-wdt: do not allow fallback alone Krzysztof Kozlowski
  2022-12-12 16:35 ` [PATCH 03/12] dt-bindings: watchdog: qcom-wdt: fix list of MSM timer compatibles Krzysztof Kozlowski
@ 2022-12-12 16:35 ` Krzysztof Kozlowski
  2022-12-13 15:37   ` Rob Herring
  2023-01-31 17:32   ` Guenter Roeck
  2022-12-12 16:35 ` [PATCH 05/12] dt-bindings: watchdog: qcom-wdt: allow interrupts Krzysztof Kozlowski
                   ` (10 subsequent siblings)
  13 siblings, 2 replies; 34+ messages in thread
From: Krzysztof Kozlowski @ 2022-12-12 16:35 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Wim Van Sebroeck,
	Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Prakash Ranjan
  Cc: Krzysztof Kozlowski, linux-arm-msm, linux-watchdog, devicetree,
	linux-kernel

Document new MDM9615 qcom,kpss-wdt-mdm9615 watchdog/timer compatible.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
index 93e4381067dd..1828eaf70b3b 100644
--- a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
+++ b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
@@ -40,6 +40,7 @@ properties:
           - enum:
               - qcom,kpss-wdt-apq8064
               - qcom,kpss-wdt-ipq8064
+              - qcom,kpss-wdt-mdm9615
               - qcom,kpss-wdt-msm8960
           - const: qcom,kpss-timer
           - const: qcom,msm-timer
-- 
2.34.1


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

* [PATCH 05/12] dt-bindings: watchdog: qcom-wdt: allow interrupts
  2022-12-12 16:35 [PATCH 01/12] dt-bindings: watchdog: qcom-wdt: require fallback for IPQ4019 Krzysztof Kozlowski
                   ` (2 preceding siblings ...)
  2022-12-12 16:35 ` [PATCH 04/12] dt-bindings: watchdog: qcom-wdt: add qcom,kpss-wdt-mdm9615 Krzysztof Kozlowski
@ 2022-12-12 16:35 ` Krzysztof Kozlowski
  2022-12-13 15:35   ` Rob Herring
                     ` (2 more replies)
  2022-12-12 16:35 ` [PATCH 06/12] dt-bindings: watchdog: qcom-wdt: merge MSM timer Krzysztof Kozlowski
                   ` (9 subsequent siblings)
  13 siblings, 3 replies; 34+ messages in thread
From: Krzysztof Kozlowski @ 2022-12-12 16:35 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Wim Van Sebroeck,
	Guenter Roeck, Rob Herring, Krzysztof Kozlowski, Prakash Ranjan
  Cc: Krzysztof Kozlowski, linux-arm-msm, linux-watchdog, devicetree,
	linux-kernel

Both of type of watchdogs described in the binding (the KPSS watchdog
and APSS WDT timer) have interrupts.  Allow interrupts and describe them
for KPSS watchdog to fix warnings like:

  watchdog@17c10000: Unevaluated properties are not allowed ('interrupts' was unexpected)

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 .../bindings/watchdog/qcom-wdt.yaml           | 24 ++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
index 1828eaf70b3b..b7fc57f4800e 100644
--- a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
+++ b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
@@ -9,9 +9,6 @@ title: Qualcomm Krait Processor Sub-system (KPSS) Watchdog timer
 maintainers:
   - Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
 
-allOf:
-  - $ref: watchdog.yaml#
-
 properties:
   compatible:
     oneOf:
@@ -51,11 +48,31 @@ properties:
   clocks:
     maxItems: 1
 
+  interrupts:
+    minItems: 1
+    maxItems: 5
+
 required:
   - compatible
   - reg
   - clocks
 
+allOf:
+  - $ref: watchdog.yaml#
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: qcom,kpss-wdt
+    then:
+      properties:
+        interrupts:
+          minItems: 1
+          items:
+            - description: Bark
+            - description: Bite
+
 unevaluatedProperties: false
 
 examples:
@@ -66,5 +83,6 @@ examples:
       compatible = "qcom,apss-wdt-sm8150", "qcom,kpss-wdt";
       reg = <0x17c10000 0x1000>;
       clocks = <&sleep_clk>;
+      interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
       timeout-sec = <10>;
     };
-- 
2.34.1


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

* [PATCH 06/12] dt-bindings: watchdog: qcom-wdt: merge MSM timer
  2022-12-12 16:35 [PATCH 01/12] dt-bindings: watchdog: qcom-wdt: require fallback for IPQ4019 Krzysztof Kozlowski
                   ` (3 preceding siblings ...)
  2022-12-12 16:35 ` [PATCH 05/12] dt-bindings: watchdog: qcom-wdt: allow interrupts Krzysztof Kozlowski
@ 2022-12-12 16:35 ` Krzysztof Kozlowski
  2022-12-13  9:11   ` Daniel Lezcano
                     ` (2 more replies)
  2022-12-12 16:35 ` [PATCH 07/12] ARM: dts: qcom: reverse compatibles to match bindings Krzysztof Kozlowski
                   ` (8 subsequent siblings)
  13 siblings, 3 replies; 34+ messages in thread
From: Krzysztof Kozlowski @ 2022-12-12 16:35 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Daniel Lezcano,
	Thomas Gleixner, Rob Herring, Krzysztof Kozlowski,
	Wim Van Sebroeck, Guenter Roeck, Prakash Ranjan
  Cc: Krzysztof Kozlowski, linux-arm-msm, linux-kernel, devicetree,
	linux-watchdog

Merge Qualcomm MSM timer bindings into watchdog, because the timer
compatibles are already included here and the hardware is quite similar.

While converting the MSM timer bindings, adjust clock-frequency
property to take only one frequency, instead of two, because:
1. DT schema does not allow to frequencies,
2. The Linux timer driver reads only first frequency.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 .../bindings/timer/qcom,msm-timer.txt         | 47 ------------------
 .../bindings/watchdog/qcom-wdt.yaml           | 49 +++++++++++++++++++
 2 files changed, 49 insertions(+), 47 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/timer/qcom,msm-timer.txt

diff --git a/Documentation/devicetree/bindings/timer/qcom,msm-timer.txt b/Documentation/devicetree/bindings/timer/qcom,msm-timer.txt
deleted file mode 100644
index 5e10c345548f..000000000000
--- a/Documentation/devicetree/bindings/timer/qcom,msm-timer.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-* MSM Timer
-
-Properties:
-
-- compatible : Should at least contain "qcom,msm-timer". More specific
-               properties specify which subsystem the timers are paired with.
-
-               "qcom,kpss-timer" - krait subsystem
-               "qcom,scss-timer" - scorpion subsystem
-
-- interrupts : Interrupts for the debug timer, the first general purpose
-               timer, and optionally a second general purpose timer, and
-               optionally as well, 2 watchdog interrupts, in that order.
-
-- reg : Specifies the base address of the timer registers.
-
-- clocks: Reference to the parent clocks, one per output clock. The parents
-          must appear in the same order as the clock names.
-
-- clock-names: The name of the clocks as free-form strings. They should be in
-               the same order as the clocks.
-
-- clock-frequency : The frequency of the debug timer and the general purpose
-                    timer(s) in Hz in that order.
-
-Optional:
-
-- cpu-offset : per-cpu offset used when the timer is accessed without the
-               CPU remapping facilities. The offset is
-               cpu-offset + (0x10000 * cpu-nr).
-
-Example:
-
-       timer@200a000 {
-               compatible = "qcom,scss-timer", "qcom,msm-timer";
-               interrupts = <1 1 0x301>,
-                            <1 2 0x301>,
-                            <1 3 0x301>,
-                            <1 4 0x301>,
-                            <1 5 0x301>;
-               reg = <0x0200a000 0x100>;
-               clock-frequency = <19200000>,
-                                 <32768>;
-               clocks = <&sleep_clk>;
-               clock-names = "sleep";
-               cpu-offset = <0x40000>;
-       };
diff --git a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
index b7fc57f4800e..697caf1937cc 100644
--- a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
+++ b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
@@ -10,6 +10,9 @@ maintainers:
   - Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
 
 properties:
+  $nodename:
+    pattern: "^(watchdog|timer)@[0-9a-f]+$"
+
   compatible:
     oneOf:
       - items:
@@ -48,6 +51,20 @@ properties:
   clocks:
     maxItems: 1
 
+  clock-names:
+    items:
+      - const: sleep
+
+  clock-frequency:
+    description:
+      The frequency of the general purpose timer in Hz in that order.
+
+  cpu-offset:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Per-CPU offset used when the timer is accessed without the CPU remapping
+      facilities. The offset is cpu-offset + (0x10000 * cpu-nr).
+
   interrupts:
     minItems: 1
     maxItems: 5
@@ -67,12 +84,27 @@ allOf:
             const: qcom,kpss-wdt
     then:
       properties:
+        clock-frequency: false
+        cpu-offset: false
         interrupts:
           minItems: 1
           items:
             - description: Bark
             - description: Bite
 
+    else:
+      properties:
+        interrupts:
+          minItems: 3
+          items:
+            - description: Debug
+            - description: First general purpose timer
+            - description: Second general purpose timer
+            - description: First watchdog
+            - description: Second watchdog
+      required:
+        - clock-frequency
+
 unevaluatedProperties: false
 
 examples:
@@ -86,3 +118,20 @@ examples:
       interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
       timeout-sec = <10>;
     };
+
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    watchdog@200a000 {
+      compatible = "qcom,kpss-wdt-ipq8064", "qcom,kpss-timer", "qcom,msm-timer";
+      interrupts = <GIC_PPI 1 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_EDGE_RISING)>,
+                   <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_EDGE_RISING)>,
+                   <GIC_PPI 3 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_EDGE_RISING)>,
+                   <GIC_PPI 4 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_EDGE_RISING)>,
+                   <GIC_PPI 5 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_EDGE_RISING)>;
+      reg = <0x0200a000 0x100>;
+      clock-frequency = <25000000>;
+      clocks = <&sleep_clk>;
+      clock-names = "sleep";
+      cpu-offset = <0x80000>;
+    };
-- 
2.34.1


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

* [PATCH 07/12] ARM: dts: qcom: reverse compatibles to match bindings
  2022-12-12 16:35 [PATCH 01/12] dt-bindings: watchdog: qcom-wdt: require fallback for IPQ4019 Krzysztof Kozlowski
                   ` (4 preceding siblings ...)
  2022-12-12 16:35 ` [PATCH 06/12] dt-bindings: watchdog: qcom-wdt: merge MSM timer Krzysztof Kozlowski
@ 2022-12-12 16:35 ` Krzysztof Kozlowski
  2022-12-13  9:31   ` Konrad Dybcio
  2022-12-12 16:35 ` [PATCH 08/12] ARM: dts: qcom: apq8064: drop second clock frequency from timer Krzysztof Kozlowski
                   ` (7 subsequent siblings)
  13 siblings, 1 reply; 34+ messages in thread
From: Krzysztof Kozlowski @ 2022-12-12 16:35 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski
  Cc: Krzysztof Kozlowski, linux-arm-msm, devicetree, linux-kernel

The most specific compatible should be upfront.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 arch/arm/boot/dts/qcom-apq8064.dtsi | 4 ++--
 arch/arm/boot/dts/qcom-ipq4019.dtsi | 2 +-
 arch/arm/boot/dts/qcom-ipq8064.dtsi | 4 ++--
 arch/arm/boot/dts/qcom-msm8960.dtsi | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm/boot/dts/qcom-apq8064.dtsi b/arch/arm/boot/dts/qcom-apq8064.dtsi
index 0da9623ea084..79575d6b3a81 100644
--- a/arch/arm/boot/dts/qcom-apq8064.dtsi
+++ b/arch/arm/boot/dts/qcom-apq8064.dtsi
@@ -375,8 +375,8 @@ intc: interrupt-controller@2000000 {
 		};
 
 		timer@200a000 {
-			compatible = "qcom,kpss-timer",
-				     "qcom,kpss-wdt-apq8064", "qcom,msm-timer";
+			compatible = "qcom,kpss-wdt-apq8064", "qcom,kpss-timer",
+				     "qcom,msm-timer";
 			interrupts = <1 1 0x301>,
 				     <1 2 0x301>,
 				     <1 3 0x301>;
diff --git a/arch/arm/boot/dts/qcom-ipq4019.dtsi b/arch/arm/boot/dts/qcom-ipq4019.dtsi
index acb08dcf9442..a73c3a17b6a4 100644
--- a/arch/arm/boot/dts/qcom-ipq4019.dtsi
+++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi
@@ -400,7 +400,7 @@ blsp1_uart2: serial@78b0000 {
 		};
 
 		watchdog: watchdog@b017000 {
-			compatible = "qcom,kpss-wdt", "qcom,kpss-wdt-ipq4019";
+			compatible = "qcom,kpss-wdt-ipq4019", "qcom,kpss-wdt";
 			reg = <0xb017000 0x40>;
 			clocks = <&sleep_clk>;
 			timeout-sec = <10>;
diff --git a/arch/arm/boot/dts/qcom-ipq8064.dtsi b/arch/arm/boot/dts/qcom-ipq8064.dtsi
index 7e784b0995da..9daafe9de02a 100644
--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
+++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
@@ -549,8 +549,8 @@ intc: interrupt-controller@2000000 {
 		};
 
 		timer@200a000 {
-			compatible = "qcom,kpss-timer",
-				     "qcom,kpss-wdt-ipq8064", "qcom,msm-timer";
+			compatible = "qcom,kpss-wdt-ipq8064", "qcom,kpss-timer",
+				     "qcom,msm-timer";
 			interrupts = <GIC_PPI 1 (GIC_CPU_MASK_SIMPLE(2) |
 						 IRQ_TYPE_EDGE_RISING)>,
 				     <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(2) |
diff --git a/arch/arm/boot/dts/qcom-msm8960.dtsi b/arch/arm/boot/dts/qcom-msm8960.dtsi
index 7debf9db7cb1..63c3c40fe9a2 100644
--- a/arch/arm/boot/dts/qcom-msm8960.dtsi
+++ b/arch/arm/boot/dts/qcom-msm8960.dtsi
@@ -103,8 +103,8 @@ intc: interrupt-controller@2000000 {
 		};
 
 		timer@200a000 {
-			compatible = "qcom,kpss-timer",
-				     "qcom,kpss-wdt-msm8960", "qcom,msm-timer";
+			compatible = "qcom,kpss-wdt-msm8960", "qcom,kpss-timer",
+				     "qcom,msm-timer";
 			interrupts = <GIC_PPI 1 0x301>,
 				     <GIC_PPI 2 0x301>,
 				     <GIC_PPI 3 0x301>;
-- 
2.34.1


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

* [PATCH 08/12] ARM: dts: qcom: apq8064: drop second clock frequency from timer
  2022-12-12 16:35 [PATCH 01/12] dt-bindings: watchdog: qcom-wdt: require fallback for IPQ4019 Krzysztof Kozlowski
                   ` (5 preceding siblings ...)
  2022-12-12 16:35 ` [PATCH 07/12] ARM: dts: qcom: reverse compatibles to match bindings Krzysztof Kozlowski
@ 2022-12-12 16:35 ` Krzysztof Kozlowski
  2022-12-13  9:34   ` Konrad Dybcio
  2022-12-12 16:35 ` [PATCH 09/12] ARM: dts: qcom: ipq8064: " Krzysztof Kozlowski
                   ` (6 subsequent siblings)
  13 siblings, 1 reply; 34+ messages in thread
From: Krzysztof Kozlowski @ 2022-12-12 16:35 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski
  Cc: Krzysztof Kozlowski, linux-arm-msm, devicetree, linux-kernel

Keep only one clock frequency for timer, because:
1. DT schema does not allow multiple frequencies in such property,
2. The Linux timer driver reads only first frequency.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 arch/arm/boot/dts/qcom-apq8064.dtsi | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/qcom-apq8064.dtsi b/arch/arm/boot/dts/qcom-apq8064.dtsi
index 79575d6b3a81..9da6459c9f67 100644
--- a/arch/arm/boot/dts/qcom-apq8064.dtsi
+++ b/arch/arm/boot/dts/qcom-apq8064.dtsi
@@ -381,8 +381,7 @@ timer@200a000 {
 				     <1 2 0x301>,
 				     <1 3 0x301>;
 			reg = <0x0200a000 0x100>;
-			clock-frequency = <27000000>,
-					  <32768>;
+			clock-frequency = <27000000>;
 			cpu-offset = <0x80000>;
 		};
 
-- 
2.34.1


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

* [PATCH 09/12] ARM: dts: qcom: ipq8064: drop second clock frequency from timer
  2022-12-12 16:35 [PATCH 01/12] dt-bindings: watchdog: qcom-wdt: require fallback for IPQ4019 Krzysztof Kozlowski
                   ` (6 preceding siblings ...)
  2022-12-12 16:35 ` [PATCH 08/12] ARM: dts: qcom: apq8064: drop second clock frequency from timer Krzysztof Kozlowski
@ 2022-12-12 16:35 ` Krzysztof Kozlowski
  2022-12-13  9:34   ` Konrad Dybcio
  2022-12-12 16:35 ` [PATCH 10/12] ARM: dts: qcom: mdm9615: " Krzysztof Kozlowski
                   ` (5 subsequent siblings)
  13 siblings, 1 reply; 34+ messages in thread
From: Krzysztof Kozlowski @ 2022-12-12 16:35 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski
  Cc: Krzysztof Kozlowski, linux-arm-msm, devicetree, linux-kernel

Keep only one clock frequency for timer, because:
1. DT schema does not allow multiple frequencies in such property,
2. The Linux timer driver reads only first frequency.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 arch/arm/boot/dts/qcom-ipq8064.dtsi | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/qcom-ipq8064.dtsi b/arch/arm/boot/dts/qcom-ipq8064.dtsi
index 9daafe9de02a..ae018a7dc6fd 100644
--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
+++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
@@ -562,8 +562,7 @@ IRQ_TYPE_EDGE_RISING)>,
 				     <GIC_PPI 5 (GIC_CPU_MASK_SIMPLE(2) |
 						 IRQ_TYPE_EDGE_RISING)>;
 			reg = <0x0200a000 0x100>;
-			clock-frequency = <25000000>,
-					  <32768>;
+			clock-frequency = <25000000>;
 			clocks = <&sleep_clk>;
 			clock-names = "sleep";
 			cpu-offset = <0x80000>;
-- 
2.34.1


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

* [PATCH 10/12] ARM: dts: qcom: mdm9615: drop second clock frequency from timer
  2022-12-12 16:35 [PATCH 01/12] dt-bindings: watchdog: qcom-wdt: require fallback for IPQ4019 Krzysztof Kozlowski
                   ` (7 preceding siblings ...)
  2022-12-12 16:35 ` [PATCH 09/12] ARM: dts: qcom: ipq8064: " Krzysztof Kozlowski
@ 2022-12-12 16:35 ` Krzysztof Kozlowski
  2022-12-13  9:34   ` Konrad Dybcio
  2022-12-12 16:35 ` [PATCH 11/12] ARM: dts: qcom: msm8960: " Krzysztof Kozlowski
                   ` (4 subsequent siblings)
  13 siblings, 1 reply; 34+ messages in thread
From: Krzysztof Kozlowski @ 2022-12-12 16:35 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski
  Cc: Krzysztof Kozlowski, linux-arm-msm, devicetree, linux-kernel

Keep only one clock frequency for timer, because:
1. DT schema does not allow multiple frequencies in such property,
2. The Linux timer driver reads only first frequency.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 arch/arm/boot/dts/qcom-mdm9615.dtsi | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/qcom-mdm9615.dtsi b/arch/arm/boot/dts/qcom-mdm9615.dtsi
index b0fe1d95d88f..a6331e5ebe09 100644
--- a/arch/arm/boot/dts/qcom-mdm9615.dtsi
+++ b/arch/arm/boot/dts/qcom-mdm9615.dtsi
@@ -84,8 +84,7 @@ timer@200a000 {
 				     <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_EDGE_RISING)>,
 				     <GIC_PPI 3 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_EDGE_RISING)>;
 			reg = <0x0200a000 0x100>;
-			clock-frequency = <27000000>,
-					  <32768>;
+			clock-frequency = <27000000>;
 			cpu-offset = <0x80000>;
 		};
 
-- 
2.34.1


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

* [PATCH 11/12] ARM: dts: qcom: msm8960: drop second clock frequency from timer
  2022-12-12 16:35 [PATCH 01/12] dt-bindings: watchdog: qcom-wdt: require fallback for IPQ4019 Krzysztof Kozlowski
                   ` (8 preceding siblings ...)
  2022-12-12 16:35 ` [PATCH 10/12] ARM: dts: qcom: mdm9615: " Krzysztof Kozlowski
@ 2022-12-12 16:35 ` Krzysztof Kozlowski
  2022-12-13  9:34   ` Konrad Dybcio
  2022-12-12 16:35 ` [PATCH 12/12] ARM: dts: qcom: msm8960: add qcom,kpss-wdt-mdm9615 Krzysztof Kozlowski
                   ` (3 subsequent siblings)
  13 siblings, 1 reply; 34+ messages in thread
From: Krzysztof Kozlowski @ 2022-12-12 16:35 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski
  Cc: Krzysztof Kozlowski, linux-arm-msm, devicetree, linux-kernel

Keep only one clock frequency for timer, because:
1. DT schema does not allow multiple frequencies in such property,
2. The Linux timer driver reads only first frequency.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 arch/arm/boot/dts/qcom-msm8960.dtsi | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/qcom-msm8960.dtsi b/arch/arm/boot/dts/qcom-msm8960.dtsi
index 63c3c40fe9a2..a0369b38fe07 100644
--- a/arch/arm/boot/dts/qcom-msm8960.dtsi
+++ b/arch/arm/boot/dts/qcom-msm8960.dtsi
@@ -109,8 +109,7 @@ timer@200a000 {
 				     <GIC_PPI 2 0x301>,
 				     <GIC_PPI 3 0x301>;
 			reg = <0x0200a000 0x100>;
-			clock-frequency = <27000000>,
-					  <32768>;
+			clock-frequency = <27000000>;
 			cpu-offset = <0x80000>;
 		};
 
-- 
2.34.1


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

* [PATCH 12/12] ARM: dts: qcom: msm8960: add qcom,kpss-wdt-mdm9615
  2022-12-12 16:35 [PATCH 01/12] dt-bindings: watchdog: qcom-wdt: require fallback for IPQ4019 Krzysztof Kozlowski
                   ` (9 preceding siblings ...)
  2022-12-12 16:35 ` [PATCH 11/12] ARM: dts: qcom: msm8960: " Krzysztof Kozlowski
@ 2022-12-12 16:35 ` Krzysztof Kozlowski
  2022-12-13  9:34   ` Konrad Dybcio
  2022-12-13 15:33 ` [PATCH 01/12] dt-bindings: watchdog: qcom-wdt: require fallback for IPQ4019 Rob Herring
                   ` (2 subsequent siblings)
  13 siblings, 1 reply; 34+ messages in thread
From: Krzysztof Kozlowski @ 2022-12-12 16:35 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski
  Cc: Krzysztof Kozlowski, linux-arm-msm, devicetree, linux-kernel

Add specific compatible to timer/watchdog device node.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 arch/arm/boot/dts/qcom-mdm9615.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/qcom-mdm9615.dtsi b/arch/arm/boot/dts/qcom-mdm9615.dtsi
index a6331e5ebe09..536bd7b50762 100644
--- a/arch/arm/boot/dts/qcom-mdm9615.dtsi
+++ b/arch/arm/boot/dts/qcom-mdm9615.dtsi
@@ -79,7 +79,8 @@ intc: interrupt-controller@2000000 {
 		};
 
 		timer@200a000 {
-			compatible = "qcom,kpss-timer", "qcom,msm-timer";
+			compatible = "qcom,kpss-wdt-mdm9615", "qcom,kpss-timer",
+				     "qcom,msm-timer";
 			interrupts = <GIC_PPI 1 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_EDGE_RISING)>,
 				     <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_EDGE_RISING)>,
 				     <GIC_PPI 3 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_EDGE_RISING)>;
-- 
2.34.1


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

* Re: [PATCH 06/12] dt-bindings: watchdog: qcom-wdt: merge MSM timer
  2022-12-12 16:35 ` [PATCH 06/12] dt-bindings: watchdog: qcom-wdt: merge MSM timer Krzysztof Kozlowski
@ 2022-12-13  9:11   ` Daniel Lezcano
  2022-12-13 15:40   ` Rob Herring
  2023-01-31 17:33   ` Guenter Roeck
  2 siblings, 0 replies; 34+ messages in thread
From: Daniel Lezcano @ 2022-12-13  9:11 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Thomas Gleixner, Rob Herring, Krzysztof Kozlowski,
	Wim Van Sebroeck, Guenter Roeck, Prakash Ranjan
  Cc: linux-arm-msm, linux-kernel, devicetree, linux-watchdog

On 12/12/2022 17:35, Krzysztof Kozlowski wrote:
> Merge Qualcomm MSM timer bindings into watchdog, because the timer
> compatibles are already included here and the hardware is quite similar.
> 
> While converting the MSM timer bindings, adjust clock-frequency
> property to take only one frequency, instead of two, because:
> 1. DT schema does not allow to frequencies,
> 2. The Linux timer driver reads only first frequency.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---

Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>

-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


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

* Re: [PATCH 07/12] ARM: dts: qcom: reverse compatibles to match bindings
  2022-12-12 16:35 ` [PATCH 07/12] ARM: dts: qcom: reverse compatibles to match bindings Krzysztof Kozlowski
@ 2022-12-13  9:31   ` Konrad Dybcio
  0 siblings, 0 replies; 34+ messages in thread
From: Konrad Dybcio @ 2022-12-13  9:31 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Andy Gross, Bjorn Andersson, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-arm-msm, devicetree, linux-kernel



On 12.12.2022 17:35, Krzysztof Kozlowski wrote:
> The most specific compatible should be upfront.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
>  arch/arm/boot/dts/qcom-apq8064.dtsi | 4 ++--
>  arch/arm/boot/dts/qcom-ipq4019.dtsi | 2 +-
>  arch/arm/boot/dts/qcom-ipq8064.dtsi | 4 ++--
>  arch/arm/boot/dts/qcom-msm8960.dtsi | 4 ++--
>  4 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/qcom-apq8064.dtsi b/arch/arm/boot/dts/qcom-apq8064.dtsi
> index 0da9623ea084..79575d6b3a81 100644
> --- a/arch/arm/boot/dts/qcom-apq8064.dtsi
> +++ b/arch/arm/boot/dts/qcom-apq8064.dtsi
> @@ -375,8 +375,8 @@ intc: interrupt-controller@2000000 {
>  		};
>  
>  		timer@200a000 {
> -			compatible = "qcom,kpss-timer",
> -				     "qcom,kpss-wdt-apq8064", "qcom,msm-timer";
> +			compatible = "qcom,kpss-wdt-apq8064", "qcom,kpss-timer",
> +				     "qcom,msm-timer";
>  			interrupts = <1 1 0x301>,
>  				     <1 2 0x301>,
>  				     <1 3 0x301>;
> diff --git a/arch/arm/boot/dts/qcom-ipq4019.dtsi b/arch/arm/boot/dts/qcom-ipq4019.dtsi
> index acb08dcf9442..a73c3a17b6a4 100644
> --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi
> +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi
> @@ -400,7 +400,7 @@ blsp1_uart2: serial@78b0000 {
>  		};
>  
>  		watchdog: watchdog@b017000 {
> -			compatible = "qcom,kpss-wdt", "qcom,kpss-wdt-ipq4019";
> +			compatible = "qcom,kpss-wdt-ipq4019", "qcom,kpss-wdt";
>  			reg = <0xb017000 0x40>;
>  			clocks = <&sleep_clk>;
>  			timeout-sec = <10>;
> diff --git a/arch/arm/boot/dts/qcom-ipq8064.dtsi b/arch/arm/boot/dts/qcom-ipq8064.dtsi
> index 7e784b0995da..9daafe9de02a 100644
> --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
> +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
> @@ -549,8 +549,8 @@ intc: interrupt-controller@2000000 {
>  		};
>  
>  		timer@200a000 {
> -			compatible = "qcom,kpss-timer",
> -				     "qcom,kpss-wdt-ipq8064", "qcom,msm-timer";
> +			compatible = "qcom,kpss-wdt-ipq8064", "qcom,kpss-timer",
> +				     "qcom,msm-timer";
>  			interrupts = <GIC_PPI 1 (GIC_CPU_MASK_SIMPLE(2) |
>  						 IRQ_TYPE_EDGE_RISING)>,
>  				     <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(2) |
> diff --git a/arch/arm/boot/dts/qcom-msm8960.dtsi b/arch/arm/boot/dts/qcom-msm8960.dtsi
> index 7debf9db7cb1..63c3c40fe9a2 100644
> --- a/arch/arm/boot/dts/qcom-msm8960.dtsi
> +++ b/arch/arm/boot/dts/qcom-msm8960.dtsi
> @@ -103,8 +103,8 @@ intc: interrupt-controller@2000000 {
>  		};
>  
>  		timer@200a000 {
> -			compatible = "qcom,kpss-timer",
> -				     "qcom,kpss-wdt-msm8960", "qcom,msm-timer";
> +			compatible = "qcom,kpss-wdt-msm8960", "qcom,kpss-timer",
> +				     "qcom,msm-timer";
>  			interrupts = <GIC_PPI 1 0x301>,
>  				     <GIC_PPI 2 0x301>,
>  				     <GIC_PPI 3 0x301>;

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

* Re: [PATCH 08/12] ARM: dts: qcom: apq8064: drop second clock frequency from timer
  2022-12-12 16:35 ` [PATCH 08/12] ARM: dts: qcom: apq8064: drop second clock frequency from timer Krzysztof Kozlowski
@ 2022-12-13  9:34   ` Konrad Dybcio
  0 siblings, 0 replies; 34+ messages in thread
From: Konrad Dybcio @ 2022-12-13  9:34 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Andy Gross, Bjorn Andersson, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-arm-msm, devicetree, linux-kernel



On 12.12.2022 17:35, Krzysztof Kozlowski wrote:
> Keep only one clock frequency for timer, because:
> 1. DT schema does not allow multiple frequencies in such property,
> 2. The Linux timer driver reads only first frequency.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
>  arch/arm/boot/dts/qcom-apq8064.dtsi | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/qcom-apq8064.dtsi b/arch/arm/boot/dts/qcom-apq8064.dtsi
> index 79575d6b3a81..9da6459c9f67 100644
> --- a/arch/arm/boot/dts/qcom-apq8064.dtsi
> +++ b/arch/arm/boot/dts/qcom-apq8064.dtsi
> @@ -381,8 +381,7 @@ timer@200a000 {
>  				     <1 2 0x301>,
>  				     <1 3 0x301>;
>  			reg = <0x0200a000 0x100>;
> -			clock-frequency = <27000000>,
> -					  <32768>;
> +			clock-frequency = <27000000>;
>  			cpu-offset = <0x80000>;
>  		};
>  

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

* Re: [PATCH 09/12] ARM: dts: qcom: ipq8064: drop second clock frequency from timer
  2022-12-12 16:35 ` [PATCH 09/12] ARM: dts: qcom: ipq8064: " Krzysztof Kozlowski
@ 2022-12-13  9:34   ` Konrad Dybcio
  0 siblings, 0 replies; 34+ messages in thread
From: Konrad Dybcio @ 2022-12-13  9:34 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Andy Gross, Bjorn Andersson, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-arm-msm, devicetree, linux-kernel



On 12.12.2022 17:35, Krzysztof Kozlowski wrote:
> Keep only one clock frequency for timer, because:
> 1. DT schema does not allow multiple frequencies in such property,
> 2. The Linux timer driver reads only first frequency.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
>  arch/arm/boot/dts/qcom-ipq8064.dtsi | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/qcom-ipq8064.dtsi b/arch/arm/boot/dts/qcom-ipq8064.dtsi
> index 9daafe9de02a..ae018a7dc6fd 100644
> --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
> +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
> @@ -562,8 +562,7 @@ IRQ_TYPE_EDGE_RISING)>,
>  				     <GIC_PPI 5 (GIC_CPU_MASK_SIMPLE(2) |
>  						 IRQ_TYPE_EDGE_RISING)>;
>  			reg = <0x0200a000 0x100>;
> -			clock-frequency = <25000000>,
> -					  <32768>;
> +			clock-frequency = <25000000>;
>  			clocks = <&sleep_clk>;
>  			clock-names = "sleep";
>  			cpu-offset = <0x80000>;

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

* Re: [PATCH 10/12] ARM: dts: qcom: mdm9615: drop second clock frequency from timer
  2022-12-12 16:35 ` [PATCH 10/12] ARM: dts: qcom: mdm9615: " Krzysztof Kozlowski
@ 2022-12-13  9:34   ` Konrad Dybcio
  0 siblings, 0 replies; 34+ messages in thread
From: Konrad Dybcio @ 2022-12-13  9:34 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Andy Gross, Bjorn Andersson, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-arm-msm, devicetree, linux-kernel



On 12.12.2022 17:35, Krzysztof Kozlowski wrote:
> Keep only one clock frequency for timer, because:
> 1. DT schema does not allow multiple frequencies in such property,
> 2. The Linux timer driver reads only first frequency.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
>  arch/arm/boot/dts/qcom-mdm9615.dtsi | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/qcom-mdm9615.dtsi b/arch/arm/boot/dts/qcom-mdm9615.dtsi
> index b0fe1d95d88f..a6331e5ebe09 100644
> --- a/arch/arm/boot/dts/qcom-mdm9615.dtsi
> +++ b/arch/arm/boot/dts/qcom-mdm9615.dtsi
> @@ -84,8 +84,7 @@ timer@200a000 {
>  				     <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_EDGE_RISING)>,
>  				     <GIC_PPI 3 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_EDGE_RISING)>;
>  			reg = <0x0200a000 0x100>;
> -			clock-frequency = <27000000>,
> -					  <32768>;
> +			clock-frequency = <27000000>;
>  			cpu-offset = <0x80000>;
>  		};
>  

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

* Re: [PATCH 11/12] ARM: dts: qcom: msm8960: drop second clock frequency from timer
  2022-12-12 16:35 ` [PATCH 11/12] ARM: dts: qcom: msm8960: " Krzysztof Kozlowski
@ 2022-12-13  9:34   ` Konrad Dybcio
  0 siblings, 0 replies; 34+ messages in thread
From: Konrad Dybcio @ 2022-12-13  9:34 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Andy Gross, Bjorn Andersson, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-arm-msm, devicetree, linux-kernel



On 12.12.2022 17:35, Krzysztof Kozlowski wrote:
> Keep only one clock frequency for timer, because:
> 1. DT schema does not allow multiple frequencies in such property,
> 2. The Linux timer driver reads only first frequency.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
>  arch/arm/boot/dts/qcom-msm8960.dtsi | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/qcom-msm8960.dtsi b/arch/arm/boot/dts/qcom-msm8960.dtsi
> index 63c3c40fe9a2..a0369b38fe07 100644
> --- a/arch/arm/boot/dts/qcom-msm8960.dtsi
> +++ b/arch/arm/boot/dts/qcom-msm8960.dtsi
> @@ -109,8 +109,7 @@ timer@200a000 {
>  				     <GIC_PPI 2 0x301>,
>  				     <GIC_PPI 3 0x301>;
>  			reg = <0x0200a000 0x100>;
> -			clock-frequency = <27000000>,
> -					  <32768>;
> +			clock-frequency = <27000000>;
>  			cpu-offset = <0x80000>;
>  		};
>  

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

* Re: [PATCH 12/12] ARM: dts: qcom: msm8960: add qcom,kpss-wdt-mdm9615
  2022-12-12 16:35 ` [PATCH 12/12] ARM: dts: qcom: msm8960: add qcom,kpss-wdt-mdm9615 Krzysztof Kozlowski
@ 2022-12-13  9:34   ` Konrad Dybcio
  0 siblings, 0 replies; 34+ messages in thread
From: Konrad Dybcio @ 2022-12-13  9:34 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Andy Gross, Bjorn Andersson, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-arm-msm, devicetree, linux-kernel



On 12.12.2022 17:35, Krzysztof Kozlowski wrote:
> Add specific compatible to timer/watchdog device node.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
>  arch/arm/boot/dts/qcom-mdm9615.dtsi | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/qcom-mdm9615.dtsi b/arch/arm/boot/dts/qcom-mdm9615.dtsi
> index a6331e5ebe09..536bd7b50762 100644
> --- a/arch/arm/boot/dts/qcom-mdm9615.dtsi
> +++ b/arch/arm/boot/dts/qcom-mdm9615.dtsi
> @@ -79,7 +79,8 @@ intc: interrupt-controller@2000000 {
>  		};
>  
>  		timer@200a000 {
> -			compatible = "qcom,kpss-timer", "qcom,msm-timer";
> +			compatible = "qcom,kpss-wdt-mdm9615", "qcom,kpss-timer",
> +				     "qcom,msm-timer";
>  			interrupts = <GIC_PPI 1 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_EDGE_RISING)>,
>  				     <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_EDGE_RISING)>,
>  				     <GIC_PPI 3 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_EDGE_RISING)>;

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

* Re: [PATCH 01/12] dt-bindings: watchdog: qcom-wdt: require fallback for IPQ4019
  2022-12-12 16:35 [PATCH 01/12] dt-bindings: watchdog: qcom-wdt: require fallback for IPQ4019 Krzysztof Kozlowski
                   ` (10 preceding siblings ...)
  2022-12-12 16:35 ` [PATCH 12/12] ARM: dts: qcom: msm8960: add qcom,kpss-wdt-mdm9615 Krzysztof Kozlowski
@ 2022-12-13 15:33 ` Rob Herring
  2023-01-11  5:09 ` (subset) " Bjorn Andersson
  2023-01-31 17:31 ` Guenter Roeck
  13 siblings, 0 replies; 34+ messages in thread
From: Rob Herring @ 2022-12-13 15:33 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: devicetree, linux-watchdog, Andy Gross, Rob Herring,
	Guenter Roeck, linux-arm-msm, Prakash Ranjan,
	Krzysztof Kozlowski, Bjorn Andersson, Konrad Dybcio,
	linux-kernel, Wim Van Sebroeck


On Mon, 12 Dec 2022 17:35:21 +0100, Krzysztof Kozlowski wrote:
> The device specific compatibles ("qcom,kpss-wdt-ipq4019") should be
> follwed by fallback "qcom,kpss-wdt", which is actually used by Linux
> driver for binding.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

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

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

* Re: [PATCH 05/12] dt-bindings: watchdog: qcom-wdt: allow interrupts
  2022-12-12 16:35 ` [PATCH 05/12] dt-bindings: watchdog: qcom-wdt: allow interrupts Krzysztof Kozlowski
@ 2022-12-13 15:35   ` Rob Herring
  2022-12-13 15:41   ` Rob Herring
  2023-01-31 17:33   ` Guenter Roeck
  2 siblings, 0 replies; 34+ messages in thread
From: Rob Herring @ 2022-12-13 15:35 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Wim Van Sebroeck,
	Guenter Roeck, Krzysztof Kozlowski, Prakash Ranjan,
	linux-arm-msm, linux-watchdog, devicetree, linux-kernel

On Mon, Dec 12, 2022 at 05:35:25PM +0100, Krzysztof Kozlowski wrote:
> Both of type of watchdogs described in the binding (the KPSS watchdog
> and APSS WDT timer) have interrupts.  Allow interrupts and describe them
> for KPSS watchdog to fix warnings like:
> 
>   watchdog@17c10000: Unevaluated properties are not allowed ('interrupts' was unexpected)
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  .../bindings/watchdog/qcom-wdt.yaml           | 24 ++++++++++++++++---
>  1 file changed, 21 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> index 1828eaf70b3b..b7fc57f4800e 100644
> --- a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> +++ b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> @@ -9,9 +9,6 @@ title: Qualcomm Krait Processor Sub-system (KPSS) Watchdog timer
>  maintainers:
>    - Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
>  
> -allOf:
> -  - $ref: watchdog.yaml#
> -
>  properties:
>    compatible:
>      oneOf:
> @@ -51,11 +48,31 @@ properties:
>    clocks:
>      maxItems: 1
>  
> +  interrupts:
> +    minItems: 1
> +    maxItems: 5

I only see 2 interrupts described at all.

> +
>  required:
>    - compatible
>    - reg
>    - clocks
>  
> +allOf:
> +  - $ref: watchdog.yaml#
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: qcom,kpss-wdt
> +    then:
> +      properties:
> +        interrupts:
> +          minItems: 1
> +          items:
> +            - description: Bark
> +            - description: Bite
> +
>  unevaluatedProperties: false
>  
>  examples:
> @@ -66,5 +83,6 @@ examples:
>        compatible = "qcom,apss-wdt-sm8150", "qcom,kpss-wdt";
>        reg = <0x17c10000 0x1000>;
>        clocks = <&sleep_clk>;
> +      interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
>        timeout-sec = <10>;
>      };
> -- 
> 2.34.1
> 
> 

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

* Re: [PATCH 02/12] dt-bindings: watchdog: qcom-wdt: do not allow fallback alone
  2022-12-12 16:35 ` [PATCH 02/12] dt-bindings: watchdog: qcom-wdt: do not allow fallback alone Krzysztof Kozlowski
@ 2022-12-13 15:35   ` Rob Herring
  2023-01-31 17:31   ` Guenter Roeck
  1 sibling, 0 replies; 34+ messages in thread
From: Rob Herring @ 2022-12-13 15:35 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Prakash Ranjan, linux-arm-msm, Wim Van Sebroeck, devicetree,
	Konrad Dybcio, linux-watchdog, Rob Herring, Bjorn Andersson,
	linux-kernel, Krzysztof Kozlowski, Guenter Roeck, Andy Gross


On Mon, 12 Dec 2022 17:35:22 +0100, Krzysztof Kozlowski wrote:
> The compatible "qcom,kpss-wdt" is too generic and should not be used
> alone.  Mark it as deprecated when not prepended by specific compatible.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 

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

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

* Re: [PATCH 03/12] dt-bindings: watchdog: qcom-wdt: fix list of MSM timer compatibles
  2022-12-12 16:35 ` [PATCH 03/12] dt-bindings: watchdog: qcom-wdt: fix list of MSM timer compatibles Krzysztof Kozlowski
@ 2022-12-13 15:37   ` Rob Herring
  2023-01-31 17:31   ` Guenter Roeck
  1 sibling, 0 replies; 34+ messages in thread
From: Rob Herring @ 2022-12-13 15:37 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Prakash Ranjan, Guenter Roeck, linux-watchdog, Rob Herring,
	linux-arm-msm, Wim Van Sebroeck, Andy Gross, linux-kernel,
	Konrad Dybcio, devicetree, Bjorn Andersson, Krzysztof Kozlowski


On Mon, 12 Dec 2022 17:35:23 +0100, Krzysztof Kozlowski wrote:
> The MSM timer ("qcom,msm-timer") is a bit different timer and watchdog
> device than KPSS watchdog.  It has its own generic and specific
> compatibles, so fix the list to reflect this.  Adjust the example to
> show the newer KPSS watchdog.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  .../devicetree/bindings/watchdog/qcom-wdt.yaml    | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
> 

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

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

* Re: [PATCH 04/12] dt-bindings: watchdog: qcom-wdt: add qcom,kpss-wdt-mdm9615
  2022-12-12 16:35 ` [PATCH 04/12] dt-bindings: watchdog: qcom-wdt: add qcom,kpss-wdt-mdm9615 Krzysztof Kozlowski
@ 2022-12-13 15:37   ` Rob Herring
  2023-01-31 17:32   ` Guenter Roeck
  1 sibling, 0 replies; 34+ messages in thread
From: Rob Herring @ 2022-12-13 15:37 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Krzysztof Kozlowski, linux-watchdog, Konrad Dybcio, linux-kernel,
	Bjorn Andersson, linux-arm-msm, Prakash Ranjan, Guenter Roeck,
	devicetree, Wim Van Sebroeck, Andy Gross, Rob Herring


On Mon, 12 Dec 2022 17:35:24 +0100, Krzysztof Kozlowski wrote:
> Document new MDM9615 qcom,kpss-wdt-mdm9615 watchdog/timer compatible.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml | 1 +
>  1 file changed, 1 insertion(+)
> 

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

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

* Re: [PATCH 06/12] dt-bindings: watchdog: qcom-wdt: merge MSM timer
  2022-12-12 16:35 ` [PATCH 06/12] dt-bindings: watchdog: qcom-wdt: merge MSM timer Krzysztof Kozlowski
  2022-12-13  9:11   ` Daniel Lezcano
@ 2022-12-13 15:40   ` Rob Herring
  2022-12-13 16:13     ` Krzysztof Kozlowski
  2023-01-31 17:33   ` Guenter Roeck
  2 siblings, 1 reply; 34+ messages in thread
From: Rob Herring @ 2022-12-13 15:40 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Daniel Lezcano,
	Thomas Gleixner, Krzysztof Kozlowski, Wim Van Sebroeck,
	Guenter Roeck, Prakash Ranjan, linux-arm-msm, linux-kernel,
	devicetree, linux-watchdog

On Mon, Dec 12, 2022 at 05:35:26PM +0100, Krzysztof Kozlowski wrote:
> Merge Qualcomm MSM timer bindings into watchdog, because the timer
> compatibles are already included here and the hardware is quite similar.
> 
> While converting the MSM timer bindings, adjust clock-frequency
> property to take only one frequency, instead of two, because:
> 1. DT schema does not allow to frequencies,
> 2. The Linux timer driver reads only first frequency.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  .../bindings/timer/qcom,msm-timer.txt         | 47 ------------------
>  .../bindings/watchdog/qcom-wdt.yaml           | 49 +++++++++++++++++++
>  2 files changed, 49 insertions(+), 47 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/timer/qcom,msm-timer.txt
> 
> diff --git a/Documentation/devicetree/bindings/timer/qcom,msm-timer.txt b/Documentation/devicetree/bindings/timer/qcom,msm-timer.txt
> deleted file mode 100644
> index 5e10c345548f..000000000000
> --- a/Documentation/devicetree/bindings/timer/qcom,msm-timer.txt
> +++ /dev/null
> @@ -1,47 +0,0 @@
> -* MSM Timer
> -
> -Properties:
> -
> -- compatible : Should at least contain "qcom,msm-timer". More specific
> -               properties specify which subsystem the timers are paired with.
> -
> -               "qcom,kpss-timer" - krait subsystem
> -               "qcom,scss-timer" - scorpion subsystem
> -
> -- interrupts : Interrupts for the debug timer, the first general purpose
> -               timer, and optionally a second general purpose timer, and
> -               optionally as well, 2 watchdog interrupts, in that order.
> -
> -- reg : Specifies the base address of the timer registers.
> -
> -- clocks: Reference to the parent clocks, one per output clock. The parents
> -          must appear in the same order as the clock names.
> -
> -- clock-names: The name of the clocks as free-form strings. They should be in
> -               the same order as the clocks.
> -
> -- clock-frequency : The frequency of the debug timer and the general purpose
> -                    timer(s) in Hz in that order.
> -
> -Optional:
> -
> -- cpu-offset : per-cpu offset used when the timer is accessed without the
> -               CPU remapping facilities. The offset is
> -               cpu-offset + (0x10000 * cpu-nr).
> -
> -Example:
> -
> -       timer@200a000 {
> -               compatible = "qcom,scss-timer", "qcom,msm-timer";
> -               interrupts = <1 1 0x301>,
> -                            <1 2 0x301>,
> -                            <1 3 0x301>,
> -                            <1 4 0x301>,
> -                            <1 5 0x301>;
> -               reg = <0x0200a000 0x100>;
> -               clock-frequency = <19200000>,
> -                                 <32768>;
> -               clocks = <&sleep_clk>;
> -               clock-names = "sleep";
> -               cpu-offset = <0x40000>;
> -       };
> diff --git a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> index b7fc57f4800e..697caf1937cc 100644
> --- a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> +++ b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> @@ -10,6 +10,9 @@ maintainers:
>    - Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
>  
>  properties:
> +  $nodename:
> +    pattern: "^(watchdog|timer)@[0-9a-f]+$"
> +
>    compatible:
>      oneOf:
>        - items:
> @@ -48,6 +51,20 @@ properties:
>    clocks:
>      maxItems: 1
>  
> +  clock-names:
> +    items:
> +      - const: sleep
> +
> +  clock-frequency:
> +    description:
> +      The frequency of the general purpose timer in Hz in that order.

'in that order'?

> +
> +  cpu-offset:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      Per-CPU offset used when the timer is accessed without the CPU remapping
> +      facilities. The offset is cpu-offset + (0x10000 * cpu-nr).
> +
>    interrupts:
>      minItems: 1
>      maxItems: 5
> @@ -67,12 +84,27 @@ allOf:
>              const: qcom,kpss-wdt
>      then:
>        properties:
> +        clock-frequency: false
> +        cpu-offset: false
>          interrupts:
>            minItems: 1
>            items:
>              - description: Bark
>              - description: Bite
>  
> +    else:
> +      properties:
> +        interrupts:
> +          minItems: 3
> +          items:
> +            - description: Debug
> +            - description: First general purpose timer
> +            - description: Second general purpose timer
> +            - description: First watchdog
> +            - description: Second watchdog

Okay, here they are. No need to set it to 2 then change to 5 in the 
series.

> +      required:
> +        - clock-frequency
> +
>  unevaluatedProperties: false
>  
>  examples:
> @@ -86,3 +118,20 @@ examples:
>        interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
>        timeout-sec = <10>;
>      };
> +
> +  - |
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> +    watchdog@200a000 {
> +      compatible = "qcom,kpss-wdt-ipq8064", "qcom,kpss-timer", "qcom,msm-timer";
> +      interrupts = <GIC_PPI 1 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_EDGE_RISING)>,
> +                   <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_EDGE_RISING)>,
> +                   <GIC_PPI 3 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_EDGE_RISING)>,
> +                   <GIC_PPI 4 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_EDGE_RISING)>,
> +                   <GIC_PPI 5 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_EDGE_RISING)>;
> +      reg = <0x0200a000 0x100>;
> +      clock-frequency = <25000000>;
> +      clocks = <&sleep_clk>;
> +      clock-names = "sleep";
> +      cpu-offset = <0x80000>;
> +    };
> -- 
> 2.34.1
> 
> 

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

* Re: [PATCH 05/12] dt-bindings: watchdog: qcom-wdt: allow interrupts
  2022-12-12 16:35 ` [PATCH 05/12] dt-bindings: watchdog: qcom-wdt: allow interrupts Krzysztof Kozlowski
  2022-12-13 15:35   ` Rob Herring
@ 2022-12-13 15:41   ` Rob Herring
  2023-01-31 17:33   ` Guenter Roeck
  2 siblings, 0 replies; 34+ messages in thread
From: Rob Herring @ 2022-12-13 15:41 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Wim Van Sebroeck,
	Guenter Roeck, Krzysztof Kozlowski, Prakash Ranjan,
	linux-arm-msm, linux-watchdog, devicetree, linux-kernel

On Mon, Dec 12, 2022 at 05:35:25PM +0100, Krzysztof Kozlowski wrote:
> Both of type of watchdogs described in the binding (the KPSS watchdog
> and APSS WDT timer) have interrupts.  Allow interrupts and describe them
> for KPSS watchdog to fix warnings like:
> 
>   watchdog@17c10000: Unevaluated properties are not allowed ('interrupts' was unexpected)
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  .../bindings/watchdog/qcom-wdt.yaml           | 24 ++++++++++++++++---
>  1 file changed, 21 insertions(+), 3 deletions(-)

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

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

* Re: [PATCH 06/12] dt-bindings: watchdog: qcom-wdt: merge MSM timer
  2022-12-13 15:40   ` Rob Herring
@ 2022-12-13 16:13     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 34+ messages in thread
From: Krzysztof Kozlowski @ 2022-12-13 16:13 UTC (permalink / raw)
  To: Rob Herring
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Daniel Lezcano,
	Thomas Gleixner, Krzysztof Kozlowski, Wim Van Sebroeck,
	Guenter Roeck, Prakash Ranjan, linux-arm-msm, linux-kernel,
	devicetree, linux-watchdog

On 13/12/2022 16:40, Rob Herring wrote:
> On Mon, Dec 12, 2022 at 05:35:26PM +0100, Krzysztof Kozlowski wrote:
>> Merge Qualcomm MSM timer bindings into watchdog, because the timer
>> compatibles are already included here and the hardware is quite similar.
>>
>> While converting the MSM timer bindings, adjust clock-frequency
>> property to take only one frequency, instead of two, because:
>> 1. DT schema does not allow to frequencies,
>> 2. The Linux timer driver reads only first frequency.
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> ---
>>  .../bindings/timer/qcom,msm-timer.txt         | 47 ------------------
>>  .../bindings/watchdog/qcom-wdt.yaml           | 49 +++++++++++++++++++
>>  2 files changed, 49 insertions(+), 47 deletions(-)
>>  delete mode 100644 Documentation/devicetree/bindings/timer/qcom,msm-timer.txt
>>
>> diff --git a/Documentation/devicetree/bindings/timer/qcom,msm-timer.txt b/Documentation/devicetree/bindings/timer/qcom,msm-timer.txt
>> deleted file mode 100644
>> index 5e10c345548f..000000000000
>> --- a/Documentation/devicetree/bindings/timer/qcom,msm-timer.txt
>> +++ /dev/null
>> @@ -1,47 +0,0 @@
>> -* MSM Timer
>> -
>> -Properties:
>> -
>> -- compatible : Should at least contain "qcom,msm-timer". More specific
>> -               properties specify which subsystem the timers are paired with.
>> -
>> -               "qcom,kpss-timer" - krait subsystem
>> -               "qcom,scss-timer" - scorpion subsystem
>> -
>> -- interrupts : Interrupts for the debug timer, the first general purpose
>> -               timer, and optionally a second general purpose timer, and
>> -               optionally as well, 2 watchdog interrupts, in that order.
>> -
>> -- reg : Specifies the base address of the timer registers.
>> -
>> -- clocks: Reference to the parent clocks, one per output clock. The parents
>> -          must appear in the same order as the clock names.
>> -
>> -- clock-names: The name of the clocks as free-form strings. They should be in
>> -               the same order as the clocks.
>> -
>> -- clock-frequency : The frequency of the debug timer and the general purpose
>> -                    timer(s) in Hz in that order.
>> -
>> -Optional:
>> -
>> -- cpu-offset : per-cpu offset used when the timer is accessed without the
>> -               CPU remapping facilities. The offset is
>> -               cpu-offset + (0x10000 * cpu-nr).
>> -
>> -Example:
>> -
>> -       timer@200a000 {
>> -               compatible = "qcom,scss-timer", "qcom,msm-timer";
>> -               interrupts = <1 1 0x301>,
>> -                            <1 2 0x301>,
>> -                            <1 3 0x301>,
>> -                            <1 4 0x301>,
>> -                            <1 5 0x301>;
>> -               reg = <0x0200a000 0x100>;
>> -               clock-frequency = <19200000>,
>> -                                 <32768>;
>> -               clocks = <&sleep_clk>;
>> -               clock-names = "sleep";
>> -               cpu-offset = <0x40000>;
>> -       };
>> diff --git a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
>> index b7fc57f4800e..697caf1937cc 100644
>> --- a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
>> +++ b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
>> @@ -10,6 +10,9 @@ maintainers:
>>    - Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
>>  
>>  properties:
>> +  $nodename:
>> +    pattern: "^(watchdog|timer)@[0-9a-f]+$"
>> +
>>    compatible:
>>      oneOf:
>>        - items:
>> @@ -48,6 +51,20 @@ properties:
>>    clocks:
>>      maxItems: 1
>>  
>> +  clock-names:
>> +    items:
>> +      - const: sleep
>> +
>> +  clock-frequency:
>> +    description:
>> +      The frequency of the general purpose timer in Hz in that order.
> 
> 'in that order'?

Left over, as I initial binding had here two frequencies. I'll remove it.

> 
>> +
>> +  cpu-offset:
>> +    $ref: /schemas/types.yaml#/definitions/uint32
>> +    description:
>> +      Per-CPU offset used when the timer is accessed without the CPU remapping
>> +      facilities. The offset is cpu-offset + (0x10000 * cpu-nr).
>> +
>>    interrupts:
>>      minItems: 1
>>      maxItems: 5
>> @@ -67,12 +84,27 @@ allOf:
>>              const: qcom,kpss-wdt
>>      then:
>>        properties:
>> +        clock-frequency: false
>> +        cpu-offset: false
>>          interrupts:
>>            minItems: 1
>>            items:
>>              - description: Bark
>>              - description: Bite
>>  
>> +    else:
>> +      properties:
>> +        interrupts:
>> +          minItems: 3
>> +          items:
>> +            - description: Debug
>> +            - description: First general purpose timer
>> +            - description: Second general purpose timer
>> +            - description: First watchdog
>> +            - description: Second watchdog
> 
> Okay, here they are. No need to set it to 2 then change to 5 in the 
> series.

My previous patch where you noticed the difference sets it to maxItems:5
in top-level and only specific variant has two described interrupts.

So if I understand your comment correctly, it is okay and I will just
fix the clock-frequency description ("in that order").

Best regards,
Krzysztof


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

* Re: (subset) [PATCH 01/12] dt-bindings: watchdog: qcom-wdt: require fallback for IPQ4019
  2022-12-12 16:35 [PATCH 01/12] dt-bindings: watchdog: qcom-wdt: require fallback for IPQ4019 Krzysztof Kozlowski
                   ` (11 preceding siblings ...)
  2022-12-13 15:33 ` [PATCH 01/12] dt-bindings: watchdog: qcom-wdt: require fallback for IPQ4019 Rob Herring
@ 2023-01-11  5:09 ` Bjorn Andersson
  2023-01-31 17:31 ` Guenter Roeck
  13 siblings, 0 replies; 34+ messages in thread
From: Bjorn Andersson @ 2023-01-11  5:09 UTC (permalink / raw)
  To: Krzysztof Kozlowski, wim, konrad.dybcio, linux, agross,
	saiprakash.ranjan, krzysztof.kozlowski+dt, robh+dt
  Cc: linux-kernel, linux-arm-msm, linux-watchdog, devicetree

On Mon, 12 Dec 2022 17:35:21 +0100, Krzysztof Kozlowski wrote:
> The device specific compatibles ("qcom,kpss-wdt-ipq4019") should be
> follwed by fallback "qcom,kpss-wdt", which is actually used by Linux
> driver for binding.
> 
> 

Applied, thanks!

[07/12] ARM: dts: qcom: reverse compatibles to match bindings
        commit: 25da76a92f88b57331946e98f659b2626d512ea2
[08/12] ARM: dts: qcom: apq8064: drop second clock frequency from timer
        commit: 462671ab0472175b52a45b91abf140df3ecf7326
[09/12] ARM: dts: qcom: ipq8064: drop second clock frequency from timer
        commit: aa482e69cd3b3513d952eab71858534315b535bf
[10/12] ARM: dts: qcom: mdm9615: drop second clock frequency from timer
        commit: 501d1437d57604659a02378d712a8fc347f8ed84
[11/12] ARM: dts: qcom: msm8960: drop second clock frequency from timer
        commit: f630f8205c37579092b37cf216428a43a73e35b8
[12/12] ARM: dts: qcom: msm8960: add qcom,kpss-wdt-mdm9615
        commit: af657876c67062a07650cacf5f0b2c754d9f14d6

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

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

* Re: [PATCH 02/12] dt-bindings: watchdog: qcom-wdt: do not allow fallback alone
  2022-12-12 16:35 ` [PATCH 02/12] dt-bindings: watchdog: qcom-wdt: do not allow fallback alone Krzysztof Kozlowski
  2022-12-13 15:35   ` Rob Herring
@ 2023-01-31 17:31   ` Guenter Roeck
  1 sibling, 0 replies; 34+ messages in thread
From: Guenter Roeck @ 2023-01-31 17:31 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Wim Van Sebroeck,
	Rob Herring, Krzysztof Kozlowski, Prakash Ranjan, linux-arm-msm,
	linux-watchdog, devicetree, linux-kernel

On Mon, Dec 12, 2022 at 05:35:22PM +0100, Krzysztof Kozlowski wrote:
> The compatible "qcom,kpss-wdt" is too generic and should not be used
> alone.  Mark it as deprecated when not prepended by specific compatible.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Acked-by: Rob Herring <robh@kernel.org>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> index e76364c52fc7..3e0b30a817d6 100644
> --- a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> +++ b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> @@ -31,9 +31,10 @@ properties:
>                - qcom,apss-wdt-sm8150
>                - qcom,apss-wdt-sm8250
>            - const: qcom,kpss-wdt
> +      - const: qcom,kpss-wdt
> +        deprecated: true
>        - items:
>            - enum:
> -              - qcom,kpss-wdt
>                - qcom,kpss-timer
>                - qcom,kpss-wdt-apq8064
>                - qcom,kpss-wdt-ipq8064

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

* Re: [PATCH 01/12] dt-bindings: watchdog: qcom-wdt: require fallback for IPQ4019
  2022-12-12 16:35 [PATCH 01/12] dt-bindings: watchdog: qcom-wdt: require fallback for IPQ4019 Krzysztof Kozlowski
                   ` (12 preceding siblings ...)
  2023-01-11  5:09 ` (subset) " Bjorn Andersson
@ 2023-01-31 17:31 ` Guenter Roeck
  13 siblings, 0 replies; 34+ messages in thread
From: Guenter Roeck @ 2023-01-31 17:31 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Wim Van Sebroeck,
	Rob Herring, Krzysztof Kozlowski, Prakash Ranjan, linux-arm-msm,
	linux-watchdog, devicetree, linux-kernel

On Mon, Dec 12, 2022 at 05:35:21PM +0100, Krzysztof Kozlowski wrote:
> The device specific compatibles ("qcom,kpss-wdt-ipq4019") should be
> follwed by fallback "qcom,kpss-wdt", which is actually used by Linux
> driver for binding.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Acked-by: Rob Herring <robh@kernel.org>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> index a1f17c9e02db..e76364c52fc7 100644
> --- a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> +++ b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> @@ -17,6 +17,7 @@ properties:
>      oneOf:
>        - items:
>            - enum:
> +              - qcom,kpss-wdt-ipq4019
>                - qcom,apss-wdt-msm8994
>                - qcom,apss-wdt-qcs404
>                - qcom,apss-wdt-sc7180
> @@ -35,7 +36,6 @@ properties:
>                - qcom,kpss-wdt
>                - qcom,kpss-timer
>                - qcom,kpss-wdt-apq8064
> -              - qcom,kpss-wdt-ipq4019
>                - qcom,kpss-wdt-ipq8064
>                - qcom,kpss-wdt-msm8960
>                - qcom,scss-timer

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

* Re: [PATCH 03/12] dt-bindings: watchdog: qcom-wdt: fix list of MSM timer compatibles
  2022-12-12 16:35 ` [PATCH 03/12] dt-bindings: watchdog: qcom-wdt: fix list of MSM timer compatibles Krzysztof Kozlowski
  2022-12-13 15:37   ` Rob Herring
@ 2023-01-31 17:31   ` Guenter Roeck
  1 sibling, 0 replies; 34+ messages in thread
From: Guenter Roeck @ 2023-01-31 17:31 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Wim Van Sebroeck,
	Rob Herring, Krzysztof Kozlowski, Prakash Ranjan, linux-arm-msm,
	linux-watchdog, devicetree, linux-kernel

On Mon, Dec 12, 2022 at 05:35:23PM +0100, Krzysztof Kozlowski wrote:
> The MSM timer ("qcom,msm-timer") is a bit different timer and watchdog
> device than KPSS watchdog.  It has its own generic and specific
> compatibles, so fix the list to reflect this.  Adjust the example to
> show the newer KPSS watchdog.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Acked-by: Rob Herring <robh@kernel.org>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  .../devicetree/bindings/watchdog/qcom-wdt.yaml    | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> index 3e0b30a817d6..93e4381067dd 100644
> --- a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> +++ b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> @@ -33,13 +33,16 @@ properties:
>            - const: qcom,kpss-wdt
>        - const: qcom,kpss-wdt
>          deprecated: true
> +      - items:
> +          - const: qcom,scss-timer
> +          - const: qcom,msm-timer
>        - items:
>            - enum:
> -              - qcom,kpss-timer
>                - qcom,kpss-wdt-apq8064
>                - qcom,kpss-wdt-ipq8064
>                - qcom,kpss-wdt-msm8960
> -              - qcom,scss-timer
> +          - const: qcom,kpss-timer
> +          - const: qcom,msm-timer
>  
>    reg:
>      maxItems: 1
> @@ -56,9 +59,11 @@ unevaluatedProperties: false
>  
>  examples:
>    - |
> -    watchdog@208a038 {
> -      compatible = "qcom,kpss-wdt-ipq8064";
> -      reg = <0x0208a038 0x40>;
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> +    watchdog@17c10000 {
> +      compatible = "qcom,apss-wdt-sm8150", "qcom,kpss-wdt";
> +      reg = <0x17c10000 0x1000>;
>        clocks = <&sleep_clk>;
>        timeout-sec = <10>;
>      };

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

* Re: [PATCH 04/12] dt-bindings: watchdog: qcom-wdt: add qcom,kpss-wdt-mdm9615
  2022-12-12 16:35 ` [PATCH 04/12] dt-bindings: watchdog: qcom-wdt: add qcom,kpss-wdt-mdm9615 Krzysztof Kozlowski
  2022-12-13 15:37   ` Rob Herring
@ 2023-01-31 17:32   ` Guenter Roeck
  1 sibling, 0 replies; 34+ messages in thread
From: Guenter Roeck @ 2023-01-31 17:32 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Wim Van Sebroeck,
	Rob Herring, Krzysztof Kozlowski, Prakash Ranjan, linux-arm-msm,
	linux-watchdog, devicetree, linux-kernel

On Mon, Dec 12, 2022 at 05:35:24PM +0100, Krzysztof Kozlowski wrote:
> Document new MDM9615 qcom,kpss-wdt-mdm9615 watchdog/timer compatible.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Acked-by: Rob Herring <robh@kernel.org>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> index 93e4381067dd..1828eaf70b3b 100644
> --- a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> +++ b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> @@ -40,6 +40,7 @@ properties:
>            - enum:
>                - qcom,kpss-wdt-apq8064
>                - qcom,kpss-wdt-ipq8064
> +              - qcom,kpss-wdt-mdm9615
>                - qcom,kpss-wdt-msm8960
>            - const: qcom,kpss-timer
>            - const: qcom,msm-timer

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

* Re: [PATCH 05/12] dt-bindings: watchdog: qcom-wdt: allow interrupts
  2022-12-12 16:35 ` [PATCH 05/12] dt-bindings: watchdog: qcom-wdt: allow interrupts Krzysztof Kozlowski
  2022-12-13 15:35   ` Rob Herring
  2022-12-13 15:41   ` Rob Herring
@ 2023-01-31 17:33   ` Guenter Roeck
  2 siblings, 0 replies; 34+ messages in thread
From: Guenter Roeck @ 2023-01-31 17:33 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Wim Van Sebroeck,
	Rob Herring, Krzysztof Kozlowski, Prakash Ranjan, linux-arm-msm,
	linux-watchdog, devicetree, linux-kernel

On Mon, Dec 12, 2022 at 05:35:25PM +0100, Krzysztof Kozlowski wrote:
> Both of type of watchdogs described in the binding (the KPSS watchdog
> and APSS WDT timer) have interrupts.  Allow interrupts and describe them
> for KPSS watchdog to fix warnings like:
> 
>   watchdog@17c10000: Unevaluated properties are not allowed ('interrupts' was unexpected)
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Reviewed-by: Rob Herring <robh@kernel.org>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  .../bindings/watchdog/qcom-wdt.yaml           | 24 ++++++++++++++++---
>  1 file changed, 21 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> index 1828eaf70b3b..b7fc57f4800e 100644
> --- a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> +++ b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> @@ -9,9 +9,6 @@ title: Qualcomm Krait Processor Sub-system (KPSS) Watchdog timer
>  maintainers:
>    - Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
>  
> -allOf:
> -  - $ref: watchdog.yaml#
> -
>  properties:
>    compatible:
>      oneOf:
> @@ -51,11 +48,31 @@ properties:
>    clocks:
>      maxItems: 1
>  
> +  interrupts:
> +    minItems: 1
> +    maxItems: 5
> +
>  required:
>    - compatible
>    - reg
>    - clocks
>  
> +allOf:
> +  - $ref: watchdog.yaml#
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: qcom,kpss-wdt
> +    then:
> +      properties:
> +        interrupts:
> +          minItems: 1
> +          items:
> +            - description: Bark
> +            - description: Bite
> +
>  unevaluatedProperties: false
>  
>  examples:
> @@ -66,5 +83,6 @@ examples:
>        compatible = "qcom,apss-wdt-sm8150", "qcom,kpss-wdt";
>        reg = <0x17c10000 0x1000>;
>        clocks = <&sleep_clk>;
> +      interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
>        timeout-sec = <10>;
>      };

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

* Re: [PATCH 06/12] dt-bindings: watchdog: qcom-wdt: merge MSM timer
  2022-12-12 16:35 ` [PATCH 06/12] dt-bindings: watchdog: qcom-wdt: merge MSM timer Krzysztof Kozlowski
  2022-12-13  9:11   ` Daniel Lezcano
  2022-12-13 15:40   ` Rob Herring
@ 2023-01-31 17:33   ` Guenter Roeck
  2 siblings, 0 replies; 34+ messages in thread
From: Guenter Roeck @ 2023-01-31 17:33 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Daniel Lezcano,
	Thomas Gleixner, Rob Herring, Krzysztof Kozlowski,
	Wim Van Sebroeck, Prakash Ranjan, linux-arm-msm, linux-kernel,
	devicetree, linux-watchdog

On Mon, Dec 12, 2022 at 05:35:26PM +0100, Krzysztof Kozlowski wrote:
> Merge Qualcomm MSM timer bindings into watchdog, because the timer
> compatibles are already included here and the hardware is quite similar.
> 
> While converting the MSM timer bindings, adjust clock-frequency
> property to take only one frequency, instead of two, because:
> 1. DT schema does not allow to frequencies,
> 2. The Linux timer driver reads only first frequency.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  .../bindings/timer/qcom,msm-timer.txt         | 47 ------------------
>  .../bindings/watchdog/qcom-wdt.yaml           | 49 +++++++++++++++++++
>  2 files changed, 49 insertions(+), 47 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/timer/qcom,msm-timer.txt
> 
> diff --git a/Documentation/devicetree/bindings/timer/qcom,msm-timer.txt b/Documentation/devicetree/bindings/timer/qcom,msm-timer.txt
> deleted file mode 100644
> index 5e10c345548f..000000000000
> --- a/Documentation/devicetree/bindings/timer/qcom,msm-timer.txt
> +++ /dev/null
> @@ -1,47 +0,0 @@
> -* MSM Timer
> -
> -Properties:
> -
> -- compatible : Should at least contain "qcom,msm-timer". More specific
> -               properties specify which subsystem the timers are paired with.
> -
> -               "qcom,kpss-timer" - krait subsystem
> -               "qcom,scss-timer" - scorpion subsystem
> -
> -- interrupts : Interrupts for the debug timer, the first general purpose
> -               timer, and optionally a second general purpose timer, and
> -               optionally as well, 2 watchdog interrupts, in that order.
> -
> -- reg : Specifies the base address of the timer registers.
> -
> -- clocks: Reference to the parent clocks, one per output clock. The parents
> -          must appear in the same order as the clock names.
> -
> -- clock-names: The name of the clocks as free-form strings. They should be in
> -               the same order as the clocks.
> -
> -- clock-frequency : The frequency of the debug timer and the general purpose
> -                    timer(s) in Hz in that order.
> -
> -Optional:
> -
> -- cpu-offset : per-cpu offset used when the timer is accessed without the
> -               CPU remapping facilities. The offset is
> -               cpu-offset + (0x10000 * cpu-nr).
> -
> -Example:
> -
> -       timer@200a000 {
> -               compatible = "qcom,scss-timer", "qcom,msm-timer";
> -               interrupts = <1 1 0x301>,
> -                            <1 2 0x301>,
> -                            <1 3 0x301>,
> -                            <1 4 0x301>,
> -                            <1 5 0x301>;
> -               reg = <0x0200a000 0x100>;
> -               clock-frequency = <19200000>,
> -                                 <32768>;
> -               clocks = <&sleep_clk>;
> -               clock-names = "sleep";
> -               cpu-offset = <0x40000>;
> -       };
> diff --git a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> index b7fc57f4800e..697caf1937cc 100644
> --- a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> +++ b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> @@ -10,6 +10,9 @@ maintainers:
>    - Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
>  
>  properties:
> +  $nodename:
> +    pattern: "^(watchdog|timer)@[0-9a-f]+$"
> +
>    compatible:
>      oneOf:
>        - items:
> @@ -48,6 +51,20 @@ properties:
>    clocks:
>      maxItems: 1
>  
> +  clock-names:
> +    items:
> +      - const: sleep
> +
> +  clock-frequency:
> +    description:
> +      The frequency of the general purpose timer in Hz in that order.
> +
> +  cpu-offset:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      Per-CPU offset used when the timer is accessed without the CPU remapping
> +      facilities. The offset is cpu-offset + (0x10000 * cpu-nr).
> +
>    interrupts:
>      minItems: 1
>      maxItems: 5
> @@ -67,12 +84,27 @@ allOf:
>              const: qcom,kpss-wdt
>      then:
>        properties:
> +        clock-frequency: false
> +        cpu-offset: false
>          interrupts:
>            minItems: 1
>            items:
>              - description: Bark
>              - description: Bite
>  
> +    else:
> +      properties:
> +        interrupts:
> +          minItems: 3
> +          items:
> +            - description: Debug
> +            - description: First general purpose timer
> +            - description: Second general purpose timer
> +            - description: First watchdog
> +            - description: Second watchdog
> +      required:
> +        - clock-frequency
> +
>  unevaluatedProperties: false
>  
>  examples:
> @@ -86,3 +118,20 @@ examples:
>        interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
>        timeout-sec = <10>;
>      };
> +
> +  - |
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> +    watchdog@200a000 {
> +      compatible = "qcom,kpss-wdt-ipq8064", "qcom,kpss-timer", "qcom,msm-timer";
> +      interrupts = <GIC_PPI 1 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_EDGE_RISING)>,
> +                   <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_EDGE_RISING)>,
> +                   <GIC_PPI 3 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_EDGE_RISING)>,
> +                   <GIC_PPI 4 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_EDGE_RISING)>,
> +                   <GIC_PPI 5 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_EDGE_RISING)>;
> +      reg = <0x0200a000 0x100>;
> +      clock-frequency = <25000000>;
> +      clocks = <&sleep_clk>;
> +      clock-names = "sleep";
> +      cpu-offset = <0x80000>;
> +    };

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

end of thread, other threads:[~2023-01-31 17:34 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-12 16:35 [PATCH 01/12] dt-bindings: watchdog: qcom-wdt: require fallback for IPQ4019 Krzysztof Kozlowski
2022-12-12 16:35 ` [PATCH 02/12] dt-bindings: watchdog: qcom-wdt: do not allow fallback alone Krzysztof Kozlowski
2022-12-13 15:35   ` Rob Herring
2023-01-31 17:31   ` Guenter Roeck
2022-12-12 16:35 ` [PATCH 03/12] dt-bindings: watchdog: qcom-wdt: fix list of MSM timer compatibles Krzysztof Kozlowski
2022-12-13 15:37   ` Rob Herring
2023-01-31 17:31   ` Guenter Roeck
2022-12-12 16:35 ` [PATCH 04/12] dt-bindings: watchdog: qcom-wdt: add qcom,kpss-wdt-mdm9615 Krzysztof Kozlowski
2022-12-13 15:37   ` Rob Herring
2023-01-31 17:32   ` Guenter Roeck
2022-12-12 16:35 ` [PATCH 05/12] dt-bindings: watchdog: qcom-wdt: allow interrupts Krzysztof Kozlowski
2022-12-13 15:35   ` Rob Herring
2022-12-13 15:41   ` Rob Herring
2023-01-31 17:33   ` Guenter Roeck
2022-12-12 16:35 ` [PATCH 06/12] dt-bindings: watchdog: qcom-wdt: merge MSM timer Krzysztof Kozlowski
2022-12-13  9:11   ` Daniel Lezcano
2022-12-13 15:40   ` Rob Herring
2022-12-13 16:13     ` Krzysztof Kozlowski
2023-01-31 17:33   ` Guenter Roeck
2022-12-12 16:35 ` [PATCH 07/12] ARM: dts: qcom: reverse compatibles to match bindings Krzysztof Kozlowski
2022-12-13  9:31   ` Konrad Dybcio
2022-12-12 16:35 ` [PATCH 08/12] ARM: dts: qcom: apq8064: drop second clock frequency from timer Krzysztof Kozlowski
2022-12-13  9:34   ` Konrad Dybcio
2022-12-12 16:35 ` [PATCH 09/12] ARM: dts: qcom: ipq8064: " Krzysztof Kozlowski
2022-12-13  9:34   ` Konrad Dybcio
2022-12-12 16:35 ` [PATCH 10/12] ARM: dts: qcom: mdm9615: " Krzysztof Kozlowski
2022-12-13  9:34   ` Konrad Dybcio
2022-12-12 16:35 ` [PATCH 11/12] ARM: dts: qcom: msm8960: " Krzysztof Kozlowski
2022-12-13  9:34   ` Konrad Dybcio
2022-12-12 16:35 ` [PATCH 12/12] ARM: dts: qcom: msm8960: add qcom,kpss-wdt-mdm9615 Krzysztof Kozlowski
2022-12-13  9:34   ` Konrad Dybcio
2022-12-13 15:33 ` [PATCH 01/12] dt-bindings: watchdog: qcom-wdt: require fallback for IPQ4019 Rob Herring
2023-01-11  5:09 ` (subset) " Bjorn Andersson
2023-01-31 17:31 ` Guenter Roeck

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).