diff options
author | Anup Patel <anup.patel@wdc.com> | 2021-05-20 13:38:38 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2021-06-24 09:39:48 +0530 |
commit | bd5d2089b80742a210b257c8e6c1361310725200 (patch) | |
tree | ada664073241ca2ac195f1cd1f15001307c0e520 /lib/utils/timer | |
parent | 5a049fe1d6a5d1c381113853fce3afad6573bb56 (diff) | |
download | opensbi-bd5d2089b80742a210b257c8e6c1361310725200.zip opensbi-bd5d2089b80742a210b257c8e6c1361310725200.tar.gz opensbi-bd5d2089b80742a210b257c8e6c1361310725200.tar.bz2 |
lib: utils: Add FDT parsing API common for both ACLINT and CLINT
We add fdt_parse_aclint_node() which can parse both ACLINT and
CLINT DT nodes. This means fdt_parse_clint_node() is not required
anymore so we remove it as well.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Xiang W <wxjstz@126.com>
Diffstat (limited to 'lib/utils/timer')
-rw-r--r-- | lib/utils/timer/fdt_timer_clint.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/utils/timer/fdt_timer_clint.c b/lib/utils/timer/fdt_timer_clint.c index 0352e53..63d6586 100644 --- a/lib/utils/timer/fdt_timer_clint.c +++ b/lib/utils/timer/fdt_timer_clint.c @@ -7,6 +7,7 @@ * Anup Patel <anup.patel@wdc.com> */ +#include <libfdt.h> #include <sbi/sbi_error.h> #include <sbi_utils/fdt/fdt_helper.h> #include <sbi_utils/timer/fdt_timer.h> @@ -21,6 +22,7 @@ static int timer_clint_cold_init(void *fdt, int nodeoff, const struct fdt_match *match) { int rc; + unsigned long ctsize; struct clint_data *ct, *ctmaster = NULL; if (CLINT_TIMER_MAX_NR <= clint_timer_count) @@ -29,10 +31,15 @@ static int timer_clint_cold_init(void *fdt, int nodeoff, if (1 < clint_timer_count) ctmaster = &clint_timer[0]; - rc = fdt_parse_clint_node(fdt, nodeoff, TRUE, ct); + rc = fdt_parse_aclint_node(fdt, nodeoff, true, &ct->addr, &ctsize, + &ct->first_hartid, &ct->hart_count); if (rc) return rc; + ct->has_64bit_mmio = true; + if (fdt_getprop(fdt, nodeoff, "clint,has-no-64bit-mmio", &rc)) + ct->has_64bit_mmio = false; + return clint_cold_timer_init(ct, ctmaster); } |