AnsweredAssumed Answered

Using qDMA to access PCIe memory

Question asked by Mathias Köhrer on Apr 11, 2018
Latest reply on Apr 12, 2018 by Mathias Köhrer

Hi all,

on an NXP LS1046A (board LS1046ARDB) I want to use the qDMA to access (read only) the memory of a PCIe device (offered as memory bar) using qDMA.

OS: Linux kernel 4.14.16

For doing this I have written a tiny kernel module that does roughly the following steps:

dma_alloc_coherent(....); // To be used as the destination memory
physaddr = 0x50400c0000; // This is the memory of the PCIe memory bar as seen by lspci

dma_map_resource(dev, physaddr, size, DMA_FROM_DEVICE, 0);
dev->device_prep_dma_memcpy(chan, dst, src, size, 0);

This works fine for sizes up to 15 (!!) byte. E.g. 4 or 8 byte copies are fine.

However when I want to use a size of 16 byte or larger there will be a DMA transaction error.
The qDMA register DEDR shows 0x20000000 (Read transaction error).

I tried a different type of PCIe device. Here the effect is similar, however I am only able to copy up to 7 (!!) byte.
Using a size >= 8 the same error occurs.

Is there any idea on what the issue could be?

Any help is highly welcome.


Thank you very much!

Best regards