USB DMA on Beagleboard xM (DM37x)

Hello,

I have written a USB driver for the OTG controller (just to be used as
peripheral) for a USB Stack (Not using Linux).
The driver is able to Tx/Rx at High Speed but I am only getting a
throughput of 3MB/s. I think I need DMA to get a higher throughput,
however I can't find the documentation for the DMA in the USB
controller. I need to know where the registers are located.

So my questions:
1. Does BB xM uses CPPI 4.1 DMA?
2. Where can I find the registers offsets for the DMA in the USB
controller?

Any other information that might be helpful when adding this
functionality to my USB driver?

Thanks,

- Esaias

Hello,

I have written a USB driver for the OTG controller (just to be used as
peripheral) for a USB Stack (Not using Linux).
The driver is able to Tx/Rx at High Speed but I am only getting a
throughput of 3MB/s. I think I need DMA to get a higher throughput,
however I can’t find the documentation for the DMA in the USB
controller. I need to know where the registers are located.

So my questions:

  1. Does BB xM uses CPPI 4.1 DMA?

Depends on which kernel you are talking about, but my understanding is that it is NOT enabled in the mainline. There have been a few candidate patches floated, but nothing accepted yet. You can google for it. There was an issue that prevents you from using the DMA in both directions and thus there was a desire to use the sDMA (system DMA) for transfers in one of the directions.

My impression might be quite wrong based on [1].

  1. Where can I find the registers offsets for the DMA in the USB
    controller?

Here’s the TI answer I got (yes, I work for TI, but I go through the typical support channels to get answers for the BeagleBoard community):

You can refer to linux code for Mentor DMA implementation. For document you should Contact local TI team and get it after signing NDA needed for this document.

I see you got a bit of an answer from the TI e2e forums [1]. It would be great if you could reply back here as well with whatever you learn.

The individual registers seem to be defined in [4] or [5]. I wanted to find where the base was introduced to see if the whole driver was introduced together, but it doesn’t look like it to me [3].

When lost in the code, it is time to revert to the TRM [7]. In the L4-Core Memory Space Mapping table, you can find the USB OTG controller base at 0x480AB000, but that doesn’t match the 0x4805e300 found in [3], which is just shown as RESERVED in the memory mapping table. :frowning:

[1] drv8840 OUT Max voltage - Motor drivers forum - Motor drivers - TI E2E support forums
[2] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=drivers/usb/musb/cppi_dma.c;h=149f3f310a0a1f9903793ca5f56daaf1038a4024;hb=HEAD
[3] ARM: OMAP: Sync headers with linux-omap - kernel/git/torvalds/linux.git - Linux kernel source tree
[4] musb_regs.h « musb « usb « drivers - kernel/git/torvalds/linux.git - Linux kernel source tree
[5] cppi_dma.h « musb « usb « drivers - kernel/git/torvalds/linux.git - Linux kernel source tree
[6] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=drivers/usb/musb/musbhsdma.h;h=320fd4afb93f7cd31b05e26e125819ae03af95c2;hb=HEAD
[7] DM3730 data sheet, product information and support | TI.com (search for “technical reference manual”)

Any other information that might be helpful when adding this
functionality to my USB driver?

If it is a Linux driver, include linux-omap (added to the CC) to the discussion. There are some USB experts there who might chime in if you are working on advancing the state of the mainline driver to include DMA support. If you have sufficient time to devote to improving the performance of the driver for the community, I can be a contact to enable the NDA.

Jason,

Thank you very much for taking the time to read and reply to my
inquiries, also for the offer of getting the documents under NDA.

The driver I am working on is not related to Linux (it's for a
proprietary stack), I am confused regarding documentation.
* The AM37x TRM (SPRUGN4M) has no information on USB registers, it
doesn't even mention CPPI at all.
* The AM35x TRM (SPRUGR0B) shows the register map for USB and mentions
CPPI, however I must say that on my implementation I am using
0x480AB000 as the base address for the Mentor Core registers (starting
with FADDR and on) and it is working correctly (driver is able to
enumerate, send and receive) so the register map does not match the
one I am using on my current working driver.

You might be able to answer some questions I have:
1. How similar is the OMAP2430 to the AM3730 regarding USB controller?
2. Where can I get the OMAP2430 TRM?

Regarding the current USB driver for BB xM, what's the performance?
What's the transfer rate in an IN transfer (the BB xM being a device,
so the BB xM transmitting data)?
What modules are used for the USB driver for BB xM? (msusbhsdma?
cppi41_dma? cppi_dma?).

Once again Jason, thank you so much for your time. I am sorry for
taking too long to reply but I didn't realize my question had been
approved and posted in the group (I submitted it before being accepted
into the group).

I will post my progress on this issue, once I got this sorted out I'll
contribute to the community.

- Esaias

Thank you for your help Jason.