public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Anup Patel <anup@brainfault.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/3] riscv: Add asm/dma-mapping.h for DMA mappings
Date: Mon, 17 Dec 2018 17:21:41 +0530	[thread overview]
Message-ID: <20181217115143.18373-2-anup@brainfault.org> (raw)
In-Reply-To: <20181217115143.18373-1-anup@brainfault.org>

From: Anup Patel <anup.patel@wdc.com>

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 <anup.patel@wdc.com>
---
 arch/riscv/include/asm/dma-mapping.h | 37 ++++++++++++++++++++++++++++
 1 file changed, 37 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..9782b6f168
--- /dev/null
+++ b/arch/riscv/include/asm/dma-mapping.h
@@ -0,0 +1,37 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2018 Western Digital Corporation or its affiliates.
+ *
+ * Authors:
+ *   Anup Patel <anup.patel@wdc.com>
+ */
+#ifndef __ASM_RISCV_DMA_MAPPING_H
+#define __ASM_RISCV_DMA_MAPPING_H
+
+#include <linux/dma-direction.h>
+
+#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 */
-- 
2.17.1

  reply	other threads:[~2018-12-17 11:51 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-17 11:51 [U-Boot] [PATCH 0/3] Ethernet support for QEMU sifive_u machine Anup Patel
2018-12-17 11:51 ` Anup Patel [this message]
2018-12-18  9:45   ` [U-Boot] [PATCH 1/3] riscv: Add asm/dma-mapping.h for DMA mappings Bin Meng
2018-12-19  8:09     ` Anup Patel
2018-12-20  5:26   ` Anup Patel
2018-12-17 11:51 ` [U-Boot] [PATCH 2/3] net: macb: Fix clk API usage for RISC-V systems Anup Patel
2018-12-18  9:45   ` Bin Meng
2018-12-19  8:15     ` Anup Patel
2018-12-17 11:51 ` [U-Boot] [PATCH 3/3] riscv: qemu: Imply MACB ethernet for emulation Anup Patel
2018-12-18  9:45   ` Bin Meng
2018-12-18  9:51 ` [U-Boot] [PATCH 0/3] Ethernet support for QEMU sifive_u machine Bin Meng
2018-12-18 10:33   ` Anup Patel
2018-12-18 10:36     ` Bin Meng
2018-12-19  4:40       ` Anup Patel
2018-12-19  5:32         ` Bin Meng
2018-12-19  6:32           ` Anup Patel
2018-12-19  9:05             ` Bin Meng
2018-12-24  1:29               ` Bin Meng
2018-12-24  5:41                 ` Anup Patel
2018-12-24  6:31                   ` Bin Meng
2018-12-24  6:42                     ` Anup Patel
2018-12-24  7:15                       ` Bin Meng
2018-12-24  7:23                         ` Anup Patel
2018-12-24  7:36                           ` Bin Meng
2018-12-24 11:34                             ` Anup Patel
2019-08-07 15:37               ` Bin Meng

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=20181217115143.18373-2-anup@brainfault.org \
    --to=anup@brainfault.org \
    --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