[U-Boot] {Spam?} usage of DMA

Marcel korgull at home.nl
Tue Jan 11 22:51:16 CET 2011


Hi,

I'm implementing the USB device controller for the SAM9G45 and got to a point 
where I've got endpoint 0 to work, so basically all descriptors are received 
by the host.
I did however have an issue getting past this and found it's related to the 
linux driver using DMA for all the other endpoints.

Somehow I managed to get endpoint 3 (status) to work with ether.c and got the 
device recognised as an ethernet gadget, however endpoints 1 and 2 still don't 
work. This was using DMA.

I'm a little stuck with the DMA part and have some questions about it :

1) I suppose this can also work work without DMA and it would make the driver 
a whole lot simpler I guess. Is this prefered in U-boot ?

2) If I want to use DMA so I can port most things from Linux, how would I deal 
with functions like 
dma_sync_single_for_device (doesn't seem to exist)
dma_map_single
dma_unmap_single

I tried to make it work without DMA and implemented the part that switched off 
DMA for the controller. I think this code works well.
Unfortunately I have no idea how to read data from the endpoints in this case 
yet. I see that data arrives (I see the out packet arrives and it tries to 
read) but I probably don't read it correctly.

I guess question 1 is most important. If using DMA is not preferred I will try 
to make it work without DMA and can forget about question 2.

Best regards,
Marcel 



More information about the U-Boot mailing list