blob: 740d345d1e84e7a602289e9fd4192688a450a08a [file] [log] [blame]
Wedson Almeida Filho987c0ff2018-06-20 16:34:38 +01001#ifndef _FDT_H
2#define _FDT_H
3
4#include <stdbool.h>
5#include <stdint.h>
6
7struct 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
15void fdt_dump(struct fdt_header *hdr);
16void fdt_root_node(struct fdt_node *node, const struct fdt_header *hdr);
17bool fdt_find_child(struct fdt_node *node, const char *child);
Wedson Almeida Filho87009642018-07-02 10:20:07 +010018bool fdt_first_child(struct fdt_node *node, const char **child_name);
19bool fdt_next_sibling(struct fdt_node *node, const char **sibling_name);
Wedson Almeida Filho987c0ff2018-06-20 16:34:38 +010020bool fdt_read_property(const struct fdt_node *node, const char *name,
21 const char **buf, uint32_t *size);
22
Wedson Almeida Filho87009642018-07-02 10:20:07 +010023void fdt_add_mem_reservation(struct fdt_header *hdr,
24 uint64_t addr, uint64_t len);
Wedson Almeida Filho987c0ff2018-06-20 16:34:38 +010025
26#endif /* _FDT_H */