blob: 44d629e199ebf591eb1a8aaeabca75825004f0c7 [file] [log] [blame]
Wedson Almeida Filho987c0ff2018-06-20 16:34:38 +01001#ifndef _FDT_H
2#define _FDT_H
3
4#include <stdbool.h>
Wedson Almeida Filhofed69022018-07-11 15:39:12 +01005#include <stddef.h>
Wedson Almeida Filho987c0ff2018-06-20 16:34:38 +01006#include <stdint.h>
7
8struct fdt_node {
9 /* TODO: What do we need here? */
10 const struct fdt_header *hdr;
11 const char *begin;
12 const char *end;
13 const char *strs;
14};
15
Wedson Almeida Filhofed69022018-07-11 15:39:12 +010016size_t fdt_header_size(void);
17size_t fdt_total_size(struct fdt_header *hdr);
Wedson Almeida Filho987c0ff2018-06-20 16:34:38 +010018void fdt_dump(struct fdt_header *hdr);
19void fdt_root_node(struct fdt_node *node, const struct fdt_header *hdr);
20bool fdt_find_child(struct fdt_node *node, const char *child);
Wedson Almeida Filho87009642018-07-02 10:20:07 +010021bool fdt_first_child(struct fdt_node *node, const char **child_name);
22bool fdt_next_sibling(struct fdt_node *node, const char **sibling_name);
Wedson Almeida Filho987c0ff2018-06-20 16:34:38 +010023bool fdt_read_property(const struct fdt_node *node, const char *name,
24 const char **buf, uint32_t *size);
25
Andrew Scull4f170f52018-07-19 12:58:20 +010026void fdt_add_mem_reservation(struct fdt_header *hdr, uint64_t addr,
27 uint64_t len);
Wedson Almeida Filho987c0ff2018-06-20 16:34:38 +010028
Andrew Scull4f170f52018-07-19 12:58:20 +010029#endif /* _FDT_H */