linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Convert mtk-timer to YAML
@ 2022-09-29 12:28 AngeloGioacchino Del Regno
  2022-09-29 12:29 ` [PATCH 1/2] arm: dts: mt7629: Remove extra interrupt from timer node AngeloGioacchino Del Regno
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-09-29 12:28 UTC (permalink / raw)
  To: daniel.lezcano
  Cc: tglx, robh+dt, krzysztof.kozlowski+dt, matthias.bgg,
	linux-kernel, devicetree, linux-arm-kernel, linux-mediatek,
	AngeloGioacchino Del Regno

This is a conversion of the mediatek,mtk-timer.txt binding to schema.

While checking the schema validity, I've seen that mt7629.dtsi was
declaring two timer interrupts while effectively there's only one:
removing it was also necessary to be compliant with the new schema.

AngeloGioacchino Del Regno (2):
  arm: dts: mt7629: Remove extra interrupt from timer node
  dt-bindings: timer: mediatek: Convert to json-schema

 .../bindings/timer/mediatek,mtk-timer.txt     | 47 ----------
 .../bindings/timer/mediatek,timer.yaml        | 86 +++++++++++++++++++
 arch/arm/boot/dts/mt7629.dtsi                 |  3 +-
 3 files changed, 87 insertions(+), 49 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt
 create mode 100644 Documentation/devicetree/bindings/timer/mediatek,timer.yaml

-- 
2.37.2



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

* [PATCH 1/2] arm: dts: mt7629: Remove extra interrupt from timer node
  2022-09-29 12:28 [PATCH 0/2] Convert mtk-timer to YAML AngeloGioacchino Del Regno
@ 2022-09-29 12:29 ` AngeloGioacchino Del Regno
  2022-11-22 17:43   ` Matthias Brugger
  2022-09-29 12:29 ` [PATCH 2/2] dt-bindings: timer: mediatek: Convert to json-schema AngeloGioacchino Del Regno
  2022-11-15  8:56 ` [PATCH 0/2] Convert mtk-timer to YAML AngeloGioacchino Del Regno
  2 siblings, 1 reply; 8+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-09-29 12:29 UTC (permalink / raw)
  To: daniel.lezcano
  Cc: tglx, robh+dt, krzysztof.kozlowski+dt, matthias.bgg,
	linux-kernel, devicetree, linux-arm-kernel, linux-mediatek,
	AngeloGioacchino Del Regno

There's only one system timer event interrupt.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 arch/arm/boot/dts/mt7629.dtsi | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/mt7629.dtsi b/arch/arm/boot/dts/mt7629.dtsi
index 46fc236e1b89..acab0883a3bb 100644
--- a/arch/arm/boot/dts/mt7629.dtsi
+++ b/arch/arm/boot/dts/mt7629.dtsi
@@ -106,8 +106,7 @@ timer: timer@10009000 {
 			compatible = "mediatek,mt7629-timer",
 				     "mediatek,mt6765-timer";
 			reg = <0x10009000 0x60>;
-			interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>,
-				     <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&clk20m>;
 			clock-names = "clk20m";
 		};
-- 
2.37.2



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

* [PATCH 2/2] dt-bindings: timer: mediatek: Convert to json-schema
  2022-09-29 12:28 [PATCH 0/2] Convert mtk-timer to YAML AngeloGioacchino Del Regno
  2022-09-29 12:29 ` [PATCH 1/2] arm: dts: mt7629: Remove extra interrupt from timer node AngeloGioacchino Del Regno
@ 2022-09-29 12:29 ` AngeloGioacchino Del Regno
  2022-09-30 19:34   ` Rob Herring
  2024-03-07 18:15   ` Rob Herring
  2022-11-15  8:56 ` [PATCH 0/2] Convert mtk-timer to YAML AngeloGioacchino Del Regno
  2 siblings, 2 replies; 8+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-09-29 12:29 UTC (permalink / raw)
  To: daniel.lezcano
  Cc: tglx, robh+dt, krzysztof.kozlowski+dt, matthias.bgg,
	linux-kernel, devicetree, linux-arm-kernel, linux-mediatek,
	AngeloGioacchino Del Regno

Convert the MediaTek SoC timer txt binding to json-schema.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 .../bindings/timer/mediatek,mtk-timer.txt     | 47 ----------
 .../bindings/timer/mediatek,timer.yaml        | 86 +++++++++++++++++++
 2 files changed, 86 insertions(+), 47 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt
 create mode 100644 Documentation/devicetree/bindings/timer/mediatek,timer.yaml

diff --git a/Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt b/Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt
deleted file mode 100644
index 8bbb6e94508b..000000000000
--- a/Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-MediaTek Timers
----------------
-
-MediaTek SoCs have different timers on different platforms,
-- CPUX (ARM/ARM64 System Timer)
-- GPT (General Purpose Timer)
-- SYST (System Timer)
-
-The proper timer will be selected automatically by driver.
-
-Required properties:
-- compatible should contain:
-	For those SoCs that use GPT
-	* "mediatek,mt2701-timer" for MT2701 compatible timers (GPT)
-	* "mediatek,mt6580-timer" for MT6580 compatible timers (GPT)
-	* "mediatek,mt6582-timer" for MT6582 compatible timers (GPT)
-	* "mediatek,mt6589-timer" for MT6589 compatible timers (GPT)
-	* "mediatek,mt7623-timer" for MT7623 compatible timers (GPT)
-	* "mediatek,mt8127-timer" for MT8127 compatible timers (GPT)
-	* "mediatek,mt8135-timer" for MT8135 compatible timers (GPT)
-	* "mediatek,mt8173-timer" for MT8173 compatible timers (GPT)
-	* "mediatek,mt8516-timer" for MT8516 compatible timers (GPT)
-	* "mediatek,mt6577-timer" for MT6577 and all above compatible timers (GPT)
-
-	For those SoCs that use SYST
-	* "mediatek,mt8183-timer" for MT8183 compatible timers (SYST)
-	* "mediatek,mt8186-timer" for MT8186 compatible timers (SYST)
-	* "mediatek,mt8188-timer" for MT8188 compatible timers (SYST)
-	* "mediatek,mt8192-timer" for MT8192 compatible timers (SYST)
-	* "mediatek,mt8195-timer" for MT8195 compatible timers (SYST)
-	* "mediatek,mt7629-timer" for MT7629 compatible timers (SYST)
-	* "mediatek,mt6765-timer" for MT6765 and all above compatible timers (SYST)
-
-	For those SoCs that use CPUX
-	* "mediatek,mt6795-systimer" for MT6795 compatible timers (CPUX)
-
-- reg: Should contain location and length for timer register.
-- clocks: Should contain system clock.
-
-Examples:
-
-	timer@10008000 {
-		compatible = "mediatek,mt6577-timer";
-		reg = <0x10008000 0x80>;
-		interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_LOW>;
-		clocks = <&system_clk>;
-	};
diff --git a/Documentation/devicetree/bindings/timer/mediatek,timer.yaml b/Documentation/devicetree/bindings/timer/mediatek,timer.yaml
new file mode 100644
index 000000000000..a5ea4095852e
--- /dev/null
+++ b/Documentation/devicetree/bindings/timer/mediatek,timer.yaml
@@ -0,0 +1,86 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/timer/mediatek,timer.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: MediaTek SoC timers
+
+maintainers:
+  - Matthias Brugger <matthias.bgg@gmail.com>
+
+description:
+  MediaTek SoCs have different timers on different platforms,
+  CPUX (ARM/ARM64 System Timer), GPT (General Purpose Timer)
+  and SYST (System Timer).
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - mediatek,mt6577-timer
+              - mediatek,mt6765-timer
+              - mediatek,mt6795-systimer
+      # GPT Timers
+      - items:
+          - enum:
+              - mediatek,mt2701-timer
+              - mediatek,mt6580-timer
+              - mediatek,mt6582-timer
+              - mediatek,mt6589-timer
+              - mediatek,mt7623-timer
+              - mediatek,mt8127-timer
+              - mediatek,mt8135-timer
+              - mediatek,mt8173-timer
+              - mediatek,mt8516-timer
+          - const: mediatek,mt6577-timer
+      # SYST Timers
+      - items:
+          - enum:
+              - mediatek,mt7629-timer
+              - mediatek,mt8183-timer
+              - mediatek,mt8186-timer
+              - mediatek,mt8188-timer
+              - mediatek,mt8192-timer
+              - mediatek,mt8195-timer
+          - const: mediatek,mt6765-timer
+      # CPUX Timers
+      - items:
+          - const: mediatek,mt6795-systimer
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    minItems: 1
+    items:
+      - description: Timer clock
+      - description: RTC or bus clock
+
+  clock-names:
+    minItems: 1
+    maxItems: 2
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    timer@10008000 {
+      compatible = "mediatek,mt6577-timer";
+      reg = <0x10008000 0x80>;
+      interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_LOW>;
+      clocks = <&system_clk>;
+    };
-- 
2.37.2



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

* Re: [PATCH 2/2] dt-bindings: timer: mediatek: Convert to json-schema
  2022-09-29 12:29 ` [PATCH 2/2] dt-bindings: timer: mediatek: Convert to json-schema AngeloGioacchino Del Regno
@ 2022-09-30 19:34   ` Rob Herring
  2024-03-07 18:15   ` Rob Herring
  1 sibling, 0 replies; 8+ messages in thread
From: Rob Herring @ 2022-09-30 19:34 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: daniel.lezcano, tglx, robh+dt, linux-arm-kernel, matthias.bgg,
	linux-mediatek, devicetree, linux-kernel, krzysztof.kozlowski+dt

On Thu, 29 Sep 2022 14:29:01 +0200, AngeloGioacchino Del Regno wrote:
> Convert the MediaTek SoC timer txt binding to json-schema.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  .../bindings/timer/mediatek,mtk-timer.txt     | 47 ----------
>  .../bindings/timer/mediatek,timer.yaml        | 86 +++++++++++++++++++
>  2 files changed, 86 insertions(+), 47 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt
>  create mode 100644 Documentation/devicetree/bindings/timer/mediatek,timer.yaml
> 

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


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

* Re: [PATCH 0/2] Convert mtk-timer to YAML
  2022-09-29 12:28 [PATCH 0/2] Convert mtk-timer to YAML AngeloGioacchino Del Regno
  2022-09-29 12:29 ` [PATCH 1/2] arm: dts: mt7629: Remove extra interrupt from timer node AngeloGioacchino Del Regno
  2022-09-29 12:29 ` [PATCH 2/2] dt-bindings: timer: mediatek: Convert to json-schema AngeloGioacchino Del Regno
@ 2022-11-15  8:56 ` AngeloGioacchino Del Regno
  2 siblings, 0 replies; 8+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-11-15  8:56 UTC (permalink / raw)
  To: daniel.lezcano
  Cc: tglx, robh+dt, krzysztof.kozlowski+dt, matthias.bgg,
	linux-kernel, devicetree, linux-arm-kernel, linux-mediatek

Il 29/09/22 14:28, AngeloGioacchino Del Regno ha scritto:
> This is a conversion of the mediatek,mtk-timer.txt binding to schema.
> 
> While checking the schema validity, I've seen that mt7629.dtsi was
> declaring two timer interrupts while effectively there's only one:
> removing it was also necessary to be compliant with the new schema.
> 
> AngeloGioacchino Del Regno (2):
>    arm: dts: mt7629: Remove extra interrupt from timer node
>    dt-bindings: timer: mediatek: Convert to json-schema
> 
>   .../bindings/timer/mediatek,mtk-timer.txt     | 47 ----------
>   .../bindings/timer/mediatek,timer.yaml        | 86 +++++++++++++++++++
>   arch/arm/boot/dts/mt7629.dtsi                 |  3 +-
>   3 files changed, 87 insertions(+), 49 deletions(-)
>   delete mode 100644 Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt
>   create mode 100644 Documentation/devicetree/bindings/timer/mediatek,timer.yaml
> 

Gentle ping about this one...

Thanks,
Angelo


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

* Re: [PATCH 1/2] arm: dts: mt7629: Remove extra interrupt from timer node
  2022-09-29 12:29 ` [PATCH 1/2] arm: dts: mt7629: Remove extra interrupt from timer node AngeloGioacchino Del Regno
@ 2022-11-22 17:43   ` Matthias Brugger
  0 siblings, 0 replies; 8+ messages in thread
From: Matthias Brugger @ 2022-11-22 17:43 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, daniel.lezcano
  Cc: tglx, robh+dt, krzysztof.kozlowski+dt, linux-kernel, devicetree,
	linux-arm-kernel, linux-mediatek



On 29/09/2022 14:29, AngeloGioacchino Del Regno wrote:
> There's only one system timer event interrupt.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Queued now for the next merge window.

Matthias

> ---
>   arch/arm/boot/dts/mt7629.dtsi | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/mt7629.dtsi b/arch/arm/boot/dts/mt7629.dtsi
> index 46fc236e1b89..acab0883a3bb 100644
> --- a/arch/arm/boot/dts/mt7629.dtsi
> +++ b/arch/arm/boot/dts/mt7629.dtsi
> @@ -106,8 +106,7 @@ timer: timer@10009000 {
>   			compatible = "mediatek,mt7629-timer",
>   				     "mediatek,mt6765-timer";
>   			reg = <0x10009000 0x60>;
> -			interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>,
> -				     <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>;
> +			interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>;
>   			clocks = <&clk20m>;
>   			clock-names = "clk20m";
>   		};


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

* Re: [PATCH 2/2] dt-bindings: timer: mediatek: Convert to json-schema
  2022-09-29 12:29 ` [PATCH 2/2] dt-bindings: timer: mediatek: Convert to json-schema AngeloGioacchino Del Regno
  2022-09-30 19:34   ` Rob Herring
@ 2024-03-07 18:15   ` Rob Herring
  2024-03-08  8:38     ` AngeloGioacchino Del Regno
  1 sibling, 1 reply; 8+ messages in thread
From: Rob Herring @ 2024-03-07 18:15 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: daniel.lezcano, tglx, krzysztof.kozlowski+dt, matthias.bgg,
	linux-kernel, devicetree, linux-arm-kernel, linux-mediatek

On Thu, Sep 29, 2022 at 7:29 AM AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com> wrote:
>
> Convert the MediaTek SoC timer txt binding to json-schema.
>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  .../bindings/timer/mediatek,mtk-timer.txt     | 47 ----------
>  .../bindings/timer/mediatek,timer.yaml        | 86 +++++++++++++++++++
>  2 files changed, 86 insertions(+), 47 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt
>  create mode 100644 Documentation/devicetree/bindings/timer/mediatek,timer.yaml

Looks like this never got applied. I've applied it now and added 8365
which got added to the .txt binding in the mean time. I'm not sure
it's right though. The txt binding says it was CPUX timer, but the dts
says otherwise. The 6795 dts looks wrong. It says the timer is CPUX
and GPT timer. That warning remains.

Rob


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

* Re: [PATCH 2/2] dt-bindings: timer: mediatek: Convert to json-schema
  2024-03-07 18:15   ` Rob Herring
@ 2024-03-08  8:38     ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 8+ messages in thread
From: AngeloGioacchino Del Regno @ 2024-03-08  8:38 UTC (permalink / raw)
  To: Rob Herring
  Cc: daniel.lezcano, tglx, krzysztof.kozlowski+dt, matthias.bgg,
	linux-kernel, devicetree, linux-arm-kernel, linux-mediatek

Il 07/03/24 19:15, Rob Herring ha scritto:
> On Thu, Sep 29, 2022 at 7:29 AM AngeloGioacchino Del Regno
> <angelogioacchino.delregno@collabora.com> wrote:
>>
>> Convert the MediaTek SoC timer txt binding to json-schema.
>>
>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>> ---
>>   .../bindings/timer/mediatek,mtk-timer.txt     | 47 ----------
>>   .../bindings/timer/mediatek,timer.yaml        | 86 +++++++++++++++++++
>>   2 files changed, 86 insertions(+), 47 deletions(-)
>>   delete mode 100644 Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt
>>   create mode 100644 Documentation/devicetree/bindings/timer/mediatek,timer.yaml
> 
> Looks like this never got applied. I've applied it now and added 8365
> which got added to the .txt binding in the mean time. I'm not sure
> it's right though. The txt binding says it was CPUX timer, but the dts
> says otherwise. The 6795 dts looks wrong. It says the timer is CPUX
> and GPT timer. That warning remains.
> 

Thanks. This one got totally forgotten, yes.

By the way, I'll recheck the 6795 DT as soon as possible.

Cheers!
Angelo



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

end of thread, other threads:[~2024-03-08  8:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-29 12:28 [PATCH 0/2] Convert mtk-timer to YAML AngeloGioacchino Del Regno
2022-09-29 12:29 ` [PATCH 1/2] arm: dts: mt7629: Remove extra interrupt from timer node AngeloGioacchino Del Regno
2022-11-22 17:43   ` Matthias Brugger
2022-09-29 12:29 ` [PATCH 2/2] dt-bindings: timer: mediatek: Convert to json-schema AngeloGioacchino Del Regno
2022-09-30 19:34   ` Rob Herring
2024-03-07 18:15   ` Rob Herring
2024-03-08  8:38     ` AngeloGioacchino Del Regno
2022-11-15  8:56 ` [PATCH 0/2] Convert mtk-timer to YAML AngeloGioacchino Del Regno

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