0
\$\begingroup\$

I'd like to clarify how the configuration address space in PCI and PCIe works. Namely, a PCI peripheral on a bus is addressed with device:function pair (the bus or domain:bus are not included, since only 1 bus is considered). How is device address determined? What sets it?

According to the answer in this question on superuser and other texts the device address is actually address of the PCI slot, and thus it should be wired in the hardware during manufacturing. Is it correct?

Then, how is this address defined in PCIe case?

From the same answer:

each device has its own individual point-to-point serial connection to its upstream device

-- thus, in PCIe each slot is connected to upstream switch device in star topology. And addresses of the slots are re-assigned by the switch on reset? (So, on power-up the switch calls for devices in each slot and if there is a response the switch assigns device address to the slot?) As in the same answer:

(hence each bridge, including the top-level "root complex", tells each device what its device ID will be)

Or they are also resolved in hardware/firmware of the switch? (And the switch always has a device address assigned to those wires going to a slot.)

It seems for easier hot-plug-ability each slot should have permanent address on the bus (on the "network" of the PCIe switch).

\$\endgroup\$
1
\$\begingroup\$

The "device ID" is a value that is read from one of the device's registers. It has nothing to do with how the device is connected, and multiple devices can have the same ID.

What that answer calls "device ID" actually is the slot number.

A PCI-E switch pretends to have two levels of PCI buses, one between the upstream device and a bridge for each downstream port, and one with a 1:1 connection for each port. So the physical PCI-E connection is point-to-point, but the virtual bus inside the switch has many devices, and therefore many slot numbers.

Slot numbers describe physical connections, and never change.

\$\endgroup\$
  • \$\begingroup\$ ooops! I didn't mean "device ID/vendor ID" -- going to fix the question now. They call it "device address/device number" -- somehow I averaged it to "device ID". Not sure about official naming in the specification.. \$\endgroup\$ – xealits Apr 12 '17 at 15:26

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.