mirror of
https://xff.cz/git/u-boot/
synced 2025-09-29 22:41:17 +02:00
Merge git://git.denx.de/u-boot-fdt
This commit is contained in:
10
cmd/fdt.c
10
cmd/fdt.c
@@ -58,7 +58,7 @@ static int fdt_value_setenv(const void *nodep, int len, const char *var)
|
|||||||
else if (len == 4) {
|
else if (len == 4) {
|
||||||
char buf[11];
|
char buf[11];
|
||||||
|
|
||||||
sprintf(buf, "0x%08X", *(uint32_t *)nodep);
|
sprintf(buf, "0x%08X", fdt32_to_cpu(*(fdt32_t *)nodep));
|
||||||
setenv(var, buf);
|
setenv(var, buf);
|
||||||
} else if (len%4 == 0 && len <= 20) {
|
} else if (len%4 == 0 && len <= 20) {
|
||||||
/* Needed to print things like sha1 hashes. */
|
/* 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) {
|
else if (strncmp(argv[1], "ap", 2) == 0) {
|
||||||
unsigned long addr;
|
unsigned long addr;
|
||||||
struct fdt_header *blob;
|
struct fdt_header *blob;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (argc != 3)
|
if (argc != 3)
|
||||||
return CMD_RET_USAGE;
|
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))
|
if (!fdt_valid(&blob))
|
||||||
return CMD_RET_FAILURE;
|
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;
|
return CMD_RET_FAILURE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* resize the fdt */
|
/* resize the fdt */
|
||||||
@@ -764,7 +768,7 @@ static int fdt_parse_prop(char * const *newval, int count, char *data, int *len)
|
|||||||
|
|
||||||
cp = newp;
|
cp = newp;
|
||||||
tmp = simple_strtoul(cp, &newp, 0);
|
tmp = simple_strtoul(cp, &newp, 0);
|
||||||
*(__be32 *)data = __cpu_to_be32(tmp);
|
*(fdt32_t *)data = cpu_to_fdt32(tmp);
|
||||||
data += 4;
|
data += 4;
|
||||||
*len += 4;
|
*len += 4;
|
||||||
|
|
||||||
|
@@ -359,6 +359,9 @@ static int overlay_fixup_one_phandle(void *fdt, void *fdto,
|
|||||||
int symbol_off, fixup_off;
|
int symbol_off, fixup_off;
|
||||||
int prop_len;
|
int prop_len;
|
||||||
|
|
||||||
|
if (symbols_off < 0)
|
||||||
|
return symbols_off;
|
||||||
|
|
||||||
symbol_path = fdt_getprop(fdt, symbols_off, label,
|
symbol_path = fdt_getprop(fdt, symbols_off, label,
|
||||||
&prop_len);
|
&prop_len);
|
||||||
if (!symbol_path)
|
if (!symbol_path)
|
||||||
@@ -492,7 +495,9 @@ static int overlay_fixup_phandles(void *fdt, void *fdto)
|
|||||||
|
|
||||||
/* We can have overlays without any fixups */
|
/* We can have overlays without any fixups */
|
||||||
fixups_off = fdt_path_offset(fdto, "/__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;
|
return fixups_off;
|
||||||
|
|
||||||
/* And base DTs without symbols */
|
/* And base DTs without symbols */
|
||||||
|
Reference in New Issue
Block a user