From: Vinod Koul <vkoul@infradead.org>
To: Jassi Brar <jassisinghbrar@gmail.com>
Cc: vinod.koul@intel.com, Barry Song <21cnbao@gmail.com>,
"arnd@arndb.de" <arnd@arndb.de>,
"linus.walleij@linaro.org" <linus.walleij@linaro.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"workgroup.linux@csr.com" <workgroup.linux@csr.com>,
"rongjun.ying@csr.com" <rongjun.ying@csr.com>,
"Baohua.Song@csr.com" <Baohua.Song@csr.com>,
"Williams, Dan J" <dan.j.williams@intel.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] dmaengine: add CSR SiRFprimaII DMAC driver
Date: Fri, 09 Sep 2011 03:16:18 +0530 [thread overview]
Message-ID: <1315518378.6638.2.camel@vkoul-mobl4> (raw)
In-Reply-To: <CABb+yY3F+DMn2SxeO0chjpiMBkgLvSK5EVYMdhQsfQoZNZ4_7Q@mail.gmail.com>
On Thu, 2011-09-08 at 10:55 +0530, Jassi Brar wrote:
> On Thu, Sep 8, 2011 at 8:47 AM, Jassi Brar <jassisinghbrar@gmail.com> wrote:
> > On Thu, Sep 8, 2011 at 7:42 AM, Barry Song <21cnbao@gmail.com> wrote:
> >
> >>>> it is much different with primacell based DMA like pl080, pl330.
> >>>> prima2 has a self-defined DMAC IP. basically it is a 2D mode dma with
> >>>> two scales X and Y and direct way to start and stop DMA.
> >>>> every channel has fixed function to serve only one perpheral. so you
> >>>> find we have a filter id.
> >>> okay, what do you mean by 2D mode? Is it similar to what TI folks, Linus
> >>> W and Jassi Brar posted RFC's on?
> >>
> >> In SiRFprimaII 2-D DMA, the system memory space is interpreted
> >> as a 2-D layout instead of a linear 1-D layout. More specifically, the
> >> system memory can be considered as
> >> multiple data lines. The length of the data line is determined by the
> >> user-selected DMA_WIDTH register.
> >> The user can specify a data window that the user wants to access using
> >> four parameters:
> >> ■ Start address
> >> ■ X length
> >> ■ Y length
> >> ■ Width
> >>
> >> The idea of a 2-D DMA is shown in figure 2d-dma.png attached.
> >>
> >> If you specifies the Y length as 0 or the X length equals to the DMA
> >> width, then this 2-D DMA reduces to
> >> 1-D. If the user configures the X length greater than the DMA width,
> >> then the extra data is wrapped around
> >> to the next data line, this may corrupt the DMA transfer for
> >> multiple-line 2-D DMA. If this is a 1-D DMA, then
> >> there is no issue. The attached diagram 2d-dma2.png shows the
> >> wrap-around of the extra data in case the X length
> >> greater than DMA width.
> >
> > Sorry, the role of DMA_WIDTH is not clear to me yet.
> > In which case the user _must_ set {xlen > width} ?
> >
> Perhaps 2d-dma.PNG is inaccurate - it shouldn't depict any deltaX.
> Doesn't xlen and width always start together ? If no, please don't read ahead.
>
> According to figures, {xlen > width} is to be set _only_ when a transfer
> is divided into _exactly_ two chunks separated by gap _exactly_
> equal to length of the second chunk (an extremely rare case).
>
> Anyways, every case can be easily expressed using the generic api
> I proposed. See 'struct xfer_template' in https://lkml.org/lkml/2011/8/12/128
>
> Roughly speaking, the following should be done...
> Client driver :-
> **************
> For a 'Rectangular' transfer (2d-dma.PNG) :-
> xfer_template.numf = Ylen; /* height of rectangle */
> xfer_template.frame_size = 1;
> xfer_template.sgl[0].size = Xlen; /* width of rectangle */
> xfer_template.sgl[0].icg = start_addr_Y(n) - end_addr_Y(n-1);
>
> For the "A Line and some" transfer (2d-dma2.PNG) :-
> xfer_template.numf = 1;
> xfer_template.frame_size = 2;
> xfer_template.sgl[0].size = xlen1; /* a line */
> xfer_template.sgl[1].size = xlen2; /* and some */
> xfer_template.sgl[0].icg = start_addr_Y(n) - end_addr_Y(n-1);
> xfer_template.sgl[1].icg = 0; /* doesn't matter */
>
> DMAC driver :-
> ***************
> if (xfer_template.frame_size == 1) {
> /* rectangle */
> schan->xlen = xfer_template.sgl[0].size;
> schan->width = schan->xlen + xfer_template.sgl[0].icg;
> } else if (xfer_template.frame_size == 2 &&
> xfer_template.numf == 1 &&
> xfer_template.sgl[1].size == xfer_template.sgl[0].icg){
> /* a line and some */
> schan->xlen = xfer_template.sgl[0].size + xfer_template.sgl[1].size.
> schan->width = xfer_template.sgl[0].size;
> } else {
> /* _Hardware_ doesn't support the transfer as such. *
> return -EINVAL;
> }
> schan->ylen = xfer_template.numf /* -1? */;
Looks like Jassi got a user for his proposed API. I am not sure whats
going on with TI folks, they never showed up here @LPC.
--
~Vinod Koul
Intel Corp.
next prev parent reply other threads:[~2011-09-08 23:32 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-07 5:41 [PATCH] dmaengine: add CSR SiRFprimaII DMAC driver Barry Song
2011-09-07 16:14 ` Koul, Vinod
2011-09-07 16:46 ` Barry Song
2011-09-07 18:09 ` Koul, Vinod
2011-09-08 2:12 ` Barry Song
2011-09-08 3:17 ` Jassi Brar
2011-09-08 5:25 ` Jassi Brar
2011-09-08 6:36 ` Barry Song
2011-09-08 7:49 ` Jassi Brar
2011-09-08 21:51 ` Vinod Koul
2011-09-09 2:35 ` Barry Song
2011-09-09 2:52 ` Barry Song
2011-09-09 16:25 ` Vinod Koul
2011-09-09 23:37 ` Barry Song
2011-09-11 15:59 ` Vinod Koul
2011-09-12 0:13 ` Barry Song
2011-09-08 21:46 ` Vinod Koul [this message]
2011-09-09 8:18 ` Barry Song
2011-09-09 16:21 ` Vinod Koul
2011-09-09 23:40 ` Barry Song
2011-09-10 7:33 ` Jassi Brar
2011-09-11 16:02 ` Vinod Koul
2011-09-12 6:33 ` Jassi Brar
2011-09-14 5:07 ` Vinod Koul
2011-09-14 6:46 ` Barry Song
2011-09-14 7:11 ` Jassi Brar
2011-09-14 9:49 ` Barry Song
2011-09-08 6:14 ` Barry Song
2011-09-08 6:37 ` Jassi Brar
2011-09-08 2:18 ` Barry Song
2011-09-16 9:06 ` Barry Song
2011-09-07 19:27 ` Linus Walleij
2011-09-08 1:47 ` Barry Song
2011-09-08 14:52 ` Arnd Bergmann
2011-09-08 15:27 ` Barry Song
2011-09-08 16:19 ` Arnd Bergmann
[not found] ` <CAKnu2Mpnjec-hvfbT0zH1P2mGZKNwTQYgDLGHWUXLmGGQB0_ow@mail.gmail.com>
2011-09-08 20:11 ` Arnd Bergmann
2011-09-08 21:38 ` Vinod Koul
2011-09-11 21:27 ` Linus Walleij
2011-09-12 0:01 ` Barry Song
2011-09-14 4:54 ` Vinod Koul
2011-09-09 16:10 ` Vinod Koul
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=1315518378.6638.2.camel@vkoul-mobl4 \
--to=vkoul@infradead.org \
--cc=21cnbao@gmail.com \
--cc=Baohua.Song@csr.com \
--cc=arnd@arndb.de \
--cc=dan.j.williams@intel.com \
--cc=jassisinghbrar@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rongjun.ying@csr.com \
--cc=vinod.koul@intel.com \
--cc=workgroup.linux@csr.com \
/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