Subject: Re: Set up device tree for PCI bus

From: Benjamin Herrenschmidt <[email-masked]>
Date: Fri, 12 Oct 2007 21:27:14 +1000

On Fri, 2007-10-12 at 12:48 +0200, Hommel, Thomas (GE Indust, GE Fanuc)
wrote:
> Hi all,
> I'm wondering how to set up a proper device tree for a PCI bus. The bus
> has a tree-like structure with several bridges and can be extended
> dynamically (by adding PMC/XMC modules).

  .../...

> A problem is that the modules in the Expansion/PMC slot can contain more
> bridges and therefore the bus numbering isn't fixed. For example, if the
> PMC adds one more bus, #5 becomes #6 and #6 becomes #7.
> Can I assign fixed resources for all the bridge parts of the system?

ppc32 should cope with renumbering... though ppc64 will probably not.

What you can do perhaps is to assign wide bus ranges to your slots. For
example, slot 0 would provide bus 0x10...0x1f, slot 1 bus 0x20 to 0x2f
etc... You would thus only put the switch busses in the device-tree.

There is still a potential issue if you connect enough sub busses to
blow that range of 16 away but that's unlikely.

Such a solution would work for the time being. In the long run, I do
intend to make the kernel more flexible overall with bus renumbering vs.
OF tree.