From patchwork Mon Jun 17 12:06:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuo-Jung Su X-Patchwork-Id: 251823 X-Patchwork-Delegate: albert.aribaud@free.fr 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 BE0A02C007B for ; Mon, 17 Jun 2013 22:08:12 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F116A4A1A5; Mon, 17 Jun 2013 14:08:05 +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 fJAVARH2ojrp; Mon, 17 Jun 2013 14:08:05 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4EC3E4A1C1; Mon, 17 Jun 2013 14:07:47 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id ED19D4A18D for ; Mon, 17 Jun 2013 14:07:36 +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 BvwTOHHEPZL4 for ; Mon, 17 Jun 2013 14:07:30 +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 mail-pd0-f175.google.com (mail-pd0-f175.google.com [209.85.192.175]) by theia.denx.de (Postfix) with ESMTPS id 290CC4A175 for ; Mon, 17 Jun 2013 14:07:23 +0200 (CEST) Received: by mail-pd0-f175.google.com with SMTP id 4so2717285pdd.20 for ; Mon, 17 Jun 2013 05:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references; bh=fxpX7alqsgwfPkVR9qRz9cudNS9z7t+18FoO0GZu9ec=; b=uWeSy8F4eVP/VxgRCTBMW43DE7+SnU5ZBYg5kMIdh6lLRiRED+99RapGx6X4zXOSSq RHKgZuCkhrF6ECIH0jOBKN38TkI6pGoTQRex2+kzNCBE8m09PdeCXlF8qocBeATOZdBh QuZHxz292olhuoS8UiLgsF5Bo+0DoJkeP+RFU6Ektc6HD+e25PZwHeb+TsrAkpxvtkvm Vd/ZLXegcjMuraxck/MVzVfPmdY740q7hLerLOB/16LMLy1jwwox0OoxjUJZTSHC33C5 bXhGP0xKLYdmP22M83LR+AbrSfvO2VhP4hdqORdnVqLFIOmyi4VZvEaOAS1qIYyg3hME Qamw== X-Received: by 10.66.135.18 with SMTP id po18mr12838563pab.1.1371470842031; Mon, 17 Jun 2013 05:07:22 -0700 (PDT) Received: from localhost.localdomain (114-35-170-161.HINET-IP.hinet.net. [114.35.170.161]) by mx.google.com with ESMTPSA id wt5sm13621839pbc.38.2013.06.17.05.07.20 for (version=TLSv1 cipher=DES-CBC3-SHA bits=168/168); Mon, 17 Jun 2013 05:07:21 -0700 (PDT) From: Kuo-Jung Su To: u-boot@lists.denx.de Date: Mon, 17 Jun 2013 20:06:51 +0800 Message-Id: <1371470824-3228-2-git-send-email-dantesu@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1371470824-3228-1-git-send-email-dantesu@gmail.com> References: <1371470824-3228-1-git-send-email-dantesu@gmail.com> In-Reply-To: <1364540788-13943-1-git-send-email-dantesu@gmail.com> References: <1364540788-13943-1-git-send-email-dantesu@gmail.com> Cc: Kuo-Jung Su Subject: [U-Boot] [PATCH v5 01/14] arm: dma_alloc_coherent: malloc() -> memalign() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 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 From: Kuo-Jung Su Even though the MMU/D-cache is off, some DMA engines still expect strict address alignment. For example, the incoming Faraday FTMAC110 & FTGMAC100 ethernet controllers expect the tx/rx descriptors should always be aligned to 16-bytes boundary. Signed-off-by: Kuo-Jung Su CC: Albert ARIBAUD --- Changes for v5: - Initial commit, which is separated from "arm: add MMU/D-Cache support for Faraday cores" arch/arm/include/asm/dma-mapping.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.7.9.5 diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h index 5bbb0a0..a11178f 100644 --- a/arch/arm/include/asm/dma-mapping.h +++ b/arch/arm/include/asm/dma-mapping.h @@ -32,7 +32,7 @@ enum dma_data_direction { static void *dma_alloc_coherent(size_t len, unsigned long *handle) { - *handle = (unsigned long)malloc(len); + *handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, len); return (void *)*handle; }