PCIe EP fails access Host Memory in linux armMIMX8ML8CVNKZAB based system

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

PCIe EP fails access Host Memory in linux armMIMX8ML8CVNKZAB based system

167 Views
awaissman
Contributor I
1. In uboot we passing "iommu.passthrough=1" to kernel to disable iommu
 
2. In our pcie device driver we are allocating memory using dma_alloc_coherent API as you suggested:
           cpu_ptr = dma_alloc_coherent(&pci_devp->dev, length, &dma_handle, GFP_KERNEL);
 
3. We are passing to EP value stored in dma_handle that , just for reference  here is what allocation returned:
 After Calling dma_alloc_coherent cpu_ptr=0xffff80000d0fd000, dma_handle=0xc4b00000 
 
4. Our EP will attempt  write to address 0xc4b00000.
 
5. No data founded in allocated memory.
 
6. In PCIe driver we are setting BME bit in side our EP device.
 
What may prevent from EP to access memory.
 
Thanks,
0 Kudos
Reply
1 Reply

139 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi,

The possible cause about this could relate to inbound iATU setting. If you add printk in dw_pcie_iatu_setup, you could see log like below, the driver doesn't use dw_pcie_prog_inbound_atu to program the 'dma-ranges' property as there is no such configuration in pcie dtsi node. 

[    2.513932] imx6q-pcie 33800000.pcie: iATU: unroll T, 4 ob, 4 ib, align 64K, limit 4G

[    2.527310] setuping pcie memory outbound, index:1, cpu_addr-->0x18000000, pci_addr-->0x18000000, size-->0x7f00000
[    2.537670] setuping pcie io outbound,index:2, cpu_addr-->0x1ff80000, pci_addr-->0x0, size-->0x10000


Best Regards,
Zhiming

0 Kudos
Reply