[RFC][Vortex86] high resolution timer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 13 May 2011 10:08:03 -0400
Andy O'Brien <aobrien@xxxxxxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux