From: pawel.moll@arm.com (Pawel Moll)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 04/12] clocksource: Sched clock source for Versatile Express
Date: Wed, 16 Apr 2014 16:05:16 +0100 [thread overview]
Message-ID: <1397660716.3407.93.camel@hornet> (raw)
In-Reply-To: <CAL_JsqLp5o9OnW5kk33BwdnOP97bjgfpMrR=PKEVH4nP4Tnrfg@mail.gmail.com>
On Wed, 2014-04-16 at 15:45 +0100, Rob Herring wrote:
> >> > + setup_sched_clock(vexpress_sys_24mhz_read, 32, 24000000);
> >>
> >> This frequency should come from a DT clock binding. You will have to
> >> fallback to 24MHz for backwards compatibility though.
> >
> > I don't see why would it go to the binding. You may have noticed the
> > register is called "SYS_24MHZ", not "SYS_RANDOMCLOCK". The driver
> > *knows* what the frequency is.
>
> A 24MHz clock is fed to this h/w block to be used by the counter in
> the block. The DT should describe that.
I even have a clk24mhz in the motherboard's dtsi, so adding a phandle to
the node is trivial, can do it. But my point is that, whatever this
clock is (24MHz, 12MHz then multiplied by 2 inside sysreg, 48MHz divided
by 2 etc.), the value in this register is incremented every 1/24 uS by
definition. And the driver can rely on this. Otherwise we're really
talking about a generic mmio-counter-based clock source, with a
clock-frequency property or a clock phandle (and a multiplier/divider
then?).
> >> > +}
> >>
> >> Wouldn't this code work for Versatile and Realview ARM reference
> >> boards? Even the register offset is the same.
> >>
> >> > +CLOCKSOURCE_OF_DECLARE(vexpress, "arm,vexpress-sysreg",
> >> > + vexpress_sched_clock_init);
> >
> > I guess it would, yes. The sysregs are annoyingly similar and different
> > at the same time.
> >
> > One could of course try to come up with a "generic mmio clock source"
> > binding, taking the frequency as a property, but don't count on me doing
> > this... ;-)
>
> I'm not asking for that. Just take care of all ARM Ltd boards which
> have the exact same 24MHz counter at offset 0x5C.
Yes, this is doable by all means. I'll rename it to
"clocksource/versatile.c" so we can add relevant compatible values.
Pawe?
WARNING: multiple messages have this Message-ID (diff)
From: Pawel Moll <pawel.moll@arm.com>
To: Rob Herring <robherring2@gmail.com>
Cc: "arm@kernel.org" <arm@kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH 04/12] clocksource: Sched clock source for Versatile Express
Date: Wed, 16 Apr 2014 16:05:16 +0100 [thread overview]
Message-ID: <1397660716.3407.93.camel@hornet> (raw)
In-Reply-To: <CAL_JsqLp5o9OnW5kk33BwdnOP97bjgfpMrR=PKEVH4nP4Tnrfg@mail.gmail.com>
On Wed, 2014-04-16 at 15:45 +0100, Rob Herring wrote:
> >> > + setup_sched_clock(vexpress_sys_24mhz_read, 32, 24000000);
> >>
> >> This frequency should come from a DT clock binding. You will have to
> >> fallback to 24MHz for backwards compatibility though.
> >
> > I don't see why would it go to the binding. You may have noticed the
> > register is called "SYS_24MHZ", not "SYS_RANDOMCLOCK". The driver
> > *knows* what the frequency is.
>
> A 24MHz clock is fed to this h/w block to be used by the counter in
> the block. The DT should describe that.
I even have a clk24mhz in the motherboard's dtsi, so adding a phandle to
the node is trivial, can do it. But my point is that, whatever this
clock is (24MHz, 12MHz then multiplied by 2 inside sysreg, 48MHz divided
by 2 etc.), the value in this register is incremented every 1/24 uS by
definition. And the driver can rely on this. Otherwise we're really
talking about a generic mmio-counter-based clock source, with a
clock-frequency property or a clock phandle (and a multiplier/divider
then?).
> >> > +}
> >>
> >> Wouldn't this code work for Versatile and Realview ARM reference
> >> boards? Even the register offset is the same.
> >>
> >> > +CLOCKSOURCE_OF_DECLARE(vexpress, "arm,vexpress-sysreg",
> >> > + vexpress_sched_clock_init);
> >
> > I guess it would, yes. The sysregs are annoyingly similar and different
> > at the same time.
> >
> > One could of course try to come up with a "generic mmio clock source"
> > binding, taking the frequency as a property, but don't count on me doing
> > this... ;-)
>
> I'm not asking for that. Just take care of all ARM Ltd boards which
> have the exact same 24MHz counter at offset 0x5C.
Yes, this is doable by all means. I'll rename it to
"clocksource/versatile.c" so we can add relevant compatible values.
Paweł
next prev parent reply other threads:[~2014-04-16 15:05 UTC|newest]
Thread overview: 112+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-11 17:10 [lm-sensors] [PATCH 00/12] Versatile Express updates Pawel Moll
2014-02-11 17:10 ` Pawel Moll
2014-02-11 17:10 ` Pawel Moll
2014-02-11 17:10 ` [PATCH 01/12] misc: vexpress-syscfg: Add udelay-based delay Pawel Moll
2014-02-11 17:10 ` Pawel Moll
2014-02-15 19:19 ` Greg Kroah-Hartman
2014-02-15 19:19 ` Greg Kroah-Hartman
2014-02-11 17:10 ` [PATCH 02/12] power/reset: vexpress: Use udelay instead of timers Pawel Moll
2014-02-11 17:10 ` Pawel Moll
2014-02-11 20:59 ` Arnd Bergmann
2014-02-11 20:59 ` Arnd Bergmann
2014-02-12 11:56 ` Pawel Moll
2014-02-12 11:56 ` Pawel Moll
2014-02-11 17:10 ` [PATCH 03/12] clk: versatile: Split config options for sp810 and vexpress_osc Pawel Moll
2014-02-11 17:10 ` Pawel Moll
2014-02-11 17:10 ` [PATCH 04/12] clocksource: Sched clock source for Versatile Express Pawel Moll
2014-02-11 17:10 ` Pawel Moll
2014-04-16 13:56 ` Rob Herring
2014-04-16 13:56 ` Rob Herring
2014-04-16 14:22 ` Pawel Moll
2014-04-16 14:22 ` Pawel Moll
2014-04-16 14:45 ` Rob Herring
2014-04-16 14:45 ` Rob Herring
2014-04-16 15:05 ` Pawel Moll [this message]
2014-04-16 15:05 ` Pawel Moll
2014-05-02 22:14 ` Linus Walleij
2014-05-02 22:14 ` Linus Walleij
2014-05-07 9:57 ` Pawel Moll
2014-05-07 9:57 ` Pawel Moll
2014-05-13 8:47 ` Linus Walleij
2014-05-13 8:47 ` Linus Walleij
2014-02-11 17:10 ` [PATCH 05/12] GPIO: gpio-generic: Add label to platform data Pawel Moll
2014-02-11 17:10 ` Pawel Moll
2014-02-11 17:17 ` Lee Jones
2014-02-11 17:17 ` Lee Jones
2014-02-11 17:20 ` Pawel Moll
2014-02-11 17:20 ` Pawel Moll
2014-02-11 17:29 ` Pawel Moll
2014-02-11 17:29 ` Pawel Moll
2014-02-11 17:46 ` Lee Jones
2014-02-11 17:46 ` Lee Jones
2014-02-11 17:10 ` [PATCH 06/12] mfd: vexpress-sysreg: Add labels to gpio banks Pawel Moll
2014-02-11 17:10 ` Pawel Moll
2014-02-11 17:19 ` Lee Jones
2014-02-11 17:19 ` Lee Jones
2014-02-13 13:08 ` Linus Walleij
2014-02-13 13:08 ` Linus Walleij
2014-02-13 13:11 ` Pawel Moll
2014-02-13 13:11 ` Pawel Moll
2014-02-11 17:10 ` [PATCH 07/12] mfd: syscon: Consider platform data a regmap config name Pawel Moll
2014-02-11 17:10 ` Pawel Moll
2014-02-11 17:24 ` Lee Jones
2014-02-11 17:24 ` Lee Jones
2014-02-12 7:09 ` Alexander Shiyan
2014-02-12 7:09 ` Alexander Shiyan
2014-02-12 8:26 ` Lee Jones
2014-02-12 8:26 ` Lee Jones
2014-02-12 11:06 ` Pawel Moll
2014-02-12 11:06 ` Pawel Moll
2014-02-12 11:18 ` Lee Jones
2014-02-12 11:18 ` Lee Jones
2014-02-12 11:27 ` Alexander Shiyan
2014-02-12 11:27 ` Alexander Shiyan
2014-02-12 11:43 ` Pawel Moll
2014-02-12 11:43 ` Pawel Moll
2014-02-11 17:10 ` [PATCH 08/12] mfd: vexpress-sysreg: Add syscon labels as platform data Pawel Moll
2014-02-11 17:10 ` Pawel Moll
2014-02-11 17:29 ` Lee Jones
2014-02-11 17:29 ` Lee Jones
2014-02-11 17:32 ` Pawel Moll
2014-02-11 17:32 ` Pawel Moll
2014-02-11 17:48 ` Lee Jones
2014-02-11 17:48 ` Lee Jones
2014-02-11 17:52 ` [PATCH v2 1/2] mfd: syscon: Add platform data with a regmap config name Pawel Moll
2014-02-11 17:52 ` Pawel Moll
2014-02-11 17:52 ` [PATCH v2 2/2] mfd: vexpress-sysreg: Add syscon labels as platform data Pawel Moll
2014-02-11 17:52 ` Pawel Moll
2014-02-12 11:20 ` Lee Jones
2014-02-12 11:20 ` Lee Jones
2014-02-11 17:55 ` [PATCH v2 1/2] mfd: syscon: Add platform data with a regmap config name Pawel Moll
2014-02-11 17:55 ` Pawel Moll
2014-02-12 11:19 ` Lee Jones
2014-02-12 11:19 ` Lee Jones
2014-02-11 17:10 ` [lm-sensors] [PATCH 09/12] hwmon: vexpress: Use devm helper for hwmon device registration Pawel Moll
2014-02-11 17:10 ` Pawel Moll
2014-02-11 17:10 ` Pawel Moll
2014-02-11 20:57 ` [lm-sensors] " Arnd Bergmann
2014-02-11 20:57 ` Arnd Bergmann
2014-02-11 20:57 ` Arnd Bergmann
2014-02-12 2:49 ` [lm-sensors] " Guenter Roeck
2014-02-12 2:49 ` Guenter Roeck
2014-02-12 11:56 ` [lm-sensors] " Pawel Moll
2014-02-12 11:56 ` Pawel Moll
2014-02-12 11:56 ` Pawel Moll
2014-02-12 11:59 ` [lm-sensors] " Pawel Moll
2014-02-12 11:59 ` Pawel Moll
2014-02-12 11:59 ` Pawel Moll
2014-02-12 16:41 ` [lm-sensors] " Guenter Roeck
2014-02-12 16:41 ` Guenter Roeck
2014-02-12 16:41 ` Guenter Roeck
2014-02-11 17:10 ` [PATCH 10/12] ARM: vexpress: remove redundant vexpress_dt_cpus_num to get cpu count Pawel Moll
2014-02-11 17:10 ` Pawel Moll
2014-02-11 17:10 ` [PATCH 11/12] ARM: vexpress: Simplify SMP operations for DT-powered system Pawel Moll
2014-02-11 17:10 ` Pawel Moll
2014-02-11 17:10 ` [PATCH 12/12] ARM: vexpress: move HBI check to sysreg driver Pawel Moll
2014-02-11 17:10 ` Pawel Moll
2014-02-11 19:28 ` [lm-sensors] [PATCH 00/12] Versatile Express updates Arnd Bergmann
2014-02-11 19:28 ` Arnd Bergmann
2014-02-11 19:28 ` Arnd Bergmann
2014-02-12 12:30 ` [lm-sensors] " Pawel Moll
2014-02-12 12:30 ` Pawel Moll
2014-02-12 12:30 ` Pawel Moll
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=1397660716.3407.93.camel@hornet \
--to=pawel.moll@arm.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.