[U-Boot] [PATCH 1/2] nand_spl_simple: Add omap3 DMA usage to SPL

Scott Wood
2011-11-02T17:29:25Z

On 11/02/2011 04:57 AM, Simon Schwarz wrote:
> Hi Scott
>
> On 10/31/2011 10:22 PM, Scott Wood wrote:
>
>> What would the semantics of a generic dma_wait_for_transfer() be?
>>
>> I just don't see how this is generic at all, whatever the name.
>>
>
> Hm. It would be a check if the given DMA channel is active - and if it
> is busy waiting for it.
>
> So, what would then be a generic interface for DMA? I see that this is a
> verrry basic solution - but where do you see the actual problems
> implementing this interface for other DMA controllers? Or do you think
> that the interface is to simple?

I'd stick with something closer to the read_buf() interface -- something
like read_buf_async() and wait_for_async(). Let the controller driver
deal with the details of how DMA is done. Parameter is the mtd pointer,
not a channel number.

Certainly all the DMA setup stuff in nand_spl_load_image() needs to go
elsewhere.

>>> A whole new driver is IMHO not the right thing as there is too much
>>> duplicated code then.

I think it can be done with less duplication than in this patch --
should only need some ifdefs in the current code. There's no need to
support both modes of operation in one SPL image, right?

-Scott