Lines Matching +full:device +full:- +full:tree
9 * overlay_get_target_phandle - retrieves the target phandle of a fragment
10 * @fdto: pointer to the device tree overlay blob
15 * property) instead of a path (target-path property).
20 * -1, if the phandle was malformed
31 if ((len != sizeof(*val)) || (fdt32_to_cpu(*val) == (uint32_t)-1)) in overlay_get_target_phandle()
32 return (uint32_t)-1; in overlay_get_target_phandle()
38 * overlay_get_target - retrieves the offset of a fragment's target
39 * @fdt: Base device tree blob
40 * @fdto: Device tree overlay blob
45 * device tree of a fragment, no matter how the actual targetting is
49 * the targetted node offset in the base device tree
61 if (phandle == (uint32_t)-1) in overlay_get_target()
62 return -FDT_ERR_BADPHANDLE; in overlay_get_target()
67 path = fdt_getprop(fdto, fragment, "target-path", &path_len); in overlay_get_target()
77 * target-path property in a node that contains a in overlay_get_target()
82 if (ret < 0 && path_len == -FDT_ERR_NOTFOUND) in overlay_get_target()
83 ret = -FDT_ERR_BADOVERLAY; in overlay_get_target()
97 * overlay_phandle_add_offset - Increases a phandle by an offset
98 * @fdt: Base device tree blob
99 * @node: Device tree overlay blob
122 return -FDT_ERR_BADPHANDLE; in overlay_phandle_add_offset()
126 return -FDT_ERR_NOPHANDLES; in overlay_phandle_add_offset()
129 if (adj_val == (uint32_t)-1) in overlay_phandle_add_offset()
130 return -FDT_ERR_NOPHANDLES; in overlay_phandle_add_offset()
136 * overlay_adjust_node_phandles - Offsets the phandles of a node
137 * @fdto: Device tree overlay blob
144 * phandles to not conflict with the overlays of the base device tree.
157 if (ret && ret != -FDT_ERR_NOTFOUND) in overlay_adjust_node_phandles()
161 if (ret && ret != -FDT_ERR_NOTFOUND) in overlay_adjust_node_phandles()
174 * overlay_adjust_local_phandles - Adjust the phandles of a whole overlay
175 * @fdto: Device tree overlay blob
181 * phandles to not conflict with the overlays of the base device tree.
196 * overlay_update_local_node_references - Adjust the overlay references
197 * @fdto: Device tree overlay blob
203 * pointing to a node within the device tree overlay by adding a
206 * This is mainly used as part of a device tree application process,
207 * where you want the device tree overlays phandles to not conflict
208 * with the ones from the base device tree before merging them.
237 return -FDT_ERR_BADOVERLAY; in overlay_update_local_node_references()
241 if (tree_len == -FDT_ERR_NOTFOUND) in overlay_update_local_node_references()
242 return -FDT_ERR_BADOVERLAY; in overlay_update_local_node_references()
270 if (ret == -FDT_ERR_NOSPACE) in overlay_update_local_node_references()
271 return -FDT_ERR_BADOVERLAY; in overlay_update_local_node_references()
285 if (tree_child == -FDT_ERR_NOTFOUND) in overlay_update_local_node_references()
286 return -FDT_ERR_BADOVERLAY; in overlay_update_local_node_references()
302 * overlay_update_local_references - Adjust the overlay references
303 * @fdto: Device tree overlay blob
307 * to a node within the device tree overlay by adding a constant
310 * This is mainly used as part of a device tree application process,
311 * where you want the device tree overlays phandles to not conflict
312 * with the ones from the base device tree before merging them.
325 if (fixups == -FDT_ERR_NOTFOUND) in overlay_update_local_references()
332 * Update our local references from the root of the tree in overlay_update_local_references()
339 * overlay_fixup_one_phandle - Set an overlay phandle to the base one
340 * @fdt: Base Device Tree blob
341 * @fdto: Device tree overlay blob
342 * @symbols_off: Node offset of the symbols node in the base device tree
351 * a node in the base device tree.
353 * This is part of the device tree overlay application process, when
387 return -FDT_ERR_NOTFOUND; in overlay_fixup_one_phandle()
390 if (fixup_off == -FDT_ERR_NOTFOUND) in overlay_fixup_one_phandle()
391 return -FDT_ERR_BADOVERLAY; in overlay_fixup_one_phandle()
403 * overlay_fixup_phandle - Set an overlay phandle to the base one
404 * @fdt: Base Device Tree blob
405 * @fdto: Device tree overlay blob
406 * @symbols_off: Node offset of the symbols node in the base device tree
411 * in use in the base device tree.
413 * This is part of the device tree overlay application process, when
431 if (len == -FDT_ERR_NOTFOUND) in overlay_fixup_phandle()
432 return -FDT_ERR_INTERNAL; in overlay_fixup_phandle()
447 return -FDT_ERR_BADOVERLAY; in overlay_fixup_phandle()
448 fixup_len = fixup_end - fixup_str; in overlay_fixup_phandle()
450 len -= fixup_len + 1; in overlay_fixup_phandle()
456 return -FDT_ERR_BADOVERLAY; in overlay_fixup_phandle()
458 path_len = sep - path; in overlay_fixup_phandle()
459 if (path_len == (fixup_len - 1)) in overlay_fixup_phandle()
460 return -FDT_ERR_BADOVERLAY; in overlay_fixup_phandle()
462 fixup_len -= path_len + 1; in overlay_fixup_phandle()
466 return -FDT_ERR_BADOVERLAY; in overlay_fixup_phandle()
468 name_len = sep - name; in overlay_fixup_phandle()
470 return -FDT_ERR_BADOVERLAY; in overlay_fixup_phandle()
474 return -FDT_ERR_BADOVERLAY; in overlay_fixup_phandle()
487 * overlay_fixup_phandles - Resolve the overlay phandles to the base
488 * device tree
489 * @fdt: Base Device Tree blob
490 * @fdto: Device tree overlay blob
493 * to nodes in the base device tree.
495 * This is one of the steps of the device tree overlay application
510 if (fixups_off == -FDT_ERR_NOTFOUND) in overlay_fixup_phandles()
517 if ((symbols_off < 0 && (symbols_off != -FDT_ERR_NOTFOUND))) in overlay_fixup_phandles()
532 * overlay_apply_node - Merges a node into the base device tree
533 * @fdt: Base Device Tree blob
534 * @target: Node offset in the base device tree to apply the fragment to
535 * @fdto: Device tree overlay blob
538 * overlay_apply_node() merges a node into a target base device tree
541 * This is part of the final step in the device tree overlay
543 * resolved and you just have to merge overlay into the base device
544 * tree.
564 if (prop_len == -FDT_ERR_NOTFOUND) in overlay_apply_node()
565 return -FDT_ERR_INTERNAL; in overlay_apply_node()
580 if (nnode == -FDT_ERR_EXISTS) { in overlay_apply_node()
582 if (nnode == -FDT_ERR_NOTFOUND) in overlay_apply_node()
583 return -FDT_ERR_INTERNAL; in overlay_apply_node()
598 * overlay_merge - Merge an overlay into its base device tree
599 * @fdt: Base Device Tree blob
600 * @fdto: Device tree overlay blob
602 * overlay_merge() merges an overlay into its base device tree.
604 * This is the next to last step in the device tree overlay application
606 * you just have to merge overlay into the base device tree.
626 if (overlay == -FDT_ERR_NOTFOUND) in overlay_merge()
673 * overlay_symbol_update - Update the symbols of base tree after a merge
674 * @fdt: Base Device Tree blob
675 * @fdto: Device tree overlay blob
677 * overlay_symbol_update() updates the symbols of the base tree with the
680 * This is the last step in the device tree overlay application
710 if (root_sym == -FDT_ERR_NOTFOUND) in overlay_symbol_update()
724 if (path_len < 1 || memchr(path, '\0', path_len) != &path[path_len - 1]) in overlay_symbol_update()
725 return -FDT_ERR_BADVALUE; in overlay_symbol_update()
730 /* format: /<fragment-name>/__overlay__/<relative-subnode-path> */ in overlay_symbol_update()
733 return -FDT_ERR_BADVALUE; in overlay_symbol_update()
738 return -FDT_ERR_BADOVERLAY; in overlay_symbol_update()
741 frag_name_len = s - path - 1; in overlay_symbol_update()
744 len = sizeof("/__overlay__/") - 1; in overlay_symbol_update()
745 if ((e - s) < len || memcmp(s, "/__overlay__/", len)) in overlay_symbol_update()
746 return -FDT_ERR_BADOVERLAY; in overlay_symbol_update()
749 rel_path_len = e - rel_path; in overlay_symbol_update()
756 return -FDT_ERR_BADOVERLAY; in overlay_symbol_update()
762 return -FDT_ERR_BADOVERLAY; in overlay_symbol_update()
803 len--; in overlay_symbol_update()
855 * The base device tree might have been damaged, erase its in fdt_overlay_apply()