diff --git a/patch/u-boot/u-boot-sunxi/fdt-setprop-fix-unaligned-access.patch b/patch/u-boot/u-boot-sunxi/fdt-setprop-fix-unaligned-access.patch new file mode 100644 index 0000000000..f164f18806 --- /dev/null +++ b/patch/u-boot/u-boot-sunxi/fdt-setprop-fix-unaligned-access.patch @@ -0,0 +1,24 @@ +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 + #include + #include ++#include + + #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++; +