summaryrefslogtreecommitdiff
path: root/include/common.h
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>2015-08-18 13:06:37 +0200
committerTom Rini <trini@konsulko.com>2015-08-28 12:33:17 -0400
commit4519668b29bb8422ceca8e7ca9a35d5af0afe959 (patch)
treecf6361ac4f48d13dc677978ae8778e63bedba402 /include/common.h
parent285e266b417103378c1cf1e9aea47b34731c45d0 (diff)
mtd/nand/ubi: assortment of alignment fixes
Various U-Boot adoptions/extensions to MTD/NAND/UBI did not take buffer alignment into account which led to failures of the following form: ERROR: v7_dcache_inval_range - start address is not aligned - 0x1f7f0108 ERROR: v7_dcache_inval_range - stop address is not aligned - 0x1f7f1108 Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Scott Wood <scottwood@freescale.com> [trini: Add __UBOOT__ hunk to lib/zlib/zutil.c due to malloc.h in common.h] Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'include/common.h')
-rw-r--r--include/common.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/common.h b/include/common.h
index c48e5bc11bf..c12f402f773 100644
--- a/include/common.h
+++ b/include/common.h
@@ -1060,6 +1060,15 @@ int cpu_release(int nr, int argc, char * const argv[]);
#define DEFINE_CACHE_ALIGN_BUFFER(type, name, size) \
DEFINE_ALIGN_BUFFER(type, name, size, ARCH_DMA_MINALIGN)
+#ifndef __ASSEMBLY__
+#include <malloc.h>
+
+static inline void *malloc_cache_aligned(size_t size)
+{
+ return memalign(ARCH_DMA_MINALIGN, ALIGN(size, ARCH_DMA_MINALIGN));
+}
+#endif
+
/*
* check_member() - Check the offset of a structure member
*