From patchwork Thu Jan 17 11:03:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1026526 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=brainfault.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=brainfault-org.20150623.gappssmtp.com header.i=@brainfault-org.20150623.gappssmtp.com header.b="q+7NbUc7"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43gLnv17X2z9sDB for ; Thu, 17 Jan 2019 22:05:07 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id C38B1C220DD; Thu, 17 Jan 2019 11:04:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=KHOP_BIG_TO_CC, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 04B59C21D4A; Thu, 17 Jan 2019 11:04:33 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6FA90C21E75; Thu, 17 Jan 2019 11:04:24 +0000 (UTC) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by lists.denx.de (Postfix) with ESMTPS id 48A40C22088 for ; Thu, 17 Jan 2019 11:04:20 +0000 (UTC) Received: by mail-pf1-f196.google.com with SMTP id q1so4677004pfi.5 for ; Thu, 17 Jan 2019 03:04:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=p/LvdIXhvZMEm2SjA4hCsGwfxVn97+qE2K9wkM8z4ZU=; b=q+7NbUc72fBQLVm2zAi9X4erp4qa+kEmO/i5+ZhN6dLEufKRDiYGDEBhI2E21J6oCI WAmirc0COJB47kIDt8epj5lgFd2xi62CJvvvC1ZlyXPLAS0fXiLubdwkHeQQ90nobjTR VB77z4YJ5Q1PDPOHJpp5tO8dzKwmC0U065wk3sZzWuh5msOA+6oYPPWJodX9WTtoQRce KvPVwWrEFJ6D0urxMKycHW8iv5tvNyoliPx0TdCACdLhSG2I23pjoVny4ORpxNHsxs1u Y6h83iW6jYmtctEvWa5HjTj68j1JsZnJ99DFKC0F7Ew5qLFlNMNb5eouZyXcX1zttjHc 9nYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=p/LvdIXhvZMEm2SjA4hCsGwfxVn97+qE2K9wkM8z4ZU=; b=L9dRYm7Yw+7b4YO09151LsNdmiwdeF8Eas880/PKWU+P7Z4Gqd+dHfwfxqlRCAXms7 0SS2UPpwhtbrrZEU5Vz43E9OLEhOI31qFP6qzTEx11nxzdvzjTH6tFPpF+jKR4z+tfSg MppSexUGNgY/HKaIibSkGLXvWaarlsFq7GGWxrpR0s8yJDB4GM50O6+FA83a4DKeL4DA sOhOJx8pZxNjTirhfbC3DiQW5XSkxbA0QZLa1hoDT8zU4imozDRsV+LqDcdbjQJB+VFn cWItJR7K/BiDhiGThA1KFKQ8x721JK9mceAGa4f/4kmBWIbvX439Llm0jEcyTYKK5nFB ukVQ== X-Gm-Message-State: AJcUukdWUnDwwanPJ10Idx5A81CtZvcq/pRVU1vb73TkSoJPhf/DBTDL S+wfVHl+smYCTgZ6ujiOdDYqHg== X-Google-Smtp-Source: ALg8bN7XtcXxse8UxRu+1raWiXvtoOugv24bjW4kIVP/lbTemIx4O++OcL/rPzQO2MzVDDDD9dD9eg== X-Received: by 2002:a65:6094:: with SMTP id t20mr12973930pgu.285.1547723058692; Thu, 17 Jan 2019 03:04:18 -0800 (PST) Received: from localhost.localdomain ([106.51.16.164]) by smtp.gmail.com with ESMTPSA id h15sm1688142pgl.43.2019.01.17.03.04.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Jan 2019 03:04:18 -0800 (PST) From: Anup Patel To: Rick Chen , Bin Meng , Joe Hershberger , Lukas Auer , Masahiro Yamada , Simon Glass Date: Thu, 17 Jan 2019 16:33:47 +0530 Message-Id: <20190117110356.36753-3-anup@brainfault.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190117110356.36753-1-anup@brainfault.org> References: <20190117110356.36753-1-anup@brainfault.org> Cc: Palmer Dabbelt , U-Boot Mailing List , Alexander Graf , Christoph Hellwig , Paul Walmsley Subject: [U-Boot] [PATCH 02/11] riscv: Add asm/dma-mapping.h for DMA mappings X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Anup Patel This patch adds asm/dma-mapping.h for Linux-like DMA mappings APIs required by some of the drivers (such as, Cadance MACB Ethernet driver). Signed-off-by: Anup Patel Reviewed-by: Bin Meng --- arch/riscv/include/asm/dma-mapping.h | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 arch/riscv/include/asm/dma-mapping.h diff --git a/arch/riscv/include/asm/dma-mapping.h b/arch/riscv/include/asm/dma-mapping.h new file mode 100644 index 0000000000..3d930c90ec --- /dev/null +++ b/arch/riscv/include/asm/dma-mapping.h @@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (c) 2018 Western Digital Corporation or its affiliates. + * + * Authors: + * Anup Patel + */ + +#ifndef __ASM_RISCV_DMA_MAPPING_H +#define __ASM_RISCV_DMA_MAPPING_H + +#include + +#define dma_mapping_error(x, y) 0 + +static inline void *dma_alloc_coherent(size_t len, unsigned long *handle) +{ + *handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, len); + return (void *)*handle; +} + +static inline void dma_free_coherent(void *addr) +{ + free(addr); +} + +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_RISCV_DMA_MAPPING_H */