littlekernel / lk

LK embedded kernel
MIT License
3.11k stars 613 forks source link

[riscv] Read the timer frequency from the device tree #318

Open heatd opened 2 years ago

heatd commented 2 years ago

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.