Port-arm archive

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

FDT DMA controller interface extension




To: port-arm%netbsd.org@localhost

Subject: FDT DMA controller interface extension

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

Date: Sun, 25 Jan 2026 00:12:02 +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


Attachment: fdt_dma.diff
Description: Binary data




Prev by Date: Re: HEADS UP: DTS updated [was Re: Call for testers: new DTS from Linux 6.12]

Previous by Thread: WiFi on RPI4 - still unconfigured in 2026?

Indexes:

reverse Date

reverse Thread

Old Index



Home | Main Index | Thread Index | Old Index