Lines Matching defs:fdt

10 #include <fdt.h>
120 const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int checklen);
122 static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
124 return (void *)(uintptr_t)fdt_offset_ptr(fdt, offset, checklen);
127 uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
193 int fdt_next_node(const void *fdt, int offset, int *depth);
197 * @fdt: FDT blob
202 int fdt_first_subnode(const void *fdt, int offset);
206 * @fdt: FDT blob
215 int fdt_next_subnode(const void *fdt, int offset);
221 * @fdt: FDT blob (const void *)
226 * fdt_for_each_subnode(node, fdt, parent) {
239 #define fdt_for_each_subnode(node, fdt, parent) \
240 for (node = fdt_first_subnode(fdt, parent); \
242 node = fdt_next_subnode(fdt, node))
247 #define fdt_get_header(fdt, field) \
248 (fdt32_ld(&((const struct fdt_header *)(fdt))->field))
249 #define fdt_magic(fdt) (fdt_get_header(fdt, magic))
250 #define fdt_totalsize(fdt) (fdt_get_header(fdt, totalsize))
251 #define fdt_off_dt_struct(fdt) (fdt_get_header(fdt, off_dt_struct))
252 #define fdt_off_dt_strings(fdt) (fdt_get_header(fdt, off_dt_strings))
253 #define fdt_off_mem_rsvmap(fdt) (fdt_get_header(fdt, off_mem_rsvmap))
254 #define fdt_version(fdt) (fdt_get_header(fdt, version))
255 #define fdt_last_comp_version(fdt) (fdt_get_header(fdt, last_comp_version))
256 #define fdt_boot_cpuid_phys(fdt) (fdt_get_header(fdt, boot_cpuid_phys))
257 #define fdt_size_dt_strings(fdt) (fdt_get_header(fdt, size_dt_strings))
258 #define fdt_size_dt_struct(fdt) (fdt_get_header(fdt, size_dt_struct))
261 static inline void fdt_set_##name(void *fdt, uint32_t val) \
263 struct fdt_header *fdth = (struct fdt_header *)fdt; \
280 * @fdt: pointer to a flattened device tree
284 size_t fdt_header_size(const void *fdt);
296 * @fdt: pointer to data which might be a flattened device tree
310 int fdt_check_header(const void *fdt);
314 * @fdt: pointer to the device tree to move
319 * fdt to the buffer at buf of size bufsize. The buffer may overlap
320 * with the existing device tree blob at fdt. Therefore,
321 * fdt_move(fdt, fdt, fdt_totalsize(fdt))
331 int fdt_move(const void *fdt, void *buf, int bufsize);
337 int fdt_check_full(const void *fdt, size_t bufsize);
341 * @fdt: pointer to the device tree blob
346 * strings block of the device tree blob at fdt, and optionally also
353 const char *fdt_get_string(const void *fdt, int stroffset, int *lenp);
357 * @fdt: pointer to the device tree blob
361 * strings block of the device tree blob at fdt.
367 const char *fdt_string(const void *fdt, int stroffset);
371 * @fdt: pointer to the device tree blob
381 int fdt_find_max_phandle(const void *fdt, uint32_t *phandle);
385 * @fdt: pointer to the device tree blob
398 static inline uint32_t fdt_get_max_phandle(const void *fdt)
403 err = fdt_find_max_phandle(fdt, &phandle);
412 * @fdt: pointer to the device tree blob
422 int fdt_generate_phandle(const void *fdt, uint32_t *phandle);
426 * @fdt: pointer to the device tree blob
435 int fdt_num_mem_rsv(const void *fdt);
439 * @fdt: pointer to the device tree blob
454 int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size);
458 * @fdt: pointer to the device tree blob
471 int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
476 * @fdt: pointer to the device tree blob
498 int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name);
502 * @fdt: pointer to the device tree blob
512 int fdt_path_offset_namelen(const void *fdt, const char *path, int namelen);
517 * @fdt: pointer to the device tree blob
538 int fdt_path_offset(const void *fdt, const char *path);
542 * @fdt: pointer to the device tree blob
563 const char *fdt_get_name(const void *fdt, int nodeoffset, int *lenp);
567 * @fdt: pointer to the device tree blob
583 int fdt_first_property_offset(const void *fdt, int nodeoffset);
587 * @fdt: pointer to the device tree blob
604 int fdt_next_property_offset(const void *fdt, int offset);
610 * @fdt: FDT blob (const void *)
615 * fdt_for_each_property_offset(property, fdt, node) {
628 #define fdt_for_each_property_offset(property, fdt, node) \
629 for (property = fdt_first_property_offset(fdt, node); \
631 property = fdt_next_property_offset(fdt, property))
635 * @fdt: pointer to the device tree blob
660 const struct fdt_property *fdt_get_property_by_offset(const void *fdt,
663 static inline struct fdt_property *fdt_get_property_by_offset_w(void *fdt,
668 fdt_get_property_by_offset(fdt, offset, lenp);
673 * @fdt: pointer to the device tree blob
686 const struct fdt_property *fdt_get_property_namelen(const void *fdt,
694 * @fdt: pointer to the device tree blob
720 const struct fdt_property *fdt_get_property(const void *fdt, int nodeoffset,
722 static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset,
727 fdt_get_property(fdt, nodeoffset, name, lenp);
732 * @fdt: pointer to the device tree blob
762 const void *fdt_getprop_by_offset(const void *fdt, int offset,
768 * @fdt: pointer to the device tree blob
780 const void *fdt_getprop_namelen(const void *fdt, int nodeoffset,
782 static inline void *fdt_getprop_namelen_w(void *fdt, int nodeoffset,
786 return (void *)(uintptr_t)fdt_getprop_namelen(fdt, nodeoffset, name,
793 * @fdt: pointer to the device tree blob
819 const void *fdt_getprop(const void *fdt, int nodeoffset,
821 static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
824 return (void *)(uintptr_t)fdt_getprop(fdt, nodeoffset, name, lenp);
829 * @fdt: pointer to the device tree blob
839 uint32_t fdt_get_phandle(const void *fdt, int nodeoffset);
843 * @fdt: pointer to the device tree blob
854 const char *fdt_get_alias_namelen(const void *fdt,
860 * @fdt: pointer to the device tree blob
870 const char *fdt_get_alias(const void *fdt, const char *name);
874 * @fdt: pointer to the device tree blob
897 int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen);
901 * @fdt: pointer to the device tree blob
909 * fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, NULL);
912 * fdt_supernode_atdepth_offset(fdt, nodeoffset, D, NULL);
929 int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
934 * @fdt: pointer to the device tree blob
951 int fdt_node_depth(const void *fdt, int nodeoffset);
955 * @fdt: pointer to the device tree blob
974 int fdt_parent_offset(const void *fdt, int nodeoffset);
978 * @fdt: pointer to the device tree blob
991 * offset = fdt_node_offset_by_prop_value(fdt, -1, propname,
995 * offset = fdt_node_offset_by_prop_value(fdt, offset, propname,
1014 int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
1020 * @fdt: pointer to the device tree blob
1037 int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle);
1041 * @fdt: pointer to the device tree blob
1060 int fdt_node_check_compatible(const void *fdt, int nodeoffset,
1065 * @fdt: pointer to the device tree blob
1076 * offset = fdt_node_offset_by_compatible(fdt, -1, compatible);
1079 * offset = fdt_node_offset_by_compatible(fdt, offset, compatible);
1097 int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
1116 * @fdt: pointer to the device tree blob
1125 int fdt_stringlist_count(const void *fdt, int nodeoffset, const char *property);
1129 * @fdt: pointer to the device tree blob
1146 int fdt_stringlist_search(const void *fdt, int nodeoffset, const char *property,
1151 * @fdt: pointer to the device tree blob
1173 const char *fdt_stringlist_get(const void *fdt, int nodeoffset,
1194 * @fdt: pointer to the device tree blob
1210 int fdt_address_cells(const void *fdt, int nodeoffset);
1215 * @fdt: pointer to the device tree blob
1231 int fdt_size_cells(const void *fdt, int nodeoffset);
1241 * @fdt: pointer to the device tree blob
1257 int fdt_setprop_inplace_namelen_partial(void *fdt, int nodeoffset,
1265 * @fdt: pointer to the device tree blob
1292 int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
1298 * @fdt: pointer to the device tree blob
1324 static inline int fdt_setprop_inplace_u32(void *fdt, int nodeoffset,
1328 return fdt_setprop_inplace(fdt, nodeoffset, name, &tmp, sizeof(tmp));
1333 * @fdt: pointer to the device tree blob
1359 static inline int fdt_setprop_inplace_u64(void *fdt, int nodeoffset,
1363 return fdt_setprop_inplace(fdt, nodeoffset, name, &tmp, sizeof(tmp));
1368 * @fdt: pointer to the device tree blob
1376 static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset,
1379 return fdt_setprop_inplace_u32(fdt, nodeoffset, name, val);
1384 * @fdt: pointer to the device tree blob
1406 int fdt_nop_property(void *fdt, int nodeoffset, const char *name);
1410 * @fdt: pointer to the device tree blob
1430 int fdt_nop_node(void *fdt, int nodeoffset);
1439 * names in the fdt. This can result in faster creation times, but
1440 * a larger fdt. */
1445 * fdt_create_with_flags - begin creation of a new fdt
1446 * @buf: pointer to memory allocated where fdt will be created
1447 * @bufsize: size of the memory space at fdt
1450 * fdt_create_with_flags() begins the process of creating a new fdt with
1453 * fdt creation process must end with fdt_finished() to produce a valid fdt.
1457 * -FDT_ERR_NOSPACE, bufsize is insufficient for a minimal fdt
1463 * fdt_create - begin creation of a new fdt
1464 * @buf: pointer to memory allocated where fdt will be created
1465 * @bufsize: size of the memory space at fdt
1471 * -FDT_ERR_NOSPACE, bufsize is insufficient for a minimal fdt
1475 int fdt_resize(void *fdt, void *buf, int bufsize);
1476 int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size);
1477 int fdt_finish_reservemap(void *fdt);
1478 int fdt_begin_node(void *fdt, const char *name);
1479 int fdt_property(void *fdt, const char *name, const void *val, int len);
1480 static inline int fdt_property_u32(void *fdt, const char *name, uint32_t val)
1483 return fdt_property(fdt, name, &tmp, sizeof(tmp));
1485 static inline int fdt_property_u64(void *fdt, const char *name, uint64_t val)
1488 return fdt_property(fdt, name, &tmp, sizeof(tmp));
1492 static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val)
1494 return fdt_property_u32(fdt, name, val);
1501 * @fdt: pointer to the device tree blob
1511 int fdt_property_placeholder(void *fdt, const char *name, int len, void **valp);
1513 #define fdt_property_string(fdt, name, str) \
1514 fdt_property(fdt, name, str, strlen(str)+1)
1515 int fdt_end_node(void *fdt);
1516 int fdt_finish(void *fdt);
1523 int fdt_open_into(const void *fdt, void *buf, int bufsize);
1524 int fdt_pack(void *fdt);
1528 * @fdt: pointer to the device tree blob
1549 int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size);
1553 * @fdt: pointer to the device tree blob
1573 int fdt_del_mem_rsv(void *fdt, int n);
1577 * @fdt: pointer to the device tree blob
1599 int fdt_set_name(void *fdt, int nodeoffset, const char *name);
1603 * @fdt: pointer to the device tree blob
1629 int fdt_setprop(void *fdt, int nodeoffset, const char *name,
1634 * @fdt: pointer to the device tree blob
1660 int fdt_setprop_placeholder(void *fdt, int nodeoffset, const char *name,
1665 * @fdt: pointer to the device tree blob
1691 static inline int fdt_setprop_u32(void *fdt, int nodeoffset, const char *name,
1695 return fdt_setprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
1700 * @fdt: pointer to the device tree blob
1726 static inline int fdt_setprop_u64(void *fdt, int nodeoffset, const char *name,
1730 return fdt_setprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
1735 * @fdt: pointer to the device tree blob
1744 static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
1747 return fdt_setprop_u32(fdt, nodeoffset, name, val);
1752 * @fdt: pointer to the device tree blob
1778 #define fdt_setprop_string(fdt, nodeoffset, name, str) \
1779 fdt_setprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
1784 * @fdt: pointer to the device tree blob
1808 #define fdt_setprop_empty(fdt, nodeoffset, name) \
1809 fdt_setprop((fdt), (nodeoffset), (name), NULL, 0)
1813 * @fdt: pointer to the device tree blob
1838 int fdt_appendprop(void *fdt, int nodeoffset, const char *name,
1843 * @fdt: pointer to the device tree blob
1869 static inline int fdt_appendprop_u32(void *fdt, int nodeoffset,
1873 return fdt_appendprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
1878 * @fdt: pointer to the device tree blob
1904 static inline int fdt_appendprop_u64(void *fdt, int nodeoffset,
1908 return fdt_appendprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
1913 * @fdt: pointer to the device tree blob
1922 static inline int fdt_appendprop_cell(void *fdt, int nodeoffset,
1925 return fdt_appendprop_u32(fdt, nodeoffset, name, val);
1930 * @fdt: pointer to the device tree blob
1955 #define fdt_appendprop_string(fdt, nodeoffset, name, str) \
1956 fdt_appendprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
1960 * @fdt: pointer to the device tree blob
1992 int fdt_appendprop_addrrange(void *fdt, int parent, int nodeoffset,
1997 * @fdt: pointer to the device tree blob
2017 int fdt_delprop(void *fdt, int nodeoffset, const char *name);
2021 * @fdt: pointer to the device tree blob
2035 int fdt_add_subnode_namelen(void *fdt, int parentoffset,
2041 * @fdt: pointer to the device tree blob
2070 int fdt_add_subnode(void *fdt, int parentoffset, const char *name);
2074 * @fdt: pointer to the device tree blob
2093 int fdt_del_node(void *fdt, int nodeoffset);
2097 * @fdt: pointer to the base device tree blob
2124 int fdt_overlay_apply(void *fdt, void *fdto);
2128 * @fdt: Base device tree blob
2141 int fdt_overlay_target_offset(const void *fdt, const void *fdto,