From: Anson Huang <[email protected]>
On some i.MX8M platforms, clock driver uses platform driver
model and it is NOT ready during timer initialization phase,
the clock operations will fail and system counter driver will
fail too. As all the i.MX8M platforms' system counter clock
are from OSC which is always enabled, so it is no need to enable
clock for system counter driver, the ONLY thing is to pass
clock frequence to driver.
This patch adds an option of skipping of_clk operation for
system counter driver, an optional property "clock-frequency"
is introduced to pass the frequency value to system counter
driver and indicate driver to skip of_clk operations.
Signed-off-by: Anson Huang <[email protected]>
---
No change.
---
drivers/clocksource/timer-imx-sysctr.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/clocksource/timer-imx-sysctr.c b/drivers/clocksource/timer-imx-sysctr.c
index fd7d680..8ff3d7e 100644
--- a/drivers/clocksource/timer-imx-sysctr.c
+++ b/drivers/clocksource/timer-imx-sysctr.c
@@ -129,6 +129,14 @@ static void __init sysctr_clockevent_init(void)
static int __init sysctr_timer_init(struct device_node *np)
{
int ret = 0;
+ u32 rate;
+
+ if (!of_property_read_u32(np, "clock-frequency",
+ &rate)) {
+ to_sysctr.of_clk.rate = rate;
+ to_sysctr.of_clk.period = DIV_ROUND_UP(rate, HZ);
+ to_sysctr.flags &= ~TIMER_OF_CLOCK;
+ }
ret = timer_of_init(np, &to_sysctr);
if (ret)
--
2.7.4
On Sun, 23 Jun 2019, [email protected] wrote:
Again the short summary could be more informative. Instead of 'Add foo' you
could say:
.....: Make timer work with platform driver model
That sums up the real meat of the patch. 'Add some option' is pretty
uninformative.
> On some i.MX8M platforms, clock driver uses platform driver
> model and it is NOT ready during timer initialization phase,
> the clock operations will fail and system counter driver will
> fail too. As all the i.MX8M platforms' system counter clock
> are from OSC which is always enabled, so it is no need to enable
> clock for system counter driver, the ONLY thing is to pass
> clock frequence to driver.
>
> This patch adds an option of skipping of_clk operation for
> system counter driver, an optional property "clock-frequency"
> is introduced to pass the frequency value to system counter
> driver and indicate driver to skip of_clk operations.
The comments to the changelog of patch 1 apply here as well :)
Hint: 'This patch'
Thanks,
tglx
Hi, Thomas
> On Sun, 23 Jun 2019, [email protected] wrote:
>
> Again the short summary could be more informative. Instead of 'Add foo'
> you could say:
>
> .....: Make timer work with platform driver model
>
> That sums up the real meat of the patch. 'Add some option' is pretty
> uninformative.
Makes sense.
>
> > On some i.MX8M platforms, clock driver uses platform driver model and
> > it is NOT ready during timer initialization phase, the clock
> > operations will fail and system counter driver will fail too. As all
> > the i.MX8M platforms' system counter clock are from OSC which is
> > always enabled, so it is no need to enable clock for system counter
> > driver, the ONLY thing is to pass clock frequence to driver.
> >
> > This patch adds an option of skipping of_clk operation for system
> > counter driver, an optional property "clock-frequency"
> > is introduced to pass the frequency value to system counter driver and
> > indicate driver to skip of_clk operations.
>
> The comments to the changelog of patch 1 apply here as well :)
>
> Hint: 'This patch'
Oops...did NOT notice that, I will resend the V2 patch series as they are actually
similar issues.
Thanks,
Anson
>
> Thanks,
>
> tglx
>