aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiang W <wxjstz@126.com>2024-06-11 19:19:29 +0800
committerAnup Patel <anup@brainfault.org>2024-06-13 18:31:40 +0530
commit5e3ad7d577573e158bb2ca90ae647d64db3f4a32 (patch)
treedaa24e88d6f922fdb1af358623b8ca74d677540d
parentc5be0e1ed1fa17b9f9abb49e80db014e067523e4 (diff)
downloadopensbi-5e3ad7d577573e158bb2ca90ae647d64db3f4a32.zip
opensbi-5e3ad7d577573e158bb2ca90ae647d64db3f4a32.tar.gz
opensbi-5e3ad7d577573e158bb2ca90ae647d64db3f4a32.tar.bz2
lib: utils/timer: Skip initialize timer when dt is not enabled
When the dt node has a status property and the value is not ok or okay, skip initializing timer. Signed-off-by: Xiang W <wxjstz@126.com> Reviewed-by: Anup Patel <anup@brainfault.org>
-rw-r--r--lib/utils/timer/fdt_timer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/utils/timer/fdt_timer.c b/lib/utils/timer/fdt_timer.c
index 62426a7..f468730 100644
--- a/lib/utils/timer/fdt_timer.c
+++ b/lib/utils/timer/fdt_timer.c
@@ -44,6 +44,9 @@ static int fdt_timer_cold_init(void)
noff = -1;
while ((noff = fdt_find_match(fdt, noff,
drv->match_table, &match)) >= 0) {
+ if (!fdt_node_is_enabled(fdt, noff))
+ continue;
+
/* drv->cold_init must not be NULL */
if (drv->cold_init == NULL)
return SBI_EFAIL;