Re: [PATCH] PCI / OF linkage in sysfs

From: Benjamin Herrenschmidt
Date: Wed Feb 04 2004 - 19:01:26 EST



> Where does this stop? Do we start doing the same for all different kinds
> of buses, and all kinds of firmware?
>
> In other words, instead of having <n> different buses all know about <m>
> different kinds of firmware information that they really have nothing else
> to do with, it's much better to just have the <m> different kinds of
> firmware information export their own information.
>
> It just sounds _wrong_ to have the PCI layer have knowledge of OF. It has
> nothing to do with OF. For OF information, you should go to the /sys/of
> tree, which has the information that OF knows about (which may, of course,
> then include the information about PCI devices).

I don't quite agree... There are cases for example (USB, Firewire) where
we could construct an OF path to be used by the bootloader setup without
having the OF information in the first place (for devices that weren't
plugged during boot typically). I do no intend to go that way for 2.6
though.

In both cases, we don't "have" the information.

OF doesn't have informations about the linux PCI layout (bus numbering can
be different between OF and linux for example) and PCI doesn't have information
about OF (except that on ppc64, pci_dev->arch_data points to the OF node).

However, the arch code provides a routine that can provide that mapping
PCI -> OF (and in _that_ direction, there is one to go the other way around,
but I hate it, it's not very reliable at the moment, though I could rewrite
it..., and on ppc64, this is the most efficient way too).

It's just about providing a pointer to OF node, not actual informations out
of the device-tree...

Ben.




-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/