Using qDMA to access PCIe memory

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using qDMA to access PCIe memory

1,422 Views
mathiasköhrer
Contributor I

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

Mathias

Labels (1)
Tags (1)
0 Kudos
2 Replies

868 Views
diljithka
Contributor I

Hi

I also have an  requirement to use the qDMA to access  the memory of a PCIe device on  LS1046. can you please share the steps that you have followed? Do you have any sample application ??

0 Kudos

928 Views
mathiasköhrer
Contributor I

The issue for the behaviour was the PCIe device in use. I switched over to a different device, a FPGA based PCIe board that allows block reading via PCIe memory bars. Now everything works as expected.

0 Kudos