summaryrefslogtreecommitdiffstats
path: root/Documentation/timekeeping.txt
blob: ed5ef62fe09e85784fc1b8ae15add037c5c4f607 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
------------ barebox timekeeping -------------

In barebox we use the clocksource mechanism from the Linux Kernel. This makes
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.