Lines Matching refs:fdt

54 #include <fdt.h>
90 * @fdt: Base device tree blob
103 static int overlay_get_target(const void *fdt, const void *fdto,
120 ret = fdt_path_offset(fdt, path);
124 ret = fdt_node_offset_by_phandle(fdt, phandle);
149 * @fdt: Base device tree blob
161 static int overlay_phandle_add_offset(void *fdt, int node,
168 val = fdt_getprop(fdt, node, name, &len);
183 return fdt_setprop_inplace_u32(fdt, node, name, adj_val);
391 * @fdt: Base Device Tree blob
412 static int overlay_fixup_one_phandle(void *fdt, void *fdto,
427 symbol_path = fdt_getprop(fdt, symbols_off, label,
432 symbol_off = fdt_path_offset(fdt, symbol_path);
436 phandle = fdt_get_phandle(fdt, symbol_off);
455 * @fdt: Base Device Tree blob
472 static int overlay_fixup_phandle(void *fdt, void *fdto, int symbols_off,
527 ret = overlay_fixup_one_phandle(fdt, fdto, symbols_off,
540 * @fdt: Base Device Tree blob
554 static int overlay_fixup_phandles(void *fdt, void *fdto)
567 symbols_off = fdt_path_offset(fdt, "/__symbols__");
574 ret = overlay_fixup_phandle(fdt, fdto, symbols_off, property);
584 * @fdt: Base Device Tree blob
601 static int overlay_apply_node(void *fdt, int target,
620 ret = fdt_setprop(fdt, target, name, prop, prop_len);
630 nnode = fdt_add_subnode(fdt, target, name);
632 nnode = fdt_subnode_offset(fdt, target, name);
640 ret = overlay_apply_node(fdt, nnode, fdto, subnode);
650 * @fdt: Base Device Tree blob
663 static int overlay_merge(void *fdt, void *fdto)
683 target = overlay_get_target(fdt, fdto, fragment, NULL);
687 ret = overlay_apply_node(fdt, target, fdto, overlay);
695 static int get_path_len(const void *fdt, int nodeoffset)
700 FDT_RO_PROBE(fdt);
703 name = fdt_get_name(fdt, nodeoffset, &namelen);
711 nodeoffset = fdt_parent_offset(fdt, nodeoffset);
725 * @fdt: Base Device Tree blob
739 static int overlay_symbol_update(void *fdt, void *fdto)
758 root_sym = fdt_subnode_offset(fdt, 0, "__symbols__");
762 root_sym = fdt_add_subnode(fdt, 0, "__symbols__");
816 ret = overlay_get_target(fdt, fdto, fragment, &target_path);
823 ret = get_path_len(fdt, target);
831 ret = fdt_setprop_placeholder(fdt, root_sym, name,
838 ret = overlay_get_target(fdt, fdto, fragment, &target_path);
847 ret = fdt_get_path(fdt, target, buf, len + 1);
864 int fdt_overlay_apply(void *fdt, void *fdto)
866 uint32_t delta = fdt_get_max_phandle(fdt);
869 FDT_RO_PROBE(fdt);
880 ret = overlay_fixup_phandles(fdt, fdto);
884 ret = overlay_merge(fdt, fdto);
888 ret = overlay_symbol_update(fdt, fdto);
909 fdt_set_magic(fdt, ~0);