Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can the linux kernel be forced to enumerate the PCI-e bus?

Tags:

Linux kernel 2.6

I've got an fpga that is loaded over GPIO connected to a development board running linux. The fpga will transmit and receive data over the pci-express bus. However, this is enumerated at boot and as such, no link is discovered (because the fpga is not loaded at boot).

How can I force re-enumeration of the pci-e bus in linux? Is there a simple command or will I have to make kernel changes? I need the capability to hotplug pcie devices.

like image 266
reign_man Avatar asked Sep 13 '12 20:09

reign_man


People also ask

How do you enumerate a PCI bus?

You can recursively enumerate devices on the PCI bus by scanning bus 0, and whenever you detect a PCI bridge recursively scanning its secondary bus. In doing this keep in mind: There can be up to 32 devices on a bus. Each device number corresponds to a slot, so some may be missing in the middle.

How does PCIe enumeration work?

During the enumeration process the system software discovers all of the switch and endpoint devices that are connected to the system, determines the memory requirements and then configures the PCIe devices.

How do I get PCIe devices on Linux?

Think of this command as “ls” + “pci”. This will display information about all the PCI bus in your server. Apart from displaying information about the bus, it will also display information about all the hardware devices that are connected to your PCI and PCIe bus.

What is PCI buses in Linux?

Peripheral Component Interconnect (PCI) is a local computer bus for attaching hardware devices in a computer and is part of the PCI Local Bus standard. The PCI bus supports the functions found on a processor bus but in a standardized format that is independent of any given processor's native bus.


1 Answers

As root, try the following command:

echo "1" > /sys/bus/pci/rescan 

See this link for more information: http://www.kernel.org/doc/Documentation/ABI/testing/sysfs-bus-pci

like image 131
user1202136 Avatar answered Sep 21 '22 15:09

user1202136