summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorClemens Gruber <clemens.gruber@pqgruber.com>2016-08-29 17:10:36 +0200
committerTom Rini <trini@konsulko.com>2016-10-06 20:57:33 -0400
commitd025021e981fc2c06e95a3512f81f799f45d1f9c (patch)
tree1749799ea5c037f9fc2595436645e75d3e8fd3ae /lib
parent4dc34be4301e9f9ddca2d22a8ddb1161ee40f2d1 (diff)
downloadu-boot-imx-d025021e981fc2c06e95a3512f81f799f45d1f9c.zip
u-boot-imx-d025021e981fc2c06e95a3512f81f799f45d1f9c.tar.gz
u-boot-imx-d025021e981fc2c06e95a3512f81f799f45d1f9c.tar.bz2
gunzip: cache-align write buffer memory
When using gzwrite to eMMC on an i.MX6Q board, the following warning occurs repeatedly: CACHE: Misaligned operation at range [4fd63318, 4fe63318] This patch cache-aligns the memory allocation for the gzwrite writebuf, therefore avoiding the misaligned dcache flush and the warning from check_cache_range. Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com> Reviewed-by: Eric Nelson <eric@nelint.com> Reviewed-by: Stefan Agner <stefan.agner@toradex.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/gunzip.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/gunzip.c b/lib/gunzip.c
index bc746d6..832b306 100644
--- a/lib/gunzip.c
+++ b/lib/gunzip.c
@@ -11,6 +11,7 @@
#include <console.h>
#include <image.h>
#include <malloc.h>
+#include <memalign.h>
#include <u-boot/zlib.h>
#include <div64.h>
@@ -193,7 +194,7 @@ int gzwrite(unsigned char *src, int len,
s.next_in = src + i;
s.avail_in = payload_size+8;
- writebuf = (unsigned char *)malloc(szwritebuf);
+ writebuf = (unsigned char *)malloc_cache_aligned(szwritebuf);
/* decompress until deflate stream ends or end of file */
do {