Uboot environment variable

Hello,

I have a need to toggle a GPIO pin to enable a PCIe device and then scan the bus for the device.

Once option is to toggle a uboot environment variable and reboot with a uboot function to check the variable and toggle the pin.

The other option is to add a kernel patch for a PCIe rescan. I have seen some references and wasn’t sure of the latest state.

Thanks,
John

Hi,

Is there a need to do this work in uboot? I think adding a patch in kernel would be more effective.

That would be great if it can happen before PCIe enumeration. Can I create a kernel module that would check a file and toggle the GPIO before PCIe enueration? Do you have any references to kernel modules toggling GPIO?

Thanks,
John

Maybe you could try some gpio API in your PCIe device driver.

For example, check devm_gpiod_get API