diff options
| author | Anup Patel <[email protected]> | 2021-09-14 21:51:48 +0530 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2021-09-26 19:52:10 +0530 |
| commit | 12e7af9ab7ef9adf61b9138e2c38e3aeef3c140b (patch) | |
| tree | 67d388a1d7a4435060beace5dbaba32679adef41 /lib/utils/timer/fdt_timer_mtimer.c | |
| parent | 72154f4708de79816f0178b16223afa352b20e30 (diff) | |
lib: sbi: Add timer frequency to struct sbi_timer_device
Generic mdelay() and udelay() functions can be provided by the
sbi_timer framework if timer frequency is available in the timer
instance provided by the platform support or timer driver.
This patch adds timer frequency (timer_freq) member in the
struct sbi_timer_device for above purpose.
Signed-off-by: Anup Patel <[email protected]>
Reviewed-by: Bin Meng <[email protected]>
Reviewed-by: Xiang W <[email protected]>
Diffstat (limited to 'lib/utils/timer/fdt_timer_mtimer.c')
| -rw-r--r-- | lib/utils/timer/fdt_timer_mtimer.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/utils/timer/fdt_timer_mtimer.c b/lib/utils/timer/fdt_timer_mtimer.c index 4eafffaa..1ad8508f 100644 --- a/lib/utils/timer/fdt_timer_mtimer.c +++ b/lib/utils/timer/fdt_timer_mtimer.c @@ -38,6 +38,10 @@ static int timer_mtimer_cold_init(void *fdt, int nodeoff, mt->has_64bit_mmio = true; mt->has_shared_mtime = false; + rc = fdt_parse_timebase_frequency(fdt, &mt->mtime_freq); + if (rc) + return rc; + if (match->data) { /* SiFive CLINT */ /* Set CLINT addresses */ mt->mtimecmp_addr = addr[0] + ACLINT_DEFAULT_MTIMECMP_OFFSET; |
