littlekernel / lk

LK embedded kernel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[riscv] Read the timer frequency from the device tree

heatd opened this issue · comments

Currently, lk relies on platform code to define ARCH_RISCV_MTIME_RATE with the timer's frequency.
This can be avoided by reading /cpus/timebase-frequency (for all CPUs, if it exists) and /cpus/cpu*/timebase-frequency (for each CPU) in the supplied FDT.