Wire up PCI on Bamboo board
Subsystems (2)
PATCH 11/20 Wire up PCI on Bamboo board
This adds the device-tree bits & call to ppc4xx_pci_find_bridges() to make PCI work on the Bamboo board
---
arch/powerpc/boot/dts/bamboo.dts | 40 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-)
arch/powerpc/boot/dts/bamboo.dts +39 -1
@@ -239,10 +239,48 @@ zmii-channel = <1>; }; }; + + PCI0: pci@ec000000 { + device_type = "pci"; + #interrupt-cells = <1>; + #size-cells = <2>; + #address-cells = <3>; + compatible = "ibm,plb440ep-pci", "ibm,plb-pci"; + primary; + reg = <0 eec00000 8 /* Config space access */ + 0 eed80000 4 /* IACK */ + 0 eed80000 4 /* Special cycle */ + 0 ef480000 40>; /* Internal registers */ + + /* Outbound ranges, one memory and one IO, + * later cannot be changed. Chip supports a second + * IO range but we don't use it for now + */ + ranges = <02000000 0 a0000000 0 a0000000 0 20000000 + 01000000 0 00000000 0 e8000000 0 00010000>; + + /* Inbound 2GB range starting at 0 */ + dma-ranges = <42000000 0 0 0 0 0 80000000>; + + /* Bamboo has all 4 IRQ pins tied together per slot */ + interrupt-map-mask = <f800 0 0 0>; + interrupt-map = < + /* IDSEL 1 */ + 0800 0 0 0 &UIC0 1c 8 + + /* IDSEL 2 */ + 1000 0 0 0 &UIC0 1b 8 + + /* IDSEL 3 */ + 1800 0 0 0 &UIC0 1a 8 + + /* IDSEL 4 */ + 2000 0 0 0 &UIC0 19 8 + >; + }; }; chosen { linux,stdout-path = "/plb/opb/serial@ef600300"; - bootargs = "console=ttyS0,115200"; }; };
Quoted 17 lines · Benjamin Herrenschmidt
This adds the device-tree bits & call to
ppc4xx_pci_find_bridges()to make PCI work on the Bamboo boardSigned-off-by Benjamin Herrenschmidt <[email protected]>---
arch/powerpc/boot/dts/bamboo.dts | 40 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-)arch/powerpc/boot/dts/bamboo.dts +2
-0@@ -239,10 +239,48 @@ zmii-channel = <1>; }; }; + + PCI0: pci@ec000000 {
arch/powerpc/boot/dts/bamboo.dts line 253
Quoted 10 lines
arch/powerpc/boot/dts/bamboo.dts +10
-0+ device_type = "pci"; + #interrupt-cells = <1>; + #size-cells = <2>; + #address-cells = <3>; + compatible = "ibm,plb440ep-pci", "ibm,plb-pci"; + primary; + reg = <0 eec00000 8 /* Config space access */ + 0 eed80000 4 /* IACK */ + 0 eed80000 4 /* Special cycle */ + 0 ef480000 40>; /* Internal registers */
Why ef480000 here? IIRC, the docs say it should be ef400000, while ef400040 - ef4fffff are reserved and can mirror local registers. Thanks,
Valentine.
Quoted 13 lines · Valentine Barshak
Quoted 13 lines
arch/powerpc/boot/dts/bamboo.dts +7
-0@@ -239,10 +239,48 @@ zmii-channel = <1>; }; }; + + PCI0: pci@ec000000 { + device_type = "pci"; + #interrupt-cells = <1>; + #size-cells = <2>; + #address-cells = <3>; + compatible = "ibm,plb440ep-pci", "ibm,plb-pci";
Quoted 8 lines
arch/powerpc/boot/dts/bamboo.dts line 253
Quoted 5 lines
arch/powerpc/boot/dts/bamboo.dts +5
-0+ primary; + reg = <0 eec00000 8 /* Config space access */ + 0 eed80000 4 /* IACK */ + 0 eed80000 4 /* Special cycle */ + 0 ef480000 40>; /* Internal registers */Why
ef480000here? IIRC, the docs say it should beef400000, whileef400040-ef4fffffare reserved and can mirror local registers.
Dunno... probably a typo, though it worked :-) I'll fix it up.
Ben.
Quoted 22 lines · Benjamin Herrenschmidt
Quoted 11 lines · Valentine Barshak
Quoted 11 lines
arch/powerpc/boot/dts/bamboo.dts +5
-0@@ -239,10 +239,48 @@ zmii-channel = <1>; }; }; + + PCI0: pci@ec000000 { + device_type = "pci"; + #interrupt-cells = <1>; + #size-cells = <2>;Quoted 8 lines
arch/powerpc/boot/dts/bamboo.dts line 253
Quoted 7 lines
arch/powerpc/boot/dts/bamboo.dts +7
-0+ #address-cells = <3>; + compatible = "ibm,plb440ep-pci", "ibm,plb-pci"; + primary; + reg = <0 eec00000 8 /* Config space access */ + 0 eed80000 4 /* IACK */ + 0 eed80000 4 /* Special cycle */ + 0 ef480000 40>; /* Internal registers */Why
ef480000here? IIRC, the docs say it should beef400000, whileef400040-ef4fffffare reserved and can mirror local registers.
Quoted 1 line
Dunno... probably a typo, though it worked :-) I'll fix it up.
Just checked the ppc440ep user manual again.
Special cycle/IACK registers are at 0xeed00000 instead of 0xeed80000.
Looks like the same typo as in the internal registers.
It works because all these registers are mirrored at 0x80000 offset (though it's claimed to be a reserved region).
Thanks,
Valentine.
Quoted 4 lines
Ben.
Quoted 5 lines · Valentine Barshak
Just checked the ppc440ep user manual again.
Special cycle/IACK registers are at0xeed00000instead of0xeed80000. Looks like the same typo as in the internal registers.
It works because all these registers are mirrored at0x80000offset (though it's claimed to be a reserved region).
Well, as for IACK, it also probably works because nobody uses it :-) I put it in the device-tree for completeness (and in case somebody ever uses it) but so far, nobody does and there is no proper interface to expose it in linux.
Ben.