Skip to contentSkip to conversation

85xxCDS: Misc 8548 PCI Corrections.

PATCH In review Randy Vinson 4 participants 8 messages Jul 20, 2007 – Jul 24, 2007

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

PATCH 5/6 85xxCDS: Misc 8548 PCI Corrections.

Quoted 1 line

From cf18185b4e201ff45f2e2a948103dd3dc088c046 Mon Sep 17 00:00:00 2001

From: Randy Vinson <[email protected]>
Date: Thu, 19 Jul 2007 10:40:53 -0700
Subject: [PATCH] 85xxCDS: Misc 8548 PCI Corrections.

Setting the host bridge @8000 as primary and only calling setup_pci_atmu for the PCI Express host bridge. Also fixing a bug in setting the USB interrupt numbers.

---
 arch/powerpc/platforms/85xx/mpc85xx_cds.c |    8 ++++----
 arch/powerpc/sysdev/fsl_pci.c             |    3 ++-
 2 files changed, 6 insertions(+), 5 deletions(-)
arch/powerpc/platforms/85xx/mpc85xx_cds.c +4 -4
index 963c6f8..862f394 100644
@@ -114,7 +114,7 @@ static void __init mpc85xx_cds_pci_irq_fixup(struct pci_dev *dev)
 		/* There are two USB controllers.
 		 * Identify them by functon number
 		 */
-			if (PCI_FUNC(dev->devfn))
+			if (PCI_FUNC(dev->devfn) == 3)
 				dev->irq = 11;
 			else
 				dev->irq = 10;
@@ -272,10 +272,10 @@ static void __init mpc85xx_cds_setup_arch(void)
 	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) {
 		struct resource rsrc;
 		of_address_to_resource(np, 0, &rsrc);
-		if ((rsrc.start & 0xfffff) == 0x9000)
-			fsl_add_bridge(np, 0);
-		else
+		if ((rsrc.start & 0xfffff) == 0x8000)
 			fsl_add_bridge(np, 1);
+		else
+			fsl_add_bridge(np, 0);
 	}
 	ppc_md.pci_irq_fixup = mpc85xx_cds_pci_irq_fixup;
 #endif
arch/powerpc/sysdev/fsl_pci.c +2 -1
index 2eefcde..931e212 100644
@@ -195,7 +195,8 @@ int __init fsl_add_bridge(struct device_node *dev, int is_primary)
 	pci_process_bridge_OF_ranges(hose, dev, is_primary);
 
 	/* Setup PEX window registers */
-	setup_pci_atmu(hose, &rsrc);
+	if (early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP))
+		setup_pci_atmu(hose, &rsrc);
 
 	return 0;
 }
Signature · 1 line
1.5.2.2.549.gaeb59
#1 lore raw
Quoted 8 lines · Randy Vinson
Quoted 1 line

From cf18185b4e201ff45f2e2a948103dd3dc088c046 Mon Sep 17 00:00:00 2001

From: Randy Vinson <[email protected]>
Date: Thu, 19 Jul 2007 10:40:53 -0700
Subject: [PATCH] 85xxCDS: Misc 8548 PCI Corrections.

Setting the host bridge @8000 as primary and only calling setup_pci_atmu for the PCI Express host bridge. Also fixing a bug in setting the USB interrupt numbers.

What issue exists with calling setup_pci_atmu on normal PCI?

- k

#2 lore raw
Quoted 8 lines · Kumar Gala
Quoted 5 lines · Randy Vinson
Quoted 1 line

From cf18185b4e201ff45f2e2a948103dd3dc088c046 Mon Sep 17 00:00:00 2001

From: Randy Vinson <[email protected]>
Date: Thu, 19 Jul 2007 10:40:53 -0700
Subject: [PATCH] 85xxCDS: Misc 8548 PCI Corrections.

Quoted 5 lines
Quoted 3 lines

Setting the host bridge @8000 as primary and only calling setup_pci_atmu for the PCI Express host bridge. Also fixing a bug in setting the USB interrupt numbers.

What issue exists with calling setup_pci_atmu on normal PCI?

At one point, it caused problems with the primary PCI controller, but I just tried it without the exclusion and it was OK. I'm wondering if my original problem was due to a buggy DTS file.

I'll remove that part of the patch and resubmit.

Randy Vinson

#3 lore raw
Quoted 1 line

From 57501bb79c2d5212c02766a32685d415cc74a4ab Mon Sep 17 00:00:00 2001

From: Randy Vinson <[email protected]>
Date: Thu, 19 Jul 2007 10:40:53 -0700
Subject: [PATCH] 85xxCDS: Misc 8548 PCI Corrections.

Setting the host bridge @8000 as primary. Also fixing a bug in setting the USB interrupt numbers.

---
 arch/powerpc/platforms/85xx/mpc85xx_cds.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
arch/powerpc/platforms/85xx/mpc85xx_cds.c +4 -4
index 963c6f8..862f394 100644
@@ -114,7 +114,7 @@ static void __init mpc85xx_cds_pci_irq_fixup(struct pci_dev *dev)
 		/* There are two USB controllers.
 		 * Identify them by functon number
 		 */
-			if (PCI_FUNC(dev->devfn))
+			if (PCI_FUNC(dev->devfn) == 3)
 				dev->irq = 11;
 			else
 				dev->irq = 10;
@@ -272,10 +272,10 @@ static void __init mpc85xx_cds_setup_arch(void)
 	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) {
 		struct resource rsrc;
 		of_address_to_resource(np, 0, &rsrc);
-		if ((rsrc.start & 0xfffff) == 0x9000)
-			fsl_add_bridge(np, 0);
-		else
+		if ((rsrc.start & 0xfffff) == 0x8000)
 			fsl_add_bridge(np, 1);
+		else
+			fsl_add_bridge(np, 0);
 	}
 	ppc_md.pci_irq_fixup = mpc85xx_cds_pci_irq_fixup;
 #endif
Signature · 1 line
1.5.2.2.549.gaeb59
#4 lore raw

arch/powerpc/platforms/85xx/mpc85xx_cds.c static void __init mpc85xx_cds_setup_arch(void) · line 279

Quoted 12 lines · Randy Vinson
arch/powerpc/platforms/85xx/mpc85xx_cds.c +3 -3
@@ -272,10 +272,10 @@ static void __init mpc85xx_cds_setup_arch(void)
        for (np = NULL; (np = of_find_node_by_type(np, "pci")) !=
 NULL;) {
                struct resource rsrc;
                of_address_to_resource(np, 0, &rsrc);
-               if ((rsrc.start & 0xfffff) == 0x9000)
-                       fsl_add_bridge(np, 0);
-               else
+               if ((rsrc.start & 0xfffff) == 0x8000)
                        fsl_add_bridge(np, 1);
+               else
+                       fsl_add_bridge(np, 0);

Why this is needed?
For pcie@a000, fsl_add_bridge(np, 0)?
Roy

#5 lore raw
Quoted 16 lines · Zang Roy-r61911 wrote:

arch/powerpc/platforms/85xx/mpc85xx_cds.c static void __init mpc85xx_cds_setup_arch(void) · line 279

Quoted 12 lines · Randy Vinson
arch/powerpc/platforms/85xx/mpc85xx_cds.c +3 -3
@@ -272,10 +272,10 @@ static void __init mpc85xx_cds_setup_arch(void)
        for (np = NULL; (np = of_find_node_by_type(np, "pci")) !=
 NULL;) {
                struct resource rsrc;
                of_address_to_resource(np, 0, &rsrc);
-               if ((rsrc.start & 0xfffff) == 0x9000)
-                       fsl_add_bridge(np, 0);
-               else
+               if ((rsrc.start & 0xfffff) == 0x8000)
                        fsl_add_bridge(np, 1);
+               else
+                       fsl_add_bridge(np, 0);

Why this is needed?
For pcie@a000, fsl_add_bridge(np, 0)?

The old version of the code would call fsl_add_bridge(np, 1) for the host bridges @8000 and @a000. When I tried it that way, it didn't work. I don't think you can have 2 primary bridges.

Randy V.

#6 lore raw

=20

Quoted 8 lines

-----Original Message-----
From: Randy Vinson [mailto:[email protected]]=20

Quoted 3 lines · Zang Roy-r61911 wrote:

On Sat, 2007-07-21 at 06:31, Randy Vinson wrote:
=20

Review static void __init=20

Quoted 1 line
(quoted diff) +0 -0
@@ -272,10 +272,10 @@ static void __init=20

mpc85xx_cds_setup_arch(void)

Quoted 1 line
Quoted 1 line
(quoted diff) +0 -0
        for (np =3D NULL; (np =3D of_find_node_by_type(np, "pci")) =

!=3D

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
arch/powerpc/platforms/85xx/mpc85xx_cds.c +3 -3
 NULL;) {
                struct resource rsrc;
                of_address_to_resource(np, 0, &rsrc);
-               if ((rsrc.start & 0xfffff) =3D=3D 0x9000)
-                       fsl_add_bridge(np, 0);
-               else
+               if ((rsrc.start & 0xfffff) =3D=3D 0x8000)
                        fsl_add_bridge(np, 1);
+               else
+                       fsl_add_bridge(np, 0);
Quoted 5 lines
Quoted 2 lines

Why this is needed?
For pcie@a000, fsl_add_bridge(np, 0)?

The old version of the code would call fsl_add_bridge(np, 1) for the host bridges @8000 and @a000. When I tried it that way, it=20 didn't work

What did not work? I tried two Ethernet cards @8000 and @a000. they worked..

Quoted 1 line

I don't think you can have 2 primary bridges.

Why?
They belong to two separate pci domain.
Roy

#7 lore raw
Quoted 5 lines · On Tuesday 24 July 2007, Zang Roy-r61911 wrote:
Quoted 2 lines

From: Randy Vinson [mailto:[email protected]]
I don't think you can have 2 primary bridges.

Why?
They belong to two separate pci domain.

PCI host bridge == PCI domain

A PHB canhave multiple buses, but only one PHB can be the primary one, which is defined as being the one that can hold ISA device. The problem is that ISA does not support multiple domains, so all devices with well-known ISA I/O port addresses have to be on the same PHB.

	Arnd <><