Figure: Configuring a PCI System: Part 1
For PCI-PCI bridges to pass PCI I/O, PCI Memory or PCI Configuration address space reads and writes across them, they need to know the following:
The problem is that at the time when you wish to configure any given PCI-PCI bridge you do not know the subordinate bus number for that bridge. You do not know if there are further PCI-PCI bridges downstream and if you did, you do not know what numbers will be assigned to them. The answer is to use a depthwise recursive algorithm and scan each bus for any PCI-PCI bridges assigning them numbers as they are found. As each PCI-PCI bridge is found and its secondary bus numbered, assign it a temporary subordinate number of 0xFF and scan and assign numbers to all PCI-PCI bridges downstream of it. This all seems complicated but the worked example below makes this process clearer.
, the first bridge
the scan would find is
Figure: Configuring a PCI System: Part 2
shows how the busses and
PCI-PCI bridges are numbered at this point.
Figure: Configuring a PCI System: Part 3
.
It is assigned 1 as its primary bus interface number, 3 as its secondary bus
interface number and 0xFF as its subordinate bus number.
Figure
on
page
shows how the system is configured now.
Type 1 PCI configuration cycles with a bus number of 1, 2 or 3 wil be correctly
delivered to the appropriate PCI buses.
Figure: Configuring a PCI System: Part 4
.
PCI Bus 3 has another PCI-PCI bridge (
) on it, it is assigned 3 as its
primary bus number and 4 as its secondary bus number.
It is the last bridge on this branch and so it is assigned a subordinate bus
interface number of 4.
The initialisation code returns to PCI-PCI
and assigns it a
subordinate bus number of 4.
Finally, the PCI initialisation code can assign 4 as the
subordinate bus number for PCI-PCI
on page
shows the final bus numbers.