Wedson Almeida Filho | 987c0ff | 2018-06-20 16:34:38 +0100 | [diff] [blame] | 1 | #ifndef _FDT_H |
| 2 | #define _FDT_H |
| 3 | |
| 4 | #include <stdbool.h> |
| 5 | #include <stdint.h> |
| 6 | |
| 7 | struct fdt_node { |
| 8 | /* TODO: What do we need here? */ |
| 9 | const struct fdt_header *hdr; |
| 10 | const char *begin; |
| 11 | const char *end; |
| 12 | const char *strs; |
| 13 | }; |
| 14 | |
| 15 | void fdt_dump(struct fdt_header *hdr); |
| 16 | void fdt_root_node(struct fdt_node *node, const struct fdt_header *hdr); |
| 17 | bool fdt_find_child(struct fdt_node *node, const char *child); |
Wedson Almeida Filho | 8700964 | 2018-07-02 10:20:07 +0100 | [diff] [blame] | 18 | bool fdt_first_child(struct fdt_node *node, const char **child_name); |
| 19 | bool fdt_next_sibling(struct fdt_node *node, const char **sibling_name); |
Wedson Almeida Filho | 987c0ff | 2018-06-20 16:34:38 +0100 | [diff] [blame] | 20 | bool fdt_read_property(const struct fdt_node *node, const char *name, |
| 21 | const char **buf, uint32_t *size); |
| 22 | |
Wedson Almeida Filho | 8700964 | 2018-07-02 10:20:07 +0100 | [diff] [blame] | 23 | void fdt_add_mem_reservation(struct fdt_header *hdr, |
| 24 | uint64_t addr, uint64_t len); |
Wedson Almeida Filho | 987c0ff | 2018-06-20 16:34:38 +0100 | [diff] [blame] | 25 | |
| 26 | #endif /* _FDT_H */ |