Home | History | Annotate | Download | only in libfdt

Lines Matching refs:fdt

60 #include <fdt.h>
140 const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int checklen);
141 static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
143 return (void *)(uintptr_t)fdt_offset_ptr(fdt, offset, checklen);
146 uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
152 int fdt_next_node(const void *fdt, int offset, int *depth);
157 * @fdt: FDT blob
161 int fdt_first_subnode(const void *fdt, int offset);
169 * @fdt: FDT blob
174 int fdt_next_subnode(const void *fdt, int offset);
180 * @fdt: FDT blob (const void *)
185 * fdt_for_each_subnode(node, fdt, parent) {
199 #define fdt_for_each_subnode(node, fdt, parent) \
200 for (node = fdt_first_subnode(fdt, parent); \
202 node = fdt_next_subnode(fdt, node))
208 #define fdt_get_header(fdt, field) \
209 (fdt32_to_cpu(((const struct fdt_header *)(fdt))->field))
210 #define fdt_magic(fdt) (fdt_get_header(fdt, magic))
211 #define fdt_totalsize(fdt) (fdt_get_header(fdt, totalsize))
212 #define fdt_off_dt_struct(fdt) (fdt_get_header(fdt, off_dt_struct))
213 #define fdt_off_dt_strings(fdt) (fdt_get_header(fdt, off_dt_strings))
214 #define fdt_off_mem_rsvmap(fdt) (fdt_get_header(fdt, off_mem_rsvmap))
215 #define fdt_version(fdt) (fdt_get_header(fdt, version))
216 #define fdt_last_comp_version(fdt) (fdt_get_header(fdt, last_comp_version))
217 #define fdt_boot_cpuid_phys(fdt) (fdt_get_header(fdt, boot_cpuid_phys))
218 #define fdt_size_dt_strings(fdt) (fdt_get_header(fdt, size_dt_strings))
219 #define fdt_size_dt_struct(fdt) (fdt_get_header(fdt, size_dt_struct))
222 static inline void fdt_set_##name(void *fdt, uint32_t val) \
224 struct fdt_header *fdth = (struct fdt_header *)fdt; \
241 * @fdt: pointer to data which might be a flattened device tree
253 int fdt_check_header(const void *fdt);
257 * @fdt: pointer to the device tree to move
262 * fdt to the buffer at buf of size bufsize. The buffer may overlap
263 * with the existing device tree blob at fdt. Therefore,
264 * fdt_move(fdt, fdt, fdt_totalsize(fdt))
274 int fdt_move(const void *fdt, void *buf, int bufsize);
282 * @fdt: pointer to the device tree blob
286 * strings block of the device tree blob at fdt.
292 const char *fdt_string(const void *fdt, int stroffset);
296 * @fdt: pointer to the device tree blob
307 uint32_t fdt_get_max_phandle(const void *fdt);
311 * @fdt: pointer to the device tree blob
320 int fdt_num_mem_rsv(const void *fdt);
324 * @fdt: pointer to the device tree blob
337 int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size);
341 * @fdt: pointer to the device tree blob
351 int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
355 * @fdt: pointer to the device tree blob
377 int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name);
381 * @fdt: pointer to the device tree blob
388 int fdt_path_offset_namelen(const void *fdt, const char *path, int namelen);
392 * @fdt: pointer to the device tree blob
413 int fdt_path_offset(const void *fdt, const char *path);
417 * @fdt: pointer to the device tree blob
438 const char *fdt_get_name(const void *fdt, int nodeoffset, int *lenp);
442 * @fdt: pointer to the device tree blob
458 int fdt_first_property_offset(const void *fdt, int nodeoffset);
462 * @fdt: pointer to the device tree blob
479 int fdt_next_property_offset(const void *fdt, int offset);
485 * @fdt: FDT blob (const void *)
490 * fdt_for_each_property_offset(property, fdt, node) {
503 #define fdt_for_each_property_offset(property, fdt, node) \
504 for (property = fdt_first_property_offset(fdt, node); \
506 property = fdt_next_property_offset(fdt, property))
510 * @fdt: pointer to the device tree blob
532 const struct fdt_property *fdt_get_property_by_offset(const void *fdt,
538 * @fdt: pointer to the device tree blob
547 const struct fdt_property *fdt_get_property_namelen(const void *fdt,
554 * @fdt: pointer to the device tree blob
580 const struct fdt_property *fdt_get_property(const void *fdt, int nodeoffset,
582 static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset,
587 fdt_get_property(fdt, nodeoffset, name, lenp);
592 * @fdt: pointer to the device tree blob
621 const void *fdt_getprop_by_offset(const void *fdt, int offset,
626 * @fdt: pointer to the device tree blob
635 const void *fdt_getprop_namelen(const void *fdt, int nodeoffset,
637 static inline void *fdt_getprop_namelen_w(void *fdt, int nodeoffset,
641 return (void *)(uintptr_t)fdt_getprop_namelen(fdt, nodeoffset, name,
647 * @fdt: pointer to the device tree blob
673 const void *fdt_getprop(const void *fdt, int nodeoffset,
675 static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
678 return (void *)(uintptr_t)fdt_getprop(fdt, nodeoffset, name, lenp);
683 * @fdt: pointer to the device tree blob
693 uint32_t fdt_get_phandle(const void *fdt, int nodeoffset);
697 * @fdt: pointer to the device tree blob
704 const char *fdt_get_alias_namelen(const void *fdt,
709 * @fdt: pointer to the device tree blob
719 const char *fdt_get_alias(const void *fdt, const char *name);
723 * @fdt: pointer to the device tree blob
746 int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen);
750 * @fdt: pointer to the device tree blob
758 * fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, NULL);
761 * fdt_supernode_atdepth_offset(fdt, nodeoffset, D, NULL);
778 int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
783 * @fdt: pointer to the device tree blob
800 int fdt_node_depth(const void *fdt, int nodeoffset);
804 * @fdt: pointer to the device tree blob
823 int fdt_parent_offset(const void *fdt, int nodeoffset);
827 * @fdt: pointer to the device tree blob
840 * offset = fdt_node_offset_by_prop_value(fdt, -1, propname,
844 * offset = fdt_node_offset_by_prop_value(fdt, offset, propname,
863 int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
869 * @fdt: pointer to the device tree blob
886 int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle);
890 * @fdt: pointer to the device tree blob
910 int fdt_node_check_compatible(const void *fdt, int nodeoffset,
915 * @fdt: pointer to the device tree blob
926 * offset = fdt_node_offset_by_compatible(fdt, -1, compatible);
929 * offset = fdt_node_offset_by_compatible(fdt, offset, compatible);
947 int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
966 * @fdt: pointer to the device tree blob
974 int fdt_stringlist_count(const void *fdt, int nodeoffset, const char *property);
978 * @fdt: pointer to the device tree blob
995 int fdt_stringlist_search(const void *fdt, int nodeoffset, const char *property,
1000 * @fdt: pointer to the device tree blob
1022 const char *fdt_stringlist_get(const void *fdt, int nodeoffset,
1043 * @fdt: pointer to the device tree blob
1059 int fdt_address_cells(const void *fdt, int nodeoffset);
1064 * @fdt: pointer to the device tree blob
1080 int fdt_size_cells(const void *fdt, int nodeoffset);
1090 * @fdt: pointer to the device tree blob
1103 int fdt_setprop_inplace_namelen_partial(void *fdt, int nodeoffset,
1110 * @fdt: pointer to the device tree blob
1136 int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
1141 * @fdt: pointer to the device tree blob
1167 static inline int fdt_setprop_inplace_u32(void *fdt, int nodeoffset,
1171 return fdt_setprop_inplace(fdt, nodeoffset, name, &tmp, sizeof(tmp));
1176 * @fdt: pointer to the device tree blob
1202 static inline int fdt_setprop_inplace_u64(void *fdt, int nodeoffset,
1206 return fdt_setprop_inplace(fdt, nodeoffset, name, &tmp, sizeof(tmp));
1214 static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset,
1217 return fdt_setprop_inplace_u32(fdt, nodeoffset, name, val);
1222 * @fdt: pointer to the device tree blob
1244 int fdt_nop_property(void *fdt, int nodeoffset, const char *name);
1248 * @fdt: pointer to the device tree blob
1268 int fdt_nop_node(void *fdt, int nodeoffset);
1275 int fdt_resize(void *fdt, void *buf, int bufsize);
1276 int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size);
1277 int fdt_finish_reservemap(void *fdt);
1278 int fdt_begin_node(void *fdt, const char *name);
1279 int fdt_property(void *fdt, const char *name, const void *val, int len);
1280 static inline int fdt_property_u32(void *fdt, const char *name, uint32_t val)
1283 return fdt_property(fdt, name, &tmp, sizeof(tmp));
1285 static inline int fdt_property_u64(void *fdt, const char *name, uint64_t val)
1288 return fdt_property(fdt, name, &tmp, sizeof(tmp));
1290 static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val)
1292 return fdt_property_u32(fdt, name, val);
1294 #define fdt_property_string(fdt, name, str) \
1295 fdt_property(fdt, name, str, strlen(str)+1)
1296 int fdt_end_node(void *fdt);
1297 int fdt_finish(void *fdt);
1304 fdt, void *buf, int bufsize);
1305 int fdt_pack(void *fdt);
1309 * @fdt: pointer to the device tree blob
1329 int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size);
1333 * @fdt: pointer to the device tree blob
1353 int fdt_del_mem_rsv(void *fdt, int n);
1357 * @fdt: pointer to the device tree blob
1379 int fdt_set_name(void *fdt, int nodeoffset, const char *name);
1383 * @fdt: pointer to the device tree blob
1409 int fdt_setprop(void *fdt, int nodeoffset, const char *name,
1414 * @fdt: pointer to the device tree blob
1440 static inline int fdt_setprop_u32(void *fdt, int nodeoffset, const char *name,
1444 return fdt_setprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
1449 * @fdt: pointer to the device tree blob
1475 static inline int fdt_setprop_u64(void *fdt, int nodeoffset, const char *name,
1479 return fdt_setprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
1487 static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
1490 return fdt_setprop_u32(fdt, nodeoffset, name, val);
1495 * @fdt: pointer to the device tree blob
1521 #define fdt_setprop_string(fdt, nodeoffset, name, str) \
1522 fdt_setprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
1526 * @fdt: pointer to the device tree blob
1551 int fdt_appendprop(void *fdt, int nodeoffset, const char *name,
1556 * @fdt: pointer to the device tree blob
1582 static inline int fdt_appendprop_u32(void *fdt, int nodeoffset,
1586 return fdt_appendprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
1591 * @fdt: pointer to the device tree blob
1617 static inline int fdt_appendprop_u64(void *fdt, int nodeoffset,
1621 return fdt_appendprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
1629 static inline int fdt_appendprop_cell(void *fdt, int nodeoffset,
1632 return fdt_appendprop_u32(fdt, nodeoffset, name, val);
1637 * @fdt: pointer to the device tree blob
1662 #define fdt_appendprop_string(fdt, nodeoffset, name, str) \
1663 fdt_appendprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
1667 * @fdt: pointer to the device tree blob
1687 int fdt_delprop(void *fdt, int nodeoffset, const char *name);
1691 * @fdt: pointer to the device tree blob
1701 int fdt_add_subnode_namelen(void *fdt, int parentoffset,
1706 * @fdt: pointer to the device tree blob
1735 int fdt_add_subnode(void *fdt, int parentoffset, const char *name);
1739 * @fdt: pointer to the device tree blob
1758 int fdt_del_node(void *fdt, int nodeoffset);