DMA support for CF
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 17 lines · Matej Kupljen
Dear Sergey and Jeff,
I have a board based on AT91SAM9263, with the CF connected to the EBI0 and I am using the
pata-at91.cdriver.My question is, can I use DMA (MWDMA and/or UDMA) for the CF card, of course, if I add support to the driver?
Basically, the question is, can we use the HDMAC (DMA controller) to support the DMA transfers?
Please note that the DMARQ and DMACK are connected from CF to SoC.I've been looking for this in the documentation, and I cannot find the answer. Considering that the SAM9263 is considered legacy, I have checked the documentation for AT91SAM9R/RL and AT91SAM9G and I couldn't find the answer there either.
Quoted 5 lines
Can you answer this question, please?
If not, to whom I should send it?Thank you and Best Regards,
Matej Kupljen
Hi,
In the future could you please consider sending your questions to a proper kernel mail list cc-ing authors/maintainers if necessary.
As you noted, driver pata-at91 does not have dma support. This is because originally it has been developed for a board based on at91sam9260 chip which has no dma engine. More recent at91 chips (including at91sam9263) do have dma engines. It should be possible to add dma support to pata-at91 driver and use dma transfers for CF.
A couple of notes regarding at91sam9263:
1. DMA driver
IIRC at91sam9263 chip has a different dma engine than all the other chips of at91 family. More recent chips have HDMAC: drivers/dma/at_hdmac.c while at91sam9263 has DWDMA: drivers/dma/dw_dmac.c
2. Size of dma transfers
IIRC there is a problem with dma engine on at91sam9263 chip: it has significantly reduced block size for transfers. This leads into a fairly small max transfer size in a single block transfer. As a result, it might not be practical to use this particular dma engine for CF.
Thanks,
Sergey
Hi,
thank you for you answers, see my comments/questions below.
Quoted 2 lines
In the future could you please consider sending your questions to a proper kernel mail list cc-ing authors/maintainers if necessary.
Sorry for that, I'll do that in the future.
Quoted 5 lines
As you noted, driver pata-at91 does not have dma support. This is because originally it has been developed for a board based on at91sam9260 chip which has no dma engine. More recent at91 chips (including at91sam9263) do have dma engines. It should be possible to add dma support to pata-at91 driver and use dma transfers for CF.
I started adding this support to pata-at91 and I got to the point where I can see that DMARQ pin from CF is getting asserted, so the DMA could start.
Basically, I am not sure, hot to configure the DMA controller. Should the DMARQ pin be connected to HDMAC perepherial? What about DMACK pin? There is no DMACK signal from HDMAC. What Handshaking Interface should I select?
Hardware handshaking, Software handshaking or Peripheral interrupt handshaking?
Quoted 6 lines
A couple of notes regarding at91sam9263:
1. DMA driver
IIRC at91sam9263 chip has a different dma engine than all the other chips of at91 family. More recent chips have HDMAC:drivers/dma/at_hdmac.cwhile at91sam9263 has DWDMA:drivers/dma/dw_dmac.c
Yes, I found that after I managed to somehow support this controller with the at_hdmac.c, since I didn't find any reference to "Synopsys DesignWare DMA Controller" in the documentation.
Quoted 5 lines
2. Size of dma transfers
IIRC there is a problem with dma engine on at91sam9263 chip: it has significantly reduced block size for transfers. This leads into a fairly small max transfer size in a single block transfer. As a result, it might not be practical to use this particular dma engine for CF.
O.K., but still. The DMA support would be beneficial for other AT91 chips, with better DMA controller, wouldn't it?
I know, that my question are basically about configuring DMA controller, but I haven't found any answers in the documentation (I have checked also the docs for SAM9R/RL and SAM9G) and have not found my answers. I tried contacting the authors but didn0t get any answers. Maybe, posting to this list would help.
Thank you once again and Regards,
Matej Kupljen