14 lines
786 B
Plaintext
14 lines
786 B
Plaintext
------------ 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.
|