From: Wade Farnsworth <wfarnsworth@mvista.com>
To: linuxppc-dev <linuxppc-dev@ozlabs.org>
Subject: [PATCH 5/5] PCI fixes for the MPC8641 Rev 2.0 silicon and Rev 1.02 hardware
Date: Tue, 15 May 2007 09:50:09 -0700 [thread overview]
Message-ID: <1179247809.8132.138.camel@rhino> (raw)
In-Reply-To: <1179245829.8132.100.camel@rhino>
This fixes PCI support for newer revisions of the MPCN8641 silicon and
the HPCN hardware.
Currently, there is a workaround for a PCI erratum that forces the host
bridge's primary bus to be 0xff. This workaround is no longer necessary
on newer revisions.
Additionally, the host bridge on the newer rev's behaves like a
transparent bridge, but does not use the correct PCI class, so this adds
a fixup for the class. This is the only device on bus 0, all other
devices are on subsequent buses.
Furthermore, all of the devices on the southbridge show up on bus 2,
behind an additional PCI bridge. In order to use the correct IRQ's for
the devices, we need to create additional device nodes for the PCI
bridges, and reproduce the interrupt map on the correct bus.
Since the southbridge devices are now bus 2, we also need to fix the bus
range for PCIe 2 to begin at bus 3.
Signed-off-by: Wade Farnsworth <wfarnsworth@mvista.com>
---
arch/powerpc/boot/dts/mpc8641_hpcn.dts | 121 ++++++++++++++++++-
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c | 8 -
arch/powerpc/platforms/86xx/pci.c | 27 +++-
3 files changed, 149 insertions(+), 7 deletions(-)On Tue, 2007-05-15 at
09:17 -0700, Wade Farnsworth wrote:
Index: linux-2.6-8641/arch/powerpc/platforms/86xx/pci.c
===================================================================
--- linux-2.6-8641.orig/arch/powerpc/platforms/86xx/pci.c
+++ linux-2.6-8641/arch/powerpc/platforms/86xx/pci.c
@@ -134,16 +134,24 @@ mpc86xx_setup_pcie(struct pci_controller
early_write_config_byte(hose, 0, 0, PCI_LATENCY_TIMER, 0x80);
- /* PCIE Bus, Fix the MPC8641D host bridge's location to bus 0xFF. */
+ /*
+ * For Rev 1.0, fix the bus to 0xff. Otherwise use the default.
+ */
early_read_config_dword(hose, 0, 0, PCI_PRIMARY_BUS, &temps);
- temps = (temps & 0xff000000) | (0xff) | (0x0 << 8) | (0xfe << 16);
+ if ((mfspr(SPRN_SVR) & 0xf0) == 0x10)
+ temps = (temps & 0xff000000) | 0xff | (0xfe << 16);
+ else
+ temps = (temps & 0xff000000) | hose->first_busno |
+ ((hose->first_busno + 1) << 8) |
+ (hose->last_busno << 16);
early_write_config_dword(hose, 0, 0, PCI_PRIMARY_BUS, temps);
}
int mpc86xx_exclude_device(u_char bus, u_char devfn)
{
- if (bus == 0 && PCI_SLOT(devfn) == 0)
- return PCIBIOS_DEVICE_NOT_FOUND;
+ if ((mfspr(SPRN_SVR) & 0xf0) == 0x10)
+ if (bus == 0 && PCI_SLOT(devfn) == 0)
+ return PCIBIOS_DEVICE_NOT_FOUND;
return PCIBIOS_SUCCESSFUL;
}
@@ -162,6 +170,11 @@ int __init add_bridge(struct device_node
/* Fetch host bridge registers address */
has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);
+ /* For Rev 1 silicon, only the first PCI host is supported. */
+ if (((mfspr(SPRN_SVR) & 0xf0) == 0x10) &&
+ ((rsrc.start & 0xfffff) == 0x9000))
+ return 0;
+
/* Get bus range if any */
bus_range = of_get_property(dev, "bus-range", &len);
if (bus_range == NULL || len < 2 * sizeof(int))
@@ -203,3 +216,9 @@ int __init add_bridge(struct device_node
return 0;
}
+
+static void __devinit early_mpc86xx_pcie(struct pci_dev *dev)
+{
+ dev->class = PCI_CLASS_BRIDGE_PCI << 8 | 0x1;
+}
+DECLARE_PCI_FIXUP_EARLY(0x1957, 0x7011, early_mpc86xx_pcie);
Index: linux-2.6-8641/arch/powerpc/boot/dts/mpc8641_hpcn.dts
===================================================================
--- linux-2.6-8641.orig/arch/powerpc/boot/dts/mpc8641_hpcn.dts
+++ linux-2.6-8641/arch/powerpc/boot/dts/mpc8641_hpcn.dts
@@ -286,6 +286,125 @@
f800 0 0 4 &i8259 0 0
>;
+ pci@00 {
+ device_type = "pci";
+ #interrupt-cells = <1>;
+ #size-cells = <2>;
+ #address-cells = <3>;
+ reg = <0000 0 0 0 0>;
+ bus-range = <0 fe>;
+ ranges = <02000000 0 80000000 80000000 0
+ 20000000
+ 01000000 0 00000000 00000000 0
+ 00100000>;
+
+ pci@00 {
+ device_type = "pci";
+ #interrupt-cells = <1>;
+ #size-cells = <2>;
+ #address-cells = <3>;
+ reg = <0000 0 0 0 0>;
+ bus-range = <1 fe>;
+ ranges = <02000000 0 80000000 80000000
+ 0 20000000
+ 01000000 0 00000000 00000000
+ 0 00100000>;
+ interrupt-map-mask = <3f800 0 0 7>;
+ interrupt-map = <
+ /* IDSEL 0x11 */
+ 28800 0 0 1 &i8259 3 2
+ 28800 0 0 2 &i8259 4 2
+ 28800 0 0 3 &i8259 5 2
+ 28800 0 0 4 &i8259 6 2
+
+ /* IDSEL 0x12 */
+ 29000 0 0 1 &i8259 4 2
+ 29000 0 0 2 &i8259 5 2
+ 29000 0 0 3 &i8259 6 2
+ 29000 0 0 4 &i8259 3 2
+
+ /* IDSEL 0x13 */
+ 29800 0 0 1 &i8259 0 0
+ 29800 0 0 2 &i8259 0 0
+ 29800 0 0 3 &i8259 0 0
+ 29800 0 0 4 &i8259 0 0
+
+ /* IDSEL 0x14 */
+ 2a000 0 0 1 &i8259 0 0
+ 2a000 0 0 2 &i8259 0 0
+ 2a000 0 0 3 &i8259 0 0
+ 2a000 0 0 4 &i8259 0 0
+
+ /* IDSEL 0x15 */
+ 2a800 0 0 1 &i8259 0 0
+ 2a800 0 0 2 &i8259 0 0
+ 2a800 0 0 3 &i8259 0 0
+ 2a800 0 0 4 &i8259 0 0
+
+ /* IDSEL 0x16 */
+ 2b000 0 0 1 &i8259 0 0
+ 2b000 0 0 2 &i8259 0 0
+ 2b000 0 0 3 &i8259 0 0
+ 2b000 0 0 4 &i8259 0 0
+
+ /* IDSEL 0x17 */
+ 2b800 0 0 1 &i8259 0 0
+ 2b800 0 0 2 &i8259 0 0
+ 2b800 0 0 3 &i8259 0 0
+ 2b800 0 0 4 &i8259 0 0
+
+ /* IDSEL 0x18 */
+ 2c000 0 0 1 &i8259 0 0
+ 2c000 0 0 2 &i8259 0 0
+ 2c000 0 0 3 &i8259 0 0
+ 2c000 0 0 4 &i8259 0 0
+
+ /* IDSEL 0x19 */
+ 2c800 0 0 1 &i8259 0 0
+ 2c800 0 0 2 &i8259 0 0
+ 2c800 0 0 3 &i8259 0 0
+ 2c800 0 0 4 &i8259 0 0
+
+ /* IDSEL 0x1a */
+ 2d000 0 0 1 &i8259 6 2
+ 2d000 0 0 2 &i8259 3 2
+ 2d000 0 0 3 &i8259 4 2
+ 2d000 0 0 4 &i8259 5 2
+
+ /* IDSEL 0x1b */
+ 2d800 0 0 1 &i8259 5 2
+ 2d800 0 0 2 &i8259 0 0
+ 2d800 0 0 3 &i8259 0 0
+ 2d800 0 0 4 &i8259 0 0
+
+ /* IDSEL 0x1c */
+ 2e000 0 0 1 &i8259 9 2
+ 2e000 0 0 2 &i8259 a 2
+ 2e000 0 0 3 &i8259 b 2
+ 2e000 0 0 4 &i8259 7 2
+
+ /* IDSEL 0x1d */
+ 2e800 0 0 1 &i8259 9 2
+ 2e800 0 0 2 &i8259 a 2
+ 2e800 0 0 3 &i8259 b 2
+ 2e800 0 0 4 &i8259 0 0
+
+ /* IDSEL 0x1e */
+ 2f000 0 0 1 &i8259 b 2
+ 2f000 0 0 2 &i8259 0 0
+ 2f000 0 0 3 &i8259 0 0
+ 2f000 0 0 4 &i8259 0 0
+
+ /* IDSEL 0x1f */
+ 2f800 0 0 1 &i8259 6 2
+ 2f800 0 0 2 &i8259 0 0
+ 2f800 0 0 3 &i8259 0 0
+ 2f800 0 0 4 &i8259 0 0
+ >;
+ };
+ };
+
+
isa@f0 {
device_type = "isa";
#interrupt-cells = <2>;
@@ -335,7 +454,7 @@
#size-cells = <2>;
#address-cells = <3>;
reg = <9000 1000>;
- bus-range = <0 ff>;
+ bus-range = <3 ff>;
ranges = <02000000 0 a0000000 a0000000 0 20000000
01000000 0 00000000 e3000000 0 00100000>;
clock-frequency = <1fca055>;
Index: linux-2.6-8641/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
===================================================================
--- linux-2.6-8641.orig/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ linux-2.6-8641/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -419,8 +419,12 @@ mpc86xx_hpcn_setup_arch(void)
}
#ifdef CONFIG_PCI
- for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
- add_bridge(np);
+ for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) {
+ struct device_node *parent = of_get_parent(np);
+ if (strcmp(parent->type, "pci"))
+ add_bridge(np);
+ of_node_put(parent);
+ }
ppc_md.pci_exclude_device = mpc86xx_exclude_device;
#endif
next prev parent reply other threads:[~2007-05-15 16:50 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-15 16:17 [PATCH 0/5] MPC8641 HPCN fixes Wade Farnsworth
2007-05-15 16:23 ` [PATCH 1/5] Add MTD support to mpc8641_hpcn.dts Wade Farnsworth
2007-05-15 16:27 ` [PATCH 2/5] Add legacy devices " Wade Farnsworth
2007-05-16 16:37 ` Jon Loeliger
2007-05-16 17:59 ` Wade Farnsworth
2007-05-16 19:59 ` Segher Boessenkool
2007-05-16 19:55 ` Segher Boessenkool
2007-05-16 20:03 ` Sergei Shtylyov
2007-05-16 20:17 ` Wade Farnsworth
2007-05-16 23:40 ` Segher Boessenkool
2007-05-16 23:47 ` Segher Boessenkool
2007-05-17 0:11 ` Wade Farnsworth
2007-05-17 0:09 ` Wade Farnsworth
2007-05-18 16:44 ` Jon Loeliger
2007-05-21 16:04 ` Wade Farnsworth
2007-05-21 16:10 ` Jon Loeliger
2007-05-21 16:51 ` Wade Farnsworth
2007-05-16 20:29 ` Wade Farnsworth
2007-07-07 18:29 ` Sergei Shtylyov
2007-07-07 18:39 ` Arnd Bergmann
2007-07-08 13:13 ` Segher Boessenkool
2007-07-08 20:36 ` Arnd Bergmann
2007-07-08 23:42 ` Segher Boessenkool
2007-07-09 12:43 ` Sergei Shtylyov
2007-07-09 14:43 ` Segher Boessenkool
2007-07-07 18:59 ` Sergei Shtylyov
2007-07-07 19:23 ` Arnd Bergmann
2007-05-15 16:32 ` [PATCH 3/5] Support for the LPC47M192 SuperIO on the MPC8641 HPCN Wade Farnsworth
2007-05-15 16:36 ` [PATCH 4/5] Add RTC CMOS support for " Wade Farnsworth
2007-05-15 16:50 ` Wade Farnsworth [this message]
2007-05-16 16:44 ` [PATCH 5/5] PCI fixes for the MPC8641 Rev 2.0 silicon and Rev 1.02 hardware Jon Loeliger
2007-05-16 18:06 ` Wade Farnsworth
2007-05-18 6:52 ` [PATCH 5/5] PCI fixes for the MPC8641 Rev 2.0 silicon and Rev1.02 hardware Jin Zhengxiong-R64188
2007-05-21 15:59 ` Wade Farnsworth
2007-05-17 2:50 ` [PATCH 5/5] PCI fixes for the MPC8641 Rev 2.0 silicon and Rev 1.02hardware Zhang Wei-r63237
2007-05-17 16:03 ` Wade Farnsworth
2007-05-17 16:14 ` Kumar Gala
2007-05-17 16:58 ` Wade Farnsworth
2007-05-17 18:46 ` Timur Tabi
2007-05-17 18:48 ` Timur Tabi
2007-05-17 18:53 ` Scott Wood
2007-05-17 18:59 ` Timur Tabi
2007-05-17 19:16 ` Jerry Van Baren
2007-05-18 13:48 ` Matt Sealey
2007-05-17 22:34 ` Wade Farnsworth
2007-05-18 0:56 ` David Gibson
2007-05-18 3:49 ` Jerry Van Baren
2007-05-18 14:34 ` Timur Tabi
2007-05-18 15:22 ` Jerry Van Baren
2007-05-18 16:46 ` Scott Wood
2007-05-18 17:30 ` Jerry Van Baren
2007-05-18 17:39 ` Timur Tabi
2007-05-18 17:43 ` Scott Wood
2007-05-18 17:47 ` Timur Tabi
2007-05-18 17:52 ` Scott Wood
2007-05-18 17:56 ` Timur Tabi
2007-05-18 18:02 ` Scott Wood
2007-05-18 18:03 ` Jerry Van Baren
2007-05-18 18:19 ` Jon Loeliger
2007-05-18 18:23 ` Scott Wood
2007-05-18 19:05 ` Jon Loeliger
2007-05-18 19:09 ` Scott Wood
2007-05-18 18:30 ` Timur Tabi
2007-05-18 17:59 ` Jerry Van Baren
2007-05-18 10:20 ` [PATCH 5/5] PCI fixes for the MPC8641 Rev 2.0 silicon and Rev1.02hardware Zhang Wei-r63237
2007-05-21 16:01 ` Wade Farnsworth
2007-05-22 2:53 ` [PATCH 5/5] PCI fixes for the MPC8641 Rev 2.0 silicon andRev1.02hardware Zhang Wei-r63237
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1179247809.8132.138.camel@rhino \
--to=wfarnsworth@mvista.com \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).