* [Qemu-devel] [PATCH] hw/pxa2xx_dma.c @ 2007-11-15 9:53 Thorsten Zitterell 2007-11-17 15:12 ` andrzej zaborowski 0 siblings, 1 reply; 4+ messages in thread From: Thorsten Zitterell @ 2007-11-15 9:53 UTC (permalink / raw) To: qemu-devel [-- Attachment #1: Type: text/plain, Size: 123 bytes --] The following patch fixes the problem that DMA transfers are not performed when the DCSR_STOPINTR bit is set. -- Thorsten [-- Attachment #2: qemu-patch-pxa2xx_dma --] [-- Type: text/plain, Size: 674 bytes --] Index: hw/pxa2xx_dma.c =================================================================== RCS file: /sources/qemu/qemu/hw/pxa2xx_dma.c,v retrieving revision 1.5 diff -u -r1.5 pxa2xx_dma.c --- hw/pxa2xx_dma.c 11 Nov 2007 19:47:58 -0000 1.5 +++ hw/pxa2xx_dma.c 15 Nov 2007 09:28:22 -0000 @@ -186,7 +186,8 @@ s->running = 1; for (c = 0; c < s->channels; c ++) { ch = &s->chan[c]; - + + ch->state &= ~DCSR_STOPINTR; while ((ch->state & DCSR_RUN) && !(ch->state & DCSR_STOPINTR)) { /* Test for pending requests */ if ((ch->cmd & (DCMD_FLOWSRC | DCMD_FLOWTRG)) && !ch->request) ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] hw/pxa2xx_dma.c 2007-11-15 9:53 [Qemu-devel] [PATCH] hw/pxa2xx_dma.c Thorsten Zitterell @ 2007-11-17 15:12 ` andrzej zaborowski 2007-11-17 15:26 ` andrzej zaborowski 0 siblings, 1 reply; 4+ messages in thread From: andrzej zaborowski @ 2007-11-17 15:12 UTC (permalink / raw) To: qemu-devel [-- Attachment #1: Type: text/plain, Size: 1917 bytes --] Hi, On 15/11/2007, Thorsten Zitterell <the.real.hik@gmx.net> wrote: > The following patch fixes the problem that DMA transfers are not performed when > the DCSR_STOPINTR bit is set. > -- > Thorsten > > Index: hw/pxa2xx_dma.c > =================================================================== > RCS file: /sources/qemu/qemu/hw/pxa2xx_dma.c,v > retrieving revision 1.5 > diff -u -r1.5 pxa2xx_dma.c > --- hw/pxa2xx_dma.c 11 Nov 2007 19:47:58 -0000 1.5 > +++ hw/pxa2xx_dma.c 15 Nov 2007 09:28:22 -0000 > @@ -186,7 +186,8 @@ > s->running = 1; > for (c = 0; c < s->channels; c ++) { > ch = &s->chan[c]; > - > + > + ch->state &= ~DCSR_STOPINTR; > while ((ch->state & DCSR_RUN) && !(ch->state & DCSR_STOPINTR)) { > /* Test for pending requests */ > if ((ch->cmd & (DCMD_FLOWSRC | DCMD_FLOWTRG)) && !ch->request) > > Can you check if the following change would make the gumstix NIC work too? In my understanding of the specs it's more correct, but I'm not sure. diff --git a/hw/pxa2xx_dma.c b/hw/pxa2xx_dma.c index 4c60ffd..7067a78 100644 --- a/hw/pxa2xx_dma.c +++ b/hw/pxa2xx_dma.c @@ -342,7 +343,7 @@ static void pxa2xx_dma_write(void *opaque, DCSR_STARTINTR | DCSR_BUSERRINTR)); s->chan[channel].state |= value & 0xfc800000; - if (s->chan[channel].state & DCSR_STOPIRQEN) + if (s->chan[channel].state & (DCSR_STOPIRQEN | DCSR_RUN)) s->chan[channel].state &= ~DCSR_STOPINTR; if (value & DCSR_NODESCFETCH) { @@ -352,7 +353,6 @@ static void pxa2xx_dma_write(void *opaque, } else { /* Descriptor-fetch mode */ if (value & DCSR_RUN) { - s->chan[channel].state &= ~DCSR_STOPINTR; pxa2xx_dma_descriptor_fetch(s, channel); pxa2xx_dma_run(s); } Regards [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: pxa-dma-stopintr-clear.patch --] [-- Type: text/x-patch; name=pxa-dma-stopintr-clear.patch, Size: 849 bytes --] diff --git a/hw/pxa2xx_dma.c b/hw/pxa2xx_dma.c index 4c60ffd..7067a78 100644 --- a/hw/pxa2xx_dma.c +++ b/hw/pxa2xx_dma.c @@ -342,7 +343,7 @@ static void pxa2xx_dma_write(void *opaque, DCSR_STARTINTR | DCSR_BUSERRINTR)); s->chan[channel].state |= value & 0xfc800000; - if (s->chan[channel].state & DCSR_STOPIRQEN) + if (s->chan[channel].state & (DCSR_STOPIRQEN | DCSR_RUN)) s->chan[channel].state &= ~DCSR_STOPINTR; if (value & DCSR_NODESCFETCH) { @@ -352,7 +353,6 @@ static void pxa2xx_dma_write(void *opaque, } else { /* Descriptor-fetch mode */ if (value & DCSR_RUN) { - s->chan[channel].state &= ~DCSR_STOPINTR; pxa2xx_dma_descriptor_fetch(s, channel); pxa2xx_dma_run(s); } ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] hw/pxa2xx_dma.c 2007-11-17 15:12 ` andrzej zaborowski @ 2007-11-17 15:26 ` andrzej zaborowski 2007-11-17 15:42 ` Thorsten Zitterell 0 siblings, 1 reply; 4+ messages in thread From: andrzej zaborowski @ 2007-11-17 15:26 UTC (permalink / raw) To: qemu-devel [-- Attachment #1: Type: text/plain, Size: 1691 bytes --] On 17/11/2007, andrzej zaborowski <balrogg@gmail.com> wrote: > Hi, > > On 15/11/2007, Thorsten Zitterell <the.real.hik@gmx.net> wrote: > > The following patch fixes the problem that DMA transfers are not performed when > > the DCSR_STOPINTR bit is set. > > -- > > Thorsten > > > > Index: hw/pxa2xx_dma.c > > =================================================================== > > RCS file: /sources/qemu/qemu/hw/pxa2xx_dma.c,v > > retrieving revision 1.5 > > diff -u -r1.5 pxa2xx_dma.c > > --- hw/pxa2xx_dma.c 11 Nov 2007 19:47:58 -0000 1.5 > > +++ hw/pxa2xx_dma.c 15 Nov 2007 09:28:22 -0000 > > @@ -186,7 +186,8 @@ > > s->running = 1; > > for (c = 0; c < s->channels; c ++) { > > ch = &s->chan[c]; > > - > > + > > + ch->state &= ~DCSR_STOPINTR; > > while ((ch->state & DCSR_RUN) && !(ch->state & DCSR_STOPINTR)) { > > /* Test for pending requests */ > > if ((ch->cmd & (DCMD_FLOWSRC | DCMD_FLOWTRG)) && !ch->request) > > > > > > Can you check if the following change would make the gumstix NIC work > too? In my understanding of the specs it's more correct, but I'm not > sure. Sorry, rather this is what I meant: --- a/hw/pxa2xx_dma.c +++ b/hw/pxa2xx_dma.c @@ -347,8 +348,10 @@ static void pxa2xx_dma_write(void *opaque, if (value & DCSR_NODESCFETCH) { /* No-descriptor-fetch mode */ - if (value & DCSR_RUN) + if (value & DCSR_RUN) { + s->chan[channel].state &= ~DCSR_STOPINTR; pxa2xx_dma_run(s); + } } else { /* Descriptor-fetch mode */ if (value & DCSR_RUN) { [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: pxa-dma-stopintr-clear.patch --] [-- Type: text/x-patch; name=pxa-dma-stopintr-clear.patch, Size: 550 bytes --] diff --git a/hw/pxa2xx_dma.c b/hw/pxa2xx_dma.c index 4c60ffd..048cb93 100644 --- a/hw/pxa2xx_dma.c +++ b/hw/pxa2xx_dma.c @@ -347,8 +348,10 @@ static void pxa2xx_dma_write(void *opaque, if (value & DCSR_NODESCFETCH) { /* No-descriptor-fetch mode */ - if (value & DCSR_RUN) + if (value & DCSR_RUN) { + s->chan[channel].state &= ~DCSR_STOPINTR; pxa2xx_dma_run(s); + } } else { /* Descriptor-fetch mode */ if (value & DCSR_RUN) { ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] hw/pxa2xx_dma.c 2007-11-17 15:26 ` andrzej zaborowski @ 2007-11-17 15:42 ` Thorsten Zitterell 0 siblings, 0 replies; 4+ messages in thread From: Thorsten Zitterell @ 2007-11-17 15:42 UTC (permalink / raw) To: qemu-devel >> Can you check if the following change would make the gumstix NIC work >> too? In my understanding of the specs it's more correct, but I'm not >> sure. It works! ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-11-17 15:42 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2007-11-15 9:53 [Qemu-devel] [PATCH] hw/pxa2xx_dma.c Thorsten Zitterell 2007-11-17 15:12 ` andrzej zaborowski 2007-11-17 15:26 ` andrzej zaborowski 2007-11-17 15:42 ` Thorsten Zitterell
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).