[PATCH 06/17] pci: host: pcie-designware: Use *base-mask* for configuring the iATU

Arnd Bergmann
2014-05-19T12:45:47Z

On Friday 16 May 2014 14:30:56 Kishon Vijay Abraham I wrote:
> On Wednesday 14 May 2014 06:15 PM, Arnd Bergmann wrote:
> > On Wednesday 14 May 2014 11:14:45 Kishon Vijay Abraham I wrote:
> > / {
> > #address-cells = <1>; // or <2> if you support > 4GB address space
> > #size-cells = <1>;
> >
> > soc {
> > #address-cells <1>;
> > #size-cells = <1>;
> > ranges;
> > dma-ranges;
> >
> > ... // all normal devices
> >
> > axi at 20000000 {
> > #size-cells = <1>;
> > #address-cells = <1>;
> > dma-ranges; // can access all 4GB outbound
> > ranges = <0 0x20000000 0x10000000>; // 28-bit bus
> >
> > pci at 0 {
> > reg = <0x0 0x1000>, // internal regs
> > <0x1000 0x2000>; // config space
>
> The internal reg address space starts at 0x51000000. By Using this <0
> 0x20000000 0x10000000>; as ranges, we are not able to get the memory resource
> properly. Can we use multiple ranges? how do we specify which ranges the *reg*
> property to use?

Yes, multiple ranges will work fine. You can make up a representation
yourself if you don't know what the hardware really does.

Two possible ways of doing this would be

a)

/* two separate physical connections represented as one logical bus */
axi at 20000000 {
#address-cells = <2>;
#size-cells = <1>;
ranges = <0 0 0x20000000 0x10000000>, /* configurable registers */
<1 0 0x51000000 0x01000000>; /* PCI host registers */

pci at 1.0 {
reg = <1 0 0x01000000>, /* host registers */
<0 0x1000 0x2000>; /* config space */
}

};

b)

/* one physical bus, with some address munging */
axi at 20000000 {
#address-cells = <1>;
#size-cells = <1>;
ranges = <0 0x20000000 0x10000000>, /* configurable registers */
<0x51000000 0x51000000 0x01000000>; /* PCI host registers */

pci at 1.0 {
reg = <0x51000000 0x01000000>, /* host registers */
<0x1000 0x2000>; /* config space */
}

};

> Btw I was using *simple-bus* as compatible to *axi*. Or should I create a new
> *axi* driver to create the pcie memory resources myself?

simple-bus is best here, since you don't have a complex bus that needs to
be set up using register accesses or that generates interrupts.

Arnd