57#define FDT_FIRST_SUPPORTED_VERSION 0x10
58#define FDT_LAST_SUPPORTED_VERSION 0x11
61#define FDT_ERR_NOTFOUND 1
63#define FDT_ERR_EXISTS 2
66#define FDT_ERR_NOSPACE 3
73#define FDT_ERR_BADOFFSET 4
77#define FDT_ERR_BADPATH 5
81#define FDT_ERR_BADPHANDLE 6
84#define FDT_ERR_BADSTATE 7
90#define FDT_ERR_TRUNCATED 8
93#define FDT_ERR_BADMAGIC 9
97#define FDT_ERR_BADVERSION 10
102#define FDT_ERR_BADSTRUCTURE 11
106#define FDT_ERR_BADLAYOUT 12
114#define FDT_ERR_INTERNAL 13
119#define FDT_ERR_MAX 13
125const void *
fdt_offset_ptr(
const void *fdt,
int offset,
unsigned int checklen);
126static inline void *fdt_offset_ptr_w(
void *fdt,
int offset,
int checklen)
143#define fdt_get_header(fdt, field) \
144 (fdt32_to_cpu(((const struct fdt_header *)(fdt))->field))
145#define fdt_magic(fdt) (fdt_get_header(fdt, magic))
146#define fdt_totalsize(fdt) (fdt_get_header(fdt, totalsize))
147#define fdt_off_dt_struct(fdt) (fdt_get_header(fdt, off_dt_struct))
148#define fdt_off_dt_strings(fdt) (fdt_get_header(fdt, off_dt_strings))
149#define fdt_off_mem_rsvmap(fdt) (fdt_get_header(fdt, off_mem_rsvmap))
150#define fdt_version(fdt) (fdt_get_header(fdt, version))
151#define fdt_last_comp_version(fdt) (fdt_get_header(fdt, last_comp_version))
152#define fdt_boot_cpuid_phys(fdt) (fdt_get_header(fdt, boot_cpuid_phys))
153#define fdt_size_dt_strings(fdt) (fdt_get_header(fdt, size_dt_strings))
154#define fdt_size_dt_struct(fdt) (fdt_get_header(fdt, size_dt_struct))
156#define __fdt_set_hdr(name) \
157 static inline void fdt_set_##name(void *fdt, uint32_t val) \
159 struct fdt_header *fdth = (struct fdt_header*)fdt; \
160 fdth->name = cpu_to_fdt32(val); \
209int fdt_move(
const void *fdt,
void *buf,
int bufsize);
227const char *
fdt_string(
const void *fdt,
int stroffset);
272 const char *name,
int namelen);
343const char *
fdt_get_name(
const void *fdt,
int nodeoffset,
int *lenp);
428 int namelen,
int *lenp);
458 const char *name,
int *lenp);
459static inline struct fdt_property *fdt_get_property_w(
void *fdt,
int nodeoffset,
499 const char **namep,
int *lenp);
513 const char *name,
int namelen,
int *lenp);
542const void *
fdt_getprop(
const void *fdt,
int nodeoffset,
543 const char *name,
int *lenp);
544static inline void *fdt_getprop_w(
void *fdt,
int nodeoffset,
545 const char *name,
int *lenp)
574 const char *name,
int namelen);
615int fdt_get_path(
const void *fdt,
int nodeoffset,
char *buf,
int buflen);
648 int supernodedepth,
int *nodedepth);
733 const char *propname,
734 const void *propval,
int proplen);
780 const char *compatible);
817 const char *compatible);
852 const void *
val,
int len);
882static inline int fdt_setprop_inplace_cell(
void *fdt,
int nodeoffset,
948static inline int fdt_property_cell(
void *fdt,
const char *name,
uint32_t val)
953#define fdt_property_string(fdt, name, str) \
954 fdt_property(fdt, name, str, strlen(str)+1)
1037int fdt_set_name(
void *fdt,
int nodeoffset,
const char *name);
1067int fdt_setprop(
void *fdt,
int nodeoffset,
const char *name,
1068 const void *
val,
int len);
1098static inline int fdt_setprop_cell(
void *fdt,
int nodeoffset,
const char *name,
1133#define fdt_setprop_string(fdt, nodeoffset, name, str) \
1134 fdt_setprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
1158int fdt_delprop(
void *fdt,
int nodeoffset,
const char *name);
1173 const char *name,
int namelen);
int fdt_add_subnode(void *fdt, int parentoffset, const char *name)
int fdt_finish_reservemap(void *fdt)
uint32_t fdt_get_phandle(const void *fdt, int nodeoffset)
int fdt_move(const void *fdt, void *buf, int bufsize)
const char * fdt_get_alias_namelen(const void *fdt, const char *name, int namelen)
int fdt_path_offset(const void *fdt, const char *path)
int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name)
int fdt_check_header(const void *fdt)
uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset)
int fdt_parent_offset(const void *fdt, int nodeoffset)
int fdt_node_depth(const void *fdt, int nodeoffset)
const void * fdt_getprop_namelen(const void *fdt, int nodeoffset, const char *name, int namelen, int *lenp)
int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size)
int fdt_del_mem_rsv(void *fdt, int n)
int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size)
int fdt_create(void *buf, int bufsize)
int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle)
const char * fdt_get_alias(const void *fdt, const char *name)
int fdt_delprop(void *fdt, int nodeoffset, const char *name)
int fdt_finish(void *fdt)
int fdt_next_node(const void *fdt, int offset, int *depth)
int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name, const void *val, int len)
int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset, int supernodedepth, int *nodedepth)
const void * fdt_offset_ptr(const void *fdt, int offset, unsigned int checklen)
int fdt_begin_node(void *fdt, const char *name)
const struct fdt_property * fdt_get_property_namelen(const void *fdt, int nodeoffset, const char *name, int namelen, int *lenp)
int fdt_num_mem_rsv(const void *fdt)
int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen)
const struct fdt_property * fdt_get_property(const void *fdt, int nodeoffset, const char *name, int *lenp)
int fdt_node_offset_by_compatible(const void *fdt, int startoffset, const char *compatible)
const void * fdt_getprop(const void *fdt, int nodeoffset, const char *name, int *lenp)
int fdt_subnode_offset_namelen(const void *fdt, int parentoffset, const char *name, int namelen)
int fdt_node_offset_by_prop_value(const void *fdt, int startoffset, const char *propname, const void *propval, int proplen)
int fdt_add_subnode_namelen(void *fdt, int parentoffset, const char *name, int namelen)
int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size)
int fdt_open_into(const void *fdt, void *buf, int bufsize)
const struct fdt_property * fdt_get_property_by_offset(const void *fdt, int offset, int *lenp)
const char * fdt_get_name(const void *fdt, int nodeoffset, int *lenp)
const char * fdt_string(const void *fdt, int stroffset)
int fdt_first_property_offset(const void *fdt, int nodeoffset)
int fdt_nop_node(void *fdt, int nodeoffset)
#define __fdt_set_hdr(name)
int fdt_end_node(void *fdt)
int fdt_nop_property(void *fdt, int nodeoffset, const char *name)
int fdt_next_property_offset(const void *fdt, int offset)
const void * fdt_getprop_by_offset(const void *fdt, int offset, const char **namep, int *lenp)
int fdt_del_node(void *fdt, int nodeoffset)
int fdt_set_name(void *fdt, int nodeoffset, const char *name)
const char * fdt_strerror(int errval)
int fdt_node_check_compatible(const void *fdt, int nodeoffset, const char *compatible)
int fdt_setprop(void *fdt, int nodeoffset, const char *name, const void *val, int len)