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()
141 static int overlay_adjust_node_phandles(void *fdto, int node, in overlay_adjust_node_phandles() argument
147 ret = overlay_phandle_add_offset(fdto, node, "phandle", delta); in overlay_adjust_node_phandles()
151 ret = overlay_phandle_add_offset(fdto, node, "linux,phandle", delta); in overlay_adjust_node_phandles()
155 fdt_for_each_subnode(child, fdto, node) { in overlay_adjust_node_phandles()
156 ret = overlay_adjust_node_phandles(fdto, child, delta); in overlay_adjust_node_phandles()
178 static int overlay_adjust_local_phandles(void *fdto, uint32_t delta) in overlay_adjust_local_phandles() argument
183 return overlay_adjust_node_phandles(fdto, 0, delta); in overlay_adjust_local_phandles()
205 static int overlay_update_local_node_references(void *fdto, in overlay_update_local_node_references() argument
214 fdt_for_each_property_offset(fixup_prop, fdto, fixup_node) { in overlay_update_local_node_references()
222 fixup_val = fdt_getprop_by_offset(fdto, fixup_prop, in overlay_update_local_node_references()
231 tree_val = fdt_getprop(fdto, tree_node, name, &tree_len); in overlay_update_local_node_references()
255 ret = fdt_setprop_inplace_namelen_partial(fdto, in overlay_update_local_node_references()
270 fdt_for_each_subnode(fixup_child, fdto, fixup_node) { in overlay_update_local_node_references()
271 const char *fixup_child_name = fdt_get_name(fdto, fixup_child, in overlay_update_local_node_references()
275 tree_child = fdt_subnode_offset(fdto, tree_node, in overlay_update_local_node_references()
282 ret = overlay_update_local_node_references(fdto, in overlay_update_local_node_references()
310 static int overlay_update_local_references(void *fdto, uint32_t delta) in overlay_update_local_references() argument
314 fixups = fdt_path_offset(fdto, "/__local_fixups__"); in overlay_update_local_references()
326 return overlay_update_local_node_references(fdto, 0, fixups, in overlay_update_local_references()
353 static int overlay_fixup_one_phandle(void *fdt, void *fdto, in overlay_fixup_one_phandle() argument
381 fixup_off = fdt_path_offset_namelen(fdto, path, path_len); in overlay_fixup_one_phandle()
388 return fdt_setprop_inplace_namelen_partial(fdto, fixup_off, in overlay_fixup_one_phandle()
413 static int overlay_fixup_phandle(void *fdt, void *fdto, int symbols_off, in overlay_fixup_phandle() argument
420 value = fdt_getprop_by_offset(fdto, property, in overlay_fixup_phandle()
468 ret = overlay_fixup_one_phandle(fdt, fdto, symbols_off, in overlay_fixup_phandle()
495 static int overlay_fixup_phandles(void *fdt, void *fdto) in overlay_fixup_phandles() argument
501 fixups_off = fdt_path_offset(fdto, "/__fixups__"); in overlay_fixup_phandles()
512 fdt_for_each_property_offset(property, fdto, fixups_off) { in overlay_fixup_phandles()
515 ret = overlay_fixup_phandle(fdt, fdto, symbols_off, property); in overlay_fixup_phandles()
543 void *fdto, int node) in overlay_apply_node() argument
548 fdt_for_each_property_offset(property, fdto, node) { in overlay_apply_node()
554 prop = fdt_getprop_by_offset(fdto, property, &name, in overlay_apply_node()
566 fdt_for_each_subnode(subnode, fdto, node) { in overlay_apply_node()
567 const char *name = fdt_get_name(fdto, subnode, NULL); in overlay_apply_node()
581 ret = overlay_apply_node(fdt, nnode, fdto, subnode); in overlay_apply_node()
604 static int overlay_merge(void *fdt, void *fdto) in overlay_merge() argument
608 fdt_for_each_subnode(fragment, fdto, 0) { in overlay_merge()
617 overlay = fdt_subnode_offset(fdto, fragment, "__overlay__"); in overlay_merge()
624 target = fdt_overlay_target_offset(fdt, fdto, fragment, NULL); in overlay_merge()
628 ret = overlay_apply_node(fdt, target, fdto, overlay); in overlay_merge()
680 static int overlay_symbol_update(void *fdt, void *fdto) in overlay_symbol_update() argument
693 ov_sym = fdt_subnode_offset(fdto, 0, "__symbols__"); in overlay_symbol_update()
710 fdt_for_each_property_offset(prop, fdto, ov_sym) { in overlay_symbol_update()
711 path = fdt_getprop_by_offset(fdto, prop, &name, &path_len); in overlay_symbol_update()
754 ret = fdt_subnode_offset_namelen(fdto, 0, frag_name, in overlay_symbol_update()
762 ret = fdt_subnode_offset(fdto, fragment, "__overlay__"); in overlay_symbol_update()
767 ret = fdt_overlay_target_offset(fdt, fdto, fragment, &target_path); in overlay_symbol_update()
789 ret = fdt_overlay_target_offset(fdt, fdto, fragment, &target_path); in overlay_symbol_update()
815 int fdt_overlay_apply(void *fdt, void *fdto) in fdt_overlay_apply() argument
821 FDT_RO_PROBE(fdto); in fdt_overlay_apply()
827 ret = overlay_adjust_local_phandles(fdto, delta); in fdt_overlay_apply()
831 ret = overlay_update_local_references(fdto, delta); in fdt_overlay_apply()
835 ret = overlay_fixup_phandles(fdt, fdto); in fdt_overlay_apply()
839 ret = overlay_merge(fdt, fdto); in fdt_overlay_apply()
843 ret = overlay_symbol_update(fdt, fdto); in fdt_overlay_apply()
850 fdt_set_magic(fdto, ~0); in fdt_overlay_apply()
858 fdt_set_magic(fdto, ~0); in fdt_overlay_apply()