2008-03-26 07:53:45

by Zhang Wei

[permalink] [raw]
Subject: [PATCH] fsldma: Split the MPC83xx event from MPC85xx and refine irq codes.

Split MPC83xx EOCDI event from MPC85xx EOLNI event, which is
also need to update cookie and start the next transfer.
The DMA channel irq handler function code is refined.
The patch is tested on MPC8377MDS board.

Signed-off-by: Zhang Wei <[email protected]>
---
drivers/dma/fsldma.c | 26 +++++++++++++++++++++-----
1 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index 07de0cf..b5a9d79 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -696,6 +696,8 @@ static irqreturn_t fsl_dma_chan_do_interrupt(int irq, void *data)
{
struct fsl_dma_chan *fsl_chan = (struct fsl_dma_chan *)data;
u32 stat;
+ int update_cookie = 0;
+ int xfer_ld_q = 0;

stat = get_sr(fsl_chan);
dev_dbg(fsl_chan->dev, "event: channel %d, stat = 0x%x\n",
@@ -720,8 +722,8 @@ static irqreturn_t fsl_dma_chan_do_interrupt(int irq, void *data)
* Now, update the completed cookie, and continue the
* next uncompleted transfer.
*/
- fsl_dma_update_completed_cookie(fsl_chan);
- fsl_chan_xfer_ld_queue(fsl_chan);
+ update_cookie = 1;
+ xfer_ld_q = 1;
}
stat &= ~FSL_DMA_SR_PE;
}
@@ -734,19 +736,33 @@ static irqreturn_t fsl_dma_chan_do_interrupt(int irq, void *data)
dev_dbg(fsl_chan->dev, "event: clndar %p, nlndar %p\n",
(void *)get_cdar(fsl_chan), (void *)get_ndar(fsl_chan));
stat &= ~FSL_DMA_SR_EOSI;
- fsl_dma_update_completed_cookie(fsl_chan);
+ update_cookie = 1;
+ }
+
+ /* For MPC8349, EOCDI event need to update cookie
+ * and start the next transfer if it exist.
+ */
+ if (stat & FSL_DMA_SR_EOCDI) {
+ dev_dbg(fsl_chan->dev, "event: End-of-Chain link INT\n");
+ stat &= ~FSL_DMA_SR_EOCDI;
+ update_cookie = 1;
+ xfer_ld_q = 1;
}

/* If it current transfer is the end-of-transfer,
* we should clear the Channel Start bit for
* prepare next transfer.
*/
- if (stat & (FSL_DMA_SR_EOLNI | FSL_DMA_SR_EOCDI)) {
+ if (stat & FSL_DMA_SR_EOLNI) {
dev_dbg(fsl_chan->dev, "event: End-of-link INT\n");
stat &= ~FSL_DMA_SR_EOLNI;
- fsl_chan_xfer_ld_queue(fsl_chan);
+ xfer_ld_q = 1;
}

+ if (update_cookie)
+ fsl_dma_update_completed_cookie(fsl_chan);
+ if (xfer_ld_q)
+ fsl_chan_xfer_ld_queue(fsl_chan);
if (stat)
dev_dbg(fsl_chan->dev, "event: unhandled sr 0x%02x\n",
stat);
--
1.5.4


2008-03-26 07:53:58

by Zhang Wei

[permalink] [raw]
Subject: [PATCH] fsldma: The MPC8377MDS board device tree node for fsldma driver

The fsldma driver is tested on MPC8377MDS board.
The patch adds fsldma driver support into MPC8377MDS device tree.

Signed-off-by: Zhang Wei <[email protected]>
---
arch/powerpc/boot/dts/mpc8377_mds.dts | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc8377_mds.dts b/arch/powerpc/boot/dts/mpc8377_mds.dts
index 49c05e9..ba5312e 100644
--- a/arch/powerpc/boot/dts/mpc8377_mds.dts
+++ b/arch/powerpc/boot/dts/mpc8377_mds.dts
@@ -268,6 +268,33 @@
interrupt-parent = <&ipic>;
};

+ dma@82a8 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "fsl,mpc8349-dma";
+ reg = <0x82a8 4>;
+ ranges = <0 0x8100 0x1a8>;
+ interrupt-parent = <&ipic>;
+ interrupts = <0x47 8>;
+ cell-index = <0>;
+ dma-channel@0 {
+ compatible = "fsl,mpc8349-dma-channel";
+ reg = <0 0x80>;
+ };
+ dma-channel@80 {
+ compatible = "fsl,mpc8349-dma-channel";
+ reg = <0x80 0x80>;
+ };
+ dma-channel@100 {
+ compatible = "fsl,mpc8349-dma-channel";
+ reg = <0x100 0x80>;
+ };
+ dma-channel@180 {
+ compatible = "fsl,mpc8349-dma-channel";
+ reg = <0x180 0x28>;
+ };
+ };
+
/* IPIC
* interrupts cell = <intr #, sense>
* sense values match linux IORESOURCE_IRQ_* defines:
--
1.5.4

2008-03-27 19:38:11

by Dan Williams

[permalink] [raw]
Subject: Re: [PATCH] fsldma: The MPC8377MDS board device tree node for fsldma driver

On Wed, Mar 26, 2008 at 12:42 AM, Zhang Wei <[email protected]> wrote:
> The fsldma driver is tested on MPC8377MDS board.
> The patch adds fsldma driver support into MPC8377MDS device tree.
>
> Signed-off-by: Zhang Wei <[email protected]>
> ---
> arch/powerpc/boot/dts/mpc8377_mds.dts | 27 +++++++++++++++++++++++++++
> 1 files changed, 27 insertions(+), 0 deletions(-)

I think this patch should probably go through the powerpc tree, or
-mm. I'll pick up the ones that touch either drivers/dma or
crypto/async_tx.

--
Dan

2008-03-28 02:10:44

by Zhang Wei

[permalink] [raw]
Subject: RE: [PATCH] fsldma: The MPC8377MDS board device tree node for fsldma driver

Hi, Dan,

Sure. The patch can be just a reference to how to config and enable the fsldma driver in dts file on MPC83xx boards.

Thanks!
Wei.

> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Dan Williams
> Sent: Friday, March 28, 2008 3:38 AM
> To: Zhang Wei; Andrew Morton
> Cc: Linux Kernel; Kumar Gala; [email protected]
> Subject: Re: [PATCH] fsldma: The MPC8377MDS board device tree
> node for fsldma driver
>
> On Wed, Mar 26, 2008 at 12:42 AM, Zhang Wei
> <[email protected]> wrote:
> > The fsldma driver is tested on MPC8377MDS board.
> > The patch adds fsldma driver support into MPC8377MDS device tree.
> >
> > Signed-off-by: Zhang Wei <[email protected]>
> > ---
> > arch/powerpc/boot/dts/mpc8377_mds.dts | 27
> +++++++++++++++++++++++++++
> > 1 files changed, 27 insertions(+), 0 deletions(-)
>
> I think this patch should probably go through the powerpc tree, or
> -mm. I'll pick up the ones that touch either drivers/dma or
> crypto/async_tx.
>
> --
> Dan
>

2008-03-28 02:25:00

by Kumar Gala

[permalink] [raw]
Subject: Re: [PATCH] fsldma: The MPC8377MDS board device tree node for fsldma driver


On Mar 27, 2008, at 2:37 PM, Dan Williams wrote:
> On Wed, Mar 26, 2008 at 12:42 AM, Zhang Wei
> <[email protected]> wrote:
>> The fsldma driver is tested on MPC8377MDS board.
>> The patch adds fsldma driver support into MPC8377MDS device tree.
>>
>> Signed-off-by: Zhang Wei <[email protected]>
>> ---
>> arch/powerpc/boot/dts/mpc8377_mds.dts | 27 ++++++++++++++++++++++
>> +++++
>> 1 files changed, 27 insertions(+), 0 deletions(-)
>
> I think this patch should probably go through the powerpc tree, or
> -mm. I'll pick up the ones that touch either drivers/dma or
> crypto/async_tx.

Can you resend and CC me. I'll pick it up and push through via the
powerpc tree.

I want to make one update to the driver to support the "proper" names
we document for compatible properties.

(uugh too many things to do)

- k

2008-03-28 02:26:20

by Zhang Wei

[permalink] [raw]
Subject: RE: [PATCH] fsldma: The MPC8377MDS board device tree node for fsldma driver

I'll send it to to.

> -----Original Message-----
> From: Kumar Gala [mailto:[email protected]]
> Sent: Friday, March 28, 2008 10:24 AM
> To: Dan Williams
> Cc: Zhang Wei; Andrew Morton; Linux Kernel; [email protected]
> Subject: Re: [PATCH] fsldma: The MPC8377MDS board device tree
> node for fsldma driver
>
>
> On Mar 27, 2008, at 2:37 PM, Dan Williams wrote:
> > On Wed, Mar 26, 2008 at 12:42 AM, Zhang Wei
> > <[email protected]> wrote:
> >> The fsldma driver is tested on MPC8377MDS board.
> >> The patch adds fsldma driver support into MPC8377MDS device tree.
> >>
> >> Signed-off-by: Zhang Wei <[email protected]>
> >> ---
> >> arch/powerpc/boot/dts/mpc8377_mds.dts | 27
> ++++++++++++++++++++++
> >> +++++
> >> 1 files changed, 27 insertions(+), 0 deletions(-)
> >
> > I think this patch should probably go through the powerpc tree, or
> > -mm. I'll pick up the ones that touch either drivers/dma or
> > crypto/async_tx.
>
> Can you resend and CC me. I'll pick it up and push through via the
> powerpc tree.
>
> I want to make one update to the driver to support the
> "proper" names
> we document for compatible properties.
>
> (uugh too many things to do)
>
> - k
>

2008-03-28 04:23:09

by Olof Johansson

[permalink] [raw]
Subject: Re: [PATCH] fsldma: The MPC8377MDS board device tree node for fsldma driver

On Thu, Mar 27, 2008 at 09:23:54PM -0500, Kumar Gala wrote:

>> I think this patch should probably go through the powerpc tree, or
>> -mm. I'll pick up the ones that touch either drivers/dma or
>> crypto/async_tx.

It's a good idea to cc all fsldma patches to linuxppc-dev when they're
posted too, none of them have been so they have been missing review from
the powerpc crowd that didn't catch them on lkml.


-Olof