diff options
author | Inochi Amaoto <inochiama@outlook.com> | 2023-11-17 20:13:09 +0800 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2023-12-11 10:35:32 +0530 |
commit | 6112d584d435d2d2f2685cfcd8321c389056636b (patch) | |
tree | 4e34fc7de22cfad3e06c31a836e2bf8844cf4732 /include | |
parent | a2e254e88162a589c42f0e4f382170fb0d7a6d85 (diff) | |
download | opensbi-6112d584d435d2d2f2685cfcd8321c389056636b.zip opensbi-6112d584d435d2d2f2685cfcd8321c389056636b.tar.gz opensbi-6112d584d435d2d2f2685cfcd8321c389056636b.tar.bz2 |
lib: utils/fdt: Allow to use reg-names when parsing ACLINT
Currently, the fdt_parse_aclint_node() follows a fixed order to parse
ACLINT timer. This may cause the undesirable result when the ACLINT
device does not support mtime without adding an empty entry for it in
the DT.
To be robust, make fdt_parse_aclint_node() support "reg-names" property,
so it can parse the DT in an order independent way. For compatibility,
fdt_parse_aclint_node() only use "reg-names" when parsing ACLINT timer,
and will fallback to the old way if "reg-names" property is not found.
Link: https://lore.kernel.org/all/20231114-skedaddle-precinct-66c8897227bb@squawk/
Signed-off-by: Inochi Amaoto <inochiama@outlook.com>
Reviewed-by: Anup patel <anup@brainfault.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/sbi_utils/fdt/fdt_helper.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/sbi_utils/fdt/fdt_helper.h b/include/sbi_utils/fdt/fdt_helper.h index 5c928ff..430d818 100644 --- a/include/sbi_utils/fdt/fdt_helper.h +++ b/include/sbi_utils/fdt/fdt_helper.h @@ -48,6 +48,9 @@ int fdt_parse_phandle_with_args(void *fdt, int nodeoff, int fdt_get_node_addr_size(void *fdt, int node, int index, uint64_t *addr, uint64_t *size); +int fdt_get_node_addr_size_by_name(void *fdt, int node, const char *name, + uint64_t *addr, uint64_t *size); + bool fdt_node_is_enabled(void *fdt, int nodeoff); int fdt_parse_hart_id(void *fdt, int cpu_offset, u32 *hartid); |