Lines Matching +full:device +full:- +full:tree
2 * libfdt - Flat Device Tree manipulation
22 * MA 02110-1301 USA
60 * overlay_get_target_phandle - retrieves the target phandle of a fragment
61 * @fdto: pointer to the device tree overlay blob
66 * property) instead of a path (target-path property).
71 * -1, if the phandle was malformed
82 if ((len != sizeof(*val)) || (fdt32_to_cpu(*val) == (uint32_t)-1)) in overlay_get_target_phandle()
83 return (uint32_t)-1; in overlay_get_target_phandle()
89 * overlay_get_target - retrieves the offset of a fragment's target
90 * @fdt: Base device tree blob
91 * @fdto: Device tree overlay blob
96 * device tree of a fragment, no matter how the actual targetting is
100 * the targetted node offset in the base device tree
112 if (phandle == (uint32_t)-1) in overlay_get_target()
113 return -FDT_ERR_BADPHANDLE; in overlay_get_target()
118 path = fdt_getprop(fdto, fragment, "target-path", &path_len); in overlay_get_target()
128 * target-path property in a node that contains a in overlay_get_target()
133 if (ret < 0 && path_len == -FDT_ERR_NOTFOUND) in overlay_get_target()
134 ret = -FDT_ERR_BADOVERLAY; in overlay_get_target()
148 * overlay_phandle_add_offset - Increases a phandle by an offset
149 * @fdt: Base device tree blob
150 * @node: Device tree overlay blob
173 return -FDT_ERR_BADPHANDLE; in overlay_phandle_add_offset()
177 return -FDT_ERR_NOPHANDLES; in overlay_phandle_add_offset()
180 if (adj_val == (uint32_t)-1) in overlay_phandle_add_offset()
181 return -FDT_ERR_NOPHANDLES; in overlay_phandle_add_offset()
187 * overlay_adjust_node_phandles - Offsets the phandles of a node
188 * @fdto: Device tree overlay blob
195 * phandles to not conflict with the overlays of the base device tree.
208 if (ret && ret != -FDT_ERR_NOTFOUND) in overlay_adjust_node_phandles()
212 if (ret && ret != -FDT_ERR_NOTFOUND) in overlay_adjust_node_phandles()
225 * overlay_adjust_local_phandles - Adjust the phandles of a whole overlay
226 * @fdto: Device tree overlay blob
232 * phandles to not conflict with the overlays of the base device tree.
247 * overlay_update_local_node_references - Adjust the overlay references
248 * @fdto: Device tree overlay blob
254 * pointing to a node within the device tree overlay by adding a
257 * This is mainly used as part of a device tree application process,
258 * where you want the device tree overlays phandles to not conflict
259 * with the ones from the base device tree before merging them.
288 return -FDT_ERR_BADOVERLAY; in overlay_update_local_node_references()
292 if (tree_len == -FDT_ERR_NOTFOUND) in overlay_update_local_node_references()
293 return -FDT_ERR_BADOVERLAY; in overlay_update_local_node_references()
321 if (ret == -FDT_ERR_NOSPACE) in overlay_update_local_node_references()
322 return -FDT_ERR_BADOVERLAY; in overlay_update_local_node_references()
336 if (tree_child == -FDT_ERR_NOTFOUND) in overlay_update_local_node_references()
337 return -FDT_ERR_BADOVERLAY; in overlay_update_local_node_references()
353 * overlay_update_local_references - Adjust the overlay references
354 * @fdto: Device tree overlay blob
358 * to a node within the device tree overlay by adding a constant
361 * This is mainly used as part of a device tree application process,
362 * where you want the device tree overlays phandles to not conflict
363 * with the ones from the base device tree before merging them.
376 if (fixups == -FDT_ERR_NOTFOUND) in overlay_update_local_references()
383 * Update our local references from the root of the tree in overlay_update_local_references()
390 * overlay_fixup_one_phandle - Set an overlay phandle to the base one
391 * @fdt: Base Device Tree blob
392 * @fdto: Device tree overlay blob
393 * @symbols_off: Node offset of the symbols node in the base device tree
402 * a node in the base device tree.
404 * This is part of the device tree overlay application process, when
438 return -FDT_ERR_NOTFOUND; in overlay_fixup_one_phandle()
441 if (fixup_off == -FDT_ERR_NOTFOUND) in overlay_fixup_one_phandle()
442 return -FDT_ERR_BADOVERLAY; in overlay_fixup_one_phandle()
454 * overlay_fixup_phandle - Set an overlay phandle to the base one
455 * @fdt: Base Device Tree blob
456 * @fdto: Device tree overlay blob
457 * @symbols_off: Node offset of the symbols node in the base device tree
462 * in use in the base device tree.
464 * This is part of the device tree overlay application process, when
482 if (len == -FDT_ERR_NOTFOUND) in overlay_fixup_phandle()
483 return -FDT_ERR_INTERNAL; in overlay_fixup_phandle()
498 return -FDT_ERR_BADOVERLAY; in overlay_fixup_phandle()
499 fixup_len = fixup_end - fixup_str; in overlay_fixup_phandle()
501 len -= fixup_len + 1; in overlay_fixup_phandle()
507 return -FDT_ERR_BADOVERLAY; in overlay_fixup_phandle()
509 path_len = sep - path; in overlay_fixup_phandle()
510 if (path_len == (fixup_len - 1)) in overlay_fixup_phandle()
511 return -FDT_ERR_BADOVERLAY; in overlay_fixup_phandle()
513 fixup_len -= path_len + 1; in overlay_fixup_phandle()
517 return -FDT_ERR_BADOVERLAY; in overlay_fixup_phandle()
519 name_len = sep - name; in overlay_fixup_phandle()
521 return -FDT_ERR_BADOVERLAY; in overlay_fixup_phandle()
525 return -FDT_ERR_BADOVERLAY; in overlay_fixup_phandle()
538 * overlay_fixup_phandles - Resolve the overlay phandles to the base
539 * device tree
540 * @fdt: Base Device Tree blob
541 * @fdto: Device tree overlay blob
544 * to nodes in the base device tree.
546 * This is one of the steps of the device tree overlay application
561 if (fixups_off == -FDT_ERR_NOTFOUND) in overlay_fixup_phandles()
568 if ((symbols_off < 0 && (symbols_off != -FDT_ERR_NOTFOUND))) in overlay_fixup_phandles()
583 * overlay_apply_node - Merges a node into the base device tree
584 * @fdt: Base Device Tree blob
585 * @target: Node offset in the base device tree to apply the fragment to
586 * @fdto: Device tree overlay blob
589 * overlay_apply_node() merges a node into a target base device tree
592 * This is part of the final step in the device tree overlay
594 * resolved and you just have to merge overlay into the base device
595 * tree.
615 if (prop_len == -FDT_ERR_NOTFOUND) in overlay_apply_node()
616 return -FDT_ERR_INTERNAL; in overlay_apply_node()
631 if (nnode == -FDT_ERR_EXISTS) { in overlay_apply_node()
633 if (nnode == -FDT_ERR_NOTFOUND) in overlay_apply_node()
634 return -FDT_ERR_INTERNAL; in overlay_apply_node()
649 * overlay_merge - Merge an overlay into its base device tree
650 * @fdt: Base Device Tree blob
651 * @fdto: Device tree overlay blob
653 * overlay_merge() merges an overlay into its base device tree.
655 * This is the next to last step in the device tree overlay application
657 * you just have to merge overlay into the base device tree.
677 if (overlay == -FDT_ERR_NOTFOUND) in overlay_merge()
724 * overlay_symbol_update - Update the symbols of base tree after a merge
725 * @fdt: Base Device Tree blob
726 * @fdto: Device tree overlay blob
728 * overlay_symbol_update() updates the symbols of the base tree with the
731 * This is the last step in the device tree overlay application
761 if (root_sym == -FDT_ERR_NOTFOUND) in overlay_symbol_update()
775 if (path_len < 1 || memchr(path, '\0', path_len) != &path[path_len - 1]) in overlay_symbol_update()
776 return -FDT_ERR_BADVALUE; in overlay_symbol_update()
781 /* format: /<fragment-name>/__overlay__/<relative-subnode-path> */ in overlay_symbol_update()
784 return -FDT_ERR_BADVALUE; in overlay_symbol_update()
789 return -FDT_ERR_BADOVERLAY; in overlay_symbol_update()
792 frag_name_len = s - path - 1; in overlay_symbol_update()
795 len = sizeof("/__overlay__/") - 1; in overlay_symbol_update()
796 if ((e - s) < len || memcmp(s, "/__overlay__/", len)) in overlay_symbol_update()
797 return -FDT_ERR_BADOVERLAY; in overlay_symbol_update()
800 rel_path_len = e - rel_path; in overlay_symbol_update()
807 return -FDT_ERR_BADOVERLAY; in overlay_symbol_update()
813 return -FDT_ERR_BADOVERLAY; in overlay_symbol_update()
854 len--; in overlay_symbol_update()
906 * The base device tree might have been damaged, erase its in fdt_overlay_apply()