Subject: Re: [RFC] AmigaOne device tree source v2

From: Segher Boessenkool <[email-masked]>
Date: Tue, 4 Sep 2007 00:32:57 +0200

>>>   	pci@80000000 {
>>> 		device_type = "pci";
>>> 		bus-frequency = <01fca055>;		// 33.3MHz
>>> 		bus-range = <0 1>;
>>> 		reg = <80000000 7f000000>;				//
>>> Whole PCI space.
>>
>> 'reg' and 'ranges' should not typically overlap.  'reg' should only
>> encode control registers for the bridge, not the whole PCI space (not
>> that I'm even entirely sure what you mean by that).
> Hmm, strange. I'm sure I found this in another device tree. I define
> "whole PCI space" as PCI (prefetchable) memory and PCI I/O space.

PCI memory space sits on the PCI bus, not on the PCI host bridge,
so is not part of "reg" but is part of "ranges" here, since it is
direct mapped into the host's address space.

PCI legacy I/O is not direct mapped: there is no legacy I/O on a
PowerPC system bus.  So, it can not be mentioned in the "ranges"
property, but the PHB registers used to access it should be shown
in the "reg" property.  It could be a simple linear window (it
sounds like it is here?), but it could for example also be implemented
via an address/data register pair.

The order of the "reg" entries depends on the exact model of PCI
bridge, so a device binding for it has to be written.

>>> 		host@0 {
>>
>> The unit address (after the @) should be derived from the first range
>> listed in the 'reg' property.  It's a bus address, not a slot number.
> AFAIK it's the device number, which is 0 for this host/PCI bridge.

The unit address is relative to the parent bus.  The PCI host bridge
is not its own parent ;-)

Segher