linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robherring2@gmail.com>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: linux-kernel@vger.kernel.org,
	devicetree-discuss@lists.ozlabs.org,
	Mike Turquette <mturquette@ti.com>,
	Sascha Hauer <kernel@pengutronix.de>,
	Shawn Guo <shawn.guo@freescale.com>,
	Russell King <linux@arm.linux.org.uk>
Subject: Re: [RFC v2 6/9] arm/dt: add devicetree support to sp804 timer support
Date: Mon, 12 Dec 2011 17:54:46 -0600	[thread overview]
Message-ID: <4EE69446.2060009@gmail.com> (raw)
In-Reply-To: <1323727329-4989-6-git-send-email-grant.likely@secretlab.ca>

Grant,

On 12/12/2011 04:02 PM, Grant Likely wrote:
> This patch adds support to the sp804 code for retrieving timer
> configuration from the device tree.  sp804 channels can be used as
> a clock event device or a clock source.
> 
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> Cc: Russell King <linux@arm.linux.org.uk>
> ---

[snip]

> +
> +	/*
> +	 * Figure out how to use this clock
> +	 *
> +	 * Note: This is kind of ugly since it requires linux-specific
> +	 * properties in the device tree so that Linux knows which sp804
> +	 * channels can be used as the clock source and the clock events
> +	 * trigger.  Something OS agnostic would be nicer, but it isn't
> +	 * obvious what that should look like.
> +	 */
> +	if (of_get_property(node, "linux,clock-source", NULL)) {
> +		__sp804_clocksource_init(base, node->full_name, clk);
> +	} else if (of_get_property(node, "linux,clockevents-device", NULL)) {
> +		irq = irq_of_parse_and_map(node, 0);
> +		__sp804_clockevents_init(base, irq, node->full_name, clk);

At least in the case of highbank, there is no interrupt connected for
2nd timer in the h/w. So we could use that fact and presence of a clock
for each timer to determine which to use. Some of the ARM boards have 2
sp804's (4 timers) though and you could use any combination I think.
Does it really matter which one is selected as long as it meets the
needs of the OS? Yes, we could think of possible scenarios that don't
work, but it's not likely to see a slew of new platforms with sp804's as
new ARM core integrate the timers in. Although, bcmring is a bit strange
setting up 2 clksrc's, but that doesn't really present a problem.

The fact that you split the timer to 2 nodes is a bit of Linux's needs
defining the binding. The h/w block is a block with 2 timers. It's not
really split. The block does have a single set of primecell ID registers
at 0xfe0 for example.

Rob

  reply	other threads:[~2011-12-12 23:54 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-12 22:02 [RFC v2 1/9] arm/versatile*: merge all versatile struct clk definitions Grant Likely
2011-12-12 22:02 ` [RFC v2 2/9] arm/versatile*: Consolidate clk_ops and setvco implementations Grant Likely
2011-12-12 22:02 ` [RFC v2 3/9] of: Add of_property_match_string() to find index into a string list Grant Likely
2011-12-12 22:02 ` [RFC v2 4/9] of: add clock providers Grant Likely
2011-12-12 23:29   ` Jamie Iles
2011-12-13 17:54     ` Grant Likely
2011-12-13 18:01       ` Rob Herring
2011-12-13 18:03         ` Grant Likely
2011-12-15 13:51       ` Shawn Guo
2011-12-15 14:23         ` Rob Herring
2011-12-15 15:13           ` Shawn Guo
2011-12-15 17:37             ` Grant Likely
2012-01-10 21:33   ` Jamie Iles
2012-01-12  4:46     ` Grant Likely
2012-01-12 10:07       ` Jamie Iles
2012-01-12 18:44         ` Turquette, Mike
2012-01-12 19:16           ` Grant Likely
2012-01-13 12:47       ` Shawn Guo
2012-01-14  4:30         ` Turquette, Mike
2012-01-14  5:40           ` Shawn Guo
2012-01-13 13:50   ` Shawn Guo
2012-01-13 14:05     ` Rob Herring
2012-01-13 14:38       ` Shawn Guo
2012-01-17 20:44   ` Stephen Warren
2012-01-17 22:47     ` Grant Likely
2012-01-17 23:37       ` Turquette, Mike
2012-01-17 23:49         ` Grant Likely
2012-01-18  0:05         ` Stephen Warren
2011-12-12 22:02 ` [RFC v2 5/9] dt/clock: Add handling for fixed clocks and a clock node setup iterator Grant Likely
2011-12-15 15:19   ` Shawn Guo
2011-12-12 22:02 ` [RFC v2 6/9] arm/dt: add devicetree support to sp804 timer support Grant Likely
2011-12-12 23:54   ` Rob Herring [this message]
2011-12-12 22:02 ` [RFC v2 7/9] arm/dt: Common plat-versatile support for icst and sp804 based system clocks Grant Likely
2012-01-17 21:05   ` Stephen Warren
2012-01-17 22:02     ` Rob Herring
2012-01-17 22:59     ` Grant Likely
2011-12-12 22:02 ` [RFC v2 8/9] dt/arm: versatile add clock parsing Grant Likely
2011-12-12 22:02 ` [RFC v2 9/9] arm/highbank: Use clock binding common support code Grant Likely

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=4EE69446.2060009@gmail.com \
    --to=robherring2@gmail.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mturquette@ti.com \
    --cc=shawn.guo@freescale.com \
    /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 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).