Lines Matching refs:fdto
73 static uint32_t overlay_get_target_phandle(const void *fdto, int fragment) in overlay_get_target_phandle() argument
78 val = fdt_getprop(fdto, fragment, "target", &len); in overlay_get_target_phandle()
103 static int overlay_get_target(const void *fdt, const void *fdto, in overlay_get_target() argument
111 phandle = overlay_get_target_phandle(fdto, fragment); in overlay_get_target()
118 path = fdt_getprop(fdto, fragment, "target-path", &path_len); in overlay_get_target()
201 static int overlay_adjust_node_phandles(void *fdto, int node, in overlay_adjust_node_phandles() argument
207 ret = overlay_phandle_add_offset(fdto, node, "phandle", delta); in overlay_adjust_node_phandles()
211 ret = overlay_phandle_add_offset(fdto, node, "linux,phandle", delta); in overlay_adjust_node_phandles()
215 fdt_for_each_subnode(child, fdto, node) { in overlay_adjust_node_phandles()
216 ret = overlay_adjust_node_phandles(fdto, child, delta); in overlay_adjust_node_phandles()
238 static int overlay_adjust_local_phandles(void *fdto, uint32_t delta) in overlay_adjust_local_phandles() argument
243 return overlay_adjust_node_phandles(fdto, 0, delta); in overlay_adjust_local_phandles()
265 static int overlay_update_local_node_references(void *fdto, in overlay_update_local_node_references() argument
274 fdt_for_each_property_offset(fixup_prop, fdto, fixup_node) { in overlay_update_local_node_references()
282 fixup_val = fdt_getprop_by_offset(fdto, fixup_prop, in overlay_update_local_node_references()
290 tree_val = fdt_getprop(fdto, tree_node, name, &tree_len); in overlay_update_local_node_references()
314 ret = fdt_setprop_inplace_namelen_partial(fdto, in overlay_update_local_node_references()
329 fdt_for_each_subnode(fixup_child, fdto, fixup_node) { in overlay_update_local_node_references()
330 const char *fixup_child_name = fdt_get_name(fdto, fixup_child, in overlay_update_local_node_references()
334 tree_child = fdt_subnode_offset(fdto, tree_node, in overlay_update_local_node_references()
341 ret = overlay_update_local_node_references(fdto, in overlay_update_local_node_references()
369 static int overlay_update_local_references(void *fdto, uint32_t delta) in overlay_update_local_references() argument
373 fixups = fdt_path_offset(fdto, "/__local_fixups__"); in overlay_update_local_references()
385 return overlay_update_local_node_references(fdto, 0, fixups, in overlay_update_local_references()
412 static int overlay_fixup_one_phandle(void *fdt, void *fdto, in overlay_fixup_one_phandle() argument
440 fixup_off = fdt_path_offset_namelen(fdto, path, path_len); in overlay_fixup_one_phandle()
447 return fdt_setprop_inplace_namelen_partial(fdto, fixup_off, in overlay_fixup_one_phandle()
472 static int overlay_fixup_phandle(void *fdt, void *fdto, int symbols_off, in overlay_fixup_phandle() argument
479 value = fdt_getprop_by_offset(fdto, property, in overlay_fixup_phandle()
527 ret = overlay_fixup_one_phandle(fdt, fdto, symbols_off, in overlay_fixup_phandle()
554 static int overlay_fixup_phandles(void *fdt, void *fdto) in overlay_fixup_phandles() argument
560 fixups_off = fdt_path_offset(fdto, "/__fixups__"); in overlay_fixup_phandles()
571 fdt_for_each_property_offset(property, fdto, fixups_off) { in overlay_fixup_phandles()
574 ret = overlay_fixup_phandle(fdt, fdto, symbols_off, property); in overlay_fixup_phandles()
602 void *fdto, int node) in overlay_apply_node() argument
607 fdt_for_each_property_offset(property, fdto, node) { in overlay_apply_node()
613 prop = fdt_getprop_by_offset(fdto, property, &name, in overlay_apply_node()
625 fdt_for_each_subnode(subnode, fdto, node) { in overlay_apply_node()
626 const char *name = fdt_get_name(fdto, subnode, NULL); in overlay_apply_node()
640 ret = overlay_apply_node(fdt, nnode, fdto, subnode); in overlay_apply_node()
663 static int overlay_merge(void *fdt, void *fdto) in overlay_merge() argument
667 fdt_for_each_subnode(fragment, fdto, 0) { in overlay_merge()
676 overlay = fdt_subnode_offset(fdto, fragment, "__overlay__"); in overlay_merge()
683 target = overlay_get_target(fdt, fdto, fragment, NULL); in overlay_merge()
687 ret = overlay_apply_node(fdt, target, fdto, overlay); in overlay_merge()
739 static int overlay_symbol_update(void *fdt, void *fdto) in overlay_symbol_update() argument
752 ov_sym = fdt_subnode_offset(fdto, 0, "__symbols__"); in overlay_symbol_update()
769 fdt_for_each_property_offset(prop, fdto, ov_sym) { in overlay_symbol_update()
770 path = fdt_getprop_by_offset(fdto, prop, &name, &path_len); in overlay_symbol_update()
803 ret = fdt_subnode_offset_namelen(fdto, 0, frag_name, in overlay_symbol_update()
811 ret = fdt_subnode_offset(fdto, fragment, "__overlay__"); in overlay_symbol_update()
816 ret = overlay_get_target(fdt, fdto, fragment, &target_path); in overlay_symbol_update()
838 ret = overlay_get_target(fdt, fdto, fragment, &target_path); in overlay_symbol_update()
864 int fdt_overlay_apply(void *fdt, void *fdto) in fdt_overlay_apply() argument
870 FDT_CHECK_HEADER(fdto); in fdt_overlay_apply()
872 ret = overlay_adjust_local_phandles(fdto, delta); in fdt_overlay_apply()
876 ret = overlay_update_local_references(fdto, delta); in fdt_overlay_apply()
880 ret = overlay_fixup_phandles(fdt, fdto); in fdt_overlay_apply()
884 ret = overlay_merge(fdt, fdto); in fdt_overlay_apply()
888 ret = overlay_symbol_update(fdt, fdto); in fdt_overlay_apply()
895 fdt_set_magic(fdto, ~0); in fdt_overlay_apply()
903 fdt_set_magic(fdto, ~0); in fdt_overlay_apply()