From 19e966b8622e21c6beb2872d3e4373de9dbfef45 Mon Sep 17 00:00:00 2001 From: Anup Patel Date: Sun, 26 Apr 2020 12:39:13 +0530 Subject: lib: utils: Add fdt_parse_hart_id() function Parsing HART id from a CPU DT node is a common requirement for RISC-V systems. The newly added fdt_parse_hart_id() also helps reduce duplicate code between fdt_cpu_fixup() function and fdt_parse_hart_count() function. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Reviewed-by: Alistair Francis --- include/sbi_utils/fdt/fdt_helper.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/sbi_utils/fdt/fdt_helper.h b/include/sbi_utils/fdt/fdt_helper.h index 3a15aca9..98c789bf 100644 --- a/include/sbi_utils/fdt/fdt_helper.h +++ b/include/sbi_utils/fdt/fdt_helper.h @@ -10,6 +10,8 @@ #ifndef __FDT_HELPER_H__ #define __FDT_HELPER_H__ +#include + struct fdt_match { const char *compatible; void *data; @@ -37,6 +39,8 @@ int fdt_find_match(void *fdt, const struct fdt_match *match_table, int fdt_get_node_addr_size(void *fdt, int node, unsigned long *addr, unsigned long *size); +int fdt_parse_hart_id(void *fdt, int cpu_offset, u32 *hartid); + int fdt_parse_sifive_uart_node(void *fdt, int nodeoffset, struct platform_uart_data *uart); -- cgit v1.3.1