Using DMA

Timur Tabi timur at freescale.com
Wed Nov 12 01:51:07 EST 2008


Bruce_Leonard at selinc.com wrote:
> linuxppc-embedded-bounces+brucle=selinc.com at ozlabs.org wrote on 11/09/2008 
> 04:09:51 PM:
> 
>>> The Elo device driver is an async DMA back-end driver.  That is, you
>>> don't communicate with that driver directly, you communicate with the
>>> async library (which is new - so you won't find it in LDD3).
>>>
>> Okay, has anyone actually _used_ the Elo driver?  I can't get the probe 
>> function to run.  I get into of_fsl_dma_init(), but of_fsl_dma_probe() 
>> never executes.  I have CONFIG_DMADEVICES and CONFIG_FSL_DMA set in my 
> 
> It would help if I was sure _when_the probe function was supposed to be 
> called. 

Normally, your driver's OF probe function will be called when the driver calls
of_register_platform_driver().

> I traced of_fsl_dma_init() all the way down into 
> bus_for_each_dev(), but the call to the passed in function 
> (__driver_attach() in this case) never gets called. 

I believe this because the kernel never scanned the DMA entries in the device
tree.  This is why I said you need of_platform_bus_probe() with the compatible
field of the parent of the DMA controller node.  Send me your device tree.

> Also, my NAND driver init function is 
> wrapped in module_init() whereas the Elo driver init function is wrapped 
> in subsys_initcall(). 

When compiled as a module, subsys_initcall() becomes module_init().  When
compiled in-kernel, subsys_initcall() guarantees the DMA driver is initialized
before other (normal) drivers are.

-- 
Timur Tabi
Linux kernel developer at Freescale


More information about the Linuxppc-embedded mailing list