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.