diff options
| author | Anup Patel <[email protected]> | 2021-07-24 10:35:01 +0530 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2021-08-14 09:07:42 +0530 |
| commit | 7aa6c9aa96049b741b754b7340ea96a37719de27 (patch) | |
| tree | 0f82d9ef6e2d02de411e52e4aa8df2371fefadf3 /include/sbi_utils/timer | |
| parent | b35f7826b019623d096b6b5c1803232818834e5b (diff) | |
lib: utils/timer: Simplify MTIMER synchronization
We simplify MTIMER synchronization as follows:
1) Detect MTIMER devices with unique (or non-shared) MTIME
register at boot-time
2) Select first MTIMER device with no associated HART as our
reference MTIMER device
3) Only synchronize MTIMER devices with unique (or non-shared)
MTIME register using reference MTIMER device
4) Directly update the MTIME register at time of synchronization
because MTIME is a read/write register.
Signed-off-by: Anup Patel <[email protected]>
Reviewed-by: Atish Patra <[email protected]>
Diffstat (limited to 'include/sbi_utils/timer')
| -rw-r--r-- | include/sbi_utils/timer/aclint_mtimer.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/sbi_utils/timer/aclint_mtimer.h b/include/sbi_utils/timer/aclint_mtimer.h index fdc46cd8..a9fe445a 100644 --- a/include/sbi_utils/timer/aclint_mtimer.h +++ b/include/sbi_utils/timer/aclint_mtimer.h @@ -31,14 +31,19 @@ struct aclint_mtimer_data { u32 first_hartid; u32 hart_count; bool has_64bit_mmio; + bool has_shared_mtime; /* Private details (initialized and used by ACLINT MTIMER library) */ struct aclint_mtimer_data *time_delta_reference; unsigned long time_delta_computed; - u64 time_delta; u64 (*time_rd)(volatile u64 *addr); void (*time_wr)(bool timecmp, u64 value, volatile u64 *addr); }; +void aclint_mtimer_sync(struct aclint_mtimer_data *mt); + +void aclint_mtimer_set_reference(struct aclint_mtimer_data *mt, + struct aclint_mtimer_data *ref); + int aclint_mtimer_warm_init(void); int aclint_mtimer_cold_init(struct aclint_mtimer_data *mt, |
