blob: 147c0dc682fb37c466c8f538a3a406b7752a349c [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 {
Wedson Almeida Filho987c0ff2018-06-20 16:34:38 +01009 const struct fdt_header *hdr;
10 const char *begin;
11 const char *end;
12 const char *strs;
13};
14
Wedson Almeida Filhofed69022018-07-11 15:39:12 +010015size_t fdt_header_size(void);
16size_t fdt_total_size(struct fdt_header *hdr);
Wedson Almeida Filho987c0ff2018-06-20 16:34:38 +010017void fdt_dump(struct fdt_header *hdr);
Wedson Almeida Filhofdf4afc2018-07-19 15:45:21 +010018bool fdt_root_node(struct fdt_node *node, const struct fdt_header *hdr);
Wedson Almeida Filho987c0ff2018-06-20 16:34:38 +010019bool fdt_find_child(struct fdt_node *node, const char *child);
Wedson Almeida Filho87009642018-07-02 10:20:07 +010020bool fdt_first_child(struct fdt_node *node, const char **child_name);
21bool fdt_next_sibling(struct fdt_node *node, const char **sibling_name);
Wedson Almeida Filho987c0ff2018-06-20 16:34:38 +010022bool fdt_read_property(const struct fdt_node *node, const char *name,
23 const char **buf, uint32_t *size);
24
Andrew Scull4f170f52018-07-19 12:58:20 +010025void fdt_add_mem_reservation(struct fdt_header *hdr, uint64_t addr,
26 uint64_t len);
Wedson Almeida Filho987c0ff2018-06-20 16:34:38 +010027
Andrew Scull4f170f52018-07-19 12:58:20 +010028#endif /* _FDT_H */