Imx8 pcie hot plugging

Toradex imx8 module connects to a Xilinx zynq7000 via PCIE.
My firmware wants to program fpga by gpios to jtag of fpga.
after fpga is configured, echo 1 > /sys/bus/pci/devices/0000:00/rescan
but I can not find fpga by lspci command.
I have to power cycle, then I can find it.
I do not know if imx8qm has pcie hot plugging or not.
if it has, what will I need to do for hardware and software.

HI @wen_jian_1973

Thanks for writing to the Toradex Support.

Could you provide the version of the Hardware (including carrier board) and Software of your module?
What is your application?

after fpga is configured, echo 1 > /sys/bus/pci/devices/0000:00/rescan but I can not find fpga by lspci command.

So this means, you always to need to program the FPGA and PowerCycle Apalis iMX8QM to find the FPGA using lspci command?

I do not know if imx8qm has pcie hot plugging or not. if it has, what will I need to do for hardware and software.

It depends what you mean with hotplugging. You can have a PCIe device connected and once it is found in Linux, you could unbind the device and then rescan which will lead to having two PCIe devices. For unplugging physically and plugging again without reboot (hot plug), you would need extra hardware on your custom carrier board.

Best regards,
Jaski

Apalis IMX8QM 4GB WB V1.0 B
My company built a carrier board for one product. On board a Xilinx fpga ZYNQ7Z030 connects imx8 via PCIE. imx8 cpu has 4 gpio connecting to fpga’s jtag, after power cycle, the firmware writes bit file to fpga to configure it. we want linux recognize fpga’s pcie after fpga configure done.
However, we have to reboot imx8 after fpga configure done. It means linux has to reboot again to find PCIE device. I heard that one company changed bios to remember PCIE’s information on X86 platform, then they do not need reboot again. I have no idea if we can change uboot or linux code to do it.

Hi @wen_jian_1973

Thanks for this Information.

It means linux has to reboot again to find PCIE device. I heard that one company changed bios to remember PCIE’s information on X86 platform, then they do not need reboot again. I have no idea if we can change uboot or linux code to do it.

Actually the PCIe device should be present when the kernel driver PCIe is getting loaded which is not the case before you program the FPGA. Surely you can change U-Boot code to wait in U-Boot and upload the firmware to FPGA before you boot the Linux Kernel.

Best regards,
Jaski