Lines Matching defs:fdt

38 #include <fdt.h>
109 const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int checklen);
110 static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
112 return (void *)(uintptr_t)fdt_offset_ptr(fdt, offset, checklen);
115 uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
121 int fdt_next_node(const void *fdt, int offset, int *depth);
127 #define fdt_get_header(fdt, field) \
128 (fdt32_to_cpu(((const struct fdt_header *)(fdt))->field))
129 #define fdt_magic(fdt) (fdt_get_header(fdt, magic))
130 #define fdt_totalsize(fdt) (fdt_get_header(fdt, totalsize))
131 #define fdt_off_dt_struct(fdt) (fdt_get_header(fdt, off_dt_struct))
132 #define fdt_off_dt_strings(fdt) (fdt_get_header(fdt, off_dt_strings))
133 #define fdt_off_mem_rsvmap(fdt) (fdt_get_header(fdt, off_mem_rsvmap))
134 #define fdt_version(fdt) (fdt_get_header(fdt, version))
135 #define fdt_last_comp_version(fdt) (fdt_get_header(fdt, last_comp_version))
136 #define fdt_boot_cpuid_phys(fdt) (fdt_get_header(fdt, boot_cpuid_phys))
137 #define fdt_size_dt_strings(fdt) (fdt_get_header(fdt, size_dt_strings))
138 #define fdt_size_dt_struct(fdt) (fdt_get_header(fdt, size_dt_struct))
141 static inline void fdt_set_##name(void *fdt, uint32_t val) \
143 struct fdt_header *fdth = (struct fdt_header*)fdt; \
160 * @fdt: pointer to data which might be a flattened device tree
172 int fdt_check_header(const void *fdt);
176 * @fdt: pointer to the device tree to move
181 * fdt to the buffer at buf of size bufsize. The buffer may overlap
182 * with the existing device tree blob at fdt. Therefore,
183 * fdt_move(fdt, fdt, fdt_totalsize(fdt))
193 int fdt_move(const void *fdt, void *buf, int bufsize);
201 * @fdt: pointer to the device tree blob
205 * strings block of the device tree blob at fdt.
211 const char *fdt_string(const void *fdt, int stroffset);
215 * @fdt: pointer to the device tree blob
224 int fdt_num_mem_rsv(const void *fdt);
228 * @fdt: pointer to the device tree blob
241 int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size);
245 * @fdt: pointer to the device tree blob
255 int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
259 * @fdt: pointer to the device tree blob
280 int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name);
284 * @fdt: pointer to the device tree blob
304 int fdt_path_offset(const void *fdt, const char *path);
308 * @fdt: pointer to the device tree blob
327 const char *fdt_get_name(const void *fdt, int nodeoffset, int *lenp);
331 * @fdt: pointer to the device tree blob
347 int fdt_first_property_offset(const void *fdt, int nodeoffset);
351 * @fdt: pointer to the device tree blob
368 int fdt_next_property_offset(const void *fdt, int offset);
372 * @fdt: pointer to the device tree blob
394 const struct fdt_property *fdt_get_property_by_offset(const void *fdt,
400 * @fdt: pointer to the device tree blob
409 const struct fdt_property *fdt_get_property_namelen(const void *fdt,
416 * @fdt: pointer to the device tree blob
441 const struct fdt_property *fdt_get_property(const void *fdt, int nodeoffset,
443 static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset,
448 fdt_get_property(fdt, nodeoffset, name, lenp);
453 * @fdt: pointer to the device tree blob
482 const void *fdt_getprop_by_offset(const void *fdt, int offset,
487 * @fdt: pointer to the device tree blob
496 const void *fdt_getprop_namelen(const void *fdt, int nodeoffset,
501 * @fdt: pointer to the device tree blob
526 const void *fdt_getprop(const void *fdt, int nodeoffset,
528 static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
531 return (void *)(uintptr_t)fdt_getprop(fdt, nodeoffset, name, lenp);
536 * @fdt: pointer to the device tree blob
546 uint32_t fdt_get_phandle(const void *fdt, int nodeoffset);
550 * @fdt: pointer to the device tree blob
557 const char *fdt_get_alias_namelen(const void *fdt,
562 * @fdt: pointer to the device tree blob
572 const char *fdt_get_alias(const void *fdt, const char *name);
576 * @fdt: pointer to the device tree blob
599 int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen);
603 * @fdt: pointer to the device tree blob
611 * fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, NULL);
614 * fdt_supernode_atdepth_offset(fdt, nodeoffset, D, NULL);
631 int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
636 * @fdt: pointer to the device tree blob
653 int fdt_node_depth(const void *fdt, int nodeoffset);
657 * @fdt: pointer to the device tree blob
676 int fdt_parent_offset(const void *fdt, int nodeoffset);
680 * @fdt: pointer to the device tree blob
693 * offset = fdt_node_offset_by_prop_value(fdt, -1, propname,
697 * offset = fdt_node_offset_by_prop_value(fdt, offset, propname,
716 int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
722 * @fdt: pointer to the device tree blob
739 int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle);
743 * @fdt: pointer to the device tree blob
763 int fdt_node_check_compatible(const void *fdt, int nodeoffset,
768 * @fdt: pointer to the device tree blob
779 * offset = fdt_node_offset_by_compatible(fdt, -1, compatible);
782 * offset = fdt_node_offset_by_compatible(fdt, offset, compatible);
800 int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
809 * @fdt: pointer to the device tree blob
835 int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
840 * @fdt: pointer to the device tree blob
866 static inline int fdt_setprop_inplace_u32(void *fdt, int nodeoffset,
870 return fdt_setprop_inplace(fdt, nodeoffset, name, &tmp, sizeof(tmp));
875 * @fdt: pointer to the device tree blob
901 static inline int fdt_setprop_inplace_u64(void *fdt, int nodeoffset,
905 return fdt_setprop_inplace(fdt, nodeoffset, name, &tmp, sizeof(tmp));
913 static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset,
916 return fdt_setprop_inplace_u32(fdt, nodeoffset, name, val);
921 * @fdt: pointer to the device tree blob
943 int fdt_nop_property(void *fdt, int nodeoffset, const char *name);
947 * @fdt: pointer to the device tree blob
967 int fdt_nop_node(void *fdt, int nodeoffset);
974 int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size);
975 int fdt_finish_reservemap(void *fdt);
976 int fdt_begin_node(void *fdt, const char *name);
977 int fdt_property(void *fdt, const char *name, const void *val, int len);
978 static inline int fdt_property_u32(void *fdt, const char *name, uint32_t val)
981 return fdt_property(fdt, name, &tmp, sizeof(tmp));
983 static inline int fdt_property_u64(void *fdt, const char *name, uint64_t val)
986 return fdt_property(fdt, name, &tmp, sizeof(tmp));
988 static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val)
990 return fdt_property_u32(fdt, name, val);
992 #define fdt_property_string(fdt, name, str) \
993 fdt_property(fdt, name, str, strlen(str)+1)
994 int fdt_end_node(void *fdt);
995 int fdt_finish(void *fdt);
1002 int fdt_open_into(const void *fdt, void *buf, int bufsize);
1003 int fdt_pack(void *fdt);
1007 * @fdt: pointer to the device tree blob
1027 int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size);
1031 * @fdt: pointer to the device tree blob
1051 int fdt_del_mem_rsv(void *fdt, int n);
1055 * @fdt: pointer to the device tree blob
1077 int fdt_set_name(void *fdt, int nodeoffset, const char *name);
1081 * @fdt: pointer to the device tree blob
1107 int fdt_setprop(void *fdt, int nodeoffset, const char *name,
1112 * @fdt: pointer to the device tree blob
1138 static inline int fdt_setprop_u32(void *fdt, int nodeoffset, const char *name,
1142 return fdt_setprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
1147 * @fdt: pointer to the device tree blob
1173 static inline int fdt_setprop_u64(void *fdt, int nodeoffset, const char *name,
1177 return fdt_setprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
1185 static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
1188 return fdt_setprop_u32(fdt, nodeoffset, name, val);
1193 * @fdt: pointer to the device tree blob
1219 #define fdt_setprop_string(fdt, nodeoffset, name, str) \
1220 fdt_setprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
1224 * @fdt: pointer to the device tree blob
1249 int fdt_appendprop(void *fdt, int nodeoffset, const char *name,
1254 * @fdt: pointer to the device tree blob
1280 static inline int fdt_appendprop_u32(void *fdt, int nodeoffset,
1284 return fdt_appendprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
1289 * @fdt: pointer to the device tree blob
1315 static inline int fdt_appendprop_u64(void *fdt, int nodeoffset,
1319 return fdt_appendprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
1327 static inline int fdt_appendprop_cell(void *fdt, int nodeoffset,
1330 return fdt_appendprop_u32(fdt, nodeoffset, name, val);
1335 * @fdt: pointer to the device tree blob
1360 #define fdt_appendprop_string(fdt, nodeoffset, name, str) \
1361 fdt_appendprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
1365 * @fdt: pointer to the device tree blob
1385 int fdt_delprop(void *fdt, int nodeoffset, const char *name);
1389 * @fdt: pointer to the device tree blob
1399 int fdt_add_subnode_namelen(void *fdt, int parentoffset,
1404 * @fdt: pointer to the device tree blob
1431 int fdt_add_subnode(void *fdt, int parentoffset, const char *name);
1435 * @fdt: pointer to the device tree blob
1454 int fdt_del_node(void *fdt, int nodeoffset);