Forcing PIO mode instead of DMA via DT property

Wolfgang Denk wd at denx.de
Mon Jul 23 15:47:58 EST 2012


Dear Poonam,

In message <ACB6D0C0104CFF42A45A5D82A0DD4F3D079B4DAE at 039-SN2MPN1-013.039d.mgd.msft.net> you wrote:
> 
> > I'm trying to implement a driver that can do both DMA and PIO, and it
> > would be nice if the user was able to select the mode (on a per-bus
> > basis) using the DT.
> > The PIO mode can reduce the overhead in some cases and therefore be
> > better choice than the DMA (for example when most transfers move only
> > very few data, or when board-specific hardware properties kick in).
> > 
> > I was thinking about using some "manf,use-pio" DT property, but I haven't
> > found any such example yet, so I wonder if this is a good idea.
> Not sure, but as far as I understand device tree is to publish the hardware
>  capabilities, not the user choice/configuration.
> One option would be to put a compile time flag in the driver, which prefers
>  PIO than DMA.
> I believe by default DMA is the first preference.

We just had such a situation, where PIO had to be used on a specific
bus, because due to a hardware problem (board design error) DMA would
crash the system.  Yet the same driver/kernel would work fine with DMA
on other buses / boards.  OK, this was on x86, so DT would not have
helped, but I think a bus-specific property of being able to do DMA
(or not) might indeed make sense for the DT.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"I haven't lost my mind - it's backed up on tape somewhere."


More information about the devicetree-discuss mailing list