From: Macpaul Lin <macpaul@andestech.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] nds32: cache: define ARCH_DMA_MINALIGN for DMA buffer alignment
Date: Mon, 24 Oct 2011 17:46:32 +0800 [thread overview]
Message-ID: <1319449593-2427-2-git-send-email-macpaul@andestech.com> (raw)
In-Reply-To: <1319449593-2427-1-git-send-email-macpaul@andestech.com>
Add ARCH_DMA_MINALIGN definition to asm/cache.h
Signed-off-by: Macpaul Lin <macpaul@andestech.com>
---
arch/nds32/include/asm/cache.h | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/arch/nds32/include/asm/cache.h b/arch/nds32/include/asm/cache.h
index d769196..fc22c7b 100644
--- a/arch/nds32/include/asm/cache.h
+++ b/arch/nds32/include/asm/cache.h
@@ -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 */
--
1.7.3.5
next prev parent reply other threads:[~2011-10-24 9:46 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-24 9:46 [U-Boot] [PATCH 1/3] nds32: Use getenv_ulong() in place of getenv(), strtoul Macpaul Lin
2011-10-24 9:46 ` Macpaul Lin [this message]
2011-10-24 17:16 ` [U-Boot] [PATCH 2/3] nds32: cache: define ARCH_DMA_MINALIGN for DMA buffer alignment Anton Staaf
2011-10-28 4:46 ` 馬克泡
2011-10-31 0:40 ` Mike Frysinger
2011-11-01 3:28 ` 馬克泡
2011-11-01 4:35 ` 馬克泡
2011-10-24 9:46 ` [U-Boot] [PATCH 3/3] nds32: asm/io.h: add __iormb and __iowmb support Macpaul Lin
2011-10-24 13:38 ` Marek Vasut
2011-10-24 13:50 ` 馬克泡
2011-10-25 8:20 ` 馬克泡
2011-10-25 8:29 ` Marek Vasut
2011-10-25 10:16 ` 馬克泡
2011-10-26 5:19 ` 馬克泡
2011-10-26 5:55 ` Graeme Russ
2011-10-27 3:23 ` 馬克泡
2011-10-27 3:39 ` Graeme Russ
2011-10-25 11:03 ` [U-Boot] [PATCH v2] nds32: asm/io.h: add __iormb __iowmb and inline io support Macpaul Lin
2011-11-01 4:37 ` 馬克泡
2011-11-01 4:33 ` [U-Boot] [PATCH 1/3] nds32: Use getenv_ulong() in place of getenv(), strtoul 馬克泡
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1319449593-2427-2-git-send-email-macpaul@andestech.com \
--to=macpaul@andestech.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox