diff options
author | Anup Patel <anup.patel@wdc.com> | 2021-09-14 21:51:48 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2021-09-26 19:52:10 +0530 |
commit | 12e7af9ab7ef9adf61b9138e2c38e3aeef3c140b (patch) | |
tree | 67d388a1d7a4435060beace5dbaba32679adef41 /platform/template | |
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 <anup.patel@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Xiang W <wxjstz@126.com>
Diffstat (limited to 'platform/template')
-rw-r--r-- | platform/template/platform.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/platform/template/platform.c b/platform/template/platform.c index 4528822..d6806e6 100644 --- a/platform/template/platform.c +++ b/platform/template/platform.c @@ -22,6 +22,7 @@ #define PLATFORM_PLIC_NUM_SOURCES 128 #define PLATFORM_HART_COUNT 4 #define PLATFORM_CLINT_ADDR 0x2000000 +#define PLATFORM_ACLINT_MTIMER_FREQ 10000000 #define PLATFORM_ACLINT_MSWI_ADDR (PLATFORM_CLINT_ADDR + \ CLINT_MSWI_OFFSET) #define PLATFORM_ACLINT_MTIMER_ADDR (PLATFORM_CLINT_ADDR + \ @@ -43,6 +44,7 @@ static struct aclint_mswi_data mswi = { }; static struct aclint_mtimer_data mtimer = { + .mtime_freq = PLATFORM_ACLINT_MTIMER_FREQ, .mtime_addr = PLATFORM_ACLINT_MTIMER_ADDR + ACLINT_DEFAULT_MTIME_OFFSET, .mtime_size = ACLINT_DEFAULT_MTIME_SIZE, |