summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2021-07-24 07:59:56 +0300
committerAnup Patel <anup@brainfault.org>2021-08-14 06:32:44 +0300
commitb35f7826b019623d096b6b5c1803232818834e5b (patch)
tree90c49f942a467d157694f00ab0cd823716cf782e
parentf3a0eb8583828b0223f9e924672fc455359ea6c8 (diff)
downloadopensbi-b35f7826b019623d096b6b5c1803232818834e5b.tar.xz
lib: utils/timer: Allow ACLINT MTIMER supporting only 32-bit MMIO
We can have ACLINT MTIMER devices which only support 32-bit MMIO accesses on RV64 system so this patch adds a boolean DT property "mtimer,no-64bit-mmio" to detect this from MTIMER DT node. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
-rw-r--r--lib/utils/timer/fdt_timer_mtimer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/utils/timer/fdt_timer_mtimer.c b/lib/utils/timer/fdt_timer_mtimer.c
index b08ed38..15a36ed 100644
--- a/lib/utils/timer/fdt_timer_mtimer.c
+++ b/lib/utils/timer/fdt_timer_mtimer.c
@@ -58,6 +58,9 @@ static int timer_mtimer_cold_init(void *fdt, int nodeoff,
mt->mtime_size = size[0];
mt->mtimecmp_addr = addr[1];
mt->mtimecmp_size = size[1];
+ /* Parse additional ACLINT MTIMER properties */
+ if (fdt_getprop(fdt, nodeoff, "mtimer,no-64bit-mmio", &rc))
+ mt->has_64bit_mmio = false;
}
rc = aclint_mtimer_cold_init(mt, mtmaster);