From patchwork Mon Oct 17 23:46:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton staaf X-Patchwork-Id: 120332 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 633A1B70BB for ; Tue, 18 Oct 2011 10:47:25 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5D31A2917E; Tue, 18 Oct 2011 01:47:13 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bHksOIrgZNiD; Tue, 18 Oct 2011 01:47:13 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0E6412911A; Tue, 18 Oct 2011 01:46:49 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EB6D429120 for ; Tue, 18 Oct 2011 01:46:35 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qqnLGyCLKUyD for ; Tue, 18 Oct 2011 01:46:34 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from smtp-out.google.com (smtp-out.google.com [74.125.121.67]) by theia.denx.de (Postfix) with ESMTPS id 6B803290E8 for ; Tue, 18 Oct 2011 01:46:27 +0200 (CEST) Received: from wpaz33.hot.corp.google.com (wpaz33.hot.corp.google.com [172.24.198.97]) by smtp-out.google.com with ESMTP id p9HNkJRR005370; Mon, 17 Oct 2011 16:46:19 -0700 Received: from servo.mtv.corp.google.com (servo.mtv.corp.google.com [172.22.72.56]) by wpaz33.hot.corp.google.com with ESMTP id p9HNkH8Q014632; Mon, 17 Oct 2011 16:46:17 -0700 Received: by servo.mtv.corp.google.com (Postfix, from userid 99248) id 928114A190; Mon, 17 Oct 2011 16:46:16 -0700 (PDT) From: Anton Staaf To: u-boot@lists.denx.de Date: Mon, 17 Oct 2011 16:46:07 -0700 Message-Id: <1318895173-32634-6-git-send-email-robotboy@chromium.org> X-Mailer: git-send-email 1.7.3.1 In-Reply-To: <1318895173-32634-1-git-send-email-robotboy@chromium.org> References: <1318895173-32634-1-git-send-email-robotboy@chromium.org> X-System-Of-Record: true Cc: Anton Staaf Subject: [U-Boot] [PATCH v2 05/11] sh: cache: define ARCH_DMA_MINALIGN for DMA buffer alignment X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Signed-off-by: Anton Staaf Cc: Mike Frysinger Cc: Lukasz Majewski Cc: Nobuhiro Iwamatsu --- arch/sh/include/asm/cache.h | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/arch/sh/include/asm/cache.h b/arch/sh/include/asm/cache.h index 2cfc0a7..6ffab4d 100644 --- a/arch/sh/include/asm/cache.h +++ b/arch/sh/include/asm/cache.h @@ -6,6 +6,7 @@ int cache_control(unsigned int cmd); #define L1_CACHE_BYTES 32 + struct __large_struct { unsigned long buf[100]; }; #define __m(x) (*(struct __large_struct *)(x)) @@ -30,6 +31,22 @@ void dcache_invalid_range(u32 start, u32 end) : "m" (__m(v))); } } +#else + +/* + * 32-bytes is the largest L1 data cache line size for SH the architecture. So + * it is a safe default for DMA alignment. + */ +#define ARCH_DMA_MINALIGN 32 + #endif /* CONFIG_SH4 || CONFIG_SH4A */ +/* + * Use the L1 data cache line size value for the minimum DMA buffer alignment + * on SH. + */ +#ifndef ARCH_DMA_MINALIGN +#define ARCH_DMA_MINALIGN L1_CACHE_BYTES +#endif + #endif /* __ASM_SH_CACHE_H */