* [PATCH] clocksource: tegra: enable arch_timer
@ 2013-04-03 11:32 Joseph Lo
[not found] ` <1364988750-25058-1-git-send-email-josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Joseph Lo @ 2013-04-03 11:32 UTC (permalink / raw)
To: Stephen Warren
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Joseph Lo,
John Stultz, Thomas Gleixner
Architected timer is the local timer for Cortex-A15. Adding the support
for Tegra.
Cc: John Stultz <john.stultz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
Signed-off-by: Joseph Lo <josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
drivers/clocksource/tegra20_timer.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/clocksource/tegra20_timer.c b/drivers/clocksource/tegra20_timer.c
index ae877b0..e443f44 100644
--- a/drivers/clocksource/tegra20_timer.c
+++ b/drivers/clocksource/tegra20_timer.c
@@ -30,6 +30,7 @@
#include <asm/mach/time.h>
#include <asm/smp_twd.h>
#include <asm/sched_clock.h>
+#include <asm/arch_timer.h>
#define RTC_SECONDS 0x08
#define RTC_SHADOW_SECONDS 0x0c
@@ -200,8 +201,6 @@ static void __init tegra20_init_timer(struct device_node *np)
WARN(1, "Unknown clock rate");
}
- setup_sched_clock(tegra_read_sched_clock, 32, 1000000);
-
if (clocksource_mmio_init(timer_reg_base + TIMERUS_CNTR_1US,
"timer_us", 1000000, 300, 32, clocksource_mmio_readl_up)) {
pr_err("Failed to register clocksource\n");
@@ -218,6 +217,10 @@ static void __init tegra20_init_timer(struct device_node *np)
tegra_clockevent.irq = tegra_timer_irq.irq;
clockevents_config_and_register(&tegra_clockevent, 1000000,
0x1, 0x1fffffff);
+ if (arch_timer_of_register())
+ setup_sched_clock(tegra_read_sched_clock, 32, 1000000);
+ else
+ arch_timer_sched_clock_init();
}
CLOCKSOURCE_OF_DECLARE(tegra20_timer, "nvidia,tegra20-timer", tegra20_init_timer);
--
1.8.2
^ permalink raw reply related [flat|nested] 6+ messages in thread[parent not found: <1364988750-25058-1-git-send-email-josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] clocksource: tegra: enable arch_timer [not found] ` <1364988750-25058-1-git-send-email-josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> @ 2013-04-03 13:28 ` Rob Herring [not found] ` <515C2E8F.1030802-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Rob Herring @ 2013-04-03 13:28 UTC (permalink / raw) To: Joseph Lo Cc: Stephen Warren, linux-tegra-u79uwXL29TY76Z2rM5mHXA, Thomas Gleixner, John Stultz, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On 04/03/2013 06:32 AM, Joseph Lo wrote: > Architected timer is the local timer for Cortex-A15. Adding the support > for Tegra. > > Cc: John Stultz <john.stultz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> > Cc: Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org> > Signed-off-by: Joseph Lo <josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> My patch series to add CLOCKSOURCE_OF_DECLARE support to arch timer and sched_clock enhancements will make this unnecessary: http://www.spinics.net/lists/arm-kernel/msg234597.html Testing would be appreciated. Rob > --- > drivers/clocksource/tegra20_timer.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/clocksource/tegra20_timer.c b/drivers/clocksource/tegra20_timer.c > index ae877b0..e443f44 100644 > --- a/drivers/clocksource/tegra20_timer.c > +++ b/drivers/clocksource/tegra20_timer.c > @@ -30,6 +30,7 @@ > #include <asm/mach/time.h> > #include <asm/smp_twd.h> > #include <asm/sched_clock.h> > +#include <asm/arch_timer.h> > > #define RTC_SECONDS 0x08 > #define RTC_SHADOW_SECONDS 0x0c > @@ -200,8 +201,6 @@ static void __init tegra20_init_timer(struct device_node *np) > WARN(1, "Unknown clock rate"); > } > > - setup_sched_clock(tegra_read_sched_clock, 32, 1000000); > - > if (clocksource_mmio_init(timer_reg_base + TIMERUS_CNTR_1US, > "timer_us", 1000000, 300, 32, clocksource_mmio_readl_up)) { > pr_err("Failed to register clocksource\n"); > @@ -218,6 +217,10 @@ static void __init tegra20_init_timer(struct device_node *np) > tegra_clockevent.irq = tegra_timer_irq.irq; > clockevents_config_and_register(&tegra_clockevent, 1000000, > 0x1, 0x1fffffff); > + if (arch_timer_of_register()) > + setup_sched_clock(tegra_read_sched_clock, 32, 1000000); > + else > + arch_timer_sched_clock_init(); > } > CLOCKSOURCE_OF_DECLARE(tegra20_timer, "nvidia,tegra20-timer", tegra20_init_timer); > > ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <515C2E8F.1030802-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH] clocksource: tegra: enable arch_timer [not found] ` <515C2E8F.1030802-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2013-04-03 18:22 ` Stephen Warren [not found] ` <515C7363.4040404-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Stephen Warren @ 2013-04-03 18:22 UTC (permalink / raw) To: Rob Herring, Joseph Lo Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, Thomas Gleixner, John Stultz, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On 04/03/2013 07:28 AM, Rob Herring wrote: > On 04/03/2013 06:32 AM, Joseph Lo wrote: >> Architected timer is the local timer for Cortex-A15. Adding the support >> for Tegra. >> >> Cc: John Stultz <john.stultz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> >> Cc: Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org> >> Signed-off-by: Joseph Lo <josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> > > My patch series to add CLOCKSOURCE_OF_DECLARE support to arch timer and > sched_clock enhancements will make this unnecessary: > > http://www.spinics.net/lists/arm-kernel/msg234597.html > > Testing would be appreciated. Joseph (or Rob), what's the benefit of this change; what works with it and/or what breaks without it? Rob, if I did apply this change, and you also apply that series of yours, what is the result: compile-time breakage, run-time breakage, just some redundant code that needs to be removed again? Thanks. ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <515C7363.4040404-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>]
* Re: [PATCH] clocksource: tegra: enable arch_timer [not found] ` <515C7363.4040404-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> @ 2013-04-03 21:34 ` Rob Herring [not found] ` <515CA060.7030100-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Rob Herring @ 2013-04-03 21:34 UTC (permalink / raw) To: Stephen Warren Cc: Joseph Lo, linux-tegra-u79uwXL29TY76Z2rM5mHXA, Thomas Gleixner, John Stultz, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On 04/03/2013 01:22 PM, Stephen Warren wrote: > On 04/03/2013 07:28 AM, Rob Herring wrote: >> On 04/03/2013 06:32 AM, Joseph Lo wrote: >>> Architected timer is the local timer for Cortex-A15. Adding the support >>> for Tegra. >>> >>> Cc: John Stultz <john.stultz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> >>> Cc: Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org> >>> Signed-off-by: Joseph Lo <josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> >> >> My patch series to add CLOCKSOURCE_OF_DECLARE support to arch timer and >> sched_clock enhancements will make this unnecessary: >> >> http://www.spinics.net/lists/arm-kernel/msg234597.html >> >> Testing would be appreciated. > > Joseph (or Rob), what's the benefit of this change; what works with it > and/or what breaks without it? I assume you mean Joseph's change. Well, it enables local timers on A15. But mine will too for Tegra if you have the arch timer in the dtb. > Rob, if I did apply this change, and you also apply that series of > yours, what is the result: compile-time breakage, run-time breakage, > just some redundant code that needs to be removed again? Compile-time breakage as the functions called here are being removed. Rob ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <515CA060.7030100-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH] clocksource: tegra: enable arch_timer [not found] ` <515CA060.7030100-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2013-04-03 22:48 ` Stephen Warren [not found] ` <515CB1A6.6090308-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Stephen Warren @ 2013-04-03 22:48 UTC (permalink / raw) To: Rob Herring Cc: Joseph Lo, linux-tegra-u79uwXL29TY76Z2rM5mHXA, Thomas Gleixner, John Stultz, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On 04/03/2013 03:34 PM, Rob Herring wrote: > On 04/03/2013 01:22 PM, Stephen Warren wrote: >> On 04/03/2013 07:28 AM, Rob Herring wrote: >>> On 04/03/2013 06:32 AM, Joseph Lo wrote: >>>> Architected timer is the local timer for Cortex-A15. Adding the support >>>> for Tegra. >>>> >>>> Cc: John Stultz <john.stultz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> >>>> Cc: Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org> >>>> Signed-off-by: Joseph Lo <josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> >>> >>> My patch series to add CLOCKSOURCE_OF_DECLARE support to arch timer and >>> sched_clock enhancements will make this unnecessary: >>> >>> http://www.spinics.net/lists/arm-kernel/msg234597.html >>> >>> Testing would be appreciated. >> >> Joseph (or Rob), what's the benefit of this change; what works with it >> and/or what breaks without it? > > I assume you mean Joseph's change. Yes. > Well, it enables local timers on A15. > But mine will too for Tegra if you have the arch timer in the dtb. Well, I meant what benefit would I see from enabling them, rather than using the Tegra-specific timers as I believe is currently happening. >> Rob, if I did apply this change, and you also apply that series of >> yours, what is the result: compile-time breakage, run-time breakage, >> just some redundant code that needs to be removed again? > > Compile-time breakage as the functions called here are being removed. OK, I definitely won't apply Joseph's patch then. Aside from that, I took the git branch you mentioned in the patch you linked to above, merged it into my dev tree, updated my bootloader to actually initialize the TSC correctly, and I see the following during boot, so I guess that's enough for: Tested-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> on your patches. > [ 0.000000] sched_clock: 32 bits at 1000kHz, resolution 1000ns, wraps every 4294967ms > [ 0.000000] Architected local timer running at 12.00MHz (virt). > [ 0.000000] Switching to timer-based delay loop > [ 117.431229] Calibrating delay loop (skipped), value calculated using timer frequency.. 24.00 BogoMIPS (lpj=120000) > [ 117.987221] Switching to clocksource arch_sys_counter ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <515CB1A6.6090308-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>]
* Re: [PATCH] clocksource: tegra: enable arch_timer [not found] ` <515CB1A6.6090308-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> @ 2013-04-04 10:28 ` Joseph Lo 0 siblings, 0 replies; 6+ messages in thread From: Joseph Lo @ 2013-04-04 10:28 UTC (permalink / raw) To: Stephen Warren Cc: Rob Herring, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Thomas Gleixner, John Stultz, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org On Thu, 2013-04-04 at 06:48 +0800, Stephen Warren wrote: > On 04/03/2013 03:34 PM, Rob Herring wrote: > > On 04/03/2013 01:22 PM, Stephen Warren wrote: > >> On 04/03/2013 07:28 AM, Rob Herring wrote: > >>> On 04/03/2013 06:32 AM, Joseph Lo wrote: > >> Rob, if I did apply this change, and you also apply that series of > >> yours, what is the result: compile-time breakage, run-time breakage, > >> just some redundant code that needs to be removed again? > > > > Compile-time breakage as the functions called here are being removed. > > OK, I definitely won't apply Joseph's patch then. Agree. This patch is redundant, once Rob's patches go into mainline. > > Aside from that, I took the git branch you mentioned in the patch you > linked to above, merged it into my dev tree, updated my bootloader to > actually initialize the TSC correctly, and I see the following during > boot, so I guess that's enough for: > > Tested-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> > > on your patches. > > > [ 0.000000] sched_clock: 32 bits at 1000kHz, resolution 1000ns, wraps every 4294967ms > > [ 0.000000] Architected local timer running at 12.00MHz (virt). > > [ 0.000000] Switching to timer-based delay loop > > [ 117.431229] Calibrating delay loop (skipped), value calculated using timer frequency.. 24.00 BogoMIPS (lpj=120000) > > [ 117.987221] Switching to clocksource arch_sys_counter ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-04-04 10:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-03 11:32 [PATCH] clocksource: tegra: enable arch_timer Joseph Lo
[not found] ` <1364988750-25058-1-git-send-email-josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-04-03 13:28 ` Rob Herring
[not found] ` <515C2E8F.1030802-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-04-03 18:22 ` Stephen Warren
[not found] ` <515C7363.4040404-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-04-03 21:34 ` Rob Herring
[not found] ` <515CA060.7030100-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-04-03 22:48 ` Stephen Warren
[not found] ` <515CB1A6.6090308-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-04-04 10:28 ` Joseph Lo
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).