How to config pcie refclk output first before installing pcie drivers

I have a situation,other soc as a pcie ep,xavier as a pcie rp.The other soc use the xavier pcie refclk.the soc starts up the pcie ep first,but the refclk has no output,so it failed to init.If the xavier starts up the pcie rp first,the pcie ep is not online that time, the xavier show the msg “link is down”,it also failed to init.So how can I let the refclk output alone, not in the pcie driver to enable it,or any oher way?

Try to rescan the device after both of them are ready?

It need to init the other soc first,it need xavier refclk.How to output pcie refclk freely?

xavier Can identify the tda4 pcie ep device now:
root@localhost:/home/nvidia# lspci -v
0005:00:00.0 PCI bridge: NVIDIA Corporation Device 1ad0 (rev a1) (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0, IRQ 39
Bus: primary=00, secondary=01, subordinate=ff, sec-latency=0
Memory behind bridge: 40000000-413fffff
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable- Count=1/1 Maskable+ 64bit+
Capabilities: [70] Express Root Port (Slot-), MSI 00
Capabilities: [b0] MSI-X: Enable- Count=8 Masked-
Capabilities: [100] Advanced Error Reporting
Capabilities: [148] #19
Capabilities: [168] #26
Capabilities: [190] #27
Capabilities: [1c0] L1 PM Substates
Capabilities: [1d0] Vendor Specific Information: ID=0002 Rev=4 Len=100 <?> Capabilities: [2d0] Vendor Specific Information: ID=0001 Rev=1 Len=038 <?>
Capabilities: [308] #25
Capabilities: [314] Precision Time Measurement
Capabilities: [320] Vendor Specific Information: ID=0004 Rev=1 Len=054 <?>
Kernel driver in use: pcieport

0005:01:00.0 Unassigned class [ff00]: Texas Instruments Device b00d
Flags: bus master, fast devsel, latency 0, IRQ 558
Memory at 1f41124600 (32-bit, non-prefetchable) [size=256]
Memory at 1f41124400 (32-bit, non-prefetchable) [size=512]
Memory at 1f41124000 (32-bit, non-prefetchable) [size=1K]
Memory at 1f41120000 (32-bit, non-prefetchable) [size=16K]
Memory at 1f41100000 (32-bit, non-prefetchable) [size=128K]
Memory at 1f41000000 (32-bit, non-prefetchable) [size=1M]
Capabilities: [80] Power Management version 3
Capabilities: [90] MSI: Enable+ Count=2/2 Maskable- 64bit+
Capabilities: [b0] MSI-X: Enable- Count=2 Masked-
Capabilities: [c0] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [140] Alternative Routing-ID Interpretation (ARI)
Capabilities: [150] Device Serial Number 00-00-00-00-00-00-00-00
Capabilities: [160] Power Budgeting <?> Capabilities: [1b8] Latency Tolerance Reporting Capabilities: [1c0] #16 Capabilities: [200] Single Root I/O Virtualization (SR-IOV) Capabilities: [300] #19 Capabilities: [400] Vendor Specific Information: ID=0001 Rev=1 Len=010 <?>
Capabilities: [440] Process Address Space ID (PASID)
Capabilities: [4c0] Virtual Channel
Capabilities: [5c0] Address Translation Service (ATS)
Capabilities: [640] Page Request Interface (PRI)
Capabilities: [900] L1 PM Substates
Capabilities: [a20] Precision Time Measurement
Kernel driver in use: pci-endpoint-test
////////////////////////////////////////////////////////////////////////////////////////
But the pcitest.sh seems failed
./pcitest.sh
BAR tests

BAR0: NOT OKAY
BAR1: NOT OKAY
BAR2: NOT OKAY
BAR3: NOT OKAY
BAR4: NOT OKAY
BAR5: NOT OKAY

Interrupt tests

SET IRQ TYPE TO LEGACY: OKAY
LEGACY IRQ: NOT OKAY
SET IRQ TYPE TO MSI: OKAY
MSI1: NOT OKAY
MSI2: NOT OKAY
MSI3: NOT OKAY
MSI4: NOT OKAY
MSI5: NOT OKAY
MSI6: NOT OKAY
MSI7: NOT OKAY
MSI8: NOT OKAY
MSI9: NOT OKAY
MSI10: NOT OKAY
MSI11: NOT OKAY
MSI12: NOT OKAY
MSI13: NOT OKAY
MSI14: NOT OKAY
MSI15: NOT OKAY
MSI16: NOT OKAY
MSI17: NOT OKAY
MSI18: NOT OKAY
MSI19: NOT OKAY

It stays pcie read test:
///////////////////////////////////////////////////////////////
MSI-X13: NOT OKAY
MSI-X14: NOT OKAY
MSI-X15: NOT OKAY
MSI-X16: NOT OKAY
MSI-X17: NOT OKAY
MSI-X18: NOT OKAY
MSI-X19: NOT OKAY

Read Tests

SET IRQ TYPE TO MSI: OKAY
[ 1692.929009] INFO: task pcitest:11215 blocked for more than 120 seconds.
[ 1692.930042] Not tainted 4.9.253-tegra #8
[ 1692.930506] “echo 0 > /proc/sys/kernel/hung_task_timeout_secs” disables this message.

pcie read test failed.It died here,“wait_for_completion(&test->irq_raised)” int pci_endpoint_test.c.It seems no msi/msix intterupts.How to debug it?

anyone knows how to debug it?