You could refer to section "7.11.6 PCIE EP" in QORIQ-SDK-2.0-IC-REV0.pdf.
Please refer to LS1046A RDB in PCIe-Endpoint Mode .
1. Modify the rcw for EP board:
set :
HOST_AGT_PEX=1
SRDS_DIV_PEX_S3=1
SRDS_DIV_PEX_S4=1
modify rcw for RC board as follow to set the linkup speed to 5.0G
SRDS_DIV_PEX_S3=1
SRDS_DIV_PEX_S4=1
Then rebuild the two rcw,
Program the rcw into EP and RC board
2.
Build the image for EP board
$ bitbake -c menuconfig virtual/kernel
-> Device Drivers
-><*>VFIO Non-Privileged userspace driver framework
-><*> VFIO support for Freescale PCI Endpoint devices
-><*> Userspace I/O drivers
<*> Freescale DMA support
3. Boot up the EP board with kerenl rootfs
Deploy the EP board
Run PCI DMA EP application to initialize EP device.
root@p5020ds:~# ./pciep_dma 0
pcidma> add 0 0
4. Build the PCIe RC driver
-> Device Drivers
-> DMA Engine support
[*] Freescale Elo and Elo Plus DMA support (enable the option)
->Bus options
--> [*] PCI IOV support
5.
On the RC board:
Test RC to EP DMA performance
root@t4240qds:/sys/class# cd pcidma/pcidma0/ root@t4240qds:/sys/class/pcidma/pcidma0# ls bars_info config_infodevicesubsystem test_dma_enable test_ep2rctest_info test_lens test_loop test_rc2ep test_start uevent
root@t4240qds:/sys/class/pcidma/pcidma0# echo 1 > test_start test starting root@t4240qds:/sys/class/pcidma/pcidma0# test info: test0 packet length:64B loop:500times RC->EP throughput:49Mbps test1 packet length:256B loop:500times RC->EP throughput:164Mbps test2 packet length:1024B loop:500times RC->EP throughput:658Mbps test3 packet length:4096B loop:500times RC->EP throughput:1594Mbps test4 packet length:1048576B loop:500times RC->EP throughput:11216Mbps test5 packet length:2097152B loop:500times RC->EP throughput:11337Mbps
6.Test EP to RC DMA performance
root@t4240qds:/sys/class/pcidma/pcidma0# echo 1 > test_ep2rc root@t4240qds:/sys/class/pcidma/pcidma0# echo 0 > test_rc2ep root@t4240qds:/sys/class/pcidma/pcidma0# echo 1 > test_start test starting root@t4240qds:/sys/class/pcidma/pcidma0# test info: test0 packet length:64B loop:500times EP->RC throughput:353Mbps test1 packet length:256B loop:500times EP->RC throughput:1270Mbps test2 packet length:1024B loop:500times EP->RC throughput:3893Mbps test3 packet length:4096B loop:500times EP->RC throughput:7710Mbps test4 packet length:1048576B loop:500times EP->RC throughput:12148Mbps test5 packet length:2097152B loop:500times EP->RC throughput:12162Mbps