From: Eugeniy Paltsev <eugeniy.paltsev@synopsys.com>
To: "dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
"gustavo.pimentel@synopsys.com" <gustavo.pimentel@synopsys.com>
Cc: "vkoul@kernel.org" <vkoul@kernel.org>,
"andriy.shevchenko@linux.intel.com"
<andriy.shevchenko@linux.intel.com>,
Joao Pinto <joao.pinto@synopsys.com>,
Alexey Brodkin <alexey.brodkin@synopsys.com>
Subject: Re: [RFC 2/6] dma: Add Synopsys eDMA IP version 0 support
Date: Wed, 12 Dec 2018 13:39:44 +0000 [thread overview]
Message-ID: <1544621983.3270.26.camel@synopsys.com> (raw)
In-Reply-To: <bb2574d32c7aeb332c79436655f5ab1f9bac540e.1544610287.git.gustavo.pimentel@synopsys.com>
Hi Gustavo,
On Wed, 2018-12-12 at 12:13 +0100, Gustavo Pimentel wrote:
> Add support for the eDMA IP version 0 driver for both register maps (legacy
> and unroll).
[snip]
> diff --git a/drivers/dma/dw-edma/dw-edma-v0-core.c b/drivers/dma/dw-edma/dw-edma-v0-core.c
> new file mode 100644
> index 0000000..cc362b0
> --- /dev/null
> +++ b/drivers/dma/dw-edma/dw-edma-v0-core.c
> @@ -0,0 +1,346 @@
> +// SPDX-License-Identifier: GPL-2.0
> +// Copyright (c) 2018 Synopsys, Inc. and/or its affiliates.
> +// Synopsys DesignWare eDMA v0 core
> +
> +#include "dw-edma-core.h"
> +#include "dw-edma-v0-core.h"
> +#include "dw-edma-v0-regs.h"
> +#include "dw-edma-v0-debugfs.h"
> +
> +#define QWORD_HI(value) ((value & 0xFFFFFFFF00000000llu) >> 32)
Use upper_32_bits() macros.
> +#define QWORD_LO(value) (value & 0x00000000FFFFFFFFllu)
Use lower_32_bits() macros.
> +enum dw_edma_control {
> + DW_EDMA_CB = BIT(0),
> + DW_EDMA_TCB = BIT(1),
> + DW_EDMA_LLP = BIT(2),
> + DW_EDMA_LIE = BIT(3),
> + DW_EDMA_RIE = BIT(4),
[snip]
> + viewport_sel = (ch & 0x00000007ul);
[snip]
> +void dw_edma_v0_core_off(struct dw_edma *dw)
> +{
> + SET_BOTH(dw, int_mask, 0x00FF00FFul);
> + SET_BOTH(dw, int_clear, 0x00FF00FFul);
> + SET_BOTH(dw, engine_en, 0x00000000ul);
> +}
[snip]
> + num_ch &= 0x0000000Ful;
> + } else {
> + num_ch &= 0x000F0000ul;
I guess it's better to name this magic numbers via defines.
[snip]
> +
> +bool dw_edma_v0_core_status_done_int(struct dw_edma_chan *chan)
> +{
> + struct dw_edma *dw = chan->chip->dw;
> + u32 tmp;
> +
> + tmp = GET_RW(dw, chan->dir, int_status);
> + tmp &= BIT(chan->id);
> +
> + return tmp ? true : false;
return !!tmp;
> +}
> +
> +bool dw_edma_v0_core_status_abort_int(struct dw_edma_chan *chan)
> +{
> + struct dw_edma *dw = chan->chip->dw;
> + u32 tmp;
> +
> + tmp = GET_RW(dw, chan->dir, int_status);
> + tmp &= BIT(chan->id + 16);
> +
> + return tmp ? true : false;
ditto.
--
Eugeniy Paltsev
next prev parent reply other threads:[~2018-12-12 13:39 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-12 11:13 [RFC 0/6] dma: Add Synopsys eDMA IP driver (version 0) Gustavo Pimentel
2018-12-12 11:13 ` [RFC 1/6] dma: Add Synopsys eDMA IP core driver Gustavo Pimentel
2018-12-12 23:00 ` Bjorn Helgaas
2018-12-13 11:03 ` Gustavo Pimentel
2018-12-17 7:23 ` Vinod Koul
2018-12-17 6:51 ` Vinod Koul
2018-12-17 15:56 ` Gustavo Pimentel
2018-12-18 3:54 ` Vinod Koul
2018-12-18 10:58 ` Gustavo Pimentel
2019-01-03 9:53 ` Gustavo Pimentel
2019-01-03 12:45 ` Vinod Koul
2019-01-03 12:55 ` Gustavo Pimentel
2019-01-03 14:53 ` Vinod Koul
2018-12-12 11:13 ` [RFC 2/6] dma: Add Synopsys eDMA IP version 0 support Gustavo Pimentel
2018-12-12 13:39 ` Eugeniy Paltsev [this message]
2018-12-13 11:51 ` Gustavo Pimentel
2018-12-12 11:13 ` [RFC 3/6] dma: Add Synopsys eDMA IP version 0 debugfs support Gustavo Pimentel
2018-12-12 11:13 ` [RFC 4/6] dma: Add Synopsys eDMA IP PCIe glue-logic Gustavo Pimentel
2018-12-12 13:25 ` Andy Shevchenko
2018-12-13 14:40 ` Gustavo Pimentel
2019-01-03 17:35 ` Andy Shevchenko
2019-01-03 18:00 ` Gustavo Pimentel
2018-12-12 11:13 ` [RFC 5/6] MAINTAINERS: Add Synopsys eDMA IP driver maintainer Gustavo Pimentel
2018-12-12 11:13 ` [RFC 6/6] pci: pci_ids: Add Synopsys device id 0xedda Gustavo Pimentel
2018-12-12 23:03 ` Bjorn Helgaas
2018-12-13 11:49 ` Gustavo Pimentel
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=1544621983.3270.26.camel@synopsys.com \
--to=eugeniy.paltsev@synopsys.com \
--cc=alexey.brodkin@synopsys.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=gustavo.pimentel@synopsys.com \
--cc=joao.pinto@synopsys.com \
--cc=linux-pci@vger.kernel.org \
--cc=vkoul@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).