ROSSIER Daniel wrote:

We are currently porting Adeos/Xenomai with Linux 2.6.14 on a ARM9-based Freescale i.mx21 (litekit) development board.

We started from the available patch for the ARM-based Integrator board.

We are now facing some interesting problems regarding clock/timer frequencies with this board, but they are about to be solved J

However, we have a question of understanding; as far as we know, ipipe starts with an aperiodic (one-shot) timer at the initialization time, and that before

the calibrate function has been called. So, we get one interrupt only since the xenomai scheduler has not been registered (we understand

that the xenomai scheduler should give the next timer shot, but since it is not registered yet, no timer reprogramming is achieved).

So, how can the calibrate function can be invoked safely if no timer IRQ is received since this kind of calibration comes before the xenomai registration

(the calibrate function needs IRQ timers to calibrate the number of busy loops between two jiffies) ?

Unlike Linux's calibrate_delay loop, Xenomai's timer calibration code does not measure the CPU performance level, but only the average cost of programming the underlying timer hw in oneshot mode (time-wise), so that the nucleus can take this unavoidable delay into account when programming the next shot.

Nowadays, this is basically an x86+8254 PIT only issue, since on this platform, one has to go through the ISA bus to (re)program the PIT for the next timer shot, and this is quite expensive (1.5 - 2.5 us for each outb, and you need two of them for programming the shot). Btw, this is the reason why using the APIC when available on x86 is always a good idea, since it only costs ~100 ns to program the timer there through a memory mapped register.

IOW, the code does not wait for any timer IRQ, but only measures the average time for setting up the proper hw registers in order to program a timer shot.

How is it realized with a x86 architecture (another timer source?)

Look at ksrc/arch/*/hal.c, where all archs implement rthal_timer_calibrate() their own way.

Is there any documentation – or discussion threads - which gives some information about the use of timers/RTC/TSC with Xenomai?

Maybe. Try browsing the archive.

Thanks so much for your help

Kind regards

Daniel Rossier


Xenomai-core mailing list



Xenomai-core mailing list

Reply via email to