Home | History | Annotate | Download | only in Include

Lines Matching refs: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);
142 * @fdt: FDT blob
146 int fdt_first_subnode(const void *fdt, int offset);
154 * @fdt: FDT blob
159 int fdt_next_subnode(const void *fdt, int offset);
165 #define fdt_get_header(fdt, field) \
166 (fdt32_to_cpu(((const struct fdt_header *)(fdt))->field))
167 #define fdt_magic(fdt) (fdt_get_header(fdt, magic))
168 #define fdt_totalsize(fdt) (fdt_get_header(fdt, totalsize))
169 #define fdt_off_dt_struct(fdt) (fdt_get_header(fdt, off_dt_struct))
170 #define fdt_off_dt_strings(fdt) (fdt_get_header(fdt, off_dt_strings))
171 #define fdt_off_mem_rsvmap(fdt) (fdt_get_header(fdt, off_mem_rsvmap))
172 #define fdt_version(fdt) (fdt_get_header(fdt, version))
173 #define fdt_last_comp_version(fdt) (fdt_get_header(fdt, last_comp_version))
174 #define fdt_boot_cpuid_phys(fdt) (fdt_get_header(fdt, boot_cpuid_phys))
175 #define fdt_size_dt_strings(fdt) (fdt_get_header(fdt, size_dt_strings))
176 #define fdt_size_dt_struct(fdt) (fdt_get_header(fdt, size_dt_struct))
179 static inline void fdt_set_##name(void *fdt, uint32_t val) \
181 struct fdt_header *fdth = (struct fdt_header*)fdt; \
198 * @fdt: pointer to data which might be a flattened device tree
210 int fdt_check_header(const void *fdt);
214 * @fdt: pointer to the device tree to move
219 * fdt to the buffer at buf of size bufsize. The buffer may overlap
220 * with the existing device tree blob at fdt. Therefore,
221 * fdt_move(fdt, fdt, fdt_totalsize(fdt))
231 int fdt_move(const void *fdt, void *buf, int bufsize);
239 * @fdt: pointer to the device tree blob
243 * strings block of the device tree blob at fdt.
249 const char *fdt_string(const void *fdt, int stroffset);
253 * @fdt: pointer to the device tree blob
262 int fdt_num_mem_rsv(const void *fdt);
266 * @fdt: pointer to the device tree blob
279 int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size);
283 * @fdt: pointer to the device tree blob
293 int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
297 * @fdt: pointer to the device tree blob
318 int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name);
322 * @fdt: pointer to the device tree blob
342 int fdt_path_offset(const void *fdt, const char *path);
346 * @fdt: pointer to the device tree blob
365 const char *fdt_get_name(const void *fdt, int nodeoffset, int *lenp);
369 * @fdt: pointer to the device tree blob
385 int fdt_first_property_offset(const void *fdt, int nodeoffset);
389 * @fdt: pointer to the device tree blob
406 int fdt_next_property_offset(const void *fdt, int offset);
410 * @fdt: pointer to the device tree blob
432 const struct fdt_property *fdt_get_property_by_offset(const void *fdt,
438 * @fdt: pointer to the device tree blob
447 const struct fdt_property *fdt_get_property_namelen(const void *fdt,
454 * @fdt: pointer to the device tree blob
479 const struct fdt_property *fdt_get_property(const void *fdt, int nodeoffset,
481 static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset,
486 fdt_get_property(fdt, nodeoffset, name, lenp);
491 * @fdt: pointer to the device tree blob
520 const void *fdt_getprop_by_offset(const void *fdt, int offset,
525 * @fdt: pointer to the device tree blob
534 const void *fdt_getprop_namelen(const void *fdt, int nodeoffset,
539 * @fdt: pointer to the device tree blob
564 const void *fdt_getprop(const void *fdt, int nodeoffset,
566 static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
569 return (void *)(uintptr_t)fdt_getprop(fdt, nodeoffset, name, lenp);
574 * @fdt: pointer to the device tree blob
584 uint32_t fdt_get_phandle(const void *fdt, int nodeoffset);
588 * @fdt: pointer to the device tree blob
595 const char *fdt_get_alias_namelen(const void *fdt,
600 * @fdt: pointer to the device tree blob
610 const char *fdt_get_alias(const void *fdt, const char *name);
614 * @fdt: pointer to the device tree blob
637 int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen);
641 * @fdt: pointer to the device tree blob
649 * fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, NULL);
652 * fdt_supernode_atdepth_offset(fdt, nodeoffset, D, NULL);
669 int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
674 * @fdt: pointer to the device tree blob
691 int fdt_node_depth(const void *fdt, int nodeoffset);
695 * @fdt: pointer to the device tree blob
714 int fdt_parent_offset(const void *fdt, int nodeoffset);
718 * @fdt: pointer to the device tree blob
731 * offset = fdt_node_offset_by_prop_value(fdt, -1, propname,
735 * offset = fdt_node_offset_by_prop_value(fdt, offset, propname,
754 int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
760 * @fdt: pointer to the device tree blob
777 int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle);
781 * @fdt: pointer to the device tree blob
801 int fdt_node_check_compatible(const void *fdt, int nodeoffset,
806 * @fdt: pointer to the device tree blob
817 * offset = fdt_node_offset_by_compatible(fdt, -1, compatible);
820 * offset = fdt_node_offset_by_compatible(fdt, offset, compatible);
838 int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
861 * @fdt: pointer to the device tree blob
887 int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
892 * @fdt: pointer to the device tree blob
918 static inline int fdt_setprop_inplace_u32(void *fdt, int nodeoffset,
922 return fdt_setprop_inplace(fdt, nodeoffset, name, &tmp, sizeof(tmp));
927 * @fdt: pointer to the device tree blob
953 static inline int fdt_setprop_inplace_u64(void *fdt, int nodeoffset,
957 return fdt_setprop_inplace(fdt, nodeoffset, name, &tmp, sizeof(tmp));
965 static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset,
968 return fdt_setprop_inplace_u32(fdt, nodeoffset, name, val);
973 * @fdt: pointer to the device tree blob
995 int fdt_nop_property(void *fdt, int nodeoffset, const char *name);
999 * @fdt: pointer to the device tree blob
1019 int fdt_nop_node(void *fdt, int nodeoffset);
1026 int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size);
1027 int fdt_finish_reservemap(void *fdt);
1028 int fdt_begin_node(void *fdt, const char *name);
1029 int fdt_property(void *fdt, const char *name, const void *val, int len);
1030 static inline int fdt_property_u32(void *fdt, const char *name, uint32_t val)
1033 return fdt_property(fdt, name, &tmp, sizeof(tmp));
1035 static inline int fdt_property_u64(void *fdt, const char *name, uint64_t val)
1038 return fdt_property(fdt, name, &tmp, sizeof(tmp));
1040 static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val)
1042 return fdt_property_u32(fdt, name, val);
1044 #define fdt_property_string(fdt, name, str) \
1045 fdt_property(fdt, name, str, strlen(str)+1)
1046 int fdt_end_node(void *fdt);
1047 int fdt_finish(void *fdt);
1054 int fdt_open_into(const void *fdt, void *buf, int bufsize);
1055 int fdt_pack(void *fdt);
1059 * @fdt: pointer to the device tree blob
1079 int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size);
1083 * @fdt: pointer to the device tree blob
1103 int fdt_del_mem_rsv(void *fdt, int n);
1107 * @fdt: pointer to the device tree blob
1129 int fdt_set_name(void *fdt, int nodeoffset, const char *name);
1133 * @fdt: pointer to the device tree blob
1159 int fdt_setprop(void *fdt, int nodeoffset, const char *name,
1164 * @fdt: pointer to the device tree blob
1190 static inline int fdt_setprop_u32(void *fdt, int nodeoffset, const char *name,
1194 return fdt_setprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
1199 * @fdt: pointer to the device tree blob
1225 static inline int fdt_setprop_u64(void *fdt, int nodeoffset, const char *name,
1229 return fdt_setprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
1237 static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
1240 return fdt_setprop_u32(fdt, nodeoffset, name, val);
1245 * @fdt: pointer to the device tree blob
1271 #define fdt_setprop_string(fdt, nodeoffset, name, str) \
1272 fdt_setprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
1276 * @fdt: pointer to the device tree blob
1301 int fdt_appendprop(void *fdt, int nodeoffset, const char *name,
1306 * @fdt: pointer to the device tree blob
1332 static inline int fdt_appendprop_u32(void *fdt, int nodeoffset,
1336 return fdt_appendprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
1341 * @fdt: pointer to the device tree blob
1367 static inline int fdt_appendprop_u64(void *fdt, int nodeoffset,
1371 return fdt_appendprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
1379 static inline int fdt_appendprop_cell(void *fdt, int nodeoffset,
1382 return fdt_appendprop_u32(fdt, nodeoffset, name, val);
1387 * @fdt: pointer to the device tree blob
1412 #define fdt_appendprop_string(fdt, nodeoffset, name, str) \
1413 fdt_appendprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
1417 * @fdt: pointer to the device tree blob
1437 int fdt_delprop(void *fdt, int nodeoffset, const char *name);
1441 * @fdt: pointer to the device tree blob
1451 int fdt_add_subnode_namelen(void *fdt, int parentoffset,
1456 * @fdt: pointer to the device tree blob
1483 int fdt_add_subnode(void *fdt, int parentoffset, const char *name);
1487 * @fdt: pointer to the device tree blob
1506 int fdt_del_node(void *fdt, int nodeoffset);