balena-allwinner/layers/meta-balena-allwinner/recipes-bsp/u-boot/u-boot_2017.09/fdt-setprop-fix-unaligned-access.patch
Florin Sarbu a6654dc76d Rename meta-resin to meta-balena in repository
Changelog-entry: Rename meta-resin to meta-balena in repository
Signed-off-by: Florin Sarbu <florin@balena.io>
2019-09-10 15:42:22 +02:00

24 lines
664 B
Diff

diff --git a/cmd/fdt.c b/cmd/fdt.c
index d7654b2c4f..a71b7713a8 100644
--- a/cmd/fdt.c
+++ b/cmd/fdt.c
@@ -17,6 +17,7 @@
#include <fdt_support.h>
#include <mapmem.h>
#include <asm/io.h>
+#include <asm/unaligned.h>
#define MAX_LEVEL 32 /* how deeply nested we will go */
#define SCRATCHPAD 1024 /* bytes of scratchpad memory */
@@ -781,7 +782,10 @@ static int fdt_parse_prop(char * const *newval, int count, char *data, int *len)
cp = newp;
tmp = simple_strtoul(cp, &newp, 0);
if (*cp != '?')
- *(fdt32_t *)data = cpu_to_fdt32(tmp);
+ {
+ tmp = cpu_to_fdt32(tmp);
+ put_unaligned(tmp, (fdt32_t *)data);
+ }
else
newp++;