Lines Matching defs:fdt

55 #include <fdt.h>
125 const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int checklen);
126 static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
128 return (void *)(uintptr_t)fdt_offset_ptr(fdt, offset, checklen);
131 uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
137 int fdt_next_node(const void *fdt, int offset, int *depth);
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))
157 static inline void fdt_set_##name(void *fdt, uint32_t val) \
159 struct fdt_header *fdth = (struct fdt_header*)fdt; \
176 * @fdt: pointer to data which might be a flattened device tree
188 int fdt_check_header(const void *fdt);
192 * @fdt: pointer to the device tree to move
197 * fdt to the buffer at buf of size bufsize. The buffer may overlap
198 * with the existing device tree blob at fdt. Therefore,
199 * fdt_move(fdt, fdt, fdt_totalsize(fdt))
209 int fdt_move(const void *fdt, void *buf, int bufsize);
217 * @fdt: pointer to the device tree blob
221 * strings block of the device tree blob at fdt.
227 const char *fdt_string(const void *fdt, int stroffset);
231 * @fdt: pointer to the device tree blob
240 int fdt_num_mem_rsv(const void *fdt);
244 * @fdt: pointer to the device tree blob
257 int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size);
261 * @fdt: pointer to the device tree blob
271 int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
275 * @fdt: pointer to the device tree blob
296 int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name);
300 * @fdt: pointer to the device tree blob
320 int fdt_path_offset(const void *fdt, const char *path);
324 * @fdt: pointer to the device tree blob
343 const char *fdt_get_name(const void *fdt, int nodeoffset, int *lenp);
347 * @fdt: pointer to the device tree blob
363 int fdt_first_property_offset(const void *fdt, int nodeoffset);
367 * @fdt: pointer to the device tree blob
384 int fdt_next_property_offset(const void *fdt, int offset);
388 * @fdt: pointer to the device tree blob
410 const struct fdt_property *fdt_get_property_by_offset(const void *fdt,
416 * @fdt: pointer to the device tree blob
425 const struct fdt_property *fdt_get_property_namelen(const void *fdt,
432 * @fdt: pointer to the device tree blob
457 const struct fdt_property *fdt_get_property(const void *fdt, int nodeoffset,
459 static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset,
464 fdt_get_property(fdt, nodeoffset, name, lenp);
469 * @fdt: pointer to the device tree blob
498 const void *fdt_getprop_by_offset(const void *fdt, int offset,
503 * @fdt: pointer to the device tree blob
512 const void *fdt_getprop_namelen(const void *fdt, int nodeoffset,
517 * @fdt: pointer to the device tree blob
542 const void *fdt_getprop(const void *fdt, int nodeoffset,
544 static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
547 return (void *)(uintptr_t)fdt_getprop(fdt, nodeoffset, name, lenp);
552 * @fdt: pointer to the device tree blob
562 uint32_t fdt_get_phandle(const void *fdt, int nodeoffset);
566 * @fdt: pointer to the device tree blob
573 const char *fdt_get_alias_namelen(const void *fdt,
578 * @fdt: pointer to the device tree blob
588 const char *fdt_get_alias(const void *fdt, const char *name);
592 * @fdt: pointer to the device tree blob
615 int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen);
619 * @fdt: pointer to the device tree blob
627 * fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, NULL);
630 * fdt_supernode_atdepth_offset(fdt, nodeoffset, D, NULL);
647 int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
652 * @fdt: pointer to the device tree blob
669 int fdt_node_depth(const void *fdt, int nodeoffset);
673 * @fdt: pointer to the device tree blob
692 int fdt_parent_offset(const void *fdt, int nodeoffset);
696 * @fdt: pointer to the device tree blob
709 * offset = fdt_node_offset_by_prop_value(fdt, -1, propname,
713 * offset = fdt_node_offset_by_prop_value(fdt, offset, propname,
732 int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
738 * @fdt: pointer to the device tree blob
755 int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle);
759 * @fdt: pointer to the device tree blob
779 int fdt_node_check_compatible(const void *fdt, int nodeoffset,
784 * @fdt: pointer to the device tree blob
795 * offset = fdt_node_offset_by_compatible(fdt, -1, compatible);
798 * offset = fdt_node_offset_by_compatible(fdt, offset, compatible);
816 int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
825 * @fdt: pointer to the device tree blob
851 int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
856 * @fdt: pointer to the device tree blob
882 static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset,
886 return fdt_setprop_inplace(fdt, nodeoffset, name, &val, sizeof(val));
891 * @fdt: pointer to the device tree blob
913 int fdt_nop_property(void *fdt, int nodeoffset, const char *name);
917 * @fdt: pointer to the device tree blob
937 int fdt_nop_node(void *fdt, int nodeoffset);
944 int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size);
945 int fdt_finish_reservemap(void *fdt);
946 int fdt_begin_node(void *fdt, const char *name);
947 int fdt_property(void *fdt, const char *name, const void *val, int len);
948 static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val)
951 return fdt_property(fdt, name, &val, sizeof(val));
953 #define fdt_property_string(fdt, name, str) \
954 fdt_property(fdt, name, str, strlen(str)+1)
955 int fdt_end_node(void *fdt);
956 int fdt_finish(void *fdt);
962 int fdt_open_into(const void *fdt, void *buf, int bufsize);
963 int fdt_pack(void *fdt);
967 * @fdt: pointer to the device tree blob
987 int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size);
991 * @fdt: pointer to the device tree blob
1011 int fdt_del_mem_rsv(void *fdt, int n);
1015 * @fdt: pointer to the device tree blob
1037 int fdt_set_name(void *fdt, int nodeoffset, const char *name);
1041 * @fdt: pointer to the device tree blob
1067 int fdt_setprop(void *fdt, int nodeoffset, const char *name,
1072 * @fdt: pointer to the device tree blob
1098 static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
1102 return fdt_setprop(fdt, nodeoffset, name, &val, sizeof(val));
1107 * @fdt: pointer to the device tree blob
1133 #define fdt_setprop_string(fdt, nodeoffset, name, str) \
1134 fdt_setprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
1138 * @fdt: pointer to the device tree blob
1158 int fdt_delprop(void *fdt, int nodeoffset, const char *name);
1162 * @fdt: pointer to the device tree blob
1172 int fdt_add_subnode_namelen(void *fdt, int parentoffset,
1177 * @fdt: pointer to the device tree blob
1204 int fdt_add_subnode(void *fdt, int parentoffset, const char *name);
1208 * @fdt: pointer to the device tree blob
1227 int fdt_del_node(void *fdt, int nodeoffset);