Skip to contentSkip to conversation

User Freescale pci/pcie common routing for 83xx/85xx/86xx boards

PATCH In review Zang Roy-r61911 1 participant 1 message Jul 10, 2007

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

PATCH 4/6 User Freescale pci/pcie common routing for 83xx/85xx/86xx boards

From: Roy Zang <[email protected]>

User Freescale pci/pcie common routing for 83xx/85xx/86xx boards.

---
 arch/powerpc/Kconfig                       |    2 +-
 arch/powerpc/platforms/83xx/Kconfig        |    4 +
 arch/powerpc/platforms/83xx/mpc8313_rdb.c  |    2 +-
 arch/powerpc/platforms/83xx/mpc832x_mds.c  |    2 +-
 arch/powerpc/platforms/83xx/mpc832x_rdb.c  |    2 +-
 arch/powerpc/platforms/83xx/mpc834x_itx.c  |   11 +++-
 arch/powerpc/platforms/83xx/mpc834x_mds.c  |   11 +++-
 arch/powerpc/platforms/83xx/mpc836x_mds.c  |    2 +-
 arch/powerpc/platforms/83xx/mpc83xx.h      |    2 +-
 arch/powerpc/platforms/83xx/pci.c          |   57 -----------------
 arch/powerpc/platforms/85xx/Kconfig        |    1 +
 arch/powerpc/platforms/85xx/Makefile       |    2 +-
 arch/powerpc/platforms/85xx/mpc85xx.h      |    1 -
 arch/powerpc/platforms/85xx/mpc85xx_ads.c  |    3 +-
 arch/powerpc/platforms/85xx/mpc85xx_cds.c  |   14 +++--
 arch/powerpc/platforms/85xx/mpc85xx_mds.c  |    6 +-
 arch/powerpc/platforms/85xx/pci.c          |   91 ----------------------------
 arch/powerpc/platforms/86xx/mpc86xx.h      |    2 -
 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |   11 +++-
 19 files changed, 51 insertions(+), 175 deletions(-)
 delete mode 100644 arch/powerpc/platforms/85xx/pci.c
arch/powerpc/Kconfig +1 -1
index 8c780bf..20f7a34 100644
@@ -421,7 +421,7 @@ config FSL_SOC
 
 config FSL_PCI
  	bool
-	depends on PPC_86xx
+	depends on PPC_85xx || PPC_86xx || PPC_83xx
 
 # Yes MCA RS/6000s exist but Linux-PPC does not currently support any
 config MCA
arch/powerpc/platforms/83xx/Kconfig +4 -0
index ec305f1..d60a431 100644
@@ -55,23 +55,27 @@ endchoice
 config PPC_MPC831x
 	bool
 	select PPC_UDBG_16550
+	select FSL_PCI
 	select PPC_INDIRECT_PCI
 	default y if MPC8313_RDB
 
 config PPC_MPC832x
 	bool
 	select PPC_UDBG_16550
+	select FSL_PCI
 	select PPC_INDIRECT_PCI
 	default y if MPC832x_MDS || MPC832x_RDB
 
 config MPC834x
 	bool
 	select PPC_UDBG_16550
+	select FSL_PCI
 	select PPC_INDIRECT_PCI
 	default y if MPC834x_MDS || MPC834x_ITX
 
 config PPC_MPC836x
 	bool
 	select PPC_UDBG_16550
+	select FSL_PCI
 	select PPC_INDIRECT_PCI
 	default y if MPC836x_MDS
arch/powerpc/platforms/83xx/mpc8313_rdb.c +1 -1
index 3edfe17..41f4988 100644
@@ -44,7 +44,7 @@ static void __init mpc8313_rdb_setup_arch(void)
 
 #ifdef CONFIG_PCI
 	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
-		mpc83xx_add_bridge(np);
+		fsl_add_bridge(np, 1);
 
 	ppc_md.pci_exclude_device = mpc83xx_exclude_device;
 #endif
arch/powerpc/platforms/83xx/mpc832x_mds.c +1 -1
index b39cb52..6ef2acf 100644
@@ -75,7 +75,7 @@ static void __init mpc832x_sys_setup_arch(void)
 
 #ifdef CONFIG_PCI
 	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
-		mpc83xx_add_bridge(np);
+		fsl_add_bridge(np, 1);
 	ppc_md.pci_exclude_device = mpc83xx_exclude_device;
 #endif
 
arch/powerpc/platforms/83xx/mpc832x_rdb.c +1 -1
index b2b28a4..0acc670 100644
@@ -48,7 +48,7 @@ static void __init mpc832x_rdb_setup_arch(void)
 
 #ifdef CONFIG_PCI
 	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
-		mpc83xx_add_bridge(np);
+		fsl_add_bridge(np, 1);
 
 	ppc_md.pci_exclude_device = mpc83xx_exclude_device;
 #endif
arch/powerpc/platforms/83xx/mpc834x_itx.c +8 -3
index 47ba544..defde26 100644
@@ -53,9 +53,14 @@ static void __init mpc834x_itx_setup_arch(void)
 		ppc_md.progress("mpc834x_itx_setup_arch()", 0);
 
 #ifdef CONFIG_PCI
-	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
-		mpc83xx_add_bridge(np);
-
+	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) == 0x8500)
+			fsl_add_bridge(np, 1);
+		else
+			fsl_add_bridge(np, 0);
+	}
 	ppc_md.pci_exclude_device = mpc83xx_exclude_device;
 #endif
 
arch/powerpc/platforms/83xx/mpc834x_mds.c +8 -3
index 4c9ff9c..dbbf8b0 100644
@@ -84,9 +84,14 @@ static void __init mpc834x_mds_setup_arch(void)
 		ppc_md.progress("mpc834x_mds_setup_arch()", 0);
 
 #ifdef CONFIG_PCI
-	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
-		mpc83xx_add_bridge(np);
-
+	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) == 0x8500)
+			fsl_add_bridge(np, 1);
+		else
+			fsl_add_bridge(np, 0);
+	}
 	ppc_md.pci_exclude_device = mpc83xx_exclude_device;
 #endif
 
arch/powerpc/platforms/83xx/mpc836x_mds.c +1 -1
index 0e615fd..9f39941 100644
@@ -81,7 +81,7 @@ static void __init mpc836x_mds_setup_arch(void)
 
 #ifdef CONFIG_PCI
 	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
-		mpc83xx_add_bridge(np);
+		fsl_add_bridge(np, 1);
 	ppc_md.pci_exclude_device = mpc83xx_exclude_device;
 #endif
 
arch/powerpc/platforms/83xx/mpc83xx.h +1 -1
index 589ee55..dd1315e 100644
@@ -48,7 +48,7 @@
  * mpc83xx_* files. Mostly for use by mpc83xx_setup
  */
 
-extern int mpc83xx_add_bridge(struct device_node *dev);
+extern int fsl_add_bridge(struct device_node *dev, int is_primary);
 extern int mpc83xx_exclude_device(struct pci_controller *hose,
 				  u_char bus, u_char devfn);
 extern void mpc83xx_restart(char *cmd);
arch/powerpc/platforms/83xx/pci.c +0 -57

60 lines not on this page · raw message

arch/powerpc/platforms/85xx/Kconfig +1 -0
index 629926e..112e5c6 100644
@@ -53,6 +53,7 @@ config MPC85xx
 	select PPC_INDIRECT_PCI
 	select PPC_INDIRECT_PCI_BE
 	select MPIC
+	select FSL_PCI
 	select SERIAL_8250_SHARE_IRQ if SERIAL_8250
 	default y if MPC8540_ADS || MPC85xx_CDS || MPC8560_ADS \
 		|| MPC85xx_MDS || MPC8544_DS
arch/powerpc/platforms/85xx/Makefile +1 -1
index 4e02cbb..d70f2d0 100644
@@ -1,7 +1,7 @@
 #
 # Makefile for the PowerPC 85xx linux kernel.
 #
-obj-$(CONFIG_PPC_85xx)	+= misc.o pci.o
+obj-$(CONFIG_PPC_85xx)	+= misc.o
 obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o
 obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o
 obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o
arch/powerpc/platforms/85xx/mpc85xx.h +0 -1
index 7286ffa..5b34dee 100644
@@ -15,4 +15,3 @@
  */
 
 extern void mpc85xx_restart(char *);
-extern int mpc85xx_add_bridge(struct device_node *dev);
arch/powerpc/platforms/85xx/mpc85xx_ads.c +2 -1
index 7235f70..40a8286 100644
@@ -29,6 +29,7 @@
 #include <asm/udbg.h>
 
 #include <sysdev/fsl_soc.h>
+#include <sysdev/fsl_pci.h>
 #include "mpc85xx.h"
 
 #ifdef CONFIG_CPM2
@@ -217,7 +218,7 @@ static void __init mpc85xx_ads_setup_arch(void)
 
 #ifdef CONFIG_PCI
 	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
-		mpc85xx_add_bridge(np);
+		fsl_add_bridge(np, 1);
 	ppc_md.pci_exclude_device = mpc85xx_exclude_device;
 #endif
 }
arch/powerpc/platforms/85xx/mpc85xx_cds.c +9 -5
index 50c8d64..2539bb5 100644
@@ -45,6 +45,7 @@
 #include <asm/i8259.h>
 
 #include <sysdev/fsl_soc.h>
+#include <sysdev/fsl_pci.h>
 #include "mpc85xx.h"
 
 static int cds_pci_slot = 2;
@@ -58,8 +59,6 @@ static volatile u8 *cadmus;
 static int mpc85xx_exclude_device(struct pci_controller *hose,
 				  u_char bus, u_char devfn)
 {
-	if ((bus == hose->first_busno) && PCI_SLOT(devfn) == 0)
-		return PCIBIOS_DEVICE_NOT_FOUND;
 	/* We explicitly do not go past the Tundra 320 Bridge */
 	if ((bus == 1) && (PCI_SLOT(devfn) == ARCADIA_2ND_BRIDGE_IDSEL))
 		return PCIBIOS_DEVICE_NOT_FOUND;
@@ -218,9 +217,14 @@ static void __init mpc85xx_cds_setup_arch(void)
 	}
 
 #ifdef CONFIG_PCI
-	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
-		mpc85xx_add_bridge(np);
-
+	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
+			fsl_add_bridge(np, 1);
+	}
 	ppc_md.pci_irq_fixup = mpc85xx_cds_pci_irq_fixup;
 	ppc_md.pci_exclude_device = mpc85xx_exclude_device;
 #endif
arch/powerpc/platforms/85xx/mpc85xx_mds.c +3 -3
index 004b80b..9aa96f0 100644
@@ -46,6 +46,7 @@
 #include <asm/prom.h>
 #include <asm/udbg.h>
 #include <sysdev/fsl_soc.h>
+#include <sysdev/fsl_pci.h>
 #include <asm/qe.h>
 #include <asm/qe_ic.h>
 #include <asm/mpic.h>
@@ -94,9 +95,8 @@ static void __init mpc85xx_mds_setup_arch(void)
 	}
 
 #ifdef CONFIG_PCI
-	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) {
-		mpc85xx_add_bridge(np);
-	}
+	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
+		fsl_add_bridge(np, 1);
 	of_node_put(np);
 #endif
 
arch/powerpc/platforms/85xx/pci.c deleted +0 -91

91 lines not on this page · raw message

arch/powerpc/platforms/86xx/mpc86xx.h +0 -2
index 23f7ed2..fdb192b 100644
@@ -15,8 +15,6 @@
  * mpc86xx_* files. Mostly for use by mpc86xx_setup().
  */
 
-extern int mpc86xx_add_bridge(struct device_node *dev);
-
 extern int mpc86xx_exclude_device(struct pci_controller *hose,
 				  u_char bus, u_char devfn);
 
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +9 -2
index 5b01ec7..dab016e 100644
@@ -32,6 +32,7 @@
 #include <asm/mpic.h>
 
 #include <sysdev/fsl_soc.h>
+#include <sysdev/fsl_pci.h>
 
 #include "mpc86xx.h"
 #include "mpc8641_hpcn.h"
@@ -344,8 +345,14 @@ mpc86xx_hpcn_setup_arch(void)
 	}
 
 #ifdef CONFIG_PCI
-	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
-		mpc86xx_add_bridge(np);
+	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) == 0x8000)
+			fsl_add_bridge(np, 1);
+		else
+			fsl_add_bridge(np, 0);
+	}
 #endif
 
 	printk("MPC86xx HPCN board from Freescale Semiconductor\n");
Signature · 1 line
1.5.1