All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] Ipipe-core patched kernel fails to start when certain platform drivers are enabled
Date: Fri, 1 May 2015 17:22:00 +0200	[thread overview]
Message-ID: <20150501152200.GJ1993@hermes.click-hack.org> (raw)
In-Reply-To: <20150501151153.GI24389@csclub.uwaterloo.ca>

On Fri, May 01, 2015 at 11:11:53AM -0400, Lennart Sorensen wrote:
> On Fri, May 01, 2015 at 04:30:45PM +0200, Gilles Chanteperdrix wrote:
> > The point is: the cortex A9 global timer runs at half the processor
> > frequency, that is 500 MHz for a 1GHz processor: that gives a much
> > better resolution than a timer with a frequency lower than 10 MHz
> > you get with a cortex A15. So since the cortex A15 is newer than the
> > cortex A9, it could be expected to do better or at least be
> > equivalent, rather than do much worse.
> 
> Did any of the A9 designs allow changing the speed on the fly the way
> the A15 and others do?
> 
> I certainly like the idea of a 500MHz timer.
> 
> > > Now they do have lots of other timers in the chip that can be programmed.
> > > I wonder if that could be used to make something much better.
> > > 
> > > I am pretty sure the omap5432 uses 6.144 MHz just like the am572x was
> > > supposed to (if it wasn't for the errata that makes it 6.147541
> > > MHz instead).
> > 
> > Yes, 5MHZ, 6 MHZ, that is the same bad order of magnitude.
> > 
> > > Looking at the manual for the am572x it looks like the general purpose
> > > timers are only 32 bit and can run at either 32.768 KHz or system clock
> > > (usually 20 MHz).  That's not much help.
> > 
> > Once again: Xenomai extends 32 bits counter to 64 bits in software.
> > So, a 32 bits counter running at 20 MHz is still better than the
> > architected timer running at 6MHz. 6 MHz is so low that by reading
> > twice the counter in less than 166ns (which is really really doable
> > on these processors), you could get twice the same value. On cortex
> > A9, I could read the counter twice in userspace in 22ns, and get
> > different values. On cortex A9, anything lower than 50 MHz would
> > not have been sufficient for user-space.
> 
> Yep, that makes sense.  160 ns is a long time on a 1GHz CPU.
> 
> It looks like one of the clock sources for the timers is
> ./sys_clkin2/abe_dpll_sys_clk_mux/abe_dpll_clk_mux/dpll_abe_ck/dpll_abe_x2_ck/dpll_abe_m2x2_ck/abe_clk/aess_fclk/abe_giclk_div/clk_rate
> which is 361267200 Hz (at least right now it is), so that might actually
> be able to be used to make a nice counter.  All the other sources are
> either external clock input pins, or sysclk1 (20 MHz usually) or sysclk2
> (22.5792 MHz).  The 361267200 is 16 * sysclk2.
> 
> I wonder how to create a clocksource from a general purpose timer.

OMAP3 uses a GP timer as clocksource, and OMAP4 does when running
only one core. So, if these IPs have not changed, the code is there
to be used. Note however that last time I tried changing the GP
timer used on OMAP4, the timer I used would not start, so a write to
a register to start a clock was probably missing, or not writing to
the right register. Since nobody ever uses another GP timer, this
code is largely untested.

-- 
					    Gilles.


      reply	other threads:[~2015-05-01 15:22 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-30 15:53 [Xenomai] Ipipe-core patched kernel fails to start when certain platform drivers are enabled Hongfei Cheng
2015-04-30 16:17 ` Gilles Chanteperdrix
2015-04-30 18:12   ` Hongfei Cheng
2015-04-30 18:14     ` Gilles Chanteperdrix
2015-04-30 18:17       ` Hongfei Cheng
2015-04-30 18:31 ` Gilles Chanteperdrix
2015-04-30 20:04   ` Hongfei Cheng
2015-04-30 20:14     ` Gilles Chanteperdrix
2015-04-30 21:21       ` Lennart Sorensen
2015-04-30 21:27         ` Gilles Chanteperdrix
2015-05-01 13:45           ` Lennart Sorensen
2015-05-01 13:56             ` Gilles Chanteperdrix
2015-05-01 14:36               ` Lennart Sorensen
2015-05-01 14:44                 ` Gilles Chanteperdrix
2015-05-01 15:33                   ` Lennart Sorensen
2015-05-13 17:01                     ` Lennart Sorensen
2015-05-13 17:33                       ` Lennart Sorensen
2015-05-01 14:00             ` Gilles Chanteperdrix
2015-04-30 21:34         ` Gilles Chanteperdrix
2015-05-01 14:20           ` Lennart Sorensen
2015-05-01 14:30             ` Gilles Chanteperdrix
2015-05-01 15:11               ` Lennart Sorensen
2015-05-01 15:22                 ` Gilles Chanteperdrix [this message]

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=20150501152200.GJ1993@hermes.click-hack.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=lsorense@csclub.uwaterloo.ca \
    --cc=xenomai@xenomai.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.