Skip to contentSkip to conversation

Adding PCI-E support for 460SX based redwood board.

PATCH In review [email protected] 2 participants 2 messages Nov 30, 2009 – Dec 18, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Adding PCI-E support for 460SX based redwood board.

From: Tirumala Marri <[email protected]>

This patch would add PCI-E support for AMCC 460SX processor based redwood board.

---
 arch/powerpc/boot/dts/redwood.dts |  122 +++++++++++++++++++++++++++++++++++++
 arch/powerpc/sysdev/ppc4xx_pci.c  |  119 ++++++++++++++++++++++++++++++++++++
 arch/powerpc/sysdev/ppc4xx_pci.h  |   58 +++++++++++++++++
 3 files changed, 299 insertions(+), 0 deletions(-)
arch/powerpc/boot/dts/redwood.dts +122 -0
index ad402c4..9eeec28 100644
@@ -233,6 +233,128 @@
 				has-inverted-stacr-oc;
 				has-new-stacr-staopc;
 			};
+			PCIE0: pciex@d00000000 {
+				device_type = "pci";
+				#interrupt-cells = <1>;
+				#size-cells = <2>;
+				#address-cells = <3>;
+				compatible = "ibm,plb-pciex-460sx", "ibm,plb-pciex";
+				primary;
+				port = <0x0>; /* port number */
+				reg = <0x0000000d 0x00000000 0x20000000	/* Config space access */
+				       0x0000000c 0x10000000 0x00001000>;	/* Registers */
+				dcr-reg = <0x100 0x020>;
+				sdr-base = <0x300>;
+
+				/* Outbound ranges, one memory and one IO,
+				 * later cannot be changed
+				 */
+				ranges = <0x02000000 0x00000000 0x80000000 0x0000000e 0x00000000 0x00000000 0x80000000
+					  0x01000000 0x00000000 0x00000000 0x0000000f 0x80000000 0x00000000 0x00010000>;
+
+				/* Inbound 2GB range starting at 0 */
+				dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x80000000>;
+
+				/* This drives busses 10 to 0x1f */
+				bus-range = <0x10 0x1f>;
+
+				/* Legacy interrupts (note the weird polarity, the bridge seems
+				 * to invert PCIe legacy interrupts).
+				 * We are de-swizzling here because the numbers are actually for
+				 * port of the root complex virtual P2P bridge. But I want
+				 * to avoid putting a node for it in the tree, so the numbers
+				 * below are basically de-swizzled numbers.
+				 * The real slot is on idsel 0, so the swizzling is 1:1
+				 */
+				interrupt-map-mask = <0x0 0x0 0x0 0x7>;
+				interrupt-map = <
+					0x0 0x0 0x0 0x1 &UIC3 0x0 0x4 /* swizzled int A */
+					0x0 0x0 0x0 0x2 &UIC3 0x1 0x4 /* swizzled int B */
+					0x0 0x0 0x0 0x3 &UIC3 0x2 0x4 /* swizzled int C */
+					0x0 0x0 0x0 0x4 &UIC3 0x3 0x4 /* swizzled int D */>;
+			};
+
+			PCIE1: pciex@d20000000 {
+				device_type = "pci";
+				#interrupt-cells = <1>;
+				#size-cells = <2>;
+				#address-cells = <3>;
+				compatible = "ibm,plb-pciex-460sx", "ibm,plb-pciex";
+				primary;
+				port = <0x1>; /* port number */
+				reg = <0x0000000d 0x20000000 0x20000000	/* Config space access */
+				       0x0000000c 0x10001000 0x00001000>;	/* Registers */
+				dcr-reg = <0x120 0x020>;
+				sdr-base = <0x340>;
+
+				/* Outbound ranges, one memory and one IO,
+				 * later cannot be changed
+				 */
+				ranges = <0x02000000 0x00000000 0x80000000 0x0000000e 0x80000000 0x00000000 0x80000000
+					  0x01000000 0x00000000 0x00000000 0x0000000f 0x80010000 0x00000000 0x00010000>;
+
+				/* Inbound 2GB range starting at 0 */
+				dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x80000000>;
+
+				/* This drives busses 10 to 0x1f */
+				bus-range = <0x20 0x2f>;
+
+				/* Legacy interrupts (note the weird polarity, the bridge seems
+				 * to invert PCIe legacy interrupts).
+				 * We are de-swizzling here because the numbers are actually for
+				 * port of the root complex virtual P2P bridge. But I want
+				 * to avoid putting a node for it in the tree, so the numbers
+				 * below are basically de-swizzled numbers.
+				 * The real slot is on idsel 0, so the swizzling is 1:1
+				 */
+				interrupt-map-mask = <0x0 0x0 0x0 0x7>;
+				interrupt-map = <
+					0x0 0x0 0x0 0x1 &UIC3 0x4 0x4 /* swizzled int A */
+					0x0 0x0 0x0 0x2 &UIC3 0x5 0x4 /* swizzled int B */
+					0x0 0x0 0x0 0x3 &UIC3 0x6 0x4 /* swizzled int C */
+					0x0 0x0 0x0 0x4 &UIC3 0x7 0x4 /* swizzled int D */>;
+			};
+
+			PCIE2: pciex@d40000000 {
+				device_type = "pci";
+				#interrupt-cells = <1>;
+				#size-cells = <2>;
+				#address-cells = <3>;
+				compatible = "ibm,plb-pciex-460sx", "ibm,plb-pciex";
+				primary;
+				port = <0x2>; /* port number */
+				reg = <0x0000000d 0x40000000 0x20000000	/* Config space access */
+				       0x0000000c 0x10002000 0x00001000>;	/* Registers */
+				dcr-reg = <0x140 0x020>;
+				sdr-base = <0x370>;
+
+				/* Outbound ranges, one memory and one IO,
+				 * later cannot be changed
+				 */
+				ranges = <0x02000000 0x00000000 0x80000000 0x0000000f 0x00000000 0x00000000 0x80000000
+					  0x01000000 0x00000000 0x00000000 0x0000000f 0x80020000 0x00000000 0x00010000>;
+
+				/* Inbound 2GB range starting at 0 */
+				dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x80000000>;
+
+				/* This drives busses 10 to 0x1f */
+				bus-range = <0x30 0x3f>;
+
+				/* Legacy interrupts (note the weird polarity, the bridge seems
+				 * to invert PCIe legacy interrupts).
+				 * We are de-swizzling here because the numbers are actually for
+				 * port of the root complex virtual P2P bridge. But I want
+				 * to avoid putting a node for it in the tree, so the numbers
+				 * below are basically de-swizzled numbers.
+				 * The real slot is on idsel 0, so the swizzling is 1:1
+				 */
+				interrupt-map-mask = <0x0 0x0 0x0 0x7>;
+				interrupt-map = <
+					0x0 0x0 0x0 0x1 &UIC3 0x8 0x4 /* swizzled int A */
+					0x0 0x0 0x0 0x2 &UIC3 0x9 0x4 /* swizzled int B */
+					0x0 0x0 0x0 0x3 &UIC3 0xa 0x4 /* swizzled int C */
+					0x0 0x0 0x0 0x4 &UIC3 0xb 0x4 /* swizzled int D */>;
+			};
 
 		};
 
arch/powerpc/sysdev/ppc4xx_pci.c +119 -0

131 lines not on this page · raw message

arch/powerpc/sysdev/ppc4xx_pci.h +58 -0

64 lines not on this page · raw message

Signature · 1 line
1.6.3.3
#1 lore raw
Quoted 9 lines · On Mon, Nov 30, 2009 at 02:58:23PM -0800, [email protected] wrote:
arch/powerpc/boot/dts/redwood.dts +9 -0
+			PCIE0: pciex@d00000000 {
+				device_type = "pci";
+				#interrupt-cells = <1>;
+				#size-cells = <2>;
+				#address-cells = <3>;
+				compatible = "ibm,plb-pciex-460sx", "ibm,plb-pciex";
+				primary;
+				port = <0x0>; /* port number */
+				reg = <0x0000000d 0x00000000 0x20000000	/* Config space access */

arch/powerpc/boot/dts/redwood.dts line 254

Quoted 10 lines
arch/powerpc/boot/dts/redwood.dts +10 -0
+				       0x0000000c 0x10000000 0x00001000>;	/* Registers */
+				dcr-reg = <0x100 0x020>;
+				sdr-base = <0x300>;
+
+				/* Outbound ranges, one memory and one IO,
+				 * later cannot be changed
+				 */
+				ranges = <0x02000000 0x00000000 0x80000000 0x0000000e 0x00000000 0x00000000 0x80000000
+					  0x01000000 0x00000000 0x00000000 0x0000000f 0x80000000 0x00000000 0x00010000>;
+

DTC complains about this:

jwboyer@zod:~/src/linux-2.6> make ARCH=powerpc CROSS_COMPILE=ppcnf-unknown- -j2 redwood.dtb
/home/jwboyer/src/linux-2.6/scripts/dtc/dtc -O dtb -o arch/powerpc/boot/redwood.dtb -b 0 -p 1024 /home/jwboyer/src/linux-2.6/arch/powerpc/boot/dts/redwood.dts
DTC: dts->dtb on file "/home/jwboyer/src/linux-2.6/arch/powerpc/boot/dts/redwood.dts"
Warning (ranges_format): "ranges" property in /plb/opb/pciex@d00000000 has invalid length (56 bytes) (parent #address-cells == 1, child #address-cells == 3, #size-cells == 2) Warning (ranges_format): "ranges" property in /plb/opb/pciex@d20000000 has invalid length (56 bytes) (parent #address-cells == 1, child #address-cells == 3, #size-cells == 2) Warning (ranges_format): "ranges" property in /plb/opb/pciex@d40000000 has invalid length (56 bytes) (parent #address-cells == 1, child #address-cells == 3, #size-cells == 2) jwboyer@zod:~/src/linux-2.6>

My guess is that you meant to have this under the PLB bus node, and not the OPB bus?

josh