opensbi/include/sbi_utils/fdt/fdt_helper.h
Anup Patel e3ad7c13a0 lib: utils: Rename fdt_parse_clint() to fdt_parse_compat_addr()
The fdt_parse_clint() is quite generic and can be used for other
types of devices so we rename it to fdt_parse_compat_addr().

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
2020-05-01 09:36:13 +05:30

38 lines
939 B
C

// SPDX-License-Identifier: BSD-2-Clause
/*
* fdt_helper.h - Flat Device Tree parsing helper routines
* Implement helper routines to parse FDT nodes on top of
* libfdt for OpenSBI usage
*
* Copyright (C) 2020 Bin Meng <bmeng.cn@gmail.com>
*/
#ifndef __FDT_HELPER_H__
#define __FDT_HELPER_H__
struct platform_uart_data {
unsigned long addr;
unsigned long freq;
unsigned long baud;
unsigned long reg_shift;
unsigned long reg_io_width;
};
struct platform_plic_data {
unsigned long addr;
unsigned long num_src;
};
int fdt_parse_uart8250_node(void *fdt, int nodeoffset,
struct platform_uart_data *uart);
int fdt_parse_uart8250(void *fdt, struct platform_uart_data *uart,
const char *compatible);
int fdt_parse_plic(void *fdt, struct platform_plic_data *plic,
const char *compatible);
int fdt_parse_compat_addr(void *fdt, unsigned long *addr,
const char *compatible);
#endif /* __FDT_HELPER_H__ */