Reenumerating PCIe device without restart

Hello,

We have an FPGA huins board connected to Windows 7 host machine. To flash the firmware we reset the FPGA board, at this point the PCIe link to the host is off (LED is turned orange). After flashing the firmware to bring the PCIe link up we need to restart the host machine.

However we want to avoid doing a restart, for this we carried out following mechanism

Connected the PCIe slot to an external power source, once the firmware is flashed we switch off the power to the particular PCIe slot and bring the power on, with this approach the PCIe link LED turns green but device is not enumerated on the host

I have following questions wrt this:

  1. Is there a way to control power to a PCIe slot without any external power source?

  2. How to trigger a reenumeration of the PCIe device? Is there any way to talk to PCIe driver to reenumerate the device connected to the slot?

Info: There is a phy reset button on the FPGA board, with this the link is up and the host is able to reenumerate the device but so far we haven’t found a way to issue this reset via some command. Here the host is able to detect the device without restart, however I would like to know is there anything which can be done to do the similar thing from the host side

Thanks.

Before the flash & reset does the FPGA show up as a device on the PCIe port? Or only after you press the PHY reset button on the board?

Is there a GPIO from the FPGA to the PHY reset that you could drive as part of initializing the controller after reconfiguring it?

-p

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Tuesday, November 7, 2017 9:47 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Reenumerating PCIe device without restart

Hello,

We have an FPGA huins board connected to Windows 7 host machine. To flash the firmware we reset the FPGA board, at this point the PCIe link to the host is off (LED is turned orange). After flashing the firmware to bring the PCIe link up we need to restart the host machine.

However we want to avoid doing a restart, for this we carried out following mechanism

Connected the PCIe slot to an external power source, once the firmware is flashed we switch off the power to the particular PCIe slot and bring the power on, with this approach the PCIe link LED turns green but device is not enumerated on the host

I have following questions wrt this:

1) Is there a way to control power to a PCIe slot without any external power source?

2) How to trigger a reenumeration of the PCIe device? Is there any way to talk to PCIe driver to reenumerate the device connected to the slot?

Info: There is a phy reset button on the FPGA board, with this the link is up and the host is able to reenumerate the device but so far we haven’t found a way to issue this reset via some command. Here the host is able to detect the device without restart, however I would like to know is there anything which can be done to do the similar thing from the host side

Thanks.


NTDEV is sponsored by OSR

Visit the list online at: https:

MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers!
Details at https:

To unsubscribe, visit the List Server section of OSR Online at https:</https:></https:></https:>

xxxxx@gmail.com wrote:

We have an FPGA huins board connected to Windows 7 host machine. To flash the firmware we reset the FPGA board, at this point the PCIe link to the host is off (LED is turned orange). After flashing the firmware to bring the PCIe link up we need to restart the host machine.

However we want to avoid doing a restart, for this we carried out following mechanism

Connected the PCIe slot to an external power source, once the firmware is flashed we switch off the power to the particular PCIe slot and bring the power on, with this approach the PCIe link LED turns green but device is not enumerated on the host

In order for this to work, your BIOS must support PCIExpress hot plug. 
Almost none of the mainstream BIOSes do so.  You’ll find it in some of
the server machines.

If you can somehow keep your configuration space valid across the reset,
you’d stand a chance.

I have following questions wrt this:

2) How to trigger a reenumeration of the PCIe device? Is there any way to talk to PCIe driver to reenumerate the device connected to the slot?

It has to be managed by the BIOS.  If the BIOS doesn’t do it, there is
no hope.

 

Info: There is a phy reset button on the FPGA board, with this the link is up and the host is able to reenumerate the device but so far we haven’t found a way to issue this reset via some command. Here the host is able to detect the device without restart,

Probably because this reset has not interrupted power, so the
configuration space is still intact.  With a scope, you ought to be able
to figure out which FPGA pin this thing is wired to.  Given that, surely
you can concoct Verilog to tickle the same pin via a register write.

however I would like to know is there anything which can be done to do the similar thing from the host side

We don’t have any way to know how your board is wired.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.