Merge git://git.denx.de/u-boot-fdt

This commit is contained in:
Tom Rini 2017-01-14 12:16:43 -05:00
commit b7127e3c51
2 changed files with 13 additions and 4 deletions

View File

@ -58,7 +58,7 @@ static int fdt_value_setenv(const void *nodep, int len, const char *var)
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. */
@ -642,6 +642,7 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
else if (strncmp(argv[1], "ap", 2) == 0) {
unsigned long addr;
struct fdt_header *blob;
int ret;
if (argc != 3)
return CMD_RET_USAGE;
@ -654,8 +655,11 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
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 */
@ -764,7 +768,7 @@ static int fdt_parse_prop(char * const *newval, int count, char *data, int *len)
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;

View File

@ -359,6 +359,9 @@ static int overlay_fixup_one_phandle(void *fdt, void *fdto,
int symbol_off, fixup_off;
int prop_len;
if (symbols_off < 0)
return symbols_off;
symbol_path = fdt_getprop(fdt, symbols_off, label,
&prop_len);
if (!symbol_path)
@ -492,7 +495,9 @@ static int overlay_fixup_phandles(void *fdt, void *fdto)
/* We can have overlays without any fixups */
fixups_off = fdt_path_offset(fdto, "/__fixups__");
if ((fixups_off < 0 && (fixups_off != -FDT_ERR_NOTFOUND)))
if (fixups_off == -FDT_ERR_NOTFOUND)
return 0; /* nothing to do */
if (fixups_off < 0)
return fixups_off;
/* And base DTs without symbols */