Lines Matching refs:fdt
56 int fdt_check_header(const void *fdt) in fdt_check_header() argument
58 if (fdt_magic(fdt) == FDT_MAGIC) { in fdt_check_header()
60 if (fdt_version(fdt) < FDT_FIRST_SUPPORTED_VERSION) in fdt_check_header()
62 if (fdt_last_comp_version(fdt) > FDT_LAST_SUPPORTED_VERSION) in fdt_check_header()
64 } else if (fdt_magic(fdt) == FDT_SW_MAGIC) { in fdt_check_header()
66 if (fdt_size_dt_struct(fdt) == 0) in fdt_check_header()
75 const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int len) in fdt_offset_ptr() argument
77 unsigned absoffset = offset + fdt_off_dt_struct(fdt); in fdt_offset_ptr()
81 || (absoffset + len) > fdt_totalsize(fdt)) in fdt_offset_ptr()
84 if (fdt_version(fdt) >= 0x11) in fdt_offset_ptr()
86 || ((offset + len) > fdt_size_dt_struct(fdt))) in fdt_offset_ptr()
89 return _fdt_offset_ptr(fdt, offset); in fdt_offset_ptr()
92 uint32_t fdt_next_tag(const void *fdt, int startoffset, int *nextoffset) in fdt_next_tag() argument
100 tagp = fdt_offset_ptr(fdt, offset, FDT_TAGSIZE); in fdt_next_tag()
111 p = fdt_offset_ptr(fdt, offset++, 1); in fdt_next_tag()
118 lenp = fdt_offset_ptr(fdt, offset, sizeof(*lenp)); in fdt_next_tag()
135 if (!fdt_offset_ptr(fdt, startoffset, offset - startoffset)) in fdt_next_tag()
142 int _fdt_check_node_offset(const void *fdt, int offset) in _fdt_check_node_offset() argument
145 || (fdt_next_tag(fdt, offset, &offset) != FDT_BEGIN_NODE)) in _fdt_check_node_offset()
151 int _fdt_check_prop_offset(const void *fdt, int offset) in _fdt_check_prop_offset() argument
154 || (fdt_next_tag(fdt, offset, &offset) != FDT_PROP)) in _fdt_check_prop_offset()
160 int fdt_next_node(const void *fdt, int offset, int *depth) in fdt_next_node() argument
166 if ((nextoffset = _fdt_check_node_offset(fdt, offset)) < 0) in fdt_next_node()
171 tag = fdt_next_tag(fdt, offset, &nextoffset); in fdt_next_node()
200 int fdt_first_subnode(const void *fdt, int offset) in fdt_first_subnode() argument
204 offset = fdt_next_node(fdt, offset, &depth); in fdt_first_subnode()
211 int fdt_next_subnode(const void *fdt, int offset) in fdt_next_subnode() argument
220 offset = fdt_next_node(fdt, offset, &depth); in fdt_next_subnode()
240 int fdt_move(const void *fdt, void *buf, int bufsize) in fdt_move() argument
242 FDT_CHECK_HEADER(fdt); in fdt_move()
244 if (fdt_totalsize(fdt) > bufsize) in fdt_move()
247 memmove(buf, fdt, fdt_totalsize(fdt)); in fdt_move()