#endif
}
+#ifdef CONFIG_OF_LIBFDT_OVERLAY
+ /* apply an overlay */
+ else if (strncmp(argv[1], "ap", 2) == 0) {
+ unsigned long addr;
+ struct fdt_header *blob;
+
+ if (argc != 3)
+ return CMD_RET_USAGE;
+
+ if (!working_fdt)
+ return CMD_RET_FAILURE;
+
+ addr = simple_strtoul(argv[2], NULL, 16);
+ blob = map_sysmem(addr, 0);
+ if (!fdt_valid(&blob))
+ return CMD_RET_FAILURE;
+
+ if (fdt_overlay_apply(working_fdt, blob))
+ return CMD_RET_FAILURE;
+ }
+#endif
/* resize the fdt */
else if (strncmp(argv[1], "re", 2) == 0) {
fdt_shrink_to_minimum(working_fdt);
#ifdef CONFIG_SYS_LONGHELP
static char fdt_help_text[] =
"addr [-c] <addr> [<length>] - Set the [control] fdt location to <addr>\n"
+#ifdef CONFIG_OF_LIBFDT_OVERLAY
+ "fdt apply <addr> - Apply overlay to the DT\n"
+#endif
#ifdef CONFIG_OF_BOARD_SETUP
"fdt boardsetup - Do board-specific set up\n"
#endif
adj_val += delta;
adj_val = cpu_to_fdt32(adj_val);
- ret = fdt_setprop_inplace_namelen_by_index(fdto, tree_node,
- name, strlen(name),
- index, &adj_val,
- sizeof(adj_val));
+ ret = fdt_setprop_inplace_namelen_partial(fdto, tree_node,
+ name, strlen(name),
+ index, &adj_val,
+ sizeof(adj_val));
if (ret)
return ret;
}
return fixup_off;
phandle = cpu_to_fdt32(phandle);
- return fdt_setprop_inplace_namelen_by_index(fdto, fixup_off,
- name, name_len, index,
- &phandle, sizeof(phandle));
+ return fdt_setprop_inplace_namelen_partial(fdto, fixup_off,
+ name, name_len, index,
+ &phandle, sizeof(phandle));
};
static int overlay_fixup_phandle(void *fdt, void *fdto, int symbols_off,