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

In U-Boot 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.