linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC][Vortex86] high resolution timer
       [not found] <4DCD3B43.3060806@greenseainc.com>
@ 2011-05-15 21:57 ` Lukasz Majewski
  2012-08-05 19:00   ` Ben Kangsah
  0 siblings, 1 reply; 2+ messages in thread
From: Lukasz Majewski @ 2011-05-15 21:57 UTC (permalink / raw)
  To: Andy O'Brien; +Cc: linux-rt-users, Lukasz Majewski, Thomas Gleixner

On Fri, 13 May 2011 10:08:03 -0400
Andy O'Brien <aobrien@greenseainc.com> wrote:

> Lukasz,
> 
> Have you made any headway on supporting the Vortex86's high
> resolution timer?  I'm in the same boat and would very much like to
> support it.
> 
> Are you still planning on implementing support for the other counter? 
> Perhaps we could work together?
> 
> Best,
> Andy
> 

Hi Andy,

The support for the High Resolution Timers on the Vortex86DX shall be
considered as work in progress.

Firstly, I've looked into the "struct clocksource" and try to understand
Vortex's internals:

1. One i8254 timer (0x40 - 0x43) is used by PIT. It has a hardcoded
frequency of 1.19MHz. It is NOT suitable for any "real-time" control
control application (rounding problem and relatively low frequency).

2. Another i8254 timer is the PWM timer (0x44 - 0x48). A programmer
can change the frequency of this timer (IO pins are muxed with COM2). 
So it is possible to connect e.g. 20MHz external oscillator and
provide very stable clock source.

3. TSC - Time Stamp Counter (one of vortex86 features - as seen on
the cat /proc/cpuinfo) allows for reading the internal chip counter
via an assembler instruction - RDTSC (rdtscll). It works on
vortex86DX and it seems, that this timer value is incremented with
each clock tick provided to CPU (e.g. 500MHz). Therefore it is a
preferred clock source for Vortex86 board.

It would be desirable to use this as clocksource with the "struct
hrtimer_cpu_base.clock_base".

I was studying the presentation:
http://www.kernel.org/pub/linux/kernel/people/tglx/hrtimers/ols2006-hrtimers.pdf

And try to "link" the slide 22 with the kernel source (I'm using
2.6.33.7.2-rt30).

In my opinion it is better to use the TSC counter as a clock base
(kernel/hrtimer.c).

To do that I guess, that I need to:
1. Define my own hrtimer_cpu_base with TSC .get_time =get_time()
function, .resolution=1.25 ns and .index = CLOCK_MONOTONIC
2. Define hrtimer struct (with .restart callback function) and use
hrtimer_init function for initialization.

3. .... I don't know if it is sufficient. Hints? Ideas?

Anyway I will investigate this issue in the following days (since
HRtimer subsystem is quite large) and poke for solution at other
architectures. 

Best regards,
Lukasz

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFC][Vortex86] high resolution timer
  2011-05-15 21:57 ` [RFC][Vortex86] high resolution timer Lukasz Majewski
@ 2012-08-05 19:00   ` Ben Kangsah
  0 siblings, 0 replies; 2+ messages in thread
From: Ben Kangsah @ 2012-08-05 19:00 UTC (permalink / raw)
  To: linux-rt-users

Hi all,

I use the kernel parameter tsc=reliable for my vortex86.
This somehow activate the high resolution timer.

Cheers,
Ben





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-08-05 19:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <4DCD3B43.3060806@greenseainc.com>
2011-05-15 21:57 ` [RFC][Vortex86] high resolution timer Lukasz Majewski
2012-08-05 19:00   ` Ben Kangsah

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).