Lines Matching defs:fdt

9 #include <fdt.h>
43 int fdt_overlay_target_offset(const void *fdt, const void *fdto,
60 ret = fdt_path_offset(fdt, path);
64 ret = fdt_node_offset_by_phandle(fdt, phandle);
89 * @fdt: Base device tree blob
101 static int overlay_phandle_add_offset(void *fdt, int node,
108 val = fdt_getprop(fdt, node, name, &len);
123 return fdt_setprop_inplace_u32(fdt, node, name, adj_val);
332 * @fdt: Base Device Tree blob
353 static int overlay_fixup_one_phandle(void *fdt, void *fdto,
368 symbol_path = fdt_getprop(fdt, symbols_off, label,
373 symbol_off = fdt_path_offset(fdt, symbol_path);
377 phandle = fdt_get_phandle(fdt, symbol_off);
396 * @fdt: Base Device Tree blob
413 static int overlay_fixup_phandle(void *fdt, void *fdto, int symbols_off,
468 ret = overlay_fixup_one_phandle(fdt, fdto, symbols_off,
481 * @fdt: Base Device Tree blob
495 static int overlay_fixup_phandles(void *fdt, void *fdto)
508 symbols_off = fdt_path_offset(fdt, "/__symbols__");
515 ret = overlay_fixup_phandle(fdt, fdto, symbols_off, property);
525 * @fdt: Base Device Tree blob
542 static int overlay_apply_node(void *fdt, int target,
561 ret = fdt_setprop(fdt, target, name, prop, prop_len);
571 nnode = fdt_add_subnode(fdt, target, name);
573 nnode = fdt_subnode_offset(fdt, target, name);
581 ret = overlay_apply_node(fdt, nnode, fdto, subnode);
591 * @fdt: Base Device Tree blob
604 static int overlay_merge(void *fdt, void *fdto)
624 target = fdt_overlay_target_offset(fdt, fdto, fragment, NULL);
628 ret = overlay_apply_node(fdt, target, fdto, overlay);
636 static int get_path_len(const void *fdt, int nodeoffset)
641 FDT_RO_PROBE(fdt);
644 name = fdt_get_name(fdt, nodeoffset, &namelen);
652 nodeoffset = fdt_parent_offset(fdt, nodeoffset);
666 * @fdt: Base Device Tree blob
680 static int overlay_symbol_update(void *fdt, void *fdto)
699 root_sym = fdt_subnode_offset(fdt, 0, "__symbols__");
703 root_sym = fdt_add_subnode(fdt, 0, "__symbols__");
767 ret = fdt_overlay_target_offset(fdt, fdto, fragment, &target_path);
774 ret = get_path_len(fdt, target);
782 ret = fdt_setprop_placeholder(fdt, root_sym, name,
789 ret = fdt_overlay_target_offset(fdt, fdto, fragment, &target_path);
798 ret = fdt_get_path(fdt, target, buf, len + 1);
815 int fdt_overlay_apply(void *fdt, void *fdto)
820 FDT_RO_PROBE(fdt);
823 ret = fdt_find_max_phandle(fdt, &delta);
835 ret = overlay_fixup_phandles(fdt, fdto);
839 ret = overlay_merge(fdt, fdto);
843 ret = overlay_symbol_update(fdt, fdto);
864 fdt_set_magic(fdt, ~0);