Re: clocksource and clockevent confusion

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

 



Le 04/04/2011 20:51, Johannes Bauer a écrit :

Hi Johannes,

Same problem than you one year before: http://www.spinics.net/lists/linux-rt-users/msg05299.html

Please find below some pointers on high resolution timers:

Thomas Gleixner's & Douglas Niehaus's presentation:
http://www.linuxsymposium.org/2006/linuxsymposium_procv1.pdf from page 333
http://userweb.kernel.org/~tglx/ols2006/ols2006-hrtimers.pdf

This good report on PREEMPT-RT port on AVR32 and on hrtimer port on AVR32: http://ntnu.diva-portal.org/smash/get/diva2:350562/FULLTEXT01

http://lwn.net/Articles/167897/
http://public.dhe.ibm.com/software/dw/linux/l-timers-list/l-timers-list-pdf.pdf
https://rt.wiki.kernel.org/index.php/High_resolution_timer_design_notes
http://elinux.org/High_Resolution_Timers

I have implemented high resolution timer support for NIOS II softcore processor. You may find the source code here as example: http://sopc.et.ntust.edu.tw/pipermail/nios2-dev/2011-January/004543.html
For the high resolution timer port, you must have 2 timers:
- a timer that you program in one shot mode with the next event of the hrtimer subsystem known as a clock event. - a timer that acts as a free running counter that gives time stamping generally multiple of the CPU frequency known as a clock source. A 64-bit timer is preferable. My work was derived from the high resolution timer port for MicroBlaze which is now in the arch/ directory in the vanilla Linux kernel. The code is easy to understand.

May this help you...

Cheers;

Pat.

Can anybody help me to sort this out plz, since I cannot find any example I can \"copy\" it for my implementation and i urgently need it to get my testscope running. I forgot to mention that i already read the highrest.txt, but it doesnt help me since there is no detailed information on what exactly mult and shift is. \"nanoseconds to cycles multiplier\" and divisor dont make click for me either and the mask member seems to have to do something with the timeroverrun, but is it the mask for the counter register, when it throw the interrupts and starts from BOTTOM again. What if i don use a power of two number as a compare match as interrupt source (for example 0x47), can i do that or is it restricted? Im somehow in the dark here...
Any help would be highly appreciated.

Kind regards Johannes Bauer

----- Original von:  Johannes Bauer

  Hi RT Mailing List!


Im trying to implement a clocksource driver for my board, which is a
mach-lpc22xx board. I downloaded linux2-6.33 and patched it with the
latest RT patch in order to get a RT kernel. Then I realized that i had
to enable the hrtimer support in order to gain the benefit of
preempt-rt.
  However, to use hrt it seems i need to use the
GENERIC_CLOCKEVENT timer instead of the old one using timer_tick(). I
do not find a detailed documentation on this clockevent subsystem, and
i dont grasp the aspect of clocksource and clockevent, what is the
difference? I also dont know what exactly the shift and mult struct
entities are in specific. I have a PIT running at 72MHz, and providing
a 32bit prescaler counter and a 32 bit counter register, I want to use
as the tick counter.
  So if i set the prescaler counter to 71
(0x47) my timer counter runs with 1Mhz (increments every us). I can
configure any number in 32bit compare register in order to throw an
interrupt and reseting the counter and prescaler counter. My cpu
(lpc2478) runs with 288MHz.
  So in thsi example, what would be the
ideal configuration for my timer to achieve highest resultion for hrt
and what would be the corresponding settings for shift and mult?
  I hope you can help me to run the system with the PIT as jiffy tick and for hrt usage.

  Thank you very much in advance
  Jhannes Bauer

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



--
Patrice Kadionik. F6KQH / F4CUQ
-----------

+----------------------------------------------------------------------+
+"Tout doit etre aussi simple que possible, pas seulement plus simple" +
+----------------------------------------------------------------------+
+ Patrice Kadionik             http://www.enseirb-matmeca.fr/~kadionik +
+ IMS Laboratory               http://www.ims-bordeaux.fr/             +
+ ENSEIRB-MATMECA              http://www.enseirb-matmeca.fr           +
+ PO BOX 99                    fax   : +33 5.56.37.20.23               +
+ 33402 TALENCE Cedex          voice : +33 5.56.84.23.47               +
+ FRANCE                       mailto:patrice.kadionik@xxxxxxxxxxxxxxx +
+----------------------------------------------------------------------+

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