summaryrefslogtreecommitdiff
path: root/include/sbi_utils/fdt/fdt_helper.h
blob: 06b8a62a9379df5d16ca165cc56d550c2b885eb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// 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;
};

struct platform_plic_data {
	unsigned long addr;
	unsigned long num_src;
};

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_clint(void *fdt, unsigned long *clint_addr,
		    const char *compatible);

#endif /* __FDT_HELPER_H__ */