I'm using a PCIe EP device which is based on the Synopsys PCIe EP IP, and running Linux on it. When connecting to a Linux host, on the host I can get the bus/device/function numbers from lspci and Linux driver to locate the device.

My question is, is there any way to get the bus/device/function numbers from the EP side? One possibility I can think of is since the bus/device numbers are determined at BIOS enumeration, does the PCIe spec requests to write back the bus/device information back somewhere to device configuration space? I'm reading the spec but it's huge and don't find anything yet.

One way to go is to let the host PCIe driver pass the numbers to EP so the endpoint function driver on EP can read it. It certainly works but I'm wondering is there any way to get the information without drivers passing involved.



Searched and asked around this is solved: didn't find anything in PCIe spec to get this info from a standard way, but the Synopsys PCIe endpoint IP does provide the fields for bus/device number in a APB slave register.

It's read only for SW and the correct bus number can be read. Maybe it's filled with the real number from host BIOS in RTL, though I cannot verify the guess.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.