lib: utils/timer: Allow separate base addresses for MTIME and MTIMECMP

We extend the ACLINT library to support separate base addresses
for MTIME and MTIMECMP registers.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
This commit is contained in:
Anup Patel
2021-07-23 14:09:43 +05:30
committed by Anup Patel
parent 47a47654e8
commit e0d1b9db8a
8 changed files with 114 additions and 41 deletions

View File

@@ -12,16 +12,22 @@
#include <sbi/sbi_types.h>
#define ACLINT_MTIMER_ALIGN 0x1000
#define ACLINT_MTIMER_SIZE 0x8000
#define ACLINT_MTIMER_MAX_HARTS 4095
#define ACLINT_MTIMER_ALIGN 0x8
#define ACLINT_MTIMER_MAX_HARTS 4095
#define ACLINT_DEFAULT_MTIME_OFFSET 0x7ff8
#define ACLINT_DEFAULT_MTIME_SIZE 0x8
#define ACLINT_DEFAULT_MTIMECMP_OFFSET 0x0000
#define ACLINT_DEFAULT_MTIMECMP_SIZE 0x7ff8
#define CLINT_MTIMER_OFFSET 0x4000
struct aclint_mtimer_data {
/* Public details */
unsigned long addr;
unsigned long size;
unsigned long mtime_addr;
unsigned long mtime_size;
unsigned long mtimecmp_addr;
unsigned long mtimecmp_size;
u32 first_hartid;
u32 hart_count;
bool has_64bit_mmio;