All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@ti.com>
To: Vaibhav Hiremath <hvaibhav@ti.com>
Cc: linux-omap@vger.kernel.org, tony@atomide.com, paul@pwsan.com,
	santosh.shilimkar@ti.com, b-cousson@ti.com,
	linux-arm-kernel@lists.infradead.org, Felipe Balbi <balbi@ti.com>,
	Tarun Kanti DebBarma <tarun.kanti@ti.com>,
	Ming Lei <tom.leiming@gmail.com>
Subject: Re: [PATCH-V6 3/3] ARM: OMAP: Make OMAP clocksource source selection using kernel param
Date: Wed, 02 May 2012 13:39:59 -0700	[thread overview]
Message-ID: <87mx5qfhb4.fsf@ti.com> (raw)
In-Reply-To: <1335967014-11937-4-git-send-email-hvaibhav@ti.com> (Vaibhav Hiremath's message of "Wed, 2 May 2012 19:26:54 +0530")

Vaibhav Hiremath <hvaibhav@ti.com> writes:

> Current OMAP code supports couple of clocksource options based
> on compilation flag (CONFIG_OMAP_32K_TIMER). The 32KHz sync-timer
> and a gptimer which can run on 32KHz or system clock (e.g 38.4 MHz).
> So there can be 3 options -
>
> 1. 32KHz sync-timer
> 2. Sys_clock based (e.g 13/19.2/26/38.4 MHz) gptimer
> 3. 32KHz based gptimer.
>
> The optional gptimer based clocksource was added so that it can
> give the high precision than sync-timer, so expected usage was 2
> and not 3.
> Unfortunately option 2, clocksource doesn't meet the requirement of
> free-running clock as per clocksource need. It stops in low power states
> when sys_clock is cut. That makes gptimer based clocksource option
> useless for OMAP2/3/4 devices with sys_clock as a clock input.
> So, in order to use option 2, deeper idle state MUST be disabled.
>
> Option 3 will still work but it is no better than 32K sync-timer
> based clocksource.
>
> We must support both sync timer and gptimer based clocksource as
> some OMAP based derivative SoCs like AM33XX does not have the
> sync timer.
>
> Considering above, make sync-timer and gptimer clocksource runtime
> selectable so that both OMAP and AMXXXX continue to use the same code.
>
> And, in order to precisely configure/setup sched_clock for given
> clocksource, decision has to be made early enough in boot sequence.
>
> So, the solution is,
>
> Use standard kernel parameter ("clocksource=") to override
> default 32k_sync-timer, in addition to this, we also use hwmod database
> lookup mechanism, through which at run-time we can identify availability
> of 32k-sync timer on the device, else fall back to gptimer.
>
> Also, moved low-level SoC specific init code to respective files,
> (mach-omap1/timer32k.c and mach-omap2/timer.c)
>
> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
> Signed-off-by: Felipe Balbi <balbi@ti.com>
> Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> Cc: Benoit Cousson <b-cousson@ti.com>
> Cc: Tony Lindgren <tony@atomide.com>
> Cc: Paul Walmsley <paul@pwsan.com>
> Cc: Kevin Hilman <khilman@ti.com>
> Cc: Tarun Kanti DebBarma <tarun.kanti@ti.com>
> Cc: Ming Lei <tom.leiming@gmail.com>

Reviewed-by: Kevin Hilman <khilman@ti.com>
Tested-by: Kevin Hilman <khilman@ti.com>

tested on OMAP3530/Overo with default 32k timer and cmdline override for
GPtimer.

Kevin

WARNING: multiple messages have this Message-ID (diff)
From: khilman@ti.com (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH-V6 3/3] ARM: OMAP: Make OMAP clocksource source selection using kernel param
Date: Wed, 02 May 2012 13:39:59 -0700	[thread overview]
Message-ID: <87mx5qfhb4.fsf@ti.com> (raw)
In-Reply-To: <1335967014-11937-4-git-send-email-hvaibhav@ti.com> (Vaibhav Hiremath's message of "Wed, 2 May 2012 19:26:54 +0530")

Vaibhav Hiremath <hvaibhav@ti.com> writes:

> Current OMAP code supports couple of clocksource options based
> on compilation flag (CONFIG_OMAP_32K_TIMER). The 32KHz sync-timer
> and a gptimer which can run on 32KHz or system clock (e.g 38.4 MHz).
> So there can be 3 options -
>
> 1. 32KHz sync-timer
> 2. Sys_clock based (e.g 13/19.2/26/38.4 MHz) gptimer
> 3. 32KHz based gptimer.
>
> The optional gptimer based clocksource was added so that it can
> give the high precision than sync-timer, so expected usage was 2
> and not 3.
> Unfortunately option 2, clocksource doesn't meet the requirement of
> free-running clock as per clocksource need. It stops in low power states
> when sys_clock is cut. That makes gptimer based clocksource option
> useless for OMAP2/3/4 devices with sys_clock as a clock input.
> So, in order to use option 2, deeper idle state MUST be disabled.
>
> Option 3 will still work but it is no better than 32K sync-timer
> based clocksource.
>
> We must support both sync timer and gptimer based clocksource as
> some OMAP based derivative SoCs like AM33XX does not have the
> sync timer.
>
> Considering above, make sync-timer and gptimer clocksource runtime
> selectable so that both OMAP and AMXXXX continue to use the same code.
>
> And, in order to precisely configure/setup sched_clock for given
> clocksource, decision has to be made early enough in boot sequence.
>
> So, the solution is,
>
> Use standard kernel parameter ("clocksource=") to override
> default 32k_sync-timer, in addition to this, we also use hwmod database
> lookup mechanism, through which at run-time we can identify availability
> of 32k-sync timer on the device, else fall back to gptimer.
>
> Also, moved low-level SoC specific init code to respective files,
> (mach-omap1/timer32k.c and mach-omap2/timer.c)
>
> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
> Signed-off-by: Felipe Balbi <balbi@ti.com>
> Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> Cc: Benoit Cousson <b-cousson@ti.com>
> Cc: Tony Lindgren <tony@atomide.com>
> Cc: Paul Walmsley <paul@pwsan.com>
> Cc: Kevin Hilman <khilman@ti.com>
> Cc: Tarun Kanti DebBarma <tarun.kanti@ti.com>
> Cc: Ming Lei <tom.leiming@gmail.com>

Reviewed-by: Kevin Hilman <khilman@ti.com>
Tested-by: Kevin Hilman <khilman@ti.com>

tested on OMAP3530/Overo with default 32k timer and cmdline override for
GPtimer.

Kevin

  reply	other threads:[~2012-05-02 20:40 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-02 13:56 [PATCH-V6 0/3] ARM: OMAP: Make OMAP clocksource source selection runtime Vaibhav Hiremath
2012-05-02 13:56 ` Vaibhav Hiremath
2012-05-02 13:56 ` [PATCH-V6 1/3] ARM: OMAP1: FIX: check possible error condition in timer_init Vaibhav Hiremath
2012-05-02 13:56   ` Vaibhav Hiremath
2012-05-02 20:08   ` Kevin Hilman
2012-05-02 20:08     ` Kevin Hilman
2012-05-04 17:43     ` Tony Lindgren
2012-05-04 17:43       ` Tony Lindgren
2012-05-04 19:45       ` Janusz Krzysztofik
2012-05-04 19:45         ` Janusz Krzysztofik
2012-05-02 13:56 ` [PATCH-V6 2/3] ARM: OMAP2+: Replace space=>underscore in the name field of system timers Vaibhav Hiremath
2012-05-02 13:56   ` Vaibhav Hiremath
2012-05-02 20:09   ` Kevin Hilman
2012-05-02 20:09     ` Kevin Hilman
2012-05-02 13:56 ` [PATCH-V6 3/3] ARM: OMAP: Make OMAP clocksource source selection using kernel param Vaibhav Hiremath
2012-05-02 13:56   ` Vaibhav Hiremath
2012-05-02 20:39   ` Kevin Hilman [this message]
2012-05-02 20:39     ` Kevin Hilman
2012-05-03  8:06     ` Hiremath, Vaibhav
2012-05-03  8:06       ` Hiremath, Vaibhav
2012-05-02 19:56 ` [PATCH-V6 0/3] ARM: OMAP: Make OMAP clocksource source selection runtime Jon Hunter
2012-05-02 19:56   ` Jon Hunter
2012-05-03  5:07   ` Hiremath, Vaibhav
2012-05-03  5:07     ` Hiremath, Vaibhav
2012-05-03 18:19     ` Jon Hunter
2012-05-03 18:19       ` Jon Hunter
2012-05-07 12:39       ` Cousson, Benoit
2012-05-07 12:39         ` Cousson, Benoit

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=87mx5qfhb4.fsf@ti.com \
    --to=khilman@ti.com \
    --cc=b-cousson@ti.com \
    --cc=balbi@ti.com \
    --cc=hvaibhav@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.com \
    --cc=santosh.shilimkar@ti.com \
    --cc=tarun.kanti@ti.com \
    --cc=tom.leiming@gmail.com \
    --cc=tony@atomide.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 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.