I am trying to get DMA transfer between FPGA and Linux x86_64 machine.
On the PC side, I do this initialization:
//driver probe ... pci_set_master(dev); //set endpoint as master result = pci_set_dma_mask(dev, 0xffffffffffffffff); //set as 64bit capable ... //read pagePointer = __get_free_page(__GFP_HIGHMEM); //get 1 page temp_addr = dma_map_page(&myPCIDev->dev,pagePointer,0,PAGE_SIZE,DMA_TO_DEVICE); printk(KERN_WARNING "[%s]Page address: 0x%lx Bus address: 0x%lx\n",DEVICE_NAME,pagePointer,temp_addr); writeq(cpu_to_be64(temp_addr),bar0Addr); //send address to FPGA wmb(); writeq(cpu_to_be64(1),bar1Addr); //start trasnfer wmb();
The bus address is a 64-bit address. On the FPGA TLP side, I send 1 DW to read:
Fmt: "001" Type: "00000" R|TC|R|Attr|R|TH : "00000000" TD|EP|Attr|AT : "000000" Length : "0000000001" Requester ID Tag : "00000000" Byte Enable : "00001111"; Address : (address from dma map page)
The completion that I will return from the PC is:
Fmt: "000" Type: "01010" R|TC|R|Attr|R|TH : "00000000" TD|EP|Attr|AT : "000000" Length : "0000000000" Completer ID Compl Status|BCM : "0010" Length : "0000000000"; Requester ID Tag : "00000000" R|Lower address : "00000000"
so basically this is completion without data and with Unsupported Request status. I donβt think that something is wrong with the TLP design, but I donβt see any problem on the part of the driver. The kernel I use has a PCIe error message, but I don't see anything in the dmesg output. What's wrong? Or, is there a way to find why I am receiving this unsupported Completion request?
Marco
source share