I has the following configuration:
C6678 (RC) directly connected via PCI to FPGA(EP).
On power on FPGA loading image_1 from EPCS.
C6678 can send Remote Update command to FPGA. If FPGA contain image_1 and receive Remote Update command, when in FPGA from EPCS wil be loaded image_2.
For example:
image_1 has PCIe DevID = 0x00AA VendorID = 0x1111
image_2 has PCIe DevID = 0x00BB VendorID = 0x1111
I'm doing the following steps:
1. Turn on board power;
- In FPGA from EPCS loading image_1.
2. Using Code Composer Studio connect to C6678 via JTAG;
3. Loading program to C6678;
4. Lunch program. Program make initialization PCIe bus and find device with DevID = 0x00AA VendorID = 0x1111 (image_1 in FPGA);
5. Program send Remote Update command to FPGA. FPGA from EPCS load image_2 (DevID = 0x00BB, VendorID = 0x1111);
- FPGA rebooted -> PCIe link down
- LTSSM_EN bit in register CMD_STATUS self set to 0
6. Try reinitialization of PCI bus.
My problems begin in paragraph 6.
After setting bit LTSSM_EN value to 1, i see that register Debug_0 field [4..0] constantly changes its state between codes 0x0D and 0x11. -> Link can't stabilize.
I tried to do retrain PCIe link by setting 5 bit in LINK_STAT_CTRL register -> No effect. (LTSSM_EN = 1 and before i set him to 1).
Tried to restart PCIe power domain -> didn't help.
At the same time, if in paragraph 6 i don't doing reinitialization PCIe, but do System_reset and reload program by JTAG , then everything is fine and the device DevID = 0x00BB VendorID = 0x1111 (image_2 in FPGA) finding successfully.
What i'm doing wrong?
How correctly restart PCIe link after EP restarts and drop link?