Using qDMA to access PCIe memory

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Using qDMA to access PCIe memory

2,460 次查看
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

标签 (1)
标记 (1)
0 项奖励
回复
2 回复数

1,906 次查看
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 项奖励
回复

1,966 次查看
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 项奖励
回复