All of lore.kernel.org
 help / color / mirror / Atom feed
* [Q] PL011 DMA Rx, using ste_dma40
@ 2013-11-27 16:38 Guennadi Liakhovetski
  2013-11-27 20:30 ` Russell King - ARM Linux
  0 siblings, 1 reply; 3+ messages in thread
From: Guennadi Liakhovetski @ 2013-11-27 16:38 UTC (permalink / raw)
  To: linux-arm-kernel

Hi

I'm trying to get a PL011 UART to work in DMA mode with an alternative 
DMAC. Transmission works, reception is more problematic. I can receive a 
complete page of data (4096 bytes), but nothing below that triggers a 
reception. Is this expected if no polling is used, as configured by the 
dma_rx_poll_timeout platform parameter, or should it work, triggered by 
the Rx timeout UART interrupt?

Looking at the amba-pl011 UART driver it seems, that it expects an Rx FIFO 
timeout IRQ to trigger if fewer than a full Rx DMA buffer bytes of data 
are received along the lines of pl011_dma_rx_irq(). Such an Rx FIFO 
timeout interrupt should be raised by the UART if a timeout occurs after 
fewer that an Rx threshold bytes are received in the UART FIFO. However, 
as soon as any data is received by the UART the DMA request line is 
toggled, which causes the DMAC to immediately read the bytes out of the 
UART, so, no timeout is occurring.

How is it working in the original set up with ste_dma40 compatible DMACs? 
Or is reception of < 4096 bytes of data, using DMA only working with 
polling, for which there's currently no DT binding?

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Q] PL011 DMA Rx, using ste_dma40
  2013-11-27 16:38 [Q] PL011 DMA Rx, using ste_dma40 Guennadi Liakhovetski
@ 2013-11-27 20:30 ` Russell King - ARM Linux
  2013-11-27 20:45   ` Guennadi Liakhovetski
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2013-11-27 20:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 27, 2013 at 05:38:43PM +0100, Guennadi Liakhovetski wrote:
> I'm trying to get a PL011 UART to work in DMA mode with an alternative 
> DMAC. Transmission works, reception is more problematic. I can receive a 
> complete page of data (4096 bytes), but nothing below that triggers a 
> reception. Is this expected if no polling is used, as configured by the 
> dma_rx_poll_timeout platform parameter, or should it work, triggered by 
> the Rx timeout UART interrupt?

Yes, there's a very basic hardware design error here.

The PL011 does, as you've noticed, have a Rx timeout interrupt.  This
timeout interrupt only fires if you leave data in the Rx FIFO.

This means that when you use DMA, for the hardware to operate correctly,
you must _not_ have the DMA engine fully empty the Rx FIFO, otherwise
interactive use is impossible.

I wrote about this when I looked at DMA on the ARM Realview boards.
I came to the conclusion that was just better to completely ignore the
hardware DMA side of PL011 and just use PIO.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Q] PL011 DMA Rx, using ste_dma40
  2013-11-27 20:30 ` Russell King - ARM Linux
@ 2013-11-27 20:45   ` Guennadi Liakhovetski
  0 siblings, 0 replies; 3+ messages in thread
From: Guennadi Liakhovetski @ 2013-11-27 20:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 27 Nov 2013, Russell King - ARM Linux wrote:

> On Wed, Nov 27, 2013 at 05:38:43PM +0100, Guennadi Liakhovetski wrote:
> > I'm trying to get a PL011 UART to work in DMA mode with an alternative 
> > DMAC. Transmission works, reception is more problematic. I can receive a 
> > complete page of data (4096 bytes), but nothing below that triggers a 
> > reception. Is this expected if no polling is used, as configured by the 
> > dma_rx_poll_timeout platform parameter, or should it work, triggered by 
> > the Rx timeout UART interrupt?
> 
> Yes, there's a very basic hardware design error here.
> 
> The PL011 does, as you've noticed, have a Rx timeout interrupt.  This
> timeout interrupt only fires if you leave data in the Rx FIFO.
> 
> This means that when you use DMA, for the hardware to operate correctly,
> you must _not_ have the DMA engine fully empty the Rx FIFO, otherwise
> interactive use is impossible.

Thanks, Russell, this perfectly answers my question.

> I wrote about this when I looked at DMA on the ARM Realview boards.
> I came to the conclusion that was just better to completely ignore the
> hardware DMA side of PL011 and just use PIO.

Regards
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-11-27 20:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-27 16:38 [Q] PL011 DMA Rx, using ste_dma40 Guennadi Liakhovetski
2013-11-27 20:30 ` Russell King - ARM Linux
2013-11-27 20:45   ` Guennadi Liakhovetski

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.