9
0
Fork 0
barebox/Documentation/timekeeping.txt

14 lines
786 B
Plaintext
Raw Normal View History

------------ barebox timekeeping -------------
2007-07-05 16:01:56 +00:00
In barebox we use the clocksource mechanism from the Linux Kernel. This makes
2007-07-05 16:01:56 +00:00
it fairly easy to add timer functionality for a new board or architecture.
Apart from initialization there is only one function required:
clocksource_read(). This function returns the current value of a free running
counter. Other functions like udelay() and get_time_ns() are derived from this
function. The only thing you have to implement is a clocksource driver. See
cpu/arm920t/imx/interrupts.c for an example. clocksource drivers from the
Linux Kernel can be used nearly 1:1, except for the register accesses.
for clocksources the __lshrdi3 symbol is needed. You can find the function for
your architecture in the Linux Kernel or a libc of your choice.