]> git.sur5r.net Git - u-boot/commitdiff
mtd: nand: mxs: fix cache alignment for cache lines >32
authorStefan Agner <stefan.agner@toradex.com>
Tue, 2 Aug 2016 06:55:18 +0000 (23:55 -0700)
committerStefano Babic <sbabic@denx.de>
Tue, 6 Sep 2016 16:22:48 +0000 (18:22 +0200)
Currently the command buffer gets allocated with a size of 32 bytes.
This causes warning messages on systems with cache lines bigger than
32 bytes:
CACHE: Misaligned operation at range [9df17a009df17a20]

Define command buffer to be at least 32 bytes, but more if cache
line is bigger.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
drivers/mtd/nand/mxs_nand.c

index 94fc5c18a0765e6c401afec22b3bdad0ce181bf4..4bf564e4f566d9a28f7187558ce4ead8a248d1f5 100644 (file)
 #endif
 #define        MXS_NAND_METADATA_SIZE                  10
 #define        MXS_NAND_BITS_PER_ECC_LEVEL             13
+
+#if !defined(CONFIG_SYS_CACHELINE_SIZE) || CONFIG_SYS_CACHELINE_SIZE < 32
 #define        MXS_NAND_COMMAND_BUFFER_SIZE            32
+#else
+#define        MXS_NAND_COMMAND_BUFFER_SIZE            CONFIG_SYS_CACHELINE_SIZE
+#endif
 
 #define        MXS_NAND_BCH_TIMEOUT                    10000