From patchwork Mon Aug 5 17:00:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ken kuo X-Patchwork-Id: 264711 X-Patchwork-Delegate: uboot@andestech.com 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 D6E302C00AD for ; Tue, 6 Aug 2013 03:03:05 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 79D644A021; Mon, 5 Aug 2013 19:02:59 +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 Gafgy7POHRV4; Mon, 5 Aug 2013 19:02:59 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E173F4A019; Mon, 5 Aug 2013 19:02:55 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3F4DC4A01B for ; Mon, 5 Aug 2013 19:02:53 +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 rh66Uaok3Xu3 for ; Mon, 5 Aug 2013 19:02:47 +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-pb0-f48.google.com (mail-pb0-f48.google.com [209.85.160.48]) by theia.denx.de (Postfix) with ESMTPS id 21D744A018 for ; Mon, 5 Aug 2013 19:02:41 +0200 (CEST) Received: by mail-pb0-f48.google.com with SMTP id ma3so3592130pbc.21 for ; Mon, 05 Aug 2013 10:02:39 -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; bh=jmnP7dAZbT2nxx03y+aOo/ax50X6/hZ1dR5N5FsX5p0=; b=gu7+StKNVvUvRyqUJuqVlOp3vUPJKC25O06DTCa+KYVR/OBWTxil2r08BEEZbhZ9xx +53n28hmXCokEB8TUdOXgRTXhvaYrBdOQ3w0kKQLE8rlSO3fa3x7L9yzVjtHGlggvlIu Pt8+4h3NnJ9U8L9Fp8GjCLwtrgy5P2R1Lyn8TIe6fuNO/QMMj0SoByy4kprUhhxydDGq 2YhNB3QnqAKwYaSaPG4qYNXjzIoxWGM9SKAombU1FF+I5NN4kz+4jpHL2dmTdDBpzpy7 XotMYu2/FyTOpehTLXW2uWpPgqfv6/lwmHkJTzftTGn4GMieSmIYuVhRYrUXudZrO0np q48A== X-Received: by 10.68.211.138 with SMTP id nc10mr23473647pbc.162.1375722158814; Mon, 05 Aug 2013 10:02:38 -0700 (PDT) Received: from localhost.localdomain (1-171-4-185.dynamic.hinet.net. [1.171.4.185]) by mx.google.com with ESMTPSA id ai6sm647678pad.15.2013.08.05.10.02.36 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 Aug 2013 10:02:38 -0700 (PDT) From: Kuan-Yu Kuo To: u-boot@lists.denx.de, wd@denx.de, dzu@denx.de Date: Tue, 6 Aug 2013 01:00:53 +0800 Message-Id: <1375722054-3808-1-git-send-email-ken.kuoky@gmail.com> X-Mailer: git-send-email 1.8.3.1 Cc: Andes Subject: [U-Boot] [PATCH 1/2] nds32: introduce DMA allocation API 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 U-Boot does not compile for the adp-ag101 boards since commit a8f9cd1893bef05b92f63242228607b45821c4a7 (net: update FTGMAC100 for MMU/D-cache support) The driver assumes that the DMA allocation API are provided by all architectures. This is not the case for nds32 and it causes a build error. This patch adds DMA allocation API to avoid the errors. Signed-off-by: Kuan-Yu Kuo Cc: Macpaul Lin Cc: Andes --- arch/nds32/include/asm/dma-mapping.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 arch/nds32/include/asm/dma-mapping.h diff --git a/arch/nds32/include/asm/dma-mapping.h b/arch/nds32/include/asm/dma-mapping.h new file mode 100644 index 0000000..25e5a1b --- /dev/null +++ b/arch/nds32/include/asm/dma-mapping.h @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2013 Andes Technology Corporation + * Ken Kuo, Andes Technology Corporation + * + * SPDX-License-Identifier: GPL-2.0+ + */ +#ifndef __ASM_NDS_DMA_MAPPING_H +#define __ASM_NDS_DMA_MAPPING_H + +enum dma_data_direction { + DMA_BIDIRECTIONAL = 0, + DMA_TO_DEVICE = 1, + DMA_FROM_DEVICE = 2, +}; + +static void *dma_alloc_coherent(size_t len, unsigned long *handle) +{ + *handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, len); + return (void *)*handle; +} + +static inline unsigned long dma_map_single(volatile void *vaddr, size_t len, + enum dma_data_direction dir) +{ + return (unsigned long)vaddr; +} + +static inline void dma_unmap_single(volatile void *vaddr, size_t len, + unsigned long paddr) +{ +} + +#endif /* __ASM_NDS_DMA_MAPPING_H */