TX2 pcie hotplug

device : rootpoint:tx2 endpoint:xilinx Fpga
questsion: I need to detect the PCI device after the TX2 is turned on,How to add hot plug to PCI,pelease help.

There is no hot-plug functionality available at this point in time.
Having said that, your requirement can be addressed in two ways.

1. Delaying the link up process

If we precisely know after how much time the PCIe endpoint device would be ready, link up process can be delayed by so much time.

diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index 7b6fbd5d90a8..d189348fddcd 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -2513,6 +2513,7 @@ static void tegra_pcie_check_ports(struct tegra_pcie *pcie)
        }
 
        /* Wait for clock to latch (min of 100us) */
+       msleep(10000);  /* currently it is 10 sec. Adjust here to increase/decrease it */
        udelay(100);
        reset_control_deassert(pcie->pciex_rst);
        /* at this point in time, there is no end point which would

2. Making the PCIe host controller driver as a loadable module

Compile the PCIe host controller driver pci-tegra.c file as a loadable module and insmod it whenever the endpoint device is ready to be enumerated.

Hope one of these would be helpful for you.

1 Like

thank you very much
how to making the PCIe host controller driver as a loadable module?

It is worked , thank you vert much.