Lines Matching defs:fdt

11 #include <fdt.h>
47 * @fdt: Base device tree blob
60 static int overlay_get_target(const void *fdt, const void *fdto,
77 ret = fdt_path_offset(fdt, path);
81 ret = fdt_node_offset_by_phandle(fdt, phandle);
106 * @fdt: Base device tree blob
118 static int overlay_phandle_add_offset(void *fdt, int node,
125 val = fdt_getprop(fdt, node, name, &len);
140 return fdt_setprop_inplace_u32(fdt, node, name, adj_val);
348 * @fdt: Base Device Tree blob
369 static int overlay_fixup_one_phandle(void *fdt, void *fdto,
384 symbol_path = fdt_getprop(fdt, symbols_off, label,
389 symbol_off = fdt_path_offset(fdt, symbol_path);
393 phandle = fdt_get_phandle(fdt, symbol_off);
412 * @fdt: Base Device Tree blob
429 static int overlay_fixup_phandle(void *fdt, void *fdto, int symbols_off,
484 ret = overlay_fixup_one_phandle(fdt, fdto, symbols_off,
497 * @fdt: Base Device Tree blob
511 static int overlay_fixup_phandles(void *fdt, void *fdto)
524 symbols_off = fdt_path_offset(fdt, "/__symbols__");
531 ret = overlay_fixup_phandle(fdt, fdto, symbols_off, property);
541 * @fdt: Base Device Tree blob
558 static int overlay_apply_node(void *fdt, int target,
577 ret = fdt_setprop(fdt, target, name, prop, prop_len);
587 nnode = fdt_add_subnode(fdt, target, name);
589 nnode = fdt_subnode_offset(fdt, target, name);
597 ret = overlay_apply_node(fdt, nnode, fdto, subnode);
607 * @fdt: Base Device Tree blob
620 static int overlay_merge(void *fdt, void *fdto)
640 target = overlay_get_target(fdt, fdto, fragment, NULL);
644 ret = overlay_apply_node(fdt, target, fdto, overlay);
652 static int get_path_len(const void *fdt, int nodeoffset)
657 FDT_RO_PROBE(fdt);
660 name = fdt_get_name(fdt, nodeoffset, &namelen);
668 nodeoffset = fdt_parent_offset(fdt, nodeoffset);
682 * @fdt: Base Device Tree blob
696 static int overlay_symbol_update(void *fdt, void *fdto)
715 root_sym = fdt_subnode_offset(fdt, 0, "__symbols__");
719 root_sym = fdt_add_subnode(fdt, 0, "__symbols__");
783 ret = overlay_get_target(fdt, fdto, fragment, &target_path);
790 ret = get_path_len(fdt, target);
798 ret = fdt_setprop_placeholder(fdt, root_sym, name,
805 ret = overlay_get_target(fdt, fdto, fragment, &target_path);
814 ret = fdt_get_path(fdt, target, buf, len + 1);
831 int fdt_overlay_apply(void *fdt, void *fdto)
836 FDT_RO_PROBE(fdt);
839 ret = fdt_find_max_phandle(fdt, &delta);
851 ret = overlay_fixup_phandles(fdt, fdto);
855 ret = overlay_merge(fdt, fdto);
859 ret = overlay_symbol_update(fdt, fdto);
880 fdt_set_magic(fdt, ~0);