Lines Matching full:fdt
55 #include <fdt.h>
147 const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int checklen);
149 static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen) in fdt_offset_ptr_w() argument
151 return (void *)(uintptr_t)fdt_offset_ptr(fdt, offset, checklen); in fdt_offset_ptr_w()
154 uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
160 int fdt_next_node(const void *fdt, int offset, int *depth);
165 * @fdt: FDT blob
169 int fdt_first_subnode(const void *fdt, int offset);
177 * @fdt: FDT blob
182 int fdt_next_subnode(const void *fdt, int offset);
188 * @fdt: FDT blob (const void *)
193 * fdt_for_each_subnode(node, fdt, parent) {
207 #define fdt_for_each_subnode(node, fdt, parent) \ argument
208 for (node = fdt_first_subnode(fdt, parent); \
210 node = fdt_next_subnode(fdt, node))
215 #define fdt_get_header(fdt, field) \ argument
216 (fdt32_to_cpu(((const struct fdt_header *)(fdt))->field))
217 #define fdt_magic(fdt) (fdt_get_header(fdt, magic)) argument
218 #define fdt_totalsize(fdt) (fdt_get_header(fdt, totalsize)) argument
219 #define fdt_off_dt_struct(fdt) (fdt_get_header(fdt, off_dt_struct)) argument
220 #define fdt_off_dt_strings(fdt) (fdt_get_header(fdt, off_dt_strings)) argument
221 #define fdt_off_mem_rsvmap(fdt) (fdt_get_header(fdt, off_mem_rsvmap)) argument
222 #define fdt_version(fdt) (fdt_get_header(fdt, version)) argument
223 #define fdt_last_comp_version(fdt) (fdt_get_header(fdt, last_comp_version)) argument
224 #define fdt_boot_cpuid_phys(fdt) (fdt_get_header(fdt, boot_cpuid_phys)) argument
225 #define fdt_size_dt_strings(fdt) (fdt_get_header(fdt, size_dt_strings)) argument
226 #define fdt_size_dt_struct(fdt) (fdt_get_header(fdt, size_dt_struct)) argument
229 static inline void fdt_set_##name(void *fdt, uint32_t val) \
231 struct fdt_header *fdth = (struct fdt_header *)fdt; \
248 * @fdt: pointer to data which might be a flattened device tree
260 int fdt_check_header(const void *fdt);
264 * @fdt: pointer to the device tree to move
269 * fdt to the buffer at buf of size bufsize. The buffer may overlap
270 * with the existing device tree blob at fdt. Therefore,
271 * fdt_move(fdt, fdt, fdt_totalsize(fdt))
281 int fdt_move(const void *fdt, void *buf, int bufsize);
289 * @fdt: pointer to the device tree blob
293 * strings block of the device tree blob at fdt.
299 const char *fdt_string(const void *fdt, int stroffset);
303 * @fdt: pointer to the device tree blob
314 uint32_t fdt_get_max_phandle(const void *fdt);
318 * @fdt: pointer to the device tree blob
327 int fdt_num_mem_rsv(const void *fdt);
331 * @fdt: pointer to the device tree blob
344 int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size);
348 * @fdt: pointer to the device tree blob
359 int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
364 * @fdt: pointer to the device tree blob
386 int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name);
390 * @fdt: pointer to the device tree blob
398 int fdt_path_offset_namelen(const void *fdt, const char *path, int namelen);
403 * @fdt: pointer to the device tree blob
424 int fdt_path_offset(const void *fdt, const char *path);
428 * @fdt: pointer to the device tree blob
449 const char *fdt_get_name(const void *fdt, int nodeoffset, int *lenp);
453 * @fdt: pointer to the device tree blob
469 int fdt_first_property_offset(const void *fdt, int nodeoffset);
473 * @fdt: pointer to the device tree blob
490 int fdt_next_property_offset(const void *fdt, int offset);
496 * @fdt: FDT blob (const void *)
501 * fdt_for_each_property_offset(property, fdt, node) {
514 #define fdt_for_each_property_offset(property, fdt, node) \ argument
515 for (property = fdt_first_property_offset(fdt, node); \
517 property = fdt_next_property_offset(fdt, property))
521 * @fdt: pointer to the device tree blob
546 const struct fdt_property *fdt_get_property_by_offset(const void *fdt,
552 * @fdt: pointer to the device tree blob
562 const struct fdt_property *fdt_get_property_namelen(const void *fdt,
570 * @fdt: pointer to the device tree blob
596 const struct fdt_property *fdt_get_property(const void *fdt, int nodeoffset,
598 static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset, in fdt_get_property_w() argument
603 fdt_get_property(fdt, nodeoffset, name, lenp); in fdt_get_property_w()
608 * @fdt: pointer to the device tree blob
638 const void *fdt_getprop_by_offset(const void *fdt, int offset,
644 * @fdt: pointer to the device tree blob
654 const void *fdt_getprop_namelen(const void *fdt, int nodeoffset,
656 static inline void *fdt_getprop_namelen_w(void *fdt, int nodeoffset, in fdt_getprop_namelen_w() argument
660 return (void *)(uintptr_t)fdt_getprop_namelen(fdt, nodeoffset, name, in fdt_getprop_namelen_w()
667 * @fdt: pointer to the device tree blob
693 const void *fdt_getprop(const void *fdt, int nodeoffset,
695 static inline void *fdt_getprop_w(void *fdt, int nodeoffset, in fdt_getprop_w() argument
698 return (void *)(uintptr_t)fdt_getprop(fdt, nodeoffset, name, lenp); in fdt_getprop_w()
703 * @fdt: pointer to the device tree blob
713 uint32_t fdt_get_phandle(const void *fdt, int nodeoffset);
717 * @fdt: pointer to the device tree blob
725 const char *fdt_get_alias_namelen(const void *fdt,
731 * @fdt: pointer to the device tree blob
741 const char *fdt_get_alias(const void *fdt, const char *name);
745 * @fdt: pointer to the device tree blob
768 int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen);
772 * @fdt: pointer to the device tree blob
780 * fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, NULL);
783 * fdt_supernode_atdepth_offset(fdt, nodeoffset, D, NULL);
800 int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
805 * @fdt: pointer to the device tree blob
822 int fdt_node_depth(const void *fdt, int nodeoffset);
826 * @fdt: pointer to the device tree blob
845 int fdt_parent_offset(const void *fdt, int nodeoffset);
849 * @fdt: pointer to the device tree blob
862 * offset = fdt_node_offset_by_prop_value(fdt, -1, propname,
866 * offset = fdt_node_offset_by_prop_value(fdt, offset, propname,
885 int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
891 * @fdt: pointer to the device tree blob
908 int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle);
912 * @fdt: pointer to the device tree blob
932 int fdt_node_check_compatible(const void *fdt, int nodeoffset,
937 * @fdt: pointer to the device tree blob
948 * offset = fdt_node_offset_by_compatible(fdt, -1, compatible);
951 * offset = fdt_node_offset_by_compatible(fdt, offset, compatible);
969 int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
988 * @fdt: pointer to the device tree blob
996 int fdt_stringlist_count(const void *fdt, int nodeoffset, const char *property);
1000 * @fdt: pointer to the device tree blob
1017 int fdt_stringlist_search(const void *fdt, int nodeoffset, const char *property,
1022 * @fdt: pointer to the device tree blob
1044 const char *fdt_stringlist_get(const void *fdt, int nodeoffset,
1065 * @fdt: pointer to the device tree blob
1081 int fdt_address_cells(const void *fdt, int nodeoffset);
1086 * @fdt: pointer to the device tree blob
1102 int fdt_size_cells(const void *fdt, int nodeoffset);
1112 * @fdt: pointer to the device tree blob
1126 int fdt_setprop_inplace_namelen_partial(void *fdt, int nodeoffset,
1134 * @fdt: pointer to the device tree blob
1161 int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
1167 * @fdt: pointer to the device tree blob
1193 static inline int fdt_setprop_inplace_u32(void *fdt, int nodeoffset, in fdt_setprop_inplace_u32() argument
1197 return fdt_setprop_inplace(fdt, nodeoffset, name, &tmp, sizeof(tmp)); in fdt_setprop_inplace_u32()
1202 * @fdt: pointer to the device tree blob
1228 static inline int fdt_setprop_inplace_u64(void *fdt, int nodeoffset, in fdt_setprop_inplace_u64() argument
1232 return fdt_setprop_inplace(fdt, nodeoffset, name, &tmp, sizeof(tmp)); in fdt_setprop_inplace_u64()
1240 static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset, in fdt_setprop_inplace_cell() argument
1243 return fdt_setprop_inplace_u32(fdt, nodeoffset, name, val); in fdt_setprop_inplace_cell()
1248 * @fdt: pointer to the device tree blob
1270 int fdt_nop_property(void *fdt, int nodeoffset, const char *name);
1274 * @fdt: pointer to the device tree blob
1294 int fdt_nop_node(void *fdt, int nodeoffset);
1301 int fdt_resize(void *fdt, void *buf, int bufsize);
1302 int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size);
1303 int fdt_finish_reservemap(void *fdt);
1304 int fdt_begin_node(void *fdt, const char *name);
1305 int fdt_property(void *fdt, const char *name, const void *val, int len);
1306 static inline int fdt_property_u32(void *fdt, const char *name, uint32_t val) in fdt_property_u32() argument
1309 return fdt_property(fdt, name, &tmp, sizeof(tmp)); in fdt_property_u32()
1311 static inline int fdt_property_u64(void *fdt, const char *name, uint64_t val) in fdt_property_u64() argument
1314 return fdt_property(fdt, name, &tmp, sizeof(tmp)); in fdt_property_u64()
1316 static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val) in fdt_property_cell() argument
1318 return fdt_property_u32(fdt, name, val); in fdt_property_cell()
1324 * @fdt: pointer to the device tree blob
1334 int fdt_property_placeholder(void *fdt, const char *name, int len, void **valp);
1336 #define fdt_property_string(fdt, name, str) \ argument
1337 fdt_property(fdt, name, str, strlen(str)+1)
1338 int fdt_end_node(void *fdt);
1339 int fdt_finish(void *fdt);
1346 int fdt_open_into(const void *fdt, void *buf, int bufsize);
1347 int fdt_pack(void *fdt);
1351 * @fdt: pointer to the device tree blob
1371 int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size);
1375 * @fdt: pointer to the device tree blob
1395 int fdt_del_mem_rsv(void *fdt, int n);
1399 * @fdt: pointer to the device tree blob
1421 int fdt_set_name(void *fdt, int nodeoffset, const char *name);
1425 * @fdt: pointer to the device tree blob
1451 int fdt_setprop(void *fdt, int nodeoffset, const char *name,
1456 * @fdt: pointer to the device tree blob
1482 int fdt_setprop_placeholder(void *fdt, int nodeoffset, const char *name,
1487 * @fdt: pointer to the device tree blob
1513 static inline int fdt_setprop_u32(void *fdt, int nodeoffset, const char *name, in fdt_setprop_u32() argument
1517 return fdt_setprop(fdt, nodeoffset, name, &tmp, sizeof(tmp)); in fdt_setprop_u32()
1522 * @fdt: pointer to the device tree blob
1548 static inline int fdt_setprop_u64(void *fdt, int nodeoffset, const char *name, in fdt_setprop_u64() argument
1552 return fdt_setprop(fdt, nodeoffset, name, &tmp, sizeof(tmp)); in fdt_setprop_u64()
1560 static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name, in fdt_setprop_cell() argument
1563 return fdt_setprop_u32(fdt, nodeoffset, name, val); in fdt_setprop_cell()
1568 * @fdt: pointer to the device tree blob
1594 #define fdt_setprop_string(fdt, nodeoffset, name, str) \ argument
1595 fdt_setprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
1600 * @fdt: pointer to the device tree blob
1624 #define fdt_setprop_empty(fdt, nodeoffset, name) \ argument
1625 fdt_setprop((fdt), (nodeoffset), (name), NULL, 0)
1629 * @fdt: pointer to the device tree blob
1654 int fdt_appendprop(void *fdt, int nodeoffset, const char *name,
1659 * @fdt: pointer to the device tree blob
1685 static inline int fdt_appendprop_u32(void *fdt, int nodeoffset, in fdt_appendprop_u32() argument
1689 return fdt_appendprop(fdt, nodeoffset, name, &tmp, sizeof(tmp)); in fdt_appendprop_u32()
1694 * @fdt: pointer to the device tree blob
1720 static inline int fdt_appendprop_u64(void *fdt, int nodeoffset, in fdt_appendprop_u64() argument
1724 return fdt_appendprop(fdt, nodeoffset, name, &tmp, sizeof(tmp)); in fdt_appendprop_u64()
1732 static inline int fdt_appendprop_cell(void *fdt, int nodeoffset, in fdt_appendprop_cell() argument
1735 return fdt_appendprop_u32(fdt, nodeoffset, name, val); in fdt_appendprop_cell()
1740 * @fdt: pointer to the device tree blob
1765 #define fdt_appendprop_string(fdt, nodeoffset, name, str) \ argument
1766 fdt_appendprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
1770 * @fdt: pointer to the device tree blob
1790 int fdt_delprop(void *fdt, int nodeoffset, const char *name);
1794 * @fdt: pointer to the device tree blob
1805 int fdt_add_subnode_namelen(void *fdt, int parentoffset,
1811 * @fdt: pointer to the device tree blob
1840 int fdt_add_subnode(void *fdt, int parentoffset, const char *name);
1844 * @fdt: pointer to the device tree blob
1863 int fdt_del_node(void *fdt, int nodeoffset);
1867 * @fdt: pointer to the base device tree blob
1894 int fdt_overlay_apply(void *fdt, void *fdto);