lib: utils/timer: Simplify MTIMER synchronization
authorAnup Patel <anup.patel@wdc.com>
Sat, 24 Jul 2021 05:05:01 +0000 (10:35 +0530)
committerAnup Patel <anup@brainfault.org>
Sat, 14 Aug 2021 03:37:42 +0000 (09:07 +0530)
commit7aa6c9aa96049b741b754b7340ea96a37719de27
tree0f82d9ef6e2d02de411e52e4aa8df2371fefadf3
parentb35f7826b019623d096b6b5c1803232818834e5b
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 <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
include/sbi_utils/timer/aclint_mtimer.h
lib/utils/timer/aclint_mtimer.c
lib/utils/timer/fdt_timer_mtimer.c