Lines Matching refs:fdto

28 static uint32_t overlay_get_target_phandle(const void *fdto, int fragment)  in overlay_get_target_phandle()  argument
33 val = fdt_getprop(fdto, fragment, "target", &len); in overlay_get_target_phandle()
43 int fdt_overlay_target_offset(const void *fdt, const void *fdto, in fdt_overlay_target_offset() argument
51 phandle = overlay_get_target_phandle(fdto, fragment_offset); in fdt_overlay_target_offset()
58 path = fdt_getprop(fdto, fragment_offset, "target-path", &path_len); in fdt_overlay_target_offset()
137 static int overlay_adjust_node_phandles(void *fdto, int node, in overlay_adjust_node_phandles() argument
143 ret = overlay_phandle_add_offset(fdto, node, "phandle", delta); in overlay_adjust_node_phandles()
147 ret = overlay_phandle_add_offset(fdto, node, "linux,phandle", delta); in overlay_adjust_node_phandles()
151 fdt_for_each_subnode(child, fdto, node) { in overlay_adjust_node_phandles()
152 ret = overlay_adjust_node_phandles(fdto, child, delta); in overlay_adjust_node_phandles()
174 static int overlay_adjust_local_phandles(void *fdto, uint32_t delta) in overlay_adjust_local_phandles() argument
179 return overlay_adjust_node_phandles(fdto, 0, delta); in overlay_adjust_local_phandles()
201 static int overlay_update_local_node_references(void *fdto, in overlay_update_local_node_references() argument
210 fdt_for_each_property_offset(fixup_prop, fdto, fixup_node) { in overlay_update_local_node_references()
218 fixup_val = fdt_getprop_by_offset(fdto, fixup_prop, in overlay_update_local_node_references()
227 tree_val = fdt_getprop_w(fdto, tree_node, name, &tree_len); in overlay_update_local_node_references()
248 fdt_for_each_subnode(fixup_child, fdto, fixup_node) { in overlay_update_local_node_references()
249 const char *fixup_child_name = fdt_get_name(fdto, fixup_child, in overlay_update_local_node_references()
253 tree_child = fdt_subnode_offset(fdto, tree_node, in overlay_update_local_node_references()
260 ret = overlay_update_local_node_references(fdto, in overlay_update_local_node_references()
288 static int overlay_update_local_references(void *fdto, uint32_t delta) in overlay_update_local_references() argument
292 fixups = fdt_path_offset(fdto, "/__local_fixups__"); in overlay_update_local_references()
304 return overlay_update_local_node_references(fdto, 0, fixups, in overlay_update_local_references()
331 static int overlay_fixup_one_phandle(void *fdt, void *fdto, in overlay_fixup_one_phandle() argument
343 fixup_off = fdt_path_offset_namelen(fdto, path, path_len); in overlay_fixup_one_phandle()
350 return fdt_setprop_inplace_namelen_partial(fdto, fixup_off, in overlay_fixup_one_phandle()
375 static int overlay_fixup_phandle(void *fdt, void *fdto, int symbols_off, in overlay_fixup_phandle() argument
386 value = fdt_getprop_by_offset(fdto, property, in overlay_fixup_phandle()
446 ret = overlay_fixup_one_phandle(fdt, fdto, symbols_off, in overlay_fixup_phandle()
473 static int overlay_fixup_phandles(void *fdt, void *fdto) in overlay_fixup_phandles() argument
479 fixups_off = fdt_path_offset(fdto, "/__fixups__"); in overlay_fixup_phandles()
490 fdt_for_each_property_offset(property, fdto, fixups_off) { in overlay_fixup_phandles()
493 ret = overlay_fixup_phandle(fdt, fdto, symbols_off, property); in overlay_fixup_phandles()
511 static int overlay_adjust_local_conflicting_phandle(void *fdto, int node, in overlay_adjust_local_conflicting_phandle() argument
517 php = fdt_getprop(fdto, node, "phandle", &len); in overlay_adjust_local_conflicting_phandle()
519 ret = fdt_setprop_inplace_u32(fdto, node, "phandle", fdt_phandle); in overlay_adjust_local_conflicting_phandle()
524 php = fdt_getprop(fdto, node, "linux,phandle", &len); in overlay_adjust_local_conflicting_phandle()
526 ret = fdt_setprop_inplace_u32(fdto, node, "linux,phandle", fdt_phandle); in overlay_adjust_local_conflicting_phandle()
548 static int overlay_update_node_conflicting_references(void *fdto, int tree_node, in overlay_update_node_conflicting_references() argument
557 fdt_for_each_property_offset(fixup_prop, fdto, fixup_node) { in overlay_update_node_conflicting_references()
565 fixup_val = fdt_getprop_by_offset(fdto, fixup_prop, in overlay_update_node_conflicting_references()
574 tree_val = fdt_getprop_w(fdto, tree_node, name, &tree_len); in overlay_update_node_conflicting_references()
594 fdt_for_each_subnode(fixup_child, fdto, fixup_node) { in overlay_update_node_conflicting_references()
595 const char *fixup_child_name = fdt_get_name(fdto, fixup_child, NULL); in overlay_update_node_conflicting_references()
598 tree_child = fdt_subnode_offset(fdto, tree_node, fixup_child_name); in overlay_update_node_conflicting_references()
605 ret = overlay_update_node_conflicting_references(fdto, tree_child, in overlay_update_node_conflicting_references()
628 static int overlay_update_local_conflicting_references(void *fdto, in overlay_update_local_conflicting_references() argument
634 fixups = fdt_path_offset(fdto, "/__local_fixups__"); in overlay_update_local_conflicting_references()
640 return overlay_update_node_conflicting_references(fdto, 0, fixups, in overlay_update_local_conflicting_references()
657 void *fdto, int fdtonode) in overlay_prevent_phandle_overwrite_node() argument
663 fdto_phandle = fdt_get_phandle(fdto, fdtonode); in overlay_prevent_phandle_overwrite_node()
668 ret = overlay_adjust_local_conflicting_phandle(fdto, fdtonode, in overlay_prevent_phandle_overwrite_node()
673 ret = overlay_update_local_conflicting_references(fdto, in overlay_prevent_phandle_overwrite_node()
680 fdt_for_each_subnode(fdtochild, fdto, fdtonode) { in overlay_prevent_phandle_overwrite_node()
681 const char *name = fdt_get_name(fdto, fdtochild, NULL); in overlay_prevent_phandle_overwrite_node()
694 fdto, fdtochild); in overlay_prevent_phandle_overwrite_node()
715 static int overlay_prevent_phandle_overwrite(void *fdt, void *fdto) in overlay_prevent_phandle_overwrite() argument
719 fdt_for_each_subnode(fragment, fdto, 0) { in overlay_prevent_phandle_overwrite()
724 overlay = fdt_subnode_offset(fdto, fragment, "__overlay__"); in overlay_prevent_phandle_overwrite()
731 target = fdt_overlay_target_offset(fdt, fdto, fragment, NULL); in overlay_prevent_phandle_overwrite()
742 fdto, overlay); in overlay_prevent_phandle_overwrite()
770 void *fdto, int node) in overlay_apply_node() argument
775 fdt_for_each_property_offset(property, fdto, node) { in overlay_apply_node()
781 prop = fdt_getprop_by_offset(fdto, property, &name, in overlay_apply_node()
793 fdt_for_each_subnode(subnode, fdto, node) { in overlay_apply_node()
794 const char *name = fdt_get_name(fdto, subnode, NULL); in overlay_apply_node()
808 ret = overlay_apply_node(fdt, nnode, fdto, subnode); in overlay_apply_node()
831 static int overlay_merge(void *fdt, void *fdto) in overlay_merge() argument
835 fdt_for_each_subnode(fragment, fdto, 0) { in overlay_merge()
844 overlay = fdt_subnode_offset(fdto, fragment, "__overlay__"); in overlay_merge()
851 target = fdt_overlay_target_offset(fdt, fdto, fragment, NULL); in overlay_merge()
855 ret = overlay_apply_node(fdt, target, fdto, overlay); in overlay_merge()
907 static int overlay_symbol_update(void *fdt, void *fdto) in overlay_symbol_update() argument
920 ov_sym = fdt_subnode_offset(fdto, 0, "__symbols__"); in overlay_symbol_update()
937 fdt_for_each_property_offset(prop, fdto, ov_sym) { in overlay_symbol_update()
938 path = fdt_getprop_by_offset(fdto, prop, &name, &path_len); in overlay_symbol_update()
981 ret = fdt_subnode_offset_namelen(fdto, 0, frag_name, in overlay_symbol_update()
989 ret = fdt_subnode_offset(fdto, fragment, "__overlay__"); in overlay_symbol_update()
994 ret = fdt_overlay_target_offset(fdt, fdto, fragment, &target_path); in overlay_symbol_update()
1016 ret = fdt_overlay_target_offset(fdt, fdto, fragment, &target_path); in overlay_symbol_update()
1042 int fdt_overlay_apply(void *fdt, void *fdto) in fdt_overlay_apply() argument
1048 FDT_RO_PROBE(fdto); in fdt_overlay_apply()
1055 ret = overlay_adjust_local_phandles(fdto, delta); in fdt_overlay_apply()
1060 ret = overlay_update_local_references(fdto, delta); in fdt_overlay_apply()
1065 ret = overlay_fixup_phandles(fdt, fdto); in fdt_overlay_apply()
1070 ret = overlay_prevent_phandle_overwrite(fdt, fdto); in fdt_overlay_apply()
1074 ret = overlay_merge(fdt, fdto); in fdt_overlay_apply()
1078 ret = overlay_symbol_update(fdt, fdto); in fdt_overlay_apply()
1085 fdt_set_magic(fdto, ~0); in fdt_overlay_apply()
1093 fdt_set_magic(fdto, ~0); in fdt_overlay_apply()