Skip to contentSkip to conversation

How to tell DMA controller in qemu to terminate transfer ?

DISCUSSION Guenter Roeck 2 participants 4 messages Jan 8, 2020 – Jan 10, 2020

lore
Share & tools
lore
#0 lore raw

Hi,

I am trying to fix DMA support with Exynos4210. The original commit 59520dc65e ("hw/arm/exynos4210: Add DMA support for the Exynos4210") doesn't really work, primarily because it assigns wrong interrupt lines (no idea how I thought I tested that).

Problem I have right now is that the pl330 peripheral DMA in Exynos4210 depends on a signal from the peripheral device (here: serial ports) to end a DMA transfer. To make this work, I need a signal from exynos4210_uart.c to pl330.c to terminate the DMA after the receive buffer is empty.

How can I implement this in qemu ?

Thanks,
Guenter

#1 lore raw
Quoted 8 lines · Guenter Roeck

Hi,

I am trying to fix DMA support with Exynos4210. The original commit 59520dc65e ("hw/arm/exynos4210: Add DMA support for the Exynos4210") doesn't really work, primarily because it assigns wrong interrupt lines (no idea how I thought I tested that).

Quoted 7 lines

Problem I have right now is that the pl330 peripheral DMA in Exynos4210 depends on a signal from the peripheral device (here: serial ports) to end a DMA transfer. To make this work, I need a signal from exynos4210_uart.c to pl330.c to terminate the DMA after the receive buffer is empty.

How can I implement this in qemu ?

That depends. How does the UART signal the DMA controller in real hardware? If there's a signal line of some kind, then you can model that with a qemu_irq line which the UART exposes and raises/lowers at the right time, that's then plumbed through by the SoC to the DMA controller.

thanks
-- PMM

#2 lore raw

Hi Peter,

Quoted 15 lines · Peter Maydell
Quoted 14 lines · Guenter Roeck

Hi,

I am trying to fix DMA support with Exynos4210. The original commit 59520dc65e ("hw/arm/exynos4210: Add DMA support for the Exynos4210") doesn't really work, primarily because it assigns wrong interrupt lines (no idea how I thought I tested that).

Problem I have right now is that the pl330 peripheral DMA in Exynos4210 depends on a signal from the peripheral device (here: serial ports) to end a DMA transfer. To make this work, I need a signal from exynos4210_uart.c to pl330.c to terminate the DMA after the receive buffer is empty.

Quoted 4 lines
Quoted 1 line

How can I implement this in qemu ?

That depends. How does the UART signal the DMA controller in real hardware? If there's a signal line of some kind,

Yes, that is my understanding.

Quoted 4 lines

then you can model that with a qemu_irq line which the UART exposes and raises/lowers at the right time, that's then plumbed through by the SoC to the DMA controller.

Makes sense. Can you give me some hints on how to do that, or point me to an example ?

The pl330 dma code registers a set of gpio pins tied to pl330_dma_stop_irq(). I suspect that is what I am looking for, I just have no idea how to tie it to the serial driver code.

Thanks,
Guenter

#3 lore raw
In reply to Peter Maydell
Quoted 15 lines · Peter Maydell
Quoted 14 lines · Guenter Roeck

Hi,

I am trying to fix DMA support with Exynos4210. The original commit 59520dc65e ("hw/arm/exynos4210: Add DMA support for the Exynos4210") doesn't really work, primarily because it assigns wrong interrupt lines (no idea how I thought I tested that).

Problem I have right now is that the pl330 peripheral DMA in Exynos4210 depends on a signal from the peripheral device (here: serial ports) to end a DMA transfer. To make this work, I need a signal from exynos4210_uart.c to pl330.c to terminate the DMA after the receive buffer is empty.

Quoted 8 lines
Quoted 1 line

How can I implement this in qemu ?

That depends. How does the UART signal the DMA controller in real hardware? If there's a signal line of some kind, then you can model that with a qemu_irq line which the UART exposes and raises/lowers at the right time, that's then plumbed through by the SoC to the DMA controller.

Never mind my previous e-mail; the above was enough to get it working.

Thanks!
Guenter