All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bin Meng <bmeng.cn@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/3] riscv: Add asm/dma-mapping.h for DMA mappings
Date: Tue, 18 Dec 2018 17:45:25 +0800	[thread overview]
Message-ID: <CAEUhbmX=i4DFOY4_nXLPXpkHUmVBaBjkgP7My9fQ3dWGnz7a5A@mail.gmail.com> (raw)
In-Reply-To: <20181217115143.18373-2-anup@brainfault.org>

On Mon, Dec 17, 2018 at 7:52 PM Anup Patel <anup@brainfault.org> wrote:
>
> 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
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

But please see nits below:

> 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>
> + */

nits: should have one blank line here

> +#ifndef __ASM_RISCV_DMA_MAPPING_H
> +#define __ASM_RISCV_DMA_MAPPING_H
> +
> +#include <linux/dma-direction.h>
> +
> +#define        dma_mapping_error(x, y) 0

nits: no <tab> between #define and dma_

> +
> +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 */
> --

Regards,
Bin

  reply	other threads:[~2018-12-18  9:45 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 ` [U-Boot] [PATCH 1/3] riscv: Add asm/dma-mapping.h for DMA mappings Anup Patel
2018-12-18  9:45   ` Bin Meng [this message]
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='CAEUhbmX=i4DFOY4_nXLPXpkHUmVBaBjkgP7My9fQ3dWGnz7a5A@mail.gmail.com' \
    --to=bmeng.cn@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.