Dear Sir/Madam,
I developed a PCIe card with Altera FPGA and I am trying to DMA 1024 bytes data from FPGA on-chip memory to a fixed physical address in TX2 linux.
In the FPGA, I set a fixed translation table which map the 0xE0000000 for DMA writing. So I don’t need to get the physical address by dma_alloc_coherent() and transfer it to FPGA in TX2 linux.
In the TX2 linux, I set the mem=3G in cbootargs to keep the 0xE0000000 clear from TX2 linux. Then in my driver, I simply mmap the physical address(0xE0000000) to user space by remap_pfn_range(vma, vma->vm_start, phy_add>> PAGE_SHIFT, size, PAGE_SHARED).
First time when I run the test application, I got “arm-smmu 12000000.iommu: Unhandled context fault: iova=0xe0000000, fsynr=0x240013, …” error for every time the DMA running. Then I search the topic in our forum. I noticed I need to disable SMMU for PCIe. I did it by remove:
- “#stream-id-cells = <1>;” from “tegra_pcie” node
- “<&{/pcie-controller@10003000} TEGRA_SID_AFI>,” from “smmu” node
After the fix, I run the test application again. There is no error anymore for the iommu. But I still cannot read anything from the 0xE0000000.
On the other hand, the system becomes very slow after I flash the new dtb without the pcie smmu. I check the dmesg and found many smmu error during the startup:
[ 0.212934] /iommu@12000000: could not get #stream-id-cells for /pcie-controller@10003000
[ 0.213042] arm-smmu 12000000.iommu: registered 40 master devices
[ 0.218490] mc: mapped MMIO address: 0xffffff8000540000 → 0x2c10000
[ 0.218554] mc: mapped MMIO address: 0xffffff8000560000 → 0x2c20000
[ 0.218602] mc: mapped MMIO address: 0xffffff8000640000 → 0x2c30000
[ 0.218650] mc: mapped MMIO address: 0xffffff8000660000 → 0x2c40000
[ 0.218713] mc: mapped MMIO address: 0xffffff8000fa0000 → 0x2c50000
[ 0.218753] mc-err: Set intmask: 0xf3140
[ 0.219064] ecc-err: dram ecc disabled-MC_ECC_CONTROL:0x0000000c
[ 0.219555] bpmp: ping status is 0
[ 0.219877] arm-smmu 12000000.iommu: Unexpected {global,context} fault, this could be serious
[ 0.219903] arm-smmu 12000000.iommu: GFSR 0x80000002, GFSYNR0 0x00000000, GFSYNR1 0x00001432, GFSYNR2 0x00000000
[ 0.219964] bpmp d000000.bpmp: firmware tag is
[ 0.220005] (255) csw_bpmpw: MC request violates VPR requirements
[ 0.220018] status = 0x00337094; addr = 0x3ffffffc0
[ 0.220025] secure: yes, access-type: write
[ 0.220039] unknown mcerr fault, int_status=0x00000000, ch_int_status=0x00000000, hubc_int_status=0x00000000
[ 0.220059] unknown mcerr fault, int_status=0x00000000, ch_int_status=0x00000000, hubc_int_status=0x00000000
[ 0.220071] unknown mcerr fault, int_status=0x00000000, ch_int_status=0x00000000, hubc_int_status=0x00000000
[ 0.220090] mc-err: Too many MC errors; throttling prints
Have you met similar problems? My questions are:
1. Is there any problem for me to DMA data with a fixed physical address?
2. Why I cannot read anything after fixing the SMMU? Is there anyway to confirm the data exsiting in a specific physical address(0xE0000000)?
3. Why the system become slow? Is there anyway to fix it?
Best regards!
/ Daning