diff options
author | Atish Patra <atish.patra@wdc.com> | 2020-03-23 22:48:57 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2020-03-24 10:59:07 +0300 |
commit | d1d6560a878200679e6e12e77032d06add8847a5 (patch) | |
tree | 7635f0cc2d56ca8d2b116368ce428beacf61cc18 /include/sbi_utils | |
parent | fb84879e66bc5a26241bcf0472688851f7240acb (diff) | |
download | opensbi-d1d6560a878200679e6e12e77032d06add8847a5.tar.xz |
platform: fpga/common: Add a fdt parsing helper functions
Different DT based platforms from the sam family may reuse IP blocks with
different configurations. These different configurations can be obtained
by parsing the device tree.
Add a FDT parser framework that can parse various device configurations from
device tree. Currently, the parsing algorithms doesn't cover all the use cases
or possible combination of DT configurations. It will be improved over time.
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'include/sbi_utils')
-rw-r--r-- | include/sbi_utils/fdt/fdt_helper.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/sbi_utils/fdt/fdt_helper.h b/include/sbi_utils/fdt/fdt_helper.h index 079b619..42baeab 100644 --- a/include/sbi_utils/fdt/fdt_helper.h +++ b/include/sbi_utils/fdt/fdt_helper.h @@ -9,6 +9,26 @@ #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); + /** * Fix up the CPU node in the device tree * |