summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2021-07-23 11:39:43 +0300
committerAnup Patel <anup@brainfault.org>2021-08-14 06:32:33 +0300
commite0d1b9db8abd8288afbaa4f93a4ace6a9b6f0100 (patch)
treea404340f4c146ae45de2ed5d50a4427de8e78672 /include
parent47a47654e8d3997b059d11bb8845ed0037e88c8e (diff)
downloadopensbi-e0d1b9db8abd8288afbaa4f93a4ace6a9b6f0100.tar.xz
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>
Diffstat (limited to 'include')
-rw-r--r--include/sbi_utils/timer/aclint_mtimer.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/include/sbi_utils/timer/aclint_mtimer.h b/include/sbi_utils/timer/aclint_mtimer.h
index 62aa086..fdc46cd 100644
--- a/include/sbi_utils/timer/aclint_mtimer.h
+++ b/include/sbi_utils/timer/aclint_mtimer.h
@@ -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;