armbian-build/patch/u-boot/u-boot-sunxi/fix-fdt-setenv-byte-order.patch
zador-blood-stained b42054d78b Fix fdt get value byte order for 32-bit int values
This is required to get and reuse DT phandles
2017-03-08 16:19:37 +03:00

14 lines
453 B
Diff

diff --git a/cmd/fdt.c b/cmd/fdt.c
index 8bd345afa..aa4d8c0f6 100644
--- a/cmd/fdt.c
+++ b/cmd/fdt.c
@@ -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(*(uint32_t *)nodep));
setenv(var, buf);
} else if (len%4 == 0 && len <= 20) {
/* Needed to print things like sha1 hashes. */