linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] clocksource: sysctr: add nxp,no-divider property
@ 2022-09-02 11:12 Peng Fan (OSS)
  2022-09-02 11:12 ` [PATCH 1/2] dt-bindings: timer: nxp,sysctr-timer: " Peng Fan (OSS)
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Peng Fan (OSS) @ 2022-09-02 11:12 UTC (permalink / raw)
  To: daniel.lezcano, tglx, robh+dt, krzysztof.kozlowski+dt
  Cc: linux-kernel, devicetree, linux-arm-kernel, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

Legacy design used in i.MX8M* has a internal divider, but new design
used in i.MX9* not has that divider. So add a property to indicate
the divider exists or not.

I thought to extend the binding such as nxp,imx93-sysctr-timer, and
update driver to support i.MX93, then no need to add nxp,no-divider.
But this means we need to extend the binding again when add new SoC,
saying imx9[x].

Not very sure which is better, so just post the NXP downstream way.

Peng Fan (2):
  dt-bindings: timer: nxp,sysctr-timer: add nxp,no-divider property
  clocksource/drivers/imx-sysctr: handle nxp,no-divider property

 .../devicetree/bindings/timer/nxp,sysctr-timer.yaml         | 4 ++++
 drivers/clocksource/timer-imx-sysctr.c                      | 6 ++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

-- 
2.37.1


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

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

* [PATCH 1/2] dt-bindings: timer: nxp,sysctr-timer: add nxp,no-divider property
  2022-09-02 11:12 [PATCH 0/2] clocksource: sysctr: add nxp,no-divider property Peng Fan (OSS)
@ 2022-09-02 11:12 ` Peng Fan (OSS)
  2022-09-08 13:11   ` Krzysztof Kozlowski
  2022-09-02 11:12 ` [PATCH 2/2] clocksource/drivers/imx-sysctr: handle " Peng Fan (OSS)
  2022-09-20  8:45 ` [PATCH 0/2] clocksource: sysctr: add " Daniel Lezcano
  2 siblings, 1 reply; 5+ messages in thread
From: Peng Fan (OSS) @ 2022-09-02 11:12 UTC (permalink / raw)
  To: daniel.lezcano, tglx, robh+dt, krzysztof.kozlowski+dt
  Cc: linux-kernel, devicetree, linux-arm-kernel, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

The base clock input to system counter is internally divided by 3 in
previous design, but there is change that no divider now. So add
a property to indicate that.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 Documentation/devicetree/bindings/timer/nxp,sysctr-timer.yaml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/timer/nxp,sysctr-timer.yaml b/Documentation/devicetree/bindings/timer/nxp,sysctr-timer.yaml
index 830211c55b4a..2b9653dafab8 100644
--- a/Documentation/devicetree/bindings/timer/nxp,sysctr-timer.yaml
+++ b/Documentation/devicetree/bindings/timer/nxp,sysctr-timer.yaml
@@ -32,6 +32,10 @@ properties:
   clock-names:
     const: per
 
+  nxp,no-divider:
+    description: if present, means there is no internal base clk divider.
+    type: boolean
+
 required:
   - compatible
   - reg
-- 
2.37.1


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

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

* [PATCH 2/2] clocksource/drivers/imx-sysctr: handle nxp,no-divider property
  2022-09-02 11:12 [PATCH 0/2] clocksource: sysctr: add nxp,no-divider property Peng Fan (OSS)
  2022-09-02 11:12 ` [PATCH 1/2] dt-bindings: timer: nxp,sysctr-timer: " Peng Fan (OSS)
@ 2022-09-02 11:12 ` Peng Fan (OSS)
  2022-09-20  8:45 ` [PATCH 0/2] clocksource: sysctr: add " Daniel Lezcano
  2 siblings, 0 replies; 5+ messages in thread
From: Peng Fan (OSS) @ 2022-09-02 11:12 UTC (permalink / raw)
  To: daniel.lezcano, tglx, robh+dt, krzysztof.kozlowski+dt
  Cc: linux-kernel, devicetree, linux-arm-kernel, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

The previous hardware design embedds a internal divider for base clock.
New design not has that divider, so check the nxp,no-divider property,
if true, directly use base clock input, otherwise divide by 3 as before.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/clocksource/timer-imx-sysctr.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/clocksource/timer-imx-sysctr.c b/drivers/clocksource/timer-imx-sysctr.c
index 523e37662a6e..5a7a951c4efc 100644
--- a/drivers/clocksource/timer-imx-sysctr.c
+++ b/drivers/clocksource/timer-imx-sysctr.c
@@ -134,8 +134,10 @@ static int __init sysctr_timer_init(struct device_node *np)
 	if (ret)
 		return ret;
 
-	/* system counter clock is divided by 3 internally */
-	to_sysctr.of_clk.rate /= SYS_CTR_CLK_DIV;
+	if (!of_property_read_bool(np, "nxp,no-divider")) {
+		/* system counter clock is divided by 3 internally */
+		to_sysctr.of_clk.rate /= SYS_CTR_CLK_DIV;
+	}
 
 	sys_ctr_base = timer_of_base(&to_sysctr);
 	cmpcr = readl(sys_ctr_base + CMPCR);
-- 
2.37.1


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

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

* Re: [PATCH 1/2] dt-bindings: timer: nxp,sysctr-timer: add nxp,no-divider property
  2022-09-02 11:12 ` [PATCH 1/2] dt-bindings: timer: nxp,sysctr-timer: " Peng Fan (OSS)
@ 2022-09-08 13:11   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-08 13:11 UTC (permalink / raw)
  To: Peng Fan (OSS), daniel.lezcano, tglx, robh+dt, krzysztof.kozlowski+dt
  Cc: linux-kernel, devicetree, linux-arm-kernel, Peng Fan

On 02/09/2022 13:12, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> The base clock input to system counter is internally divided by 3 in
> previous design, but there is change that no divider now. So add
> a property to indicate that.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>


Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Best regards,
Krzysztof

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

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

* Re: [PATCH 0/2] clocksource: sysctr: add nxp,no-divider property
  2022-09-02 11:12 [PATCH 0/2] clocksource: sysctr: add nxp,no-divider property Peng Fan (OSS)
  2022-09-02 11:12 ` [PATCH 1/2] dt-bindings: timer: nxp,sysctr-timer: " Peng Fan (OSS)
  2022-09-02 11:12 ` [PATCH 2/2] clocksource/drivers/imx-sysctr: handle " Peng Fan (OSS)
@ 2022-09-20  8:45 ` Daniel Lezcano
  2 siblings, 0 replies; 5+ messages in thread
From: Daniel Lezcano @ 2022-09-20  8:45 UTC (permalink / raw)
  To: Peng Fan (OSS), tglx, robh+dt, krzysztof.kozlowski+dt
  Cc: linux-kernel, devicetree, linux-arm-kernel, Peng Fan

On 02/09/2022 13:12, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> Legacy design used in i.MX8M* has a internal divider, but new design
> used in i.MX9* not has that divider. So add a property to indicate
> the divider exists or not.
> 
> I thought to extend the binding such as nxp,imx93-sysctr-timer, and
> update driver to support i.MX93, then no need to add nxp,no-divider.
> But this means we need to extend the binding again when add new SoC,
> saying imx9[x].
> 
> Not very sure which is better, so just post the NXP downstream way.
> 

Applied, thanks


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

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

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

end of thread, other threads:[~2022-09-20  8:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-02 11:12 [PATCH 0/2] clocksource: sysctr: add nxp,no-divider property Peng Fan (OSS)
2022-09-02 11:12 ` [PATCH 1/2] dt-bindings: timer: nxp,sysctr-timer: " Peng Fan (OSS)
2022-09-08 13:11   ` Krzysztof Kozlowski
2022-09-02 11:12 ` [PATCH 2/2] clocksource/drivers/imx-sysctr: handle " Peng Fan (OSS)
2022-09-20  8:45 ` [PATCH 0/2] clocksource: sysctr: add " Daniel Lezcano

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