All of lore.kernel.org
 help / color / mirror / Atom feed
From: maxime.ripard@free-electrons.com (Maxime Ripard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/5] clocksource: Add Allwinner SoCs HS timers driver
Date: Thu, 26 Sep 2013 16:13:29 +0300	[thread overview]
Message-ID: <20130926131329.GQ2954@lukather> (raw)
In-Reply-To: <52437062.5040705@elopez.com.ar>

On Wed, Sep 25, 2013 at 08:23:14PM -0300, Emilio L?pez wrote:
> El 25/09/13 11:03, Maxime Ripard escribi?:
> >Most of the Allwinner SoCs (at this time, all but the A10) also have a
> >High Speed timers that are not using the 24MHz oscillator as a source
> >but rather the AHB clock running much faster.
> >
> >The IP is slightly different between the A10s/A13 and the one used in
> >the A20/A31, since the latter have 4 timers available, while the former
> >have only 2 of them.
> >
> >Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> >---
> 
> [...]
> 
> >+static void __init sun5i_timer_init(struct device_node *node)
> >+{
> >+	unsigned long rate;
> >+	struct clk *clk;
> >+	int ret, irq;
> >+	u32 val;
> >+
> >+	timer_base = of_iomap(node, 0);
> >+	if (!timer_base)
> >+		panic("Can't map registers");
> >+
> >+	irq = irq_of_parse_and_map(node, 0);
> >+	if (irq <= 0)
> >+		panic("Can't parse IRQ");
> >+
> >+	clk = of_clk_get(node, 0);
> >+	if (IS_ERR(clk))
> >+		panic("Can't get timer clock");
> 
> I'm not familiar with clocksources, but does this have to be as
> fatal as it is considering the kernel also supports the slower sun4i
> timer?

Hmmm, I don't know, one might choose to enable only this timer, in that
case that would make sense to panic, since it would be the only timer in
that case.

> Also, would any special considerations be needed when adjusting the
> ahb clock? A future cpufreq driver will most likely need to.

While this will be needed at some point, I don't really see how to
handle that properly. The clock framework doesn't seem to have any
callback when it comes to reconfiguring a clock that a device might
use.

This will also creates trouble for IPs such as the I2C that have to
setup internal dividers, and use clk_get_rate to do so.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130926/31e586c1/attachment.sig>

WARNING: multiple messages have this Message-ID (diff)
From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: "Emilio López" <emilio@elopez.com.ar>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-arm-kernel@lists.infradead.org, kevin.z.m.zh@gmail.com,
	sunny@allwinnertech.com, shuge@allwinnertech.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/5] clocksource: Add Allwinner SoCs HS timers driver
Date: Thu, 26 Sep 2013 16:13:29 +0300	[thread overview]
Message-ID: <20130926131329.GQ2954@lukather> (raw)
In-Reply-To: <52437062.5040705@elopez.com.ar>

[-- Attachment #1: Type: text/plain, Size: 1966 bytes --]

On Wed, Sep 25, 2013 at 08:23:14PM -0300, Emilio López wrote:
> El 25/09/13 11:03, Maxime Ripard escribió:
> >Most of the Allwinner SoCs (at this time, all but the A10) also have a
> >High Speed timers that are not using the 24MHz oscillator as a source
> >but rather the AHB clock running much faster.
> >
> >The IP is slightly different between the A10s/A13 and the one used in
> >the A20/A31, since the latter have 4 timers available, while the former
> >have only 2 of them.
> >
> >Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> >---
> 
> [...]
> 
> >+static void __init sun5i_timer_init(struct device_node *node)
> >+{
> >+	unsigned long rate;
> >+	struct clk *clk;
> >+	int ret, irq;
> >+	u32 val;
> >+
> >+	timer_base = of_iomap(node, 0);
> >+	if (!timer_base)
> >+		panic("Can't map registers");
> >+
> >+	irq = irq_of_parse_and_map(node, 0);
> >+	if (irq <= 0)
> >+		panic("Can't parse IRQ");
> >+
> >+	clk = of_clk_get(node, 0);
> >+	if (IS_ERR(clk))
> >+		panic("Can't get timer clock");
> 
> I'm not familiar with clocksources, but does this have to be as
> fatal as it is considering the kernel also supports the slower sun4i
> timer?

Hmmm, I don't know, one might choose to enable only this timer, in that
case that would make sense to panic, since it would be the only timer in
that case.

> Also, would any special considerations be needed when adjusting the
> ahb clock? A future cpufreq driver will most likely need to.

While this will be needed at some point, I don't really see how to
handle that properly. The clock framework doesn't seem to have any
callback when it comes to reconfiguring a clock that a device might
use.

This will also creates trouble for IPs such as the I2C that have to
setup internal dividers, and use clk_get_rate to do so.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-09-26 13:13 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-25 14:03 [PATCH 0/5] Allwinner SoCs High Speed Timer support Maxime Ripard
2013-09-25 14:03 ` Maxime Ripard
2013-09-25 14:03 ` [PATCH 1/5] clocksource: sun4i: Select CLKSRC_MMIO Maxime Ripard
2013-09-25 14:03   ` Maxime Ripard
2013-09-25 14:03 ` [PATCH 2/5] clocksource: Add Allwinner SoCs HS timers driver Maxime Ripard
2013-09-25 14:03   ` Maxime Ripard
2013-09-25 23:16   ` Stephen Boyd
2013-09-25 23:16     ` Stephen Boyd
2013-09-26 12:58     ` Maxime Ripard
2013-09-26 12:58       ` Maxime Ripard
2013-10-10 19:13     ` Maxime Ripard
2013-10-10 19:13       ` Maxime Ripard
2013-10-10 22:46       ` Stephen Boyd
2013-10-10 22:46         ` Stephen Boyd
2013-10-11 18:33         ` Maxime Ripard
2013-10-11 18:33           ` Maxime Ripard
2013-09-25 23:23   ` Emilio López
2013-09-25 23:23     ` Emilio López
2013-09-26 13:13     ` Maxime Ripard [this message]
2013-09-26 13:13       ` Maxime Ripard
2013-09-29  4:34       ` Emilio López
2013-09-29  4:34         ` Emilio López
2013-09-29 18:44         ` Maxime Ripard
2013-09-29 18:44           ` Maxime Ripard
2013-09-25 14:03 ` [PATCH 3/5] ARM: sun5i: a10s: Add support for the High Speed Timers Maxime Ripard
2013-09-25 14:03   ` Maxime Ripard
2013-09-25 14:03 ` [PATCH 4/5] ARM: sun5i: a13: " Maxime Ripard
2013-09-25 14:03   ` Maxime Ripard
2013-09-25 14:03 ` [PATCH 5/5] ARM: sun7i: a20: " Maxime Ripard
2013-09-25 14:03   ` Maxime Ripard
2013-09-25 18:13 ` [PATCH 0/5] Allwinner SoCs High Speed Timer support Kevin Hilman
2013-09-25 18:13   ` Kevin Hilman
2013-09-25 18:14   ` Olof Johansson
2013-09-25 18:14     ` Olof Johansson
2013-09-25 19:50     ` Maxime Ripard
2013-09-25 19:50       ` Maxime Ripard
2013-09-26 14:39       ` Thomas Petazzoni
2013-09-26 14:39         ` Thomas Petazzoni
2013-09-27 17:05         ` Maxime Ripard
2013-09-27 17:05           ` Maxime Ripard
2013-09-27 17:55           ` Thomas Petazzoni
2013-09-27 17:55             ` Thomas Petazzoni
2013-09-25 20:21     ` Kevin Hilman
2013-09-25 20:21       ` Kevin Hilman
2013-09-25 22:41 ` Emilio López
2013-09-25 22:41   ` Emilio López

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130926131329.GQ2954@lukather \
    --to=maxime.ripard@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.