diff options
author | Anup Patel <anup.patel@wdc.com> | 2020-05-13 07:25:28 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2020-05-23 08:06:46 +0300 |
commit | 569dd64b7270fd1cd17006e1b76484d84b1a0a71 (patch) | |
tree | 9d5a97ae6127548658fe04cdf72bc5c8718f9562 /lib/utils/timer | |
parent | a9a97511851198559e75640a9e5e67f65695dc2e (diff) | |
download | opensbi-569dd64b7270fd1cd17006e1b76484d84b1a0a71.tar.xz |
lib: utils: Add fdt_parse_clint_node() function
We add fdt_parse_clint_node() function which will be used by
fdt_ipi_clint and fdt_timer_clint drivers to parse CLINT details
from DT node.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'lib/utils/timer')
-rw-r--r-- | lib/utils/timer/fdt_timer_clint.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/lib/utils/timer/fdt_timer_clint.c b/lib/utils/timer/fdt_timer_clint.c index 2f5f283..85779b7 100644 --- a/lib/utils/timer/fdt_timer_clint.c +++ b/lib/utils/timer/fdt_timer_clint.c @@ -17,23 +17,11 @@ static int timer_clint_cold_init(void *fdt, int nodeoff, const struct fdt_match *match) { int rc; - u32 max_hartid; - unsigned long addr; - rc = fdt_parse_max_hart_id(fdt, &max_hartid); + rc = fdt_parse_clint_node(fdt, nodeoff, TRUE, &clint_timer); if (rc) return rc; - rc = fdt_get_node_addr_size(fdt, nodeoff, &addr, NULL); - if (rc) - return rc; - - /* TODO: We should figure-out CLINT has_64bit_mmio from DT node */ - clint_timer.addr = addr; - clint_timer.first_hartid = 0; - clint_timer.hart_count = max_hartid + 1; - clint_timer.has_64bit_mmio = TRUE; - return clint_cold_timer_init(&clint_timer, NULL); } |