linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: joelf@ti.com (Joel Fernandes)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/8] ARM: OMAP2+: timer: Introduce OF-friendly clocksource/clockevent system timers
Date: Fri, 22 Nov 2013 10:42:01 -0600	[thread overview]
Message-ID: <528F8959.7080207@ti.com> (raw)
In-Reply-To: <CAL_JsqKS=cGeAhj+K04SOtA8nJRR3MXxS3ry-kzjQOkZx3yK4g@mail.gmail.com>

On 11/22/2013 09:58 AM, Rob Herring wrote:
> On Thu, Nov 21, 2013 at 7:56 PM, Joel Fernandes <joelf@ti.com> wrote:
>> This work is a migration effort of OMAP system timers to the
>> clocksource/clockevent framework. Consider this as a first-pass in this effort.
>> There are few cleanups that need to be done first. The HWMOD code is
>> intertwined with the timer code. HWMOD code cleanups in the future will
>> hopefully make most of this code go away, so till then we separate out the
>> power/clocks portion of the code from the actual timer bits.  This will
>> facilitate near-future work of adapting the system timer as a clocksource.
>>
>> New functions for OF-only boot are introduced, and we can soon delete the old
>> versions once we migrate all platforms. Currently only AM335x is migrated and
>> testedA new omap_generic_timer_init function is introduced for DT platforms.
>> Code required earlier for non-DT platforms such as setup of timer IDs and timer
>> parent clock is not required.  parent clocks are automatically setup by the mux
>> clock driver through DT so they no longer need to be hardcoded.
>>
>> The init code will try to pick the best timer for clocksource and clockevent
>> however bindings are added to force a particular timer as clocksource or
>> clockevent through DT.
>>
>> Signed-off-by: Joel Fernandes <joelf@ti.com>
>> ---
>>  .../devicetree/bindings/arm/omap/timer.txt         |  12 ++
>>  arch/arm/mach-omap2/common.h                       |   1 +
>>  arch/arm/mach-omap2/timer.c                        | 235 +++++++++++++++++++++
>>  3 files changed, 248 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/arm/omap/timer.txt b/Documentation/devicetree/bindings/arm/omap/timer.txt
>> index d02e27c..6cf7a75 100644
>> --- a/Documentation/devicetree/bindings/arm/omap/timer.txt
>> +++ b/Documentation/devicetree/bindings/arm/omap/timer.txt
>> @@ -32,6 +32,18 @@ Optional properties:
>>  - ti,timer-secure:     Indicates the timer is reserved on a secure OMAP device
>>                         and therefore cannot be used by the kernel.
>>
>> +- ti,timer-clockevent,
>> +  ti,timer-clocksource These properties force the system timer code to choose
>> +                       the particular timer as a clockevent or clocksource.
>> +                       If these properties are not specified, the timer code
>> +                       picks up a "ti,timer-alwon" as the clocksource and a
>> +                       timer containing one of the following properties as
>> +                       the clockevent in the following order:
>> +                               ti,timer-alwon
>> +                               ti,timer-dsp
>> +                               ti,timer-pwm
>> +                               ti,timer-secure
> 
> These properties were added specifically for the reason of avoiding
> linux specific properties like these. When is this not sufficient?

Some platforms cannot use certain timers as clockevents and clocksource, to keep
this code functionally equivalent and working, I added these properties so that
its possible to select specific timers as clockevents/sources as was being done
in the non-DT case. I'm open to suggestions for doing this in a better way for DT.

> 
> And I agree with the comment to use OF_CLKSRC.
> 

There are difficulties I mentioned in a previous post [1] stating why it may not
be possible to use OF_CLKSRC macros, and still keep the code functionally
equivalent to when it was non-DT.

thanks,

-Joel

[1] http://marc.info/?l=linux-arm-kernel&m=138513299917850&w=2

  reply	other threads:[~2013-11-22 16:42 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-22  1:56 [PATCH 0/8] OMAP: timers: Preparation for migration to clocksource Joel Fernandes
2013-11-22  1:56 ` [PATCH 1/8] ARM: OMAP: Move public portion of dmtimer.h to include/linux/omap-timer.h Joel Fernandes
2013-11-22 15:33   ` Tony Lindgren
2013-11-22 16:01     ` Joel Fernandes
2013-11-26  3:02     ` Joel Fernandes
2013-11-26 18:29       ` Tony Lindgren
2013-11-26 19:52         ` Joel Fernandes
2013-11-26 20:32           ` Tony Lindgren
2013-11-22  1:56 ` [PATCH 2/8] rc: ir-rx51: Use clk API to get clock rate Joel Fernandes
2013-11-22  1:56 ` [PATCH 3/8] rc: ir-rx51: Turn ON ir-rx51 as it should work for MULTIPLATFORM Joel Fernandes
2013-11-22  1:56 ` [PATCH 4/8] ARM: OMAP4: timer: Remove non-DT code for TWD timer Joel Fernandes
2013-11-22  1:56 ` [PATCH 5/8] ARM: OMAP2+: timer: Introduce OF-friendly clocksource/clockevent system timers Joel Fernandes
2013-11-22  3:51   ` Felipe Balbi
2013-11-22 15:09     ` Joel Fernandes
2013-11-22 15:58   ` Rob Herring
2013-11-22 16:42     ` Joel Fernandes [this message]
2013-11-22 20:01       ` Rob Herring
2013-11-23  1:12         ` Joel Fernandes
2013-11-23  1:22           ` Joel Fernandes
2013-11-23 16:26           ` Rob Herring
2013-11-22  1:56 ` [PATCH 6/8] devicetree: doc: Document ti,timer-parent property Joel Fernandes
2013-11-22 15:58   ` Tony Lindgren
2013-11-22 16:36     ` Joel Fernandes
2013-11-22 17:08       ` Tony Lindgren
2013-11-23  0:31         ` Joel Fernandes
2013-11-23  0:52           ` Tony Lindgren
2013-11-22 17:05     ` Joel Fernandes
2013-11-22 17:11       ` Tony Lindgren
2013-11-22  1:56 ` [PATCH 7/8] ARM: DTS: am33xx: Provide the " Joel Fernandes
2013-11-22  1:56 ` [PATCH 8/8] ARM: AM33xx: Move to using omap_generic_timer_init for init_time Joel Fernandes

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=528F8959.7080207@ti.com \
    --to=joelf@ti.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 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).