else if (len == 4) {
char buf[11];
- sprintf(buf, "0x%08X", *(uint32_t *)nodep);
+ sprintf(buf, "0x%08X", fdt32_to_cpu(*(fdt32_t *)nodep));
setenv(var, buf);
} else if (len%4 == 0 && len <= 20) {
/* Needed to print things like sha1 hashes. */
return 1;
}
working_fdt = newaddr;
+#ifdef CONFIG_OF_SYSTEM_SETUP
+ /* Call the board-specific fixup routine */
+ } else if (strncmp(argv[1], "sys", 3) == 0) {
+ int err = ft_system_setup(working_fdt, gd->bd);
+ if (err) {
+ printf("Failed to add system information to FDT: %s\n",
+ fdt_strerror(err));
+ return CMD_RET_FAILURE;
+ }
+#endif
/*
* Make a new node
*/
return CMD_RET_FAILURE;
}
}
-#endif
-#ifdef CONFIG_OF_SYSTEM_SETUP
- /* Call the board-specific fixup routine */
- else if (strncmp(argv[1], "sys", 3) == 0) {
- int err = ft_system_setup(working_fdt, gd->bd);
-
- if (err) {
- printf("Failed to add system information to FDT: %s\n",
- fdt_strerror(err));
- return CMD_RET_FAILURE;
- }
- }
#endif
/* Create a chosen node */
else if (strncmp(argv[1], "cho", 3) == 0) {
else if (strncmp(argv[1], "ap", 2) == 0) {
unsigned long addr;
struct fdt_header *blob;
+ int ret;
if (argc != 3)
return CMD_RET_USAGE;
if (!fdt_valid(&blob))
return CMD_RET_FAILURE;
- if (fdt_overlay_apply(working_fdt, blob))
+ ret = fdt_overlay_apply(working_fdt, blob);
+ if (ret) {
+ printf("fdt_overlay_apply(): %s\n", fdt_strerror(ret));
return CMD_RET_FAILURE;
+ }
}
#endif
/* resize the fdt */
cp = newp;
tmp = simple_strtoul(cp, &newp, 0);
- *(__be32 *)data = __cpu_to_be32(tmp);
+ *(fdt32_t *)data = cpu_to_fdt32(tmp);
data += 4;
*len += 4;