<iscle>
could be either of the two, not really sure
<apritzel>
iscle: are there interrupt status bits you could poll to check this?
<apritzel>
and maybe inspect the DMA buffer memory to see if the controller put something in there?
<iscle>
I am printing the irq status register every time there's an usb interrupt (just in case the dma interrupt does not get triggered, but at least I get to read them after another usb interrupt is triggered) and the status is always 0.
<iscle>
I think the issue is that the DMA transfer is never started because I never receive anything in the host side (I'm testing as gadget/peripheral mode)
<apritzel>
looks odd (read: embedded) to have this a build time option. Why would one not want this? And who would make this decision? The distro?
<apritzel>
I guess a kernel command line option would be more useful?
<apritzel>
does the original Allwinner code actually use DMA? Or do they just have the code in, but never enable or use DMA?
<apritzel>
Because this is what I remember from previous investigations: that the BSP does not use DMA, and so people were wary it would work at all
<apritzel>
anyway, good job, let's hope it works now (and it's not just a spurious IRQ) ;-)
<iscle>
Not a spurious IRQ: https://pastecode.io/s/0phmszod it actually sets the DMA IRQ status bits for the appropriate channels
<iscle>
Now I just need to figure out how to handle it
<iscle>
And yes, the Allwinner code seems to use DMA, I checked build flags and everything and it should all be connected. That's why I did not know if those drq bits was needed or not
<iscle>
BTW, the code I'm writing does not support all SoCs, according to a comment in Allwinner's code: only SUN8IW5 and later ic support inner dma, former ic(eg. SUN8IW1, SUN8IW3, SUN8IW2 etc) use outer dma.
<iscle>
apritzel: Okay, so, I'm starting to think Allwinner's code does not use DMA, because without the drq bits correctly set, the DMA interrupt is never triggered (I'm guessing because it never starts)
<iscle>
However, with the drq bits being set, it does trigger the irq
ftg has quit [Read error: Connection reset by peer]
<iscle>
Okay, forget what I said xD The IRQ gets triggered when I write something from host to peripheral (remember, DUT is running as peripheral)
<iscle>
But we're a bit closer, I think... Will continue tomorrow
iscle has quit [Remote host closed the connection]
<iscle>
So, I'm about to give the USB DMA driver another go, and I found something which might explain what was happening... I had the DMA transfer direction the other way around...
<iscle>
It sure looks like that was the issue! Nice! :)