nds32: cache: define ARCH_DMA_MINALIGN for DMA buffer alignment
authorMacpaul Lin <macpaul@andestech.com>
Mon, 24 Oct 2011 08:48:39 +0000 (16:48 +0800)
committerMacpaul Lin <macpaul@andestech.com>
Tue, 1 Nov 2011 04:47:17 +0000 (12:47 +0800)
Add ARCH_DMA_MINALIGN definition to asm/cache.h

Signed-off-by: Macpaul Lin <macpaul@andestech.com>
arch/nds32/include/asm/cache.h

index d7691962131ef8223bf10981831ef0afe4407622..fc22c7bc0526d090fa591aac0bdb5702c539165a 100644 (file)
@@ -51,4 +51,15 @@ DEFINE_GET_SYS_REG(DCM_CFG);
 #define DCM_CFG_OFF_DSZ        6       /* D-cache line size */
 #define DCM_CFG_MSK_DSZ        (0x7UL << DCM_CFG_OFF_DSZ)
 
+/*
+ * The current upper bound for NDS32 L1 data cache line sizes is 32 bytes.
+ * We use that value for aligning DMA buffers unless the board config has
+ * specified an alternate cache line size.
+ */
+#ifdef CONFIG_SYS_CACHELINE_SIZE
+#define ARCH_DMA_MINALIGN      CONFIG_SYS_CACHELINE_SIZE
+#else
+#define ARCH_DMA_MINALIGN      32
+#endif
+
 #endif /* _ASM_CACHE_H */