Bringing Up an Ethernet Interface Over PCIE

Hi,
we want to boot the endpoint system and boot the root port system together.
We can configure the endpoint system according to the following methods

cd /sys/kernel/config/pci_ep/
mkdir functions/pci_epf_tvnet/func1
echo 16 > functions/pci_epf_tvnet/func1/msi_interrupts
ln -s functions/pci_epf_tvnet/func1 controllers/141a0000.pcie_ep/
echo 1 > controllers/141a0000.pcie_ep/start

At this time, we must restart the root port system now.So,we can find ethx.
We don’t want to restart.We tried the pcie-rescan method.It can not worked.

echo 1 > /sys/bus/pci/rescan

We also try to integrate pcie_ tegra.c is compiled into .ko module.But it also failed.

ERROR: “__dw_pcie_write_dbi” [drivers/pci/dwc/pcie-tegra.ko] undefined!
ERROR: “dw_pcie_ep_linkup” [drivers/pci/dwc/pcie-tegra.ko] undefined!
ERROR: “dw_pcie_set_regs_available” [drivers/pci/dwc/pcie-tegra.ko] undefined!

We’d like to ask if it’s possible to solve this problem other than restarting the root system.

Please use the following changes to fix the build issues with compiling the PCIe driver as a loadable module

diff --git a/drivers/pci/dwc/pcie-designware-ep.c b/drivers/pci/dwc/pcie-designware-ep.c
index 6424c6340ac7..0f6fe378dd4d 100644
--- a/drivers/pci/dwc/pcie-designware-ep.c
+++ b/drivers/pci/dwc/pcie-designware-ep.c
@@ -29,6 +29,7 @@ void dw_pcie_ep_linkup(struct dw_pcie_ep *ep)

        pci_epc_linkup(epc);
 }
+EXPORT_SYMBOL(dw_pcie_ep_linkup);

 static void dw_pcie_ep_reset_bar(struct dw_pcie *pci, enum pci_barno bar)
 {
@@ -307,6 +308,7 @@ void dw_pcie_set_regs_available(struct dw_pcie *pci)
        dw_pcie_writew_dbi(pci, MSI_MESSAGE_CONTROL, ep->cached_msi_ctrl);
        dw_pcie_dbi_ro_wr_dis(pci);
 }
+EXPORT_SYMBOL(dw_pcie_set_regs_available);

 static int dw_pcie_ep_raise_irq(struct pci_epc *epc,
                                enum pci_epc_irq_type type, u8 interrupt_num)
diff --git a/drivers/pci/dwc/pcie-designware.c b/drivers/pci/dwc/pcie-designware.c
index e69b9f6fc21c..97f007ab752b 100644
--- a/drivers/pci/dwc/pcie-designware.c
+++ b/drivers/pci/dwc/pcie-designware.c
@@ -93,6 +93,7 @@ void __dw_pcie_write_dbi(struct dw_pcie *pci, void __iomem *base, u32 reg,
        if (ret)
                dev_err(pci->dev, "write DBI address failed\n");
 }
+EXPORT_SYMBOL(__dw_pcie_write_dbi);

 static u32 dw_pcie_readl_ob_unroll(struct dw_pcie *pci, u32 index, u32 reg)
 {

Thank you. I have compiled it

Was there any resolution for the pci rescan? We are experiencing the same issue. We need to boot the AGX at the same time as our host PC. pci rescan on the host does not seem to show the AGX. If we power the AGX on first, the host sees it fine, but this does not work for our final product.

Hi jmumper2,

Please help to open a new topic if it’s still an issue. Thanks