Is there a binding for IORESOURCE_DMA population?

Shawn Guo shawn.guo at freescale.com
Sat Jul 16 02:32:55 EST 2011


It's pretty common on ARM platforms that IORESOURCE_DMA is being used
by platform devices to tell DMA channel/request/event number (either
physical or virtual).  And then drivers simply call function
platform_get_resource() to get that.  Do we have any support for
IORESOURCE_DMA to make it migrate to device tree probe as easy as we
do for IORESOURCE_IRQ?  Or do we have to follow "dma-channel" binding
that is being used on powerpc?

I ask because I do not see too much sense to use dma-channel binding
on ARM platforms.  For specific example like imx-sdma, it has 32
physical channels which are not bonded to any specific devices.
Instead, hardware defines 48 dma events (something like virtual
channels).  Every single event is assigned to specific device by
hardware.  Whenever one device wants to do dma, it just tells its dma
request number.  sdma will find an available physical channel to
do dma.

First of all, using powerpc dma-channel binding on such dma event
seems not reflecting the hardware facts.  Secondly, the binding in
this case (below) looks silly.  Thirdly, device driver need to make
code change for simply getting a dma event number.

sdma at 83fb0000 {
        #address-cells = <1>;
        #size-cells = <0>;
        compatible = "fsl,imx51-sdma", "fsl,imx35-sdma";
        reg = <0x83fb0000 0x4000>;
        interrupts = <6>;
        fsl,sdma-ram-script-name = "sdma-imx51.bin";

        dma00: dma-channel at 0 {
                compatible = "fsl,sdma-channel";
                reg = <0>;
        };

        dma01: dma-channel at 1 {
                compatible = "fsl,sdma-channel";
                reg = <1>;
        };

        dma02: dma-channel at 2 {
                compatible = "fsl,sdma-channel";
                reg = <2>;
        };

        dma04: dma-channel at 3 {
                compatible = "fsl,sdma-channel";
                reg = <3>;
        };

        ......

        dma47: dma-channel at 47 {
                compatible = "fsl,sdma-channel";
                reg = <47>;
        };
};

ssi at 83fcc000 { /* SSI1 */
        compatible = "fsl,imx51-ssi", "fsl,imx1-ssi";
        reg = <0x83fcc000 0x4000>;
        interrupts = <29>;
        fsl,ssi-uses-dma;
        fsl,ssi-tx-dma-channel = &dma02;
        fsl,ssi-rx-dma-channel = &dma03;
};

Should we get dt infrastructural auto-load IORESOURCE_DMA to make
the thing a lot easier?  Or did I miss anything?

-- 
Regards,
Shawn



More information about the devicetree-discuss mailing list