Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: FDT DMA controller interface extension




To: port-arm%netbsd.org@localhost

Subject: Re: FDT DMA controller interface extension

From: Yuri Honegger <yuri.honegger%icloud.com@localhost>

Date: Sun, 25 Jan 2026 15:20:01 +0100


> Hi everyone,
> 
> Recently, I've been writing a DMA controller for the i.MX23. The i.MX23 DMA
> controller works by passing the hardware a pointer to a DMA command chain stored
> in memory. A DMA command looks roughly like this:
> 
> struct dma_command {
> void *next; /* you can chain commands */
> uint32_t control;
> void *buffer; /* memory buffer to transfer to/from */
> uint32_t pio_words[3];
> };
> 
> The i.MX23 DMA controller supports so-called "Programmable IO Words", short PIO.
> These PIO words get written to the hardware configuration register of the
> peripheral we are interacting over DMA before transferring data.
> 
> Due to some peculiarities of the i.MX23 hardware, you basically need to use PIO
> for the SD card driver if you don't want to write a polling driver.
> 
> The issue is that the FDT DMA controller interface (sys/dev/fdt/fdt_dma.h)
> doesn't provide a way to pass PIO data from a driver to the DMA controller.
> Therefore, I suggest to extend the fdtbus_dma_req struct with some optional
> parameters to specify PIO operations.
> 
> Here is my suggested diff. It solves the problem in the most straightforward way
> that works for the i.MX23.
> 
> Is it fine like this? I’m a bit afraid of ballooning the fdtbus_dma_req struct even more.
> Already right now most options are only supported by 1-2 controllers due to the wide
> variety in DMA controllers. 
> 
> Thanks,
> Yuri

Hi,
With the help of Nick and Jared, we’ve created an updated patch. It should be less 
i.MX23-specific by using a pointer+size approach.
Yuri


Attachment: fdt_dma_v2.diff
Description: Binary data


References:

FDT DMA controller interface extension
From: Yuri Honegger




Prev by Date: FDT DMA controller interface extension

Previous by Thread: FDT DMA controller interface extension

Indexes:

reverse Date

reverse Thread

Old Index



Home | Main Index | Thread Index | Old Index