Immediate dma_write() and dma_read() cause system crash
Dear supporters,
My SDK is JetPack_4.6.1_Linux_JETSON_XAVIER_NX_TARGETS.
I modified pcie-tegra.c (at drivers/pci/dwc/) to communicate EP(FPGA) and RC (Xavier NX) using DMA and ioctl;
RC is providing misc_device to allow an application access DMA memory by mmap(). Single and discrete dma_write() or dma_read() are OK but immediate and contiguous (pair) dma_write() and dma_read() caused system crash.
Pseudo code;
write FPGA’s memory bank number through dma_write() as follow;
…
tx.dst = pcie->dst = RC_DMA_PHY_ADDR + 0x200; /* 0x1f40000000, DMA memory address /
/ adding an offset as 0x200 is FPGA engineer’s request to identify its internal memory bank */
dst_cpu_virt = ioremap(pcie->dst, pcie->size);
memcpy(pcie->cpu_virt_addr, &((struct ioctl_info *)data)->chan, tx.size);
ret = sci_dma_write(pcie, &tx);
…
I could check the correct (intended) memory bank number was written at RC_DMA_PHY_ADDR + 0x200. I’ve check this with Vivado tool.
try to read data
After above dma_write(), I immediately tried to read FPGA’s memory bank at RC_DMA_PHY_ADDR but the system crashed.
Do you have any idea about this weird situation?
If you need full source code please let me know, I will provide you in private.
Thanks in advance,
Matt