I am attempting to read data using a C6678 EVM from an FPGA dev board using PCIe. The C6678 is the RC and the FPGA is the EP on the PCIe bus.
The FPGA has the following BARs configured:
BAR0 - 0x0 - 0x3FFF (16 kB)
BAR1 - 0x0 - 0xFFFF (64 kB)
BAR2 - 0x0 - 0xFFFF (64 kB)
BAR3 - 0x0 - 0xFFFF (64 kB)
BAR4 - 0x0 - 0x1FFFF (128 kB)
The C6678 EVN (and PCIe carrier card) are connected to the FPGA board using a simple PCIe backplane that wires the PCIe connectors together. I previously verified the operation of the C6678 and FPGA cards by plugging them both into a Linux based PC. In this case, the Linux PC is acting as the RC on the PCIe bus for both devices and I am able to read and write to all of the BARs on both cards with no issues.
With the C6678 as the RC, I am able to perform link training and read the configuration registers on the FPGA. I can see the vendor ID and device number that match what was configured in the FPGA.
The problem I am having is reading the data from the FPGA. I am following the example in the PCIE_exampleProject and also some modifications that I found on the TI E2E forum. I modified the value of PCIE_IB_LO_ADDR_M and PCIE_OB_LO_ADDR_M to 0x0 to reflect the start address of the PCIe BAR. I also set PCIE_BAR_IDX_S and PCIE_BAR_IDX_M to 1. PcieModeGbl is also set to pcie_RC_MODE.
The code in pcie_sample.c reports that it is successfully able to configure inbound and outbound translation. However when I try to read the BAR data using *((volatile uint32_t *)pcieBase + i) the data alternates between 0x60000000 and an sequence starting with 0x01 that increases in steps of 2.
Is the sequence I am seeing the default for the PCIe device memory upon initialization?
Is there something else I need to set up to trigger a read from the FPGA (such as some sort of read request TLP)?
Are there any other settings that may need to be modified other than the values of PCIE_IB_LO_ADDR_M, PCIE_OB_LO_ADDR_M, PCIE_BAR_IDX_M and PCIE_BAR_IDX_S?
Also does TI have an example code available beyond the pcie_sample.c file? The sample provided communicates only between two identical EVM cards and assumes the EP is pushing data back to the RC. I would like to find an example where the RC is initiating the data reads from an EP device.
Thanks,
-Bruce