Generally speaking the best sequence would probably be as follows:
On power on and hardware reset: VDD_12V is disabled, PCIE_REFCLK_P/N is disabled, PEX_L5_RST_N_R is active (low)
Perform other boot activities as required keeping signals as previously described. Also guarantee it takes at least 100 ms to allow capacitance discharge in case of hardware reset
Enable VDD_12V and wait for it to stabilize
Enable PCIE_REFCLK_P/N and wait for it to stabilize
Wait 100 ms
Make PEX_L5_RST_N_R inactive (high)
Check for PCIe link multiple times with timeout (e.g. 100 ms)
If PCIe link is not up:
Make PEX_L5_RST_N_R active (low) with delay after it
@vidyas: I’m just following up on earlier posts from my colleagues @cioma and @c_seymour. Thanks for your suggestions for changes to the PCIE driver code. I have been working on applying these.
We have three Jetson Xavier development units. On the first, we have added the patches for the 5s delay in tegra_pcie_dw_host_init() and disabled the call to config_plat_gpio() in tegra_pcie_dw_runtime_suspend().
On the second, we have again added the 5s delay but this time disabled the calls to config_plat_gpio() in tegra_pcie_dw_runtime_resume().
On the third, we have added the 5s delay and disabled the calls to config_plat_gpio() in both tegra_pcie_dw_runtime_resume() and tegra_pcie_dw_runtime_suspend().
Unfortunately, the PCIE card is still not being initialised by any of the units but my colleagues are working to get some traces from the bus and we will post those shortly.
NB: I noticed that drivers/pci/host/pcie-tegra-dw.c no longer gets compiled into the kernel. It appears that these functions are now present in drivers/pci/dwc/pcie-tegra.c so I have applied your suggestions here instead and verified from dmesg that this is the code being run.
It seems that keeping VDD_12V enabled gives the correct PCIe signal sequence on power-on but still no link. We’ll see how we can debug it from the FPGA side.
where and how does this change have to be done? I have a similar situation, FPGA connected through the PCI port to jetson Xavier and same messages but I can’t find the file pcie-tegra-dw.c to make the changes.