All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] Description for PCI patches using platform driver
@ 2012-06-08  9:42 Jia Hongtao
  2012-06-08  9:42 ` [PATCH V3 1/6] powerpc/fsl-pci: Unify pci/pcie initialization code Jia Hongtao
                   ` (6 more replies)
  0 siblings, 7 replies; 19+ messages in thread
From: Jia Hongtao @ 2012-06-08  9:42 UTC (permalink / raw)
  To: linuxppc-dev, galak; +Cc: R65777, b38951, B07421

This series of patches are to unify pci initialization code and add PM support
for all 85xx/86xx powerpc boards. But two side effects are introduced by this
mechanism which listed below:

1. of_platform_bus_probe() will be called twice but in some cases duplication
   warning occured. We fix this in [PATCH 5/6].

2. Edac driver failed to register pci nodes as platform devices. We fix this
   in [PATCH 6/6].

These patches are against 'next' branch on:
http://git.kernel.org/?p=linux/kernel/git/galak/powerpc.git

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH V3 1/6] powerpc/fsl-pci: Unify pci/pcie initialization code
  2012-06-08  9:42 [PATCH 0/6] Description for PCI patches using platform driver Jia Hongtao
@ 2012-06-08  9:42 ` Jia Hongtao
  2012-06-08  9:42 ` [PATCH V3 2/6] powerpc/fsl-pci: Using common pci/pcie initialization for all boards Jia Hongtao
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 19+ messages in thread
From: Jia Hongtao @ 2012-06-08  9:42 UTC (permalink / raw)
  To: linuxppc-dev, galak; +Cc: R65777, b38951, B07421

We unified the Freescale pci/pcie initialization by changing the fsl_pci
to a platform driver.

In previous version pci/pcie initialization is in platform code which
Initialize pci bridge base on EP/RC or host/agent settings.

Signed-off-by: Jia Hongtao <B38951@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
---
 arch/powerpc/sysdev/fsl_pci.c |   61 +++++++++++++++++++++++++++++++++++++++++
 arch/powerpc/sysdev/fsl_pci.h |    1 +
 2 files changed, 62 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 6073288..4c3d130 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -807,3 +807,64 @@ u64 fsl_pci_immrbar_base(struct pci_controller *hose)
 
 	return 0;
 }
+
+#if defined(CONFIG_FSL_SOC_BOOKE) || defined(CONFIG_PPC_86xx)
+static const struct of_device_id pci_ids[] = {
+	{ .compatible = "fsl,mpc8540-pci", },
+	{ .compatible = "fsl,mpc8548-pcie", },
+	{ .compatible = "fsl,mpc8641-pcie", },
+	{ .compatible = "fsl,p1022-pcie", },
+	{ .compatible = "fsl,p1010-pcie", },
+	{ .compatible = "fsl,p1023-pcie", },
+	{ .compatible = "fsl,p4080-pcie", },
+	{ .compatible = "fsl,qoriq-pcie-v2.3", },
+	{ .compatible = "fsl,qoriq-pcie-v2.2", },
+	{},
+};
+
+int primary_phb_addr;
+static int __devinit fsl_pci_probe(struct platform_device *pdev)
+{
+	struct pci_controller *hose;
+	int ret;
+	bool is_primary;
+
+	if (of_match_node(pci_ids, pdev->dev.of_node)) {
+		struct resource rsrc;
+		of_address_to_resource(pdev->dev.of_node, 0, &rsrc);
+		is_primary = ((rsrc.start & 0xfffff) == primary_phb_addr);
+		ret = fsl_add_bridge(pdev->dev.of_node, is_primary);
+
+#ifdef CONFIG_SWIOTLB
+		hose = pci_find_hose_for_OF_device(pdev->dev.of_node);
+		/*
+		 * if we couldn't map all of DRAM via the dma windows
+		 * we need SWIOTLB to handle buffers located outside of
+		 * dma capable memory region
+		 */
+		if (memblock_end_of_DRAM() > hose->dma_window_base_cur
+				+ hose->dma_window_size) {
+			ppc_swiotlb_enable = 1;
+			set_pci_dma_ops(&swiotlb_dma_ops);
+			ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
+		}
+#endif
+	}
+
+	return 0;
+}
+
+static struct platform_driver fsl_pci_driver = {
+	.driver = {
+		.name = "fsl-pci",
+		.of_match_table = pci_ids,
+	},
+	.probe = fsl_pci_probe,
+};
+
+static int __init fsl_pci_init(void)
+{
+	return platform_driver_register(&fsl_pci_driver);
+}
+arch_initcall(fsl_pci_init);
+#endif
diff --git a/arch/powerpc/sysdev/fsl_pci.h b/arch/powerpc/sysdev/fsl_pci.h
index a39ed5c..df9fc44 100644
--- a/arch/powerpc/sysdev/fsl_pci.h
+++ b/arch/powerpc/sysdev/fsl_pci.h
@@ -88,6 +88,7 @@ struct ccsr_pci {
 	__be32	pex_err_cap_r3;		/* 0x.e34 - PCIE error capture register 0 */
 };
 
+extern int primary_phb_addr;
 extern int fsl_add_bridge(struct device_node *dev, int is_primary);
 extern void fsl_pcibios_fixup_bus(struct pci_bus *bus);
 extern int mpc83xx_add_bridge(struct device_node *dev);
-- 
1.7.5.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH V3 2/6] powerpc/fsl-pci: Using common pci/pcie initialization for all boards
  2012-06-08  9:42 [PATCH 0/6] Description for PCI patches using platform driver Jia Hongtao
  2012-06-08  9:42 ` [PATCH V3 1/6] powerpc/fsl-pci: Unify pci/pcie initialization code Jia Hongtao
@ 2012-06-08  9:42 ` Jia Hongtao
  2012-06-08  9:42 ` [PATCH V3 3/6] powerpc/fsl-pci: Only scan PCI bus if configured as a host Jia Hongtao
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 19+ messages in thread
From: Jia Hongtao @ 2012-06-08  9:42 UTC (permalink / raw)
  To: linuxppc-dev, galak; +Cc: R65777, b38951, B07421

Including all 85xx and 86xx platforms.

Signed-off-by: Jia Hongtao <B38951@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
---
 arch/powerpc/platforms/85xx/common.c       |   28 ++++++++++++
 arch/powerpc/platforms/85xx/corenet_ds.c   |   27 +------------
 arch/powerpc/platforms/85xx/corenet_ds.h   |    1 +
 arch/powerpc/platforms/85xx/ge_imp3a.c     |   34 +--------------
 arch/powerpc/platforms/85xx/mpc8536_ds.c   |   40 ++++-------------
 arch/powerpc/platforms/85xx/mpc85xx.h      |    1 +
 arch/powerpc/platforms/85xx/mpc85xx_ads.c  |   17 ++++----
 arch/powerpc/platforms/85xx/mpc85xx_cds.c  |   24 ++++------
 arch/powerpc/platforms/85xx/mpc85xx_ds.c   |   33 ++------------
 arch/powerpc/platforms/85xx/mpc85xx_mds.c  |   62 +++++++++++++--------------
 arch/powerpc/platforms/85xx/mpc85xx_rdb.c  |   13 ++----
 arch/powerpc/platforms/85xx/p1010rdb.c     |   13 +-----
 arch/powerpc/platforms/85xx/p1022_ds.c     |   29 +------------
 arch/powerpc/platforms/85xx/p1023_rds.c    |    6 +--
 arch/powerpc/platforms/85xx/p2041_rdb.c    |    1 +
 arch/powerpc/platforms/85xx/p3041_ds.c     |    1 +
 arch/powerpc/platforms/85xx/p3060_qds.c    |    1 +
 arch/powerpc/platforms/85xx/p4080_ds.c     |    1 +
 arch/powerpc/platforms/85xx/p5020_ds.c     |    1 +
 arch/powerpc/platforms/85xx/sbc8548.c      |   27 ++++--------
 arch/powerpc/platforms/85xx/sbc8560.c      |   19 ++++----
 arch/powerpc/platforms/85xx/socrates.c     |   16 +++----
 arch/powerpc/platforms/85xx/stx_gp3.c      |   19 ++++----
 arch/powerpc/platforms/85xx/tqm85xx.c      |   29 ++++---------
 arch/powerpc/platforms/85xx/xes_mpc85xx.c  |   25 ++---------
 arch/powerpc/platforms/86xx/gef_ppc9a.c    |   34 ++++++++++++----
 arch/powerpc/platforms/86xx/gef_sbc310.c   |   34 ++++++++++++----
 arch/powerpc/platforms/86xx/gef_sbc610.c   |   34 ++++++++++++----
 arch/powerpc/platforms/86xx/mpc8610_hpcd.c |   41 ++++++++++++-------
 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |   55 ++++++++++++-------------
 arch/powerpc/platforms/86xx/sbc8641d.c     |   30 +++++++++----
 drivers/of/platform.c                      |    3 +-
 include/linux/of_platform.h                |    4 ++
 33 files changed, 313 insertions(+), 390 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/common.c b/arch/powerpc/platforms/85xx/common.c
index 9fef530..ae162ae 100644
--- a/arch/powerpc/platforms/85xx/common.c
+++ b/arch/powerpc/platforms/85xx/common.c
@@ -28,6 +28,34 @@ int __init mpc85xx_common_publish_devices(void)
 {
 	return of_platform_bus_probe(NULL, mpc85xx_common_ids, NULL);
 }
+
+static struct of_device_id __initdata mpc85xx_pci_ids[] = {
+	{ .compatible = "fsl,mpc8540-pci", },
+	{ .compatible = "fsl,mpc8548-pcie", },
+	{ .compatible = "fsl,p1022-pcie", },
+	{ .compatible = "fsl,p1010-pcie", },
+	{ .compatible = "fsl,p1023-pcie", },
+	{ .compatible = "fsl,p4080-pcie", },
+	{ .compatible = "fsl,qoriq-pcie-v2.3", },
+	{ .compatible = "fsl,qoriq-pcie-v2.2", },
+	{},
+};
+
+int __init mpc85xx_pci_publish_devices(void)
+{
+	struct device_node *np;
+	int rc = 0;
+
+	for_each_matching_node(np, mpc85xx_pci_ids) {
+		rc = of_platform_bus_create(np, mpc85xx_pci_ids, NULL,
+				NULL, true);
+		if (rc)
+			break;
+	}
+
+	return rc;
+}
+
 #ifdef CONFIG_CPM2
 static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
 {
diff --git a/arch/powerpc/platforms/85xx/corenet_ds.c b/arch/powerpc/platforms/85xx/corenet_ds.c
index df69e99..a21a075 100644
--- a/arch/powerpc/platforms/85xx/corenet_ds.c
+++ b/arch/powerpc/platforms/85xx/corenet_ds.c
@@ -53,36 +53,17 @@ void __init corenet_ds_pic_init(void)
  */
 void __init corenet_ds_setup_arch(void)
 {
-#ifdef CONFIG_PCI
-	struct device_node *np;
-	struct pci_controller *hose;
-#endif
-	dma_addr_t max = 0xffffffff;
-
 	mpc85xx_smp_init();
 
 #ifdef CONFIG_PCI
-	for_each_node_by_type(np, "pci") {
-		if (of_device_is_compatible(np, "fsl,p4080-pcie") ||
-		    of_device_is_compatible(np, "fsl,qoriq-pcie-v2.2")) {
-			fsl_add_bridge(np, 0);
-			hose = pci_find_hose_for_OF_device(np);
-			max = min(max, hose->dma_window_base_cur +
-					hose->dma_window_size);
-		}
-	}
-
 #ifdef CONFIG_PPC64
 	pci_devs_phb_init();
 #endif
 #endif
 
 #ifdef CONFIG_SWIOTLB
-	if (memblock_end_of_DRAM() > max) {
+	if (memblock_end_of_DRAM() > 0xffffffff)
 		ppc_swiotlb_enable = 1;
-		set_pci_dma_ops(&swiotlb_dma_ops);
-		ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
-	}
 #endif
 	pr_info("%s board from Freescale Semiconductor\n", ppc_md.name);
 }
@@ -94,12 +75,6 @@ static const struct of_device_id of_device_ids[] __devinitconst = {
 	{
 		.compatible	= "fsl,srio",
 	},
-	{
-		.compatible	= "fsl,p4080-pcie",
-	},
-	{
-		.compatible	= "fsl,qoriq-pcie-v2.2",
-	},
 	/* The following two are for the Freescale hypervisor */
 	{
 		.name		= "hypervisor",
diff --git a/arch/powerpc/platforms/85xx/corenet_ds.h b/arch/powerpc/platforms/85xx/corenet_ds.h
index ddd700b..89700e6 100644
--- a/arch/powerpc/platforms/85xx/corenet_ds.h
+++ b/arch/powerpc/platforms/85xx/corenet_ds.h
@@ -15,5 +15,6 @@
 extern void __init corenet_ds_pic_init(void);
 extern void __init corenet_ds_setup_arch(void);
 extern int __init corenet_ds_publish_devices(void);
+extern int __init mpc85xx_pci_publish_devices(void);
 
 #endif
diff --git a/arch/powerpc/platforms/85xx/ge_imp3a.c b/arch/powerpc/platforms/85xx/ge_imp3a.c
index d50056f..43f7142 100644
--- a/arch/powerpc/platforms/85xx/ge_imp3a.c
+++ b/arch/powerpc/platforms/85xx/ge_imp3a.c
@@ -85,52 +85,21 @@ void __init ge_imp3a_pic_init(void)
 	of_node_put(cascade_node);
 }
 
-#ifdef CONFIG_PCI
-static int primary_phb_addr;
-#endif	/* CONFIG_PCI */
-
 /*
  * Setup the architecture
  */
 static void __init ge_imp3a_setup_arch(void)
 {
 	struct device_node *regs;
-#ifdef CONFIG_PCI
-	struct device_node *np;
-	struct pci_controller *hose;
-#endif
-	dma_addr_t max = 0xffffffff;
 
 	if (ppc_md.progress)
 		ppc_md.progress("ge_imp3a_setup_arch()", 0);
 
-#ifdef CONFIG_PCI
-	for_each_node_by_type(np, "pci") {
-		if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
-		    of_device_is_compatible(np, "fsl,mpc8548-pcie") ||
-		    of_device_is_compatible(np, "fsl,p2020-pcie")) {
-			struct resource rsrc;
-			of_address_to_resource(np, 0, &rsrc);
-			if ((rsrc.start & 0xfffff) == primary_phb_addr)
-				fsl_add_bridge(np, 1);
-			else
-				fsl_add_bridge(np, 0);
-
-			hose = pci_find_hose_for_OF_device(np);
-			max = min(max, hose->dma_window_base_cur +
-					hose->dma_window_size);
-		}
-	}
-#endif
-
 	mpc85xx_smp_init();
 
 #ifdef CONFIG_SWIOTLB
-	if (memblock_end_of_DRAM() > max) {
+	if (memblock_end_of_DRAM() > 0xffffffff)
 		ppc_swiotlb_enable = 1;
-		set_pci_dma_ops(&swiotlb_dma_ops);
-		ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
-	}
 #endif
 
 	/* Remap basic board registers */
@@ -226,6 +195,7 @@ static int __init ge_imp3a_probe(void)
 	return 0;
 }
 
+machine_arch_initcall(p1022_ds, mpc85xx_pci_publish_devices);
 machine_device_initcall(ge_imp3a, mpc85xx_common_publish_devices);
 
 machine_arch_initcall(ge_imp3a, swiotlb_setup_bus_notifier);
diff --git a/arch/powerpc/platforms/85xx/mpc8536_ds.c b/arch/powerpc/platforms/85xx/mpc8536_ds.c
index f588726..e9fc274 100644
--- a/arch/powerpc/platforms/85xx/mpc8536_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc8536_ds.c
@@ -47,40 +47,12 @@ void __init mpc8536_ds_pic_init(void)
  */
 static void __init mpc8536_ds_setup_arch(void)
 {
-#ifdef CONFIG_PCI
-	struct device_node *np;
-	struct pci_controller *hose;
-#endif
-	dma_addr_t max = 0xffffffff;
-
 	if (ppc_md.progress)
 		ppc_md.progress("mpc8536_ds_setup_arch()", 0);
 
-#ifdef CONFIG_PCI
-	for_each_node_by_type(np, "pci") {
-		if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
-		    of_device_is_compatible(np, "fsl,mpc8548-pcie")) {
-			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);
-
-			hose = pci_find_hose_for_OF_device(np);
-			max = min(max, hose->dma_window_base_cur +
-					hose->dma_window_size);
-		}
-	}
-
-#endif
-
 #ifdef CONFIG_SWIOTLB
-	if (memblock_end_of_DRAM() > max) {
+	if (memblock_end_of_DRAM() > 0xffffffff)
 		ppc_swiotlb_enable = 1;
-		set_pci_dma_ops(&swiotlb_dma_ops);
-		ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
-	}
 #endif
 
 	printk("MPC8536 DS board from Freescale Semiconductor\n");
@@ -88,6 +60,7 @@ static void __init mpc8536_ds_setup_arch(void)
 
 machine_device_initcall(mpc8536_ds, mpc85xx_common_publish_devices);
 
+machine_arch_initcall(mpc8536_ds, mpc85xx_pci_publish_devices);
 machine_arch_initcall(mpc8536_ds, swiotlb_setup_bus_notifier);
 
 /*
@@ -97,7 +70,14 @@ static int __init mpc8536_ds_probe(void)
 {
 	unsigned long root = of_get_flat_dt_root();
 
-	return of_flat_dt_is_compatible(root, "fsl,mpc8536ds");
+	if (of_flat_dt_is_compatible(root, "fsl,mpc8536ds")) {
+#ifdef CONFIG_PCI
+		primary_phb_addr = 0x8000;
+#endif
+		return 1;
+	}
+
+	return 0;
 }
 
 define_machine(mpc8536_ds) {
diff --git a/arch/powerpc/platforms/85xx/mpc85xx.h b/arch/powerpc/platforms/85xx/mpc85xx.h
index 2aa7c5d..4ebdbb7 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx.h
+++ b/arch/powerpc/platforms/85xx/mpc85xx.h
@@ -1,6 +1,7 @@
 #ifndef MPC85xx_H
 #define MPC85xx_H
 extern int mpc85xx_common_publish_devices(void);
+extern int mpc85xx_pci_publish_devices(void);
 
 #ifdef CONFIG_CPM2
 extern void mpc85xx_cpm2_pic_init(void);
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index d19f675..f590df8 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -138,10 +138,6 @@ static void __init init_ioports(void)
 
 static void __init mpc85xx_ads_setup_arch(void)
 {
-#ifdef CONFIG_PCI
-	struct device_node *np;
-#endif
-
 	if (ppc_md.progress)
 		ppc_md.progress("mpc85xx_ads_setup_arch()", 0);
 
@@ -151,9 +147,6 @@ static void __init mpc85xx_ads_setup_arch(void)
 #endif
 
 #ifdef CONFIG_PCI
-	for_each_compatible_node(np, "pci", "fsl,mpc8540-pci")
-		fsl_add_bridge(np, 1);
-
 	ppc_md.pci_exclude_device = mpc85xx_exclude_device;
 #endif
 }
@@ -174,6 +167,7 @@ static void mpc85xx_ads_show_cpuinfo(struct seq_file *m)
 	seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
 }
 
+machine_arch_initcall(mpc85xx_ads, mpc85xx_pci_publish_devices);
 machine_device_initcall(mpc85xx_ads, mpc85xx_common_publish_devices);
 
 /*
@@ -183,7 +177,14 @@ static int __init mpc85xx_ads_probe(void)
 {
         unsigned long root = of_get_flat_dt_root();
 
-        return of_flat_dt_is_compatible(root, "MPC85xxADS");
+	if (of_flat_dt_is_compatible(root, "MPC85xxADS")) {
+#ifdef CONFIG_PCI
+		primary_phb_addr = 0x8000;
+#endif
+		return 1;
+	}
+
+	return 0;
 }
 
 define_machine(mpc85xx_ads) {
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index ab5f0bf1..2bb6b9c 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -310,18 +310,6 @@ static void __init mpc85xx_cds_setup_arch(void)
 	}
 
 #ifdef CONFIG_PCI
-	for_each_node_by_type(np, "pci") {
-		if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
-		    of_device_is_compatible(np, "fsl,mpc8548-pcie")) {
-			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);
-		}
-	}
-
 	ppc_md.pci_irq_fixup = mpc85xx_cds_pci_irq_fixup;
 	ppc_md.pci_exclude_device = mpc85xx_exclude_device;
 #endif
@@ -351,12 +339,20 @@ static void mpc85xx_cds_show_cpuinfo(struct seq_file *m)
  */
 static int __init mpc85xx_cds_probe(void)
 {
-        unsigned long root = of_get_flat_dt_root();
+	unsigned long root = of_get_flat_dt_root();
 
-        return of_flat_dt_is_compatible(root, "MPC85xxCDS");
+	if (of_flat_dt_is_compatible(root, "MPC85xxCDS")) {
+#ifdef CONFIG_PCI
+		primary_phb_addr = 0x8000;
+#endif
+		return 1;
+	}
+
+	return 0;
 }
 
 machine_device_initcall(mpc85xx_cds, mpc85xx_common_publish_devices);
+machine_arch_initcall(mpc85xx_cds, mpc85xx_pci_publish_devices);
 
 define_machine(mpc85xx_cds) {
 	.name		= "MPC85xx CDS",
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
index 6e23e3e..e33a8cf 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
@@ -115,7 +115,6 @@ void __init mpc85xx_ds_pic_init(void)
 }
 
 #ifdef CONFIG_PCI
-static int primary_phb_addr;
 extern int uli_exclude_device(struct pci_controller *hose,
 				u_char bus, u_char devfn);
 
@@ -141,44 +140,18 @@ static int mpc85xx_exclude_device(struct pci_controller *hose,
  */
 static void __init mpc85xx_ds_setup_arch(void)
 {
-#ifdef CONFIG_PCI
-	struct device_node *np;
-	struct pci_controller *hose;
-#endif
-	dma_addr_t max = 0xffffffff;
-
 	if (ppc_md.progress)
 		ppc_md.progress("mpc85xx_ds_setup_arch()", 0);
 
 #ifdef CONFIG_PCI
-	for_each_node_by_type(np, "pci") {
-		if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
-		    of_device_is_compatible(np, "fsl,mpc8548-pcie") ||
-		    of_device_is_compatible(np, "fsl,p2020-pcie")) {
-			struct resource rsrc;
-			of_address_to_resource(np, 0, &rsrc);
-			if ((rsrc.start & 0xfffff) == primary_phb_addr)
-				fsl_add_bridge(np, 1);
-			else
-				fsl_add_bridge(np, 0);
-
-			hose = pci_find_hose_for_OF_device(np);
-			max = min(max, hose->dma_window_base_cur +
-					hose->dma_window_size);
-		}
-	}
-
 	ppc_md.pci_exclude_device = mpc85xx_exclude_device;
 #endif
 
 	mpc85xx_smp_init();
 
 #ifdef CONFIG_SWIOTLB
-	if (memblock_end_of_DRAM() > max) {
+	if (memblock_end_of_DRAM() > 0xffffffff)
 		ppc_swiotlb_enable = 1;
-		set_pci_dma_ops(&swiotlb_dma_ops);
-		ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
-	}
 #endif
 
 	printk("MPC85xx DS board from Freescale Semiconductor\n");
@@ -205,6 +178,10 @@ machine_device_initcall(mpc8544_ds, mpc85xx_common_publish_devices);
 machine_device_initcall(mpc8572_ds, mpc85xx_common_publish_devices);
 machine_device_initcall(p2020_ds, mpc85xx_common_publish_devices);
 
+machine_arch_initcall(mpc8544_ds, mpc85xx_pci_publish_devices);
+machine_arch_initcall(mpc8572_ds, mpc85xx_pci_publish_devices);
+machine_arch_initcall(p2020_ds, mpc85xx_pci_publish_devices);
+
 machine_arch_initcall(mpc8544_ds, swiotlb_setup_bus_notifier);
 machine_arch_initcall(mpc8572_ds, swiotlb_setup_bus_notifier);
 machine_arch_initcall(p2020_ds, swiotlb_setup_bus_notifier);
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index e82f06f..6170d5f 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -328,43 +328,16 @@ static void __init mpc85xx_mds_qeic_init(void) { }
 
 static void __init mpc85xx_mds_setup_arch(void)
 {
-#ifdef CONFIG_PCI
-	struct pci_controller *hose;
-	struct device_node *np;
-#endif
-	dma_addr_t max = 0xffffffff;
-
 	if (ppc_md.progress)
 		ppc_md.progress("mpc85xx_mds_setup_arch()", 0);
 
-#ifdef CONFIG_PCI
-	for_each_node_by_type(np, "pci") {
-		if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
-		    of_device_is_compatible(np, "fsl,mpc8548-pcie")) {
-			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);
-
-			hose = pci_find_hose_for_OF_device(np);
-			max = min(max, hose->dma_window_base_cur +
-					hose->dma_window_size);
-		}
-	}
-#endif
-
 	mpc85xx_smp_init();
 
 	mpc85xx_mds_qe_init();
 
 #ifdef CONFIG_SWIOTLB
-	if (memblock_end_of_DRAM() > max) {
+	if (memblock_end_of_DRAM() > 0xffffffff)
 		ppc_swiotlb_enable = 1;
-		set_pci_dma_ops(&swiotlb_dma_ops);
-		ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
-	}
 #endif
 }
 
@@ -423,6 +396,10 @@ machine_device_initcall(mpc8568_mds, mpc85xx_publish_devices);
 machine_device_initcall(mpc8569_mds, mpc85xx_publish_devices);
 machine_device_initcall(p1021_mds, mpc85xx_common_publish_devices);
 
+machine_arch_initcall(mpc8568_mds, mpc85xx_pci_publish_devices);
+machine_arch_initcall(mpc8569_mds, mpc85xx_pci_publish_devices);
+machine_arch_initcall(p1021_mds, mpc85xx_pci_publish_devices);
+
 machine_arch_initcall(mpc8568_mds, swiotlb_setup_bus_notifier);
 machine_arch_initcall(mpc8569_mds, swiotlb_setup_bus_notifier);
 machine_arch_initcall(p1021_mds, swiotlb_setup_bus_notifier);
@@ -440,9 +417,16 @@ static void __init mpc85xx_mds_pic_init(void)
 
 static int __init mpc85xx_mds_probe(void)
 {
-        unsigned long root = of_get_flat_dt_root();
+	unsigned long root = of_get_flat_dt_root();
 
-        return of_flat_dt_is_compatible(root, "MPC85xxMDS");
+	if (of_flat_dt_is_compatible(root, "MPC85xxMDS")) {
+#ifdef CONFIG_PCI
+		primary_phb_addr = 0x8000;
+#endif
+		return 1;
+	}
+
+	return 0;
 }
 
 define_machine(mpc8568_mds) {
@@ -463,7 +447,14 @@ static int __init mpc8569_mds_probe(void)
 {
 	unsigned long root = of_get_flat_dt_root();
 
-	return of_flat_dt_is_compatible(root, "fsl,MPC8569EMDS");
+	if (of_flat_dt_is_compatible(root, "fsl,MPC8569EMDS")) {
+#ifdef CONFIG_PCI
+		primary_phb_addr = 0x8000;
+#endif
+		return 1;
+	}
+
+	return 0;
 }
 
 define_machine(mpc8569_mds) {
@@ -484,7 +475,14 @@ static int __init p1021_mds_probe(void)
 {
 	unsigned long root = of_get_flat_dt_root();
 
-	return of_flat_dt_is_compatible(root, "fsl,P1021MDS");
+	if (of_flat_dt_is_compatible(root, "fsl,P1021MDS")) {
+#ifdef CONFIG_PCI
+		primary_phb_addr = 0x8000;
+#endif
+		return 1;
+	}
+
+	return 0;
 
 }
 
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
index 1a66c3d..453a935 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
@@ -87,21 +87,13 @@ void __init mpc85xx_rdb_pic_init(void)
  */
 static void __init mpc85xx_rdb_setup_arch(void)
 {
-#if defined(CONFIG_PCI) || defined(CONFIG_QUICC_ENGINE)
+#ifdef CONFIG_QUICC_ENGINE
 	struct device_node *np;
 #endif
 
 	if (ppc_md.progress)
 		ppc_md.progress("mpc85xx_rdb_setup_arch()", 0);
 
-#ifdef CONFIG_PCI
-	for_each_node_by_type(np, "pci") {
-		if (of_device_is_compatible(np, "fsl,mpc8548-pcie"))
-			fsl_add_bridge(np, 0);
-	}
-
-#endif
-
 	mpc85xx_smp_init();
 
 #ifdef CONFIG_QUICC_ENGINE
@@ -171,6 +163,9 @@ machine_device_initcall(p1020_utm_pc, mpc85xx_common_publish_devices);
 machine_device_initcall(p1021_rdb_pc, mpc85xx_common_publish_devices);
 machine_device_initcall(p1025_rdb, mpc85xx_common_publish_devices);
 
+machine_arch_initcall(p2020_rdb, mpc85xx_pci_publish_devices);
+machine_arch_initcall(p1020_rdb, mpc85xx_pci_publish_devices);
+
 /*
  * Called very early, device-tree isn't unflattened
  */
diff --git a/arch/powerpc/platforms/85xx/p1010rdb.c b/arch/powerpc/platforms/85xx/p1010rdb.c
index d8bd656..ad9987c 100644
--- a/arch/powerpc/platforms/85xx/p1010rdb.c
+++ b/arch/powerpc/platforms/85xx/p1010rdb.c
@@ -47,25 +47,14 @@ void __init p1010_rdb_pic_init(void)
  */
 static void __init p1010_rdb_setup_arch(void)
 {
-#ifdef CONFIG_PCI
-	struct device_node *np;
-#endif
-
 	if (ppc_md.progress)
 		ppc_md.progress("p1010_rdb_setup_arch()", 0);
 
-#ifdef CONFIG_PCI
-	for_each_node_by_type(np, "pci") {
-		if (of_device_is_compatible(np, "fsl,p1010-pcie"))
-			fsl_add_bridge(np, 0);
-	}
-
-#endif
-
 	printk(KERN_INFO "P1010 RDB board from Freescale Semiconductor\n");
 }
 
 machine_device_initcall(p1010_rdb, mpc85xx_common_publish_devices);
+machine_arch_initcall(p1010_rdb, mpc85xx_pci_publish_devices);
 machine_arch_initcall(p1010_rdb, swiotlb_setup_bus_notifier);
 
 /*
diff --git a/arch/powerpc/platforms/85xx/p1022_ds.c b/arch/powerpc/platforms/85xx/p1022_ds.c
index e74b7cd..a8c4118 100644
--- a/arch/powerpc/platforms/85xx/p1022_ds.c
+++ b/arch/powerpc/platforms/85xx/p1022_ds.c
@@ -385,32 +385,9 @@ early_param("video", early_video_setup);
  */
 static void __init p1022_ds_setup_arch(void)
 {
-#ifdef CONFIG_PCI
-	struct device_node *np;
-#endif
-	dma_addr_t max = 0xffffffff;
-
 	if (ppc_md.progress)
 		ppc_md.progress("p1022_ds_setup_arch()", 0);
 
-#ifdef CONFIG_PCI
-	for_each_compatible_node(np, "pci", "fsl,p1022-pcie") {
-		struct resource rsrc;
-		struct pci_controller *hose;
-
-		of_address_to_resource(np, 0, &rsrc);
-
-		if ((rsrc.start & 0xfffff) == 0x8000)
-			fsl_add_bridge(np, 1);
-		else
-			fsl_add_bridge(np, 0);
-
-		hose = pci_find_hose_for_OF_device(np);
-		max = min(max, hose->dma_window_base_cur +
-			  hose->dma_window_size);
-	}
-#endif
-
 #if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
 	diu_ops.get_pixel_format	= p1022ds_get_pixel_format;
 	diu_ops.set_gamma_table		= p1022ds_set_gamma_table;
@@ -450,11 +427,8 @@ static void __init p1022_ds_setup_arch(void)
 	mpc85xx_smp_init();
 
 #ifdef CONFIG_SWIOTLB
-	if (memblock_end_of_DRAM() > max) {
+	if (memblock_end_of_DRAM() > 0xffffffff)
 		ppc_swiotlb_enable = 1;
-		set_pci_dma_ops(&swiotlb_dma_ops);
-		ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
-	}
 #endif
 
 	pr_info("Freescale P1022 DS reference board\n");
@@ -473,6 +447,7 @@ static int __init p1022_ds_publish_devices(void)
 }
 machine_device_initcall(p1022_ds, p1022_ds_publish_devices);
 
+machine_arch_initcall(p1022_ds, mpc85xx_pci_publish_devices);
 machine_arch_initcall(p1022_ds, swiotlb_setup_bus_notifier);
 
 /*
diff --git a/arch/powerpc/platforms/85xx/p1023_rds.c b/arch/powerpc/platforms/85xx/p1023_rds.c
index 6b07398..c62303c 100644
--- a/arch/powerpc/platforms/85xx/p1023_rds.c
+++ b/arch/powerpc/platforms/85xx/p1023_rds.c
@@ -81,15 +81,11 @@ static void __init mpc85xx_rds_setup_arch(void)
 		}
 	}
 
-#ifdef CONFIG_PCI
-	for_each_compatible_node(np, "pci", "fsl,p1023-pcie")
-		fsl_add_bridge(np, 0);
-#endif
-
 	mpc85xx_smp_init();
 }
 
 machine_device_initcall(p1023_rds, mpc85xx_common_publish_devices);
+machine_arch_initcall(p1023_rds, mpc85xx_pci_publish_devices);
 
 static void __init mpc85xx_rds_pic_init(void)
 {
diff --git a/arch/powerpc/platforms/85xx/p2041_rdb.c b/arch/powerpc/platforms/85xx/p2041_rdb.c
index eda6ed5..5123400 100644
--- a/arch/powerpc/platforms/85xx/p2041_rdb.c
+++ b/arch/powerpc/platforms/85xx/p2041_rdb.c
@@ -81,6 +81,7 @@ define_machine(p2041_rdb) {
 	.power_save		= e500_idle,
 };
 
+machine_arch_initcall(p2041_rdb, mpc85xx_pci_publish_devices);
 machine_device_initcall(p2041_rdb, corenet_ds_publish_devices);
 
 #ifdef CONFIG_SWIOTLB
diff --git a/arch/powerpc/platforms/85xx/p3041_ds.c b/arch/powerpc/platforms/85xx/p3041_ds.c
index 96d99a3..aa0dd29 100644
--- a/arch/powerpc/platforms/85xx/p3041_ds.c
+++ b/arch/powerpc/platforms/85xx/p3041_ds.c
@@ -83,6 +83,7 @@ define_machine(p3041_ds) {
 	.power_save		= e500_idle,
 };
 
+machine_arch_initcall(p3041_ds, mpc85xx_pci_publish_devices);
 machine_device_initcall(p3041_ds, corenet_ds_publish_devices);
 
 #ifdef CONFIG_SWIOTLB
diff --git a/arch/powerpc/platforms/85xx/p3060_qds.c b/arch/powerpc/platforms/85xx/p3060_qds.c
index 081cf4a..51aece5 100644
--- a/arch/powerpc/platforms/85xx/p3060_qds.c
+++ b/arch/powerpc/platforms/85xx/p3060_qds.c
@@ -70,6 +70,7 @@ define_machine(p3060_qds) {
 	.power_save		= e500_idle,
 };
 
+machine_arch_initcall(p3060_qds, mpc85xx_pci_publish_devices);
 machine_device_initcall(p3060_qds, corenet_ds_publish_devices);
 
 #ifdef CONFIG_SWIOTLB
diff --git a/arch/powerpc/platforms/85xx/p4080_ds.c b/arch/powerpc/platforms/85xx/p4080_ds.c
index d1b21d7..e6b52e8 100644
--- a/arch/powerpc/platforms/85xx/p4080_ds.c
+++ b/arch/powerpc/platforms/85xx/p4080_ds.c
@@ -82,6 +82,7 @@ define_machine(p4080_ds) {
 	.power_save		= e500_idle,
 };
 
+machine_arch_initcall(p4080_ds, mpc85xx_pci_publish_devices);
 machine_device_initcall(p4080_ds, corenet_ds_publish_devices);
 #ifdef CONFIG_SWIOTLB
 machine_arch_initcall(p4080_ds, swiotlb_setup_bus_notifier);
diff --git a/arch/powerpc/platforms/85xx/p5020_ds.c b/arch/powerpc/platforms/85xx/p5020_ds.c
index e8cba50..77953cc 100644
--- a/arch/powerpc/platforms/85xx/p5020_ds.c
+++ b/arch/powerpc/platforms/85xx/p5020_ds.c
@@ -92,6 +92,7 @@ define_machine(p5020_ds) {
 #endif
 };
 
+machine_arch_initcall(p5020_ds, mpc85xx_pci_publish_devices);
 machine_device_initcall(p5020_ds, corenet_ds_publish_devices);
 
 #ifdef CONFIG_SWIOTLB
diff --git a/arch/powerpc/platforms/85xx/sbc8548.c b/arch/powerpc/platforms/85xx/sbc8548.c
index 1677b8a..9049994 100644
--- a/arch/powerpc/platforms/85xx/sbc8548.c
+++ b/arch/powerpc/platforms/85xx/sbc8548.c
@@ -89,26 +89,9 @@ static int __init sbc8548_hw_rev(void)
  */
 static void __init sbc8548_setup_arch(void)
 {
-#ifdef CONFIG_PCI
-	struct device_node *np;
-#endif
-
 	if (ppc_md.progress)
 		ppc_md.progress("sbc8548_setup_arch()", 0);
 
-#ifdef CONFIG_PCI
-	for_each_node_by_type(np, "pci") {
-		if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
-		    of_device_is_compatible(np, "fsl,mpc8548-pcie")) {
-			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
 	sbc_rev = sbc8548_hw_rev();
 }
 
@@ -129,6 +112,7 @@ static void sbc8548_show_cpuinfo(struct seq_file *m)
 	seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
 }
 
+machine_arch_initcall(sbc8548, mpc85xx_pci_publish_devices);
 machine_device_initcall(sbc8548, mpc85xx_common_publish_devices);
 
 /*
@@ -138,7 +122,14 @@ static int __init sbc8548_probe(void)
 {
         unsigned long root = of_get_flat_dt_root();
 
-        return of_flat_dt_is_compatible(root, "SBC8548");
+	if (of_flat_dt_is_compatible(root, "SBC8548")) {
+#ifdef CONFIG_PCI
+		primary_phb_addr = 0x8000;
+#endif
+		return 1;
+	}
+
+	return 0;
 }
 
 define_machine(sbc8548) {
diff --git a/arch/powerpc/platforms/85xx/sbc8560.c b/arch/powerpc/platforms/85xx/sbc8560.c
index 3c3bbcc..c62692d 100644
--- a/arch/powerpc/platforms/85xx/sbc8560.c
+++ b/arch/powerpc/platforms/85xx/sbc8560.c
@@ -127,10 +127,6 @@ static void __init init_ioports(void)
 
 static void __init sbc8560_setup_arch(void)
 {
-#ifdef CONFIG_PCI
-	struct device_node *np;
-#endif
-
 	if (ppc_md.progress)
 		ppc_md.progress("sbc8560_setup_arch()", 0);
 
@@ -138,11 +134,6 @@ static void __init sbc8560_setup_arch(void)
 	cpm2_reset();
 	init_ioports();
 #endif
-
-#ifdef CONFIG_PCI
-	for_each_compatible_node(np, "pci", "fsl,mpc8540-pci")
-		fsl_add_bridge(np, 1);
-#endif
 }
 
 static void sbc8560_show_cpuinfo(struct seq_file *m)
@@ -161,6 +152,7 @@ static void sbc8560_show_cpuinfo(struct seq_file *m)
 	seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
 }
 
+machine_arch_initcall(sbc8560, mpc85xx_pci_publish_devices);
 machine_device_initcall(sbc8560, mpc85xx_common_publish_devices);
 
 /*
@@ -170,7 +162,14 @@ static int __init sbc8560_probe(void)
 {
         unsigned long root = of_get_flat_dt_root();
 
-        return of_flat_dt_is_compatible(root, "SBC8560");
+	if (of_flat_dt_is_compatible(root, "SBC8560")) {
+#ifdef CONFIG_PCI
+		primary_phb_addr = 0x8000;
+#endif
+		return 1;
+	}
+
+	return 0;
 }
 
 #ifdef CONFIG_RTC_DRV_M48T59
diff --git a/arch/powerpc/platforms/85xx/socrates.c b/arch/powerpc/platforms/85xx/socrates.c
index b719192..eb94e586 100644
--- a/arch/powerpc/platforms/85xx/socrates.c
+++ b/arch/powerpc/platforms/85xx/socrates.c
@@ -67,19 +67,11 @@ static void __init socrates_pic_init(void)
  */
 static void __init socrates_setup_arch(void)
 {
-#ifdef CONFIG_PCI
-	struct device_node *np;
-#endif
-
 	if (ppc_md.progress)
 		ppc_md.progress("socrates_setup_arch()", 0);
-
-#ifdef CONFIG_PCI
-	for_each_compatible_node(np, "pci", "fsl,mpc8540-pci")
-		fsl_add_bridge(np, 1);
-#endif
 }
 
+machine_arch_initcall(socrates, mpc85xx_pci_publish_devices);
 machine_device_initcall(socrates, mpc85xx_common_publish_devices);
 
 /*
@@ -89,8 +81,12 @@ static int __init socrates_probe(void)
 {
 	unsigned long root = of_get_flat_dt_root();
 
-	if (of_flat_dt_is_compatible(root, "abb,socrates"))
+	if (of_flat_dt_is_compatible(root, "abb,socrates")) {
+#ifdef CONFIG_PCI
+		primary_phb_addr = 0x8000;
+#endif
 		return 1;
+	}
 
 	return 0;
 }
diff --git a/arch/powerpc/platforms/85xx/stx_gp3.c b/arch/powerpc/platforms/85xx/stx_gp3.c
index 27ca3a7..92d2c3b 100644
--- a/arch/powerpc/platforms/85xx/stx_gp3.c
+++ b/arch/powerpc/platforms/85xx/stx_gp3.c
@@ -61,21 +61,12 @@ static void __init stx_gp3_pic_init(void)
  */
 static void __init stx_gp3_setup_arch(void)
 {
-#ifdef CONFIG_PCI
-	struct device_node *np;
-#endif
-
 	if (ppc_md.progress)
 		ppc_md.progress("stx_gp3_setup_arch()", 0);
 
 #ifdef CONFIG_CPM2
 	cpm2_reset();
 #endif
-
-#ifdef CONFIG_PCI
-	for_each_compatible_node(np, "pci", "fsl,mpc8540-pci")
-		fsl_add_bridge(np, 1);
-#endif
 }
 
 static void stx_gp3_show_cpuinfo(struct seq_file *m)
@@ -94,6 +85,7 @@ static void stx_gp3_show_cpuinfo(struct seq_file *m)
 	seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
 }
 
+machine_arch_initcall(stx_gp3, mpc85xx_pci_publish_devices);
 machine_device_initcall(stx_gp3, mpc85xx_common_publish_devices);
 
 /*
@@ -103,7 +95,14 @@ static int __init stx_gp3_probe(void)
 {
 	unsigned long root = of_get_flat_dt_root();
 
-	return of_flat_dt_is_compatible(root, "stx,gp3-8560");
+	if (of_flat_dt_is_compatible(root, "stx,gp3-8560")) {
+#ifdef CONFIG_PCI
+		primary_phb_addr = 0x8000;
+#endif
+		return 1;
+	}
+
+	return 0;
 }
 
 define_machine(stx_gp3) {
diff --git a/arch/powerpc/platforms/85xx/tqm85xx.c b/arch/powerpc/platforms/85xx/tqm85xx.c
index d7504ce..c8e2599 100644
--- a/arch/powerpc/platforms/85xx/tqm85xx.c
+++ b/arch/powerpc/platforms/85xx/tqm85xx.c
@@ -60,31 +60,12 @@ static void __init tqm85xx_pic_init(void)
  */
 static void __init tqm85xx_setup_arch(void)
 {
-#ifdef CONFIG_PCI
-	struct device_node *np;
-#endif
-
 	if (ppc_md.progress)
 		ppc_md.progress("tqm85xx_setup_arch()", 0);
 
 #ifdef CONFIG_CPM2
 	cpm2_reset();
 #endif
-
-#ifdef CONFIG_PCI
-	for_each_node_by_type(np, "pci") {
-		if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
-		    of_device_is_compatible(np, "fsl,mpc8548-pcie")) {
-			struct resource rsrc;
-			if (!of_address_to_resource(np, 0, &rsrc)) {
-				if ((rsrc.start & 0xfffff) == 0x8000)
-					fsl_add_bridge(np, 1);
-				else
-					fsl_add_bridge(np, 0);
-			}
-		}
-	}
-#endif
 }
 
 static void tqm85xx_show_cpuinfo(struct seq_file *m)
@@ -124,6 +105,7 @@ static void __init tqm85xx_ti1520_fixup(struct pci_dev *pdev)
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1520,
 		tqm85xx_ti1520_fixup);
 
+machine_arch_initcall(tqm85xx, mpc85xx_pci_publish_devices);
 machine_device_initcall(tqm85xx, mpc85xx_common_publish_devices);
 
 static const char *board[] __initdata = {
@@ -140,7 +122,14 @@ static const char *board[] __initdata = {
  */
 static int __init tqm85xx_probe(void)
 {
-	return of_flat_dt_match(of_get_flat_dt_root(), board);
+	if (of_flat_dt_match(of_get_flat_dt_root(), board)) {
+#ifdef CONFIG_PCI
+		primary_phb_addr = 0x8000;
+#endif
+		return 1;
+	}
+
+	return 0;
 }
 
 define_machine(tqm85xx) {
diff --git a/arch/powerpc/platforms/85xx/xes_mpc85xx.c b/arch/powerpc/platforms/85xx/xes_mpc85xx.c
index 503c215..f5ef6b5 100644
--- a/arch/powerpc/platforms/85xx/xes_mpc85xx.c
+++ b/arch/powerpc/platforms/85xx/xes_mpc85xx.c
@@ -112,18 +112,11 @@ static void xes_mpc85xx_fixups(void)
 	}
 }
 
-#ifdef CONFIG_PCI
-static int primary_phb_addr;
-#endif
-
 /*
  * Setup the architecture
  */
 static void __init xes_mpc85xx_setup_arch(void)
 {
-#ifdef CONFIG_PCI
-	struct device_node *np;
-#endif
 	struct device_node *root;
 	const char *model = "Unknown";
 
@@ -138,20 +131,6 @@ static void __init xes_mpc85xx_setup_arch(void)
 
 	xes_mpc85xx_fixups();
 
-#ifdef CONFIG_PCI
-	for_each_node_by_type(np, "pci") {
-		if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
-		    of_device_is_compatible(np, "fsl,mpc8548-pcie")) {
-			struct resource rsrc;
-			of_address_to_resource(np, 0, &rsrc);
-			if ((rsrc.start & 0xfffff) == primary_phb_addr)
-				fsl_add_bridge(np, 1);
-			else
-				fsl_add_bridge(np, 0);
-		}
-	}
-#endif
-
 	mpc85xx_smp_init();
 }
 
@@ -159,6 +138,10 @@ machine_device_initcall(xes_mpc8572, mpc85xx_common_publish_devices);
 machine_device_initcall(xes_mpc8548, mpc85xx_common_publish_devices);
 machine_device_initcall(xes_mpc8540, mpc85xx_common_publish_devices);
 
+machine_arch_initcall(xes_mpc8572, mpc85xx_pci_publish_devices);
+machine_arch_initcall(xes_mpc8548, mpc85xx_pci_publish_devices);
+machine_arch_initcall(xes_mpc8540, mpc85xx_pci_publish_devices);
+
 /*
  * Called very early, device-tree isn't unflattened
  */
diff --git a/arch/powerpc/platforms/86xx/gef_ppc9a.c b/arch/powerpc/platforms/86xx/gef_ppc9a.c
index ed58b6c..4f75816 100644
--- a/arch/powerpc/platforms/86xx/gef_ppc9a.c
+++ b/arch/powerpc/platforms/86xx/gef_ppc9a.c
@@ -74,13 +74,6 @@ static void __init gef_ppc9a_init_irq(void)
 static void __init gef_ppc9a_setup_arch(void)
 {
 	struct device_node *regs;
-#ifdef CONFIG_PCI
-	struct device_node *np;
-
-	for_each_compatible_node(np, "pci", "fsl,mpc8641-pcie") {
-		fsl_add_bridge(np, 1);
-	}
-#endif
 
 	printk(KERN_INFO "GE Intelligent Platforms PPC9A 6U VME SBC\n");
 
@@ -197,8 +190,12 @@ static int __init gef_ppc9a_probe(void)
 {
 	unsigned long root = of_get_flat_dt_root();
 
-	if (of_flat_dt_is_compatible(root, "gef,ppc9a"))
+	if (of_flat_dt_is_compatible(root, "gef,ppc9a")) {
+#ifdef CONFIG_PCI
+		primary_phb_addr = 0x8000;
+#endif
 		return 1;
+	}
 
 	return 0;
 }
@@ -219,6 +216,27 @@ static long __init mpc86xx_time_init(void)
 	return 0;
 }
 
+static struct of_device_id __initdata gef_ppc9a_pci_ids[] = {
+	{ .compatible = "fsl,mpc8641-pcie", },
+	{},
+};
+
+static int __init gef_ppc9a_publish_pci_device(void)
+{
+	struct device_node *np;
+	int rc = 0;
+
+	for_each_matching_node(np, gef_ppc9a_pci_ids) {
+		rc = of_platform_bus_create(np, gef_ppc9a_pci_ids, NULL,
+				NULL, true);
+		if (rc)
+			break;
+	}
+
+	return rc;
+}
+machine_arch_initcall(gef_ppc9a, gef_ppc9a_publish_pci_device);
+
 static __initdata struct of_device_id of_bus_ids[] = {
 	{ .compatible = "simple-bus", },
 	{ .compatible = "gianfar", },
diff --git a/arch/powerpc/platforms/86xx/gef_sbc310.c b/arch/powerpc/platforms/86xx/gef_sbc310.c
index 710db69..6be455b 100644
--- a/arch/powerpc/platforms/86xx/gef_sbc310.c
+++ b/arch/powerpc/platforms/86xx/gef_sbc310.c
@@ -74,13 +74,6 @@ static void __init gef_sbc310_init_irq(void)
 static void __init gef_sbc310_setup_arch(void)
 {
 	struct device_node *regs;
-#ifdef CONFIG_PCI
-	struct device_node *np;
-
-	for_each_compatible_node(np, "pci", "fsl,mpc8641-pcie") {
-		fsl_add_bridge(np, 1);
-	}
-#endif
 
 	printk(KERN_INFO "GE Intelligent Platforms SBC310 6U VPX SBC\n");
 
@@ -185,8 +178,12 @@ static int __init gef_sbc310_probe(void)
 {
 	unsigned long root = of_get_flat_dt_root();
 
-	if (of_flat_dt_is_compatible(root, "gef,sbc310"))
+	if (of_flat_dt_is_compatible(root, "gef,sbc310")) {
+#ifdef CONFIG_PCI
+		primary_phb_addr = 0x8000;
+#endif
 		return 1;
+	}
 
 	return 0;
 }
@@ -207,6 +204,27 @@ static long __init mpc86xx_time_init(void)
 	return 0;
 }
 
+static struct of_device_id __initdata gef_sbc310_pci_ids[] = {
+	{ .compatible = "fsl,mpc8641-pcie", },
+	{},
+};
+
+static int __init gef_sbc310_publish_pci_device(void)
+{
+	struct device_node *np;
+	int rc = 0;
+
+	for_each_matching_node(np, gef_sbc310_pci_ids) {
+		rc = of_platform_bus_create(np, gef_sbc310_pci_ids, NULL,
+				NULL, true);
+		if (rc)
+			break;
+	}
+
+	return rc;
+}
+machine_arch_initcall(gef_sbc310, gef_sbc310_publish_pci_device);
+
 static __initdata struct of_device_id of_bus_ids[] = {
 	{ .compatible = "simple-bus", },
 	{ .compatible = "gianfar", },
diff --git a/arch/powerpc/platforms/86xx/gef_sbc610.c b/arch/powerpc/platforms/86xx/gef_sbc610.c
index 4a13d2f..93e0f8d 100644
--- a/arch/powerpc/platforms/86xx/gef_sbc610.c
+++ b/arch/powerpc/platforms/86xx/gef_sbc610.c
@@ -74,13 +74,6 @@ static void __init gef_sbc610_init_irq(void)
 static void __init gef_sbc610_setup_arch(void)
 {
 	struct device_node *regs;
-#ifdef CONFIG_PCI
-	struct device_node *np;
-
-	for_each_compatible_node(np, "pci", "fsl,mpc8641-pcie") {
-		fsl_add_bridge(np, 1);
-	}
-#endif
 
 	printk(KERN_INFO "GE Intelligent Platforms SBC610 6U VPX SBC\n");
 
@@ -174,8 +167,12 @@ static int __init gef_sbc610_probe(void)
 {
 	unsigned long root = of_get_flat_dt_root();
 
-	if (of_flat_dt_is_compatible(root, "gef,sbc610"))
+	if (of_flat_dt_is_compatible(root, "gef,sbc610")) {
+#ifdef CONFIG_PCI
+		primary_phb_addr = 0x8000;
+#endif
 		return 1;
+	}
 
 	return 0;
 }
@@ -196,6 +193,27 @@ static long __init mpc86xx_time_init(void)
 	return 0;
 }
 
+static struct of_device_id __initdata gef_sbc610_pci_ids[] = {
+	{ .compatible = "fsl,mpc8641-pcie", },
+	{},
+};
+
+static int __init gef_sbc610_publish_pci_device(void)
+{
+	struct device_node *np;
+	int rc = 0;
+
+	for_each_matching_node(np, gef_sbc610_pci_ids) {
+		rc = of_platform_bus_create(np, gef_sbc610_pci_ids, NULL,
+				NULL, true);
+		if (rc)
+			break;
+	}
+
+	return rc;
+}
+machine_arch_initcall(gef_sbc610, gef_sbc610_publish_pci_device);
+
 static __initdata struct of_device_id of_bus_ids[] = {
 	{ .compatible = "simple-bus", },
 	{ .compatible = "gianfar", },
diff --git a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
index b8b1f33..a072145 100644
--- a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
+++ b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
@@ -86,6 +86,27 @@ static void __init mpc8610_suspend_init(void)
 static inline void mpc8610_suspend_init(void) { }
 #endif /* CONFIG_SUSPEND */
 
+static struct of_device_id __initdata mpc86xx_hpcd_pci_ids[] = {
+	{ .compatible = "fsl,mpc8641-pcie", },
+	{},
+};
+
+static int __init mpc86xx_hpcd_publish_pci_device(void)
+{
+	struct device_node *np;
+	int rc = 0;
+
+	for_each_matching_node(np, mpc86xx_hpcd_pci_ids) {
+		rc = of_platform_bus_create(np, mpc86xx_hpcd_pci_ids, NULL,
+				NULL, true);
+		if (rc)
+			break;
+	}
+
+	return rc;
+}
+machine_arch_initcall(mpc86xx_hpcd, mpc86xx_hpcd_publish_pci_device);
+
 static struct of_device_id __initdata mpc8610_ids[] = {
 	{ .compatible = "fsl,mpc8610-immr", },
 	{ .compatible = "fsl,mpc8610-guts", },
@@ -279,25 +300,11 @@ mpc8610hpcd_valid_monitor_port(enum fsl_diu_monitor_port port)
 static void __init mpc86xx_hpcd_setup_arch(void)
 {
 	struct resource r;
-	struct device_node *np;
 	unsigned char *pixis;
 
 	if (ppc_md.progress)
 		ppc_md.progress("mpc86xx_hpcd_setup_arch()", 0);
 
-#ifdef CONFIG_PCI
-	for_each_node_by_type(np, "pci") {
-		if (of_device_is_compatible(np, "fsl,mpc8610-pci")
-		    || of_device_is_compatible(np, "fsl,mpc8641-pcie")) {
-			struct resource rsrc;
-			of_address_to_resource(np, 0, &rsrc);
-			if ((rsrc.start & 0xfffff) == 0xa000)
-				fsl_add_bridge(np, 1);
-			else
-				fsl_add_bridge(np, 0);
-		}
-        }
-#endif
 #if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
 	diu_ops.get_pixel_format	= mpc8610hpcd_get_pixel_format;
 	diu_ops.set_gamma_table		= mpc8610hpcd_set_gamma_table;
@@ -331,8 +338,12 @@ static int __init mpc86xx_hpcd_probe(void)
 {
 	unsigned long root = of_get_flat_dt_root();
 
-	if (of_flat_dt_is_compatible(root, "fsl,MPC8610HPCD"))
+	if (of_flat_dt_is_compatible(root, "fsl,MPC8610HPCD")) {
+#ifdef CONFIG_PCI
+		primary_phb_addr = 0xa000;
+#endif
 		return 1;	/* Looks good */
+	}
 
 	return 0;
 }
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index 569262c..2f44eb4 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -70,30 +70,11 @@ static int mpc86xx_exclude_device(struct pci_controller *hose,
 static void __init
 mpc86xx_hpcn_setup_arch(void)
 {
-#ifdef CONFIG_PCI
-	struct device_node *np;
-	struct pci_controller *hose;
-#endif
-	dma_addr_t max = 0xffffffff;
-
 	if (ppc_md.progress)
 		ppc_md.progress("mpc86xx_hpcn_setup_arch()", 0);
 
 #ifdef CONFIG_PCI
-	for_each_compatible_node(np, "pci", "fsl,mpc8641-pcie") {
-		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);
-		hose = pci_find_hose_for_OF_device(np);
-		max = min(max, hose->dma_window_base_cur +
-			  hose->dma_window_size);
-	}
-
 	ppc_md.pci_exclude_device = mpc86xx_exclude_device;
-
 #endif
 
 	printk("MPC86xx HPCN board from Freescale Semiconductor\n");
@@ -103,11 +84,8 @@ mpc86xx_hpcn_setup_arch(void)
 #endif
 
 #ifdef CONFIG_SWIOTLB
-	if (memblock_end_of_DRAM() > max) {
+	if (memblock_end_of_DRAM() > 0xffffffff)
 		ppc_swiotlb_enable = 1;
-		set_pci_dma_ops(&swiotlb_dma_ops);
-		ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
-	}
 #endif
 }
 
@@ -130,12 +108,10 @@ static int __init mpc86xx_hpcn_probe(void)
 {
 	unsigned long root = of_get_flat_dt_root();
 
-	if (of_flat_dt_is_compatible(root, "fsl,mpc8641hpcn"))
-		return 1;	/* Looks good */
-
-	/* Be nice and don't give silent boot death.  Delete this in 2.6.27 */
-	if (of_flat_dt_is_compatible(root, "mpc86xx")) {
-		pr_warning("WARNING: your dts/dtb is old. You must update before the next kernel release\n");
+	if (of_flat_dt_is_compatible(root, "fsl,mpc8641hpcn")) {
+#ifdef CONFIG_PCI
+		primary_phb_addr = 0x8000;
+#endif
 		return 1;
 	}
 
@@ -159,6 +135,27 @@ mpc86xx_time_init(void)
 	return 0;
 }
 
+static struct of_device_id __initdata mpc86xx_hpcn_pci_ids[] = {
+	{ .compatible = "fsl,mpc8641-pcie", },
+	{},
+};
+
+static int __init mpc86xx_hpcn_publish_pci_device(void)
+{
+	struct device_node *np;
+	int rc = 0;
+
+	for_each_matching_node(np, mpc86xx_hpcn_pci_ids) {
+		rc = of_platform_bus_create(np, mpc86xx_hpcn_pci_ids, NULL,
+				NULL, true);
+		if (rc)
+			break;
+	}
+
+	return rc;
+}
+machine_arch_initcall(mpc86xx_hpcn, mpc86xx_hpcn_publish_pci_device);
+
 static __initdata struct of_device_id of_bus_ids[] = {
 	{ .compatible = "simple-bus", },
 	{ .compatible = "fsl,srio", },
diff --git a/arch/powerpc/platforms/86xx/sbc8641d.c b/arch/powerpc/platforms/86xx/sbc8641d.c
index 51c8f33..7cffe8c 100644
--- a/arch/powerpc/platforms/86xx/sbc8641d.c
+++ b/arch/powerpc/platforms/86xx/sbc8641d.c
@@ -39,18 +39,9 @@
 static void __init
 sbc8641_setup_arch(void)
 {
-#ifdef CONFIG_PCI
-	struct device_node *np;
-#endif
-
 	if (ppc_md.progress)
 		ppc_md.progress("sbc8641_setup_arch()", 0);
 
-#ifdef CONFIG_PCI
-	for_each_compatible_node(np, "pci", "fsl,mpc8641-pcie")
-		fsl_add_bridge(np, 0);
-#endif
-
 	printk("SBC8641 board from Wind River\n");
 
 #ifdef CONFIG_SMP
@@ -100,6 +91,27 @@ mpc86xx_time_init(void)
 	return 0;
 }
 
+static struct of_device_id __initdata sbc8641_pci_ids[] = {
+	{ .compatible = "fsl,mpc8641-pcie", },
+	{},
+};
+
+static int __init sbc8641_publish_pci_device(void)
+{
+	struct device_node *np;
+	int rc = 0;
+
+	for_each_matching_node(np, sbc8641_pci_ids) {
+		rc = of_platform_bus_create(np, sbc8641_pci_ids, NULL,
+				NULL, true);
+		if (rc)
+			break;
+	}
+
+	return rc;
+}
+machine_arch_initcall(sbc8641, sbc8641_publish_pci_device);
+
 static __initdata struct of_device_id of_bus_ids[] = {
 	{ .compatible = "simple-bus", },
 	{ .compatible = "gianfar", },
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 343ad29..a37330e 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -339,7 +339,7 @@ static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l
  * Creates a platform_device for the provided device_node, and optionally
  * recursively create devices for all the child nodes.
  */
-static int of_platform_bus_create(struct device_node *bus,
+int of_platform_bus_create(struct device_node *bus,
 				  const struct of_device_id *matches,
 				  const struct of_dev_auxdata *lookup,
 				  struct device *parent, bool strict)
@@ -383,6 +383,7 @@ static int of_platform_bus_create(struct device_node *bus,
 	}
 	return rc;
 }
+EXPORT_SYMBOL(of_platform_bus_create);
 
 /**
  * of_platform_bus_probe() - Probe the device-tree for platform buses
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index b47d204..680e48d 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -94,6 +94,10 @@ extern int of_platform_populate(struct device_node *root,
 				const struct of_device_id *matches,
 				const struct of_dev_auxdata *lookup,
 				struct device *parent);
+extern int of_platform_bus_create(struct device_node *bus,
+				const struct of_device_id *matches,
+				const struct of_dev_auxdata *lookup,
+				struct device *parent, bool strict);
 #endif /* CONFIG_OF_ADDRESS */
 
 #endif /* CONFIG_OF_DEVICE */
-- 
1.7.5.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH V3 3/6] powerpc/fsl-pci: Only scan PCI bus if configured as a host
  2012-06-08  9:42 [PATCH 0/6] Description for PCI patches using platform driver Jia Hongtao
  2012-06-08  9:42 ` [PATCH V3 1/6] powerpc/fsl-pci: Unify pci/pcie initialization code Jia Hongtao
  2012-06-08  9:42 ` [PATCH V3 2/6] powerpc/fsl-pci: Using common pci/pcie initialization for all boards Jia Hongtao
@ 2012-06-08  9:42 ` Jia Hongtao
  2012-06-08  9:42 ` [PATCH V3 4/6] powerpc/fsl-pci: Add pci inbound/outbound PM support Jia Hongtao
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 19+ messages in thread
From: Jia Hongtao @ 2012-06-08  9:42 UTC (permalink / raw)
  To: linuxppc-dev, galak; +Cc: R65777, b38951, B07421

If we're an agent/end-point or fsl_add_bridge doesn't succeed due to some
resource failure we should not scan the PCI bus. We change fsl_add_bridge()
to return -ENODEV in the case we're an agent/end-point.

Signed-off-by: Jia Hongtao <B38951@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
---
 arch/powerpc/sysdev/fsl_pci.c |   27 +++++++++++++++------------
 1 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 4c3d130..a5e573c 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -465,7 +465,7 @@ int __init fsl_add_bridge(struct device_node *dev, int is_primary)
 			iounmap(hose->cfg_data);
 		iounmap(hose->cfg_addr);
 		pcibios_free_controller(hose);
-		return 0;
+		return -ENODEV;
 	}
 
 	setup_pci_cmd(hose);
@@ -836,17 +836,20 @@ static int __devinit fsl_pci_probe(struct platform_device *pdev)
 		ret = fsl_add_bridge(pdev->dev.of_node, is_primary);
 
 #ifdef CONFIG_SWIOTLB
-		hose = pci_find_hose_for_OF_device(pdev->dev.of_node);
-		/*
-		 * if we couldn't map all of DRAM via the dma windows
-		 * we need SWIOTLB to handle buffers located outside of
-		 * dma capable memory region
-		 */
-		if (memblock_end_of_DRAM() > hose->dma_window_base_cur
-				+ hose->dma_window_size) {
-			ppc_swiotlb_enable = 1;
-			set_pci_dma_ops(&swiotlb_dma_ops);
-			ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
+		if (ret == 0) {
+			hose = pci_find_hose_for_OF_device(pdev->dev.of_node);
+			/*
+			 * if we couldn't map all of DRAM via the dma windows
+			 * we need SWIOTLB to handle buffers located outside of
+			 * dma capable memory region
+			 */
+			if (memblock_end_of_DRAM() > hose->dma_window_base_cur
+					+ hose->dma_window_size) {
+				ppc_swiotlb_enable = 1;
+				set_pci_dma_ops(&swiotlb_dma_ops);
+				ppc_md.pci_dma_dev_setup =
+					pci_dma_dev_setup_swiotlb;
+			}
 		}
 #endif
 	}
-- 
1.7.5.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH V3 4/6] powerpc/fsl-pci: Add pci inbound/outbound PM support
  2012-06-08  9:42 [PATCH 0/6] Description for PCI patches using platform driver Jia Hongtao
                   ` (2 preceding siblings ...)
  2012-06-08  9:42 ` [PATCH V3 3/6] powerpc/fsl-pci: Only scan PCI bus if configured as a host Jia Hongtao
@ 2012-06-08  9:42 ` Jia Hongtao
  2012-06-08  9:42 ` [PATCH V3 5/6] Avoid duplicate probe for of platform devices Jia Hongtao
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 19+ messages in thread
From: Jia Hongtao @ 2012-06-08  9:42 UTC (permalink / raw)
  To: linuxppc-dev, galak; +Cc: R65777, b38951, B07421

Power supply for PCI inbound/outbound window registers is off when system
go to deep-sleep state. We save the values of registers before suspend
and restore to registers after resume.

Signed-off-by: Jiang Yutang <b14898@freescale.com>
Signed-off-by: Jia Hongtao <B38951@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
---
 arch/powerpc/include/asm/pci-bridge.h |    2 +-
 arch/powerpc/sysdev/fsl_pci.c         |  121 +++++++++++++++++++++++++++++++++
 arch/powerpc/sysdev/fsl_pci.h         |   10 +++
 3 files changed, 132 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index ac39e6a..823e000 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -89,9 +89,9 @@ struct pci_controller {
 
 #ifdef CONFIG_PPC64
 	unsigned long buid;
+#endif	/* CONFIG_PPC64 */
 
 	void *private_data;
-#endif	/* CONFIG_PPC64 */
 };
 
 /* These are used for config access before all the PCI probing
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index a5e573c..287e630 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -857,12 +857,133 @@ static int __devinit fsl_pci_probe(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_SUSPEND
+
+#define PCI_POW_PIW_OFFSET	0xc00
+#define PCI_POW_PIW_SIZE	0x200
+#define PCI_POW_NUMBER		5
+
+static int fsl_pci_suspend(struct platform_device *pdev, pm_message_t state)
+{
+	struct pci_controller *hose;
+	struct pci_outbound_window_regs *pci_saved_pow;
+	struct pci_inbound_window_regs *pci_saved_piw, *temp_piw;
+	struct resource pci_rsrc;
+	unsigned int i;
+	struct fsl_pci_private_data *sus_info;
+
+	hose = pci_find_hose_for_OF_device(pdev->dev.of_node);
+	of_address_to_resource(pdev->dev.of_node, 0, &pci_rsrc);
+
+	sus_info = kmalloc(
+			sizeof(struct fsl_pci_private_data), GFP_KERNEL);
+	if (!sus_info)
+		return -ENOMEM;
+
+	hose->private_data = sus_info;
+
+	sus_info->pci_pow = ioremap(pci_rsrc.start + PCI_POW_PIW_OFFSET,
+			PCI_POW_PIW_SIZE);
+	if (!sus_info->pci_pow) {
+		dev_err(&pdev->dev, "pci outbound/inbound windows ioremap error!\n");
+		goto err1;
+	}
+
+	sus_info->pci_piw = (struct pci_inbound_window_regs *)
+		((void *)sus_info->pci_pow + PCI_POW_PIW_SIZE) - 1;
+
+	if (of_device_is_compatible(pdev->dev.of_node, "fsl,qoriq-pcie-v2.2"))
+		sus_info->inbound_num = 4;
+	else
+		sus_info->inbound_num = 3;
+
+	sus_info->saved_regs = kmalloc(
+		sizeof(struct pci_outbound_window_regs) * PCI_POW_NUMBER +
+		sizeof(struct pci_inbound_window_regs) * sus_info->inbound_num,
+		GFP_KERNEL);
+	if (!sus_info->saved_regs)
+		goto err2;
+
+	pci_saved_pow = sus_info->saved_regs;
+	for (i = 0; i < PCI_POW_NUMBER; i++) {
+		pci_saved_pow[i].potar = in_be32(&sus_info->pci_pow[i].potar);
+		pci_saved_pow[i].potear = in_be32(&sus_info->pci_pow[i].potear);
+		pci_saved_pow[i].powbar = in_be32(&sus_info->pci_pow[i].powbar);
+		pci_saved_pow[i].powar = in_be32(&sus_info->pci_pow[i].powar);
+	}
+
+	pci_saved_piw = (struct pci_inbound_window_regs *)
+		(pci_saved_pow + PCI_POW_NUMBER);
+	temp_piw = sus_info->pci_piw;
+	for (i = 0; i < sus_info->inbound_num; i++, temp_piw--) {
+		pci_saved_piw[i].pitar = in_be32(&temp_piw->pitar);
+		pci_saved_piw[i].piwbar = in_be32(&temp_piw->piwbar);
+		pci_saved_piw[i].piwbear = in_be32(&temp_piw->piwbear);
+		pci_saved_piw[i].piwar = in_be32(&temp_piw->piwar);
+	}
+
+	return 0;
+
+err2:
+	iounmap(sus_info->pci_pow);
+
+err1:
+	kfree(sus_info);
+	return -ENOMEM;
+}
+
+static int fsl_pci_resume(struct platform_device *pdev)
+{
+	struct pci_controller *hose;
+	struct pci_outbound_window_regs *pci_saved_pow;
+	struct pci_inbound_window_regs *pci_saved_piw, *temp_piw;
+	unsigned int i;
+	struct fsl_pci_private_data *sus_info;
+
+	hose = pci_find_hose_for_OF_device(pdev->dev.of_node);
+	sus_info = (struct fsl_pci_private_data *)hose->private_data;
+
+	if (!sus_info->pci_pow || !sus_info->pci_piw || !sus_info->saved_regs)
+		return 0;
+
+	pci_saved_pow = sus_info->saved_regs;
+	for (i = 0; i < PCI_POW_NUMBER; i++) {
+		out_be32(&sus_info->pci_pow[i].potar, pci_saved_pow[i].potar);
+		out_be32(&sus_info->pci_pow[i].potear, pci_saved_pow[i].potear);
+		out_be32(&sus_info->pci_pow[i].powbar, pci_saved_pow[i].powbar);
+		out_be32(&sus_info->pci_pow[i].powar, pci_saved_pow[i].powar);
+	}
+
+	pci_saved_piw = (struct pci_inbound_window_regs *)
+		(pci_saved_pow + PCI_POW_NUMBER);
+	temp_piw = sus_info->pci_piw;
+	for (i = 0; i < sus_info->inbound_num; i++, temp_piw--) {
+		out_be32(&temp_piw->pitar, pci_saved_piw[i].pitar);
+		out_be32(&temp_piw->piwbar, pci_saved_piw[i].piwbar);
+		out_be32(&temp_piw->piwbear, pci_saved_piw[i].piwbear);
+		out_be32(&temp_piw->piwar, pci_saved_piw[i].piwar);
+	}
+	iounmap(sus_info->pci_pow);
+	kfree(sus_info->saved_regs);
+	sus_info->saved_regs = NULL;
+	kfree(sus_info);
+	sus_info = NULL;
+	hose->private_data = NULL;
+
+	return 0;
+}
+#endif
+
 static struct platform_driver fsl_pci_driver = {
 	.driver = {
 		.name = "fsl-pci",
 		.of_match_table = pci_ids,
 	},
 	.probe = fsl_pci_probe,
+#ifdef CONFIG_SUSPEND
+	.suspend	= fsl_pci_suspend,
+	.resume		= fsl_pci_resume,
+#endif
 };
 
 static int __init fsl_pci_init(void)
diff --git a/arch/powerpc/sysdev/fsl_pci.h b/arch/powerpc/sysdev/fsl_pci.h
index df9fc44..1093e24 100644
--- a/arch/powerpc/sysdev/fsl_pci.h
+++ b/arch/powerpc/sysdev/fsl_pci.h
@@ -88,6 +88,16 @@ struct ccsr_pci {
 	__be32	pex_err_cap_r3;		/* 0x.e34 - PCIE error capture register 0 */
 };
 
+
+#ifdef CONFIG_SUSPEND
+struct fsl_pci_private_data {
+	int inbound_num;
+	struct pci_outbound_window_regs __iomem *pci_pow;
+	struct pci_inbound_window_regs __iomem *pci_piw;
+	void *saved_regs;
+};
+#endif
+
 extern int primary_phb_addr;
 extern int fsl_add_bridge(struct device_node *dev, int is_primary);
 extern void fsl_pcibios_fixup_bus(struct pci_bus *bus);
-- 
1.7.5.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH V3 5/6] Avoid duplicate probe for of platform devices
  2012-06-08  9:42 [PATCH 0/6] Description for PCI patches using platform driver Jia Hongtao
                   ` (3 preceding siblings ...)
  2012-06-08  9:42 ` [PATCH V3 4/6] powerpc/fsl-pci: Add pci inbound/outbound PM support Jia Hongtao
@ 2012-06-08  9:42 ` Jia Hongtao
  2012-06-08  9:42 ` [PATCH V3 6/6] Edac/85xx: Register mpc85xx_pci_err_driver by fsl_pci_driver Jia Hongtao
  2012-06-08 10:47 ` [PATCH 0/6] Description for PCI patches using platform driver Bhushan Bharat-R65777
  6 siblings, 0 replies; 19+ messages in thread
From: Jia Hongtao @ 2012-06-08  9:42 UTC (permalink / raw)
  To: linuxppc-dev, galak; +Cc: R65777, b38951, B07421

We changed the pcie controller driver to platform driver so that the PCI
of platform devices need to be created earlier in the arch_initcall stage
according to the original timing of calling fsl_add_bridge(). So we do PCI
probing separately from other devices. But probing more than once could
cause duplication warning. We add check if the devices have already probed
before probing any devices to avoid duplication warning.

Signed-off-by: Jia Hongtao <B38951@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
---
 drivers/of/platform.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index a37330e..3aab01f 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -139,6 +139,18 @@ struct platform_device *of_device_alloc(struct device_node *np,
 	if (!dev)
 		return NULL;
 
+	dev->dev.of_node = of_node_get(np);
+	if (bus_id)
+		dev_set_name(&dev->dev, "%s", bus_id);
+	else
+		of_device_make_bus_id(&dev->dev);
+
+	if (kset_find_obj(dev->dev.kobj.kset, kobject_name(&dev->dev.kobj))) {
+		kfree(dev);
+		of_node_put(np);
+		return NULL;
+	}
+
 	/* count the io and irq resources */
 	while (of_address_to_resource(np, num_reg, &temp_res) == 0)
 		num_reg++;
@@ -161,17 +173,11 @@ struct platform_device *of_device_alloc(struct device_node *np,
 		WARN_ON(of_irq_to_resource_table(np, res, num_irq) != num_irq);
 	}
 
-	dev->dev.of_node = of_node_get(np);
 #if defined(CONFIG_MICROBLAZE)
 	dev->dev.dma_mask = &dev->archdata.dma_mask;
 #endif
 	dev->dev.parent = parent;
 
-	if (bus_id)
-		dev_set_name(&dev->dev, "%s", bus_id);
-	else
-		of_device_make_bus_id(&dev->dev);
-
 	return dev;
 }
 EXPORT_SYMBOL(of_device_alloc);
-- 
1.7.5.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH V3 6/6] Edac/85xx: Register mpc85xx_pci_err_driver by fsl_pci_driver
  2012-06-08  9:42 [PATCH 0/6] Description for PCI patches using platform driver Jia Hongtao
                   ` (4 preceding siblings ...)
  2012-06-08  9:42 ` [PATCH V3 5/6] Avoid duplicate probe for of platform devices Jia Hongtao
@ 2012-06-08  9:42 ` Jia Hongtao
  2012-06-08 10:47 ` [PATCH 0/6] Description for PCI patches using platform driver Bhushan Bharat-R65777
  6 siblings, 0 replies; 19+ messages in thread
From: Jia Hongtao @ 2012-06-08  9:42 UTC (permalink / raw)
  To: linuxppc-dev, galak; +Cc: R65777, b38951, B07421

Now we registered pci controllers as platform devices. It will make edac
driver failed to register pci nodes as platform devices too. So we combine
two initialization code as one platform driver.

Signed-off-by: Chunhe Lan <Chunhe.Lan@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Jia Hongtao <B38951@freescale.com>
---
 arch/powerpc/sysdev/fsl_pci.c |    4 +++
 arch/powerpc/sysdev/fsl_pci.h |    4 +++
 drivers/edac/mpc85xx_edac.c   |   43 +++++++++++-----------------------------
 3 files changed, 20 insertions(+), 31 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 287e630..1012bf7 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -854,6 +854,10 @@ static int __devinit fsl_pci_probe(struct platform_device *pdev)
 #endif
 	}
 
+#ifdef CONFIG_EDAC_MPC85XX
+	mpc85xx_pci_err_probe(pdev);
+#endif
+
 	return 0;
 }
 
diff --git a/arch/powerpc/sysdev/fsl_pci.h b/arch/powerpc/sysdev/fsl_pci.h
index 1093e24..ea2e025 100644
--- a/arch/powerpc/sysdev/fsl_pci.h
+++ b/arch/powerpc/sysdev/fsl_pci.h
@@ -104,5 +104,9 @@ extern void fsl_pcibios_fixup_bus(struct pci_bus *bus);
 extern int mpc83xx_add_bridge(struct device_node *dev);
 u64 fsl_pci_immrbar_base(struct pci_controller *hose);
 
+#ifdef CONFIG_EDAC_MPC85XX
+extern int mpc85xx_pci_err_probe(struct platform_device *op);
+#endif
+
 #endif /* __POWERPC_FSL_PCI_H */
 #endif /* __KERNEL__ */
diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c
index 73464a6..aec880b 100644
--- a/drivers/edac/mpc85xx_edac.c
+++ b/drivers/edac/mpc85xx_edac.c
@@ -200,7 +200,7 @@ static irqreturn_t mpc85xx_pci_isr(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static int __devinit mpc85xx_pci_err_probe(struct platform_device *op)
+int __devinit mpc85xx_pci_err_probe(struct platform_device *op)
 {
 	struct edac_pci_ctl_info *pci;
 	struct mpc85xx_pci_pdata *pdata;
@@ -214,6 +214,16 @@ static int __devinit mpc85xx_pci_err_probe(struct platform_device *op)
 	if (!pci)
 		return -ENOMEM;
 
+	/* make sure error reporting method is sane */
+	switch (edac_op_state) {
+	case EDAC_OPSTATE_POLL:
+	case EDAC_OPSTATE_INT:
+		break;
+	default:
+		edac_op_state = EDAC_OPSTATE_INT;
+		break;
+	}
+
 	pdata = pci->pvt_info;
 	pdata->name = "mpc85xx_pci_err";
 	pdata->irq = NO_IRQ;
@@ -303,6 +313,7 @@ err:
 	devres_release_group(&op->dev, mpc85xx_pci_err_probe);
 	return res;
 }
+EXPORT_SYMBOL(mpc85xx_pci_err_probe);
 
 static int mpc85xx_pci_err_remove(struct platform_device *op)
 {
@@ -326,27 +337,6 @@ static int mpc85xx_pci_err_remove(struct platform_device *op)
 	return 0;
 }
 
-static struct of_device_id mpc85xx_pci_err_of_match[] = {
-	{
-	 .compatible = "fsl,mpc8540-pcix",
-	 },
-	{
-	 .compatible = "fsl,mpc8540-pci",
-	},
-	{},
-};
-MODULE_DEVICE_TABLE(of, mpc85xx_pci_err_of_match);
-
-static struct platform_driver mpc85xx_pci_err_driver = {
-	.probe = mpc85xx_pci_err_probe,
-	.remove = __devexit_p(mpc85xx_pci_err_remove),
-	.driver = {
-		.name = "mpc85xx_pci_err",
-		.owner = THIS_MODULE,
-		.of_match_table = mpc85xx_pci_err_of_match,
-	},
-};
-
 #endif				/* CONFIG_PCI */
 
 /**************************** L2 Err device ***************************/
@@ -1177,12 +1167,6 @@ static int __init mpc85xx_mc_init(void)
 	if (res)
 		printk(KERN_WARNING EDAC_MOD_STR "L2 fails to register\n");
 
-#ifdef CONFIG_PCI
-	res = platform_driver_register(&mpc85xx_pci_err_driver);
-	if (res)
-		printk(KERN_WARNING EDAC_MOD_STR "PCI fails to register\n");
-#endif
-
 #ifdef CONFIG_FSL_SOC_BOOKE
 	pvr = mfspr(SPRN_PVR);
 
@@ -1219,9 +1203,6 @@ static void __exit mpc85xx_mc_exit(void)
 		on_each_cpu(mpc85xx_mc_restore_hid1, NULL, 0);
 	}
 #endif
-#ifdef CONFIG_PCI
-	platform_driver_unregister(&mpc85xx_pci_err_driver);
-#endif
 	platform_driver_unregister(&mpc85xx_l2_err_driver);
 	platform_driver_unregister(&mpc85xx_mc_err_driver);
 }
-- 
1.7.5.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* RE: [PATCH 0/6] Description for PCI patches using platform driver
  2012-06-08  9:42 [PATCH 0/6] Description for PCI patches using platform driver Jia Hongtao
                   ` (5 preceding siblings ...)
  2012-06-08  9:42 ` [PATCH V3 6/6] Edac/85xx: Register mpc85xx_pci_err_driver by fsl_pci_driver Jia Hongtao
@ 2012-06-08 10:47 ` Bhushan Bharat-R65777
  2012-06-11  2:33   ` Jia Hongtao-B38951
  6 siblings, 1 reply; 19+ messages in thread
From: Bhushan Bharat-R65777 @ 2012-06-08 10:47 UTC (permalink / raw)
  To: Jia Hongtao-B38951, linuxppc-dev, galak; +Cc: Li Yang-R58472, Wood Scott-B07421


> -----Original Message-----
> From: Jia Hongtao-B38951
> Sent: Friday, June 08, 2012 3:12 PM
> To: linuxppc-dev@lists.ozlabs.org; galak@kernel.crashing.org
> Cc: Li Yang-R58472; benh@kernel.crashing.org; Wood Scott-B07421; Bhushan =
Bharat-
> R65777; Jia Hongtao-B38951
> Subject: [PATCH 0/6] Description for PCI patches using platform driver
>=20
> This series of patches are to unify pci initialization code and add PM su=
pport
> for all 85xx/86xx powerpc boards. But two side effects are introduced by =
this
> mechanism which listed below:
>=20
> 1. of_platform_bus_probe() will be called twice but in some cases duplica=
tion
>    warning occured. We fix this in [PATCH 5/6].
>=20
> 2. Edac driver failed to register pci nodes as platform devices. We fix t=
his
>    in [PATCH 6/6].

With these patches will not the SWIOTLB will not be initialized even if PCI=
/PCIe demanded?

Thanks
-Bharat

>=20
> These patches are against 'next' branch on:
> http://git.kernel.org/?p=3Dlinux/kernel/git/galak/powerpc.git

^ permalink raw reply	[flat|nested] 19+ messages in thread

* RE: [PATCH 0/6] Description for PCI patches using platform driver
  2012-06-08 10:47 ` [PATCH 0/6] Description for PCI patches using platform driver Bhushan Bharat-R65777
@ 2012-06-11  2:33   ` Jia Hongtao-B38951
  2012-06-11 13:24     ` Bhushan Bharat-R65777
  2012-06-11 15:43     ` Scott Wood
  0 siblings, 2 replies; 19+ messages in thread
From: Jia Hongtao-B38951 @ 2012-06-11  2:33 UTC (permalink / raw)
  To: Bhushan Bharat-R65777, linuxppc-dev, galak
  Cc: Li Yang-R58472, Wood Scott-B07421

> -----Original Message-----
> From: Bhushan Bharat-R65777
> Sent: Friday, June 08, 2012 6:47 PM
> To: Jia Hongtao-B38951; linuxppc-dev@lists.ozlabs.org;
> galak@kernel.crashing.org
> Cc: Li Yang-R58472; benh@kernel.crashing.org; Wood Scott-B07421
> Subject: RE: [PATCH 0/6] Description for PCI patches using platform
> driver
>=20
>=20
> > -----Original Message-----
> > From: Jia Hongtao-B38951
> > Sent: Friday, June 08, 2012 3:12 PM
> > To: linuxppc-dev@lists.ozlabs.org; galak@kernel.crashing.org
> > Cc: Li Yang-R58472; benh@kernel.crashing.org; Wood Scott-B07421;
> Bhushan Bharat-
> > R65777; Jia Hongtao-B38951
> > Subject: [PATCH 0/6] Description for PCI patches using platform driver
> >
> > This series of patches are to unify pci initialization code and add PM
> support
> > for all 85xx/86xx powerpc boards. But two side effects are introduced
> by this
> > mechanism which listed below:
> >
> > 1. of_platform_bus_probe() will be called twice but in some cases
> duplication
> >    warning occured. We fix this in [PATCH 5/6].
> >
> > 2. Edac driver failed to register pci nodes as platform devices. We fix
> this
> >    in [PATCH 6/6].
>=20
> With these patches will not the SWIOTLB will not be initialized even if
> PCI/PCIe demanded?
>=20
> Thanks
> -Bharat
>=20

These patches still have the swiotlb init problem if "ppc_swiotlb_enable" i=
s
only demanded by PCI/PCIe. One of the purposes of sending out these patches
is to let us start a discussion for this problem in upstream.

-Jia Hongtao.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* RE: [PATCH 0/6] Description for PCI patches using platform driver
  2012-06-11  2:33   ` Jia Hongtao-B38951
@ 2012-06-11 13:24     ` Bhushan Bharat-R65777
  2012-06-12  2:24       ` Jia Hongtao-B38951
  2012-06-11 15:43     ` Scott Wood
  1 sibling, 1 reply; 19+ messages in thread
From: Bhushan Bharat-R65777 @ 2012-06-11 13:24 UTC (permalink / raw)
  To: Jia Hongtao-B38951, linuxppc-dev, galak; +Cc: Li Yang-R58472, Wood Scott-B07421



> -----Original Message-----
> From: Jia Hongtao-B38951
> Sent: Monday, June 11, 2012 8:03 AM
> To: Bhushan Bharat-R65777; linuxppc-dev@lists.ozlabs.org;
> galak@kernel.crashing.org
> Cc: Li Yang-R58472; benh@kernel.crashing.org; Wood Scott-B07421
> Subject: RE: [PATCH 0/6] Description for PCI patches using platform drive=
r
>=20
> > -----Original Message-----
> > From: Bhushan Bharat-R65777
> > Sent: Friday, June 08, 2012 6:47 PM
> > To: Jia Hongtao-B38951; linuxppc-dev@lists.ozlabs.org;
> > galak@kernel.crashing.org
> > Cc: Li Yang-R58472; benh@kernel.crashing.org; Wood Scott-B07421
> > Subject: RE: [PATCH 0/6] Description for PCI patches using platform
> > driver
> >
> >
> > > -----Original Message-----
> > > From: Jia Hongtao-B38951
> > > Sent: Friday, June 08, 2012 3:12 PM
> > > To: linuxppc-dev@lists.ozlabs.org; galak@kernel.crashing.org
> > > Cc: Li Yang-R58472; benh@kernel.crashing.org; Wood Scott-B07421;
> > Bhushan Bharat-
> > > R65777; Jia Hongtao-B38951
> > > Subject: [PATCH 0/6] Description for PCI patches using platform
> > > driver
> > >
> > > This series of patches are to unify pci initialization code and add
> > > PM
> > support
> > > for all 85xx/86xx powerpc boards. But two side effects are
> > > introduced
> > by this
> > > mechanism which listed below:
> > >
> > > 1. of_platform_bus_probe() will be called twice but in some cases
> > duplication
> > >    warning occured. We fix this in [PATCH 5/6].
> > >
> > > 2. Edac driver failed to register pci nodes as platform devices. We
> > > fix
> > this
> > >    in [PATCH 6/6].
> >
> > With these patches will not the SWIOTLB will not be initialized even
> > if PCI/PCIe demanded?
> >
> > Thanks
> > -Bharat
> >
>=20
> These patches still have the swiotlb init problem if "ppc_swiotlb_enable"=
 is
> only demanded by PCI/PCIe. One of the purposes of sending out these patch=
es is
> to let us start a discussion for this problem in upstream.

Ok, I did not find any mention of that, so I thought that you have resolved=
 the issue by some means in these patches which I did not catch.

So, these patches introduces the issue, that SWIOTLB will not be initialize=
d if requested by pci/pcie. The request is raised by setting the flag ppc_s=
wiotlb_enable. The swiotlb_init() will be called in mem_init() if ppc_swiot=
lb_enable is set. Now with these patches, the request is raised after mem_i=
nit() is called. So request not handled :).

Following are the solutions we have thought of during our internal discussi=
ons (if I did not missed any):

1. These patches move the code from platform init to device init (arch_init=
call()). Rather than moving the whole code, let us divide the code into two=
. First, which is needed to raise the swiotlb init request and second the r=
est. Define this first as an function in arch/powerpc/sysdev/fsl_pci.c and =
call this from platform init code of the SOCs.

2. All known devices, the lowest PCIe outbound range starts at 0x80000000, =
but there's nothing above 0xc0000000. So the inbound of size 0x8000_0000 is=
 always availbe on all devices. Hardcode the check in platform code to chec=
k memblock_end_of_DRAM() to 0x80000000.

Something like this:

diff --git a/arch/powerpc/platforms/85xx/corenet_ds.c
b/arch/powerpc/platforms/85xx/corenet_ds.c
index 1f7028e..ef4e215 100644
--- a/arch/powerpc/platforms/85xx/corenet_ds.c
+++ b/arch/powerpc/platforms/85xx/corenet_ds.c
@@ -79,7 +79,7 @@ void __init corenet_ds_setup_arch(void)  #endif

#ifdef CONFIG_SWIOTLB
-       if (memblock_end_of_DRAM() > 0xffffffff)
+       if (memblock_end_of_DRAM() > 0xff000000)
                 ppc_swiotlb_enable =3D 1;  #endif
         pr_info("%s board from Freescale Semiconductor\n", ppc_md.name);

-------------

3. Always do swiotlb_init() in mem_init() and later after PCI init, if the =
swiotlb is not needed then free it (swiotlb_free()).=20

4. etc, please provide some other better way.

Thanks
-Bharat

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH 0/6] Description for PCI patches using platform driver
  2012-06-11  2:33   ` Jia Hongtao-B38951
  2012-06-11 13:24     ` Bhushan Bharat-R65777
@ 2012-06-11 15:43     ` Scott Wood
  2012-06-12  2:27       ` Jia Hongtao-B38951
  1 sibling, 1 reply; 19+ messages in thread
From: Scott Wood @ 2012-06-11 15:43 UTC (permalink / raw)
  To: Jia Hongtao-B38951
  Cc: Wood Scott-B07421, Li Yang-R58472, Bhushan Bharat-R65777, linuxppc-dev

On 06/10/2012 09:33 PM, Jia Hongtao-B38951 wrote:
>> -----Original Message-----
>> From: Bhushan Bharat-R65777
>> Sent: Friday, June 08, 2012 6:47 PM
>> To: Jia Hongtao-B38951; linuxppc-dev@lists.ozlabs.org;
>> galak@kernel.crashing.org
>> Cc: Li Yang-R58472; benh@kernel.crashing.org; Wood Scott-B07421
>> Subject: RE: [PATCH 0/6] Description for PCI patches using platform
>> driver
>>
>>
>>> -----Original Message-----
>>> From: Jia Hongtao-B38951
>>> Sent: Friday, June 08, 2012 3:12 PM
>>> To: linuxppc-dev@lists.ozlabs.org; galak@kernel.crashing.org
>>> Cc: Li Yang-R58472; benh@kernel.crashing.org; Wood Scott-B07421;
>> Bhushan Bharat-
>>> R65777; Jia Hongtao-B38951
>>> Subject: [PATCH 0/6] Description for PCI patches using platform driver
>>>
>>> This series of patches are to unify pci initialization code and add PM
>> support
>>> for all 85xx/86xx powerpc boards. But two side effects are introduced
>> by this
>>> mechanism which listed below:
>>>
>>> 1. of_platform_bus_probe() will be called twice but in some cases
>> duplication
>>>    warning occured. We fix this in [PATCH 5/6].
>>>
>>> 2. Edac driver failed to register pci nodes as platform devices. We fix
>> this
>>>    in [PATCH 6/6].
>>
>> With these patches will not the SWIOTLB will not be initialized even if
>> PCI/PCIe demanded?
>>
>> Thanks
>> -Bharat
>>
> 
> These patches still have the swiotlb init problem if "ppc_swiotlb_enable" is
> only demanded by PCI/PCIe. One of the purposes of sending out these patches
> is to let us start a discussion for this problem in upstream.

When sending out a patchset like that, label it as [RFC PATCH] (request
for comments), and mention all known problems to be resolved.

-Scott

^ permalink raw reply	[flat|nested] 19+ messages in thread

* RE: [PATCH 0/6] Description for PCI patches using platform driver
  2012-06-11 13:24     ` Bhushan Bharat-R65777
@ 2012-06-12  2:24       ` Jia Hongtao-B38951
  2012-06-14  9:52         ` Bhushan Bharat-R65777
  0 siblings, 1 reply; 19+ messages in thread
From: Jia Hongtao-B38951 @ 2012-06-12  2:24 UTC (permalink / raw)
  To: Bhushan Bharat-R65777, linuxppc-dev, galak
  Cc: Li Yang-R58472, Wood Scott-B07421



> -----Original Message-----
> From: Bhushan Bharat-R65777
> Sent: Monday, June 11, 2012 9:25 PM
> To: Jia Hongtao-B38951; linuxppc-dev@lists.ozlabs.org;
> galak@kernel.crashing.org
> Cc: Li Yang-R58472; benh@kernel.crashing.org; Wood Scott-B07421
> Subject: RE: [PATCH 0/6] Description for PCI patches using platform
> driver
>=20
>=20
>=20
> > -----Original Message-----
> > From: Jia Hongtao-B38951
> > Sent: Monday, June 11, 2012 8:03 AM
> > To: Bhushan Bharat-R65777; linuxppc-dev@lists.ozlabs.org;
> > galak@kernel.crashing.org
> > Cc: Li Yang-R58472; benh@kernel.crashing.org; Wood Scott-B07421
> > Subject: RE: [PATCH 0/6] Description for PCI patches using platform
> driver
> >
> > > -----Original Message-----
> > > From: Bhushan Bharat-R65777
> > > Sent: Friday, June 08, 2012 6:47 PM
> > > To: Jia Hongtao-B38951; linuxppc-dev@lists.ozlabs.org;
> > > galak@kernel.crashing.org
> > > Cc: Li Yang-R58472; benh@kernel.crashing.org; Wood Scott-B07421
> > > Subject: RE: [PATCH 0/6] Description for PCI patches using platform
> > > driver
> > >
> > >
> > > > -----Original Message-----
> > > > From: Jia Hongtao-B38951
> > > > Sent: Friday, June 08, 2012 3:12 PM
> > > > To: linuxppc-dev@lists.ozlabs.org; galak@kernel.crashing.org
> > > > Cc: Li Yang-R58472; benh@kernel.crashing.org; Wood Scott-B07421;
> > > Bhushan Bharat-
> > > > R65777; Jia Hongtao-B38951
> > > > Subject: [PATCH 0/6] Description for PCI patches using platform
> > > > driver
> > > >
> > > > This series of patches are to unify pci initialization code and add
> > > > PM
> > > support
> > > > for all 85xx/86xx powerpc boards. But two side effects are
> > > > introduced
> > > by this
> > > > mechanism which listed below:
> > > >
> > > > 1. of_platform_bus_probe() will be called twice but in some cases
> > > duplication
> > > >    warning occured. We fix this in [PATCH 5/6].
> > > >
> > > > 2. Edac driver failed to register pci nodes as platform devices. We
> > > > fix
> > > this
> > > >    in [PATCH 6/6].
> > >
> > > With these patches will not the SWIOTLB will not be initialized even
> > > if PCI/PCIe demanded?
> > >
> > > Thanks
> > > -Bharat
> > >
> >
> > These patches still have the swiotlb init problem if
> "ppc_swiotlb_enable" is
> > only demanded by PCI/PCIe. One of the purposes of sending out these
> patches is
> > to let us start a discussion for this problem in upstream.
>=20
> Ok, I did not find any mention of that, so I thought that you have
> resolved the issue by some means in these patches which I did not catch.
>=20
> So, these patches introduces the issue, that SWIOTLB will not be
> initialized if requested by pci/pcie. The request is raised by setting
> the flag ppc_swiotlb_enable. The swiotlb_init() will be called in
> mem_init() if ppc_swiotlb_enable is set. Now with these patches, the
> request is raised after mem_init() is called. So request not handled :).
>=20
> Following are the solutions we have thought of during our internal
> discussions (if I did not missed any):
>=20
> 1. These patches move the code from platform init to device init
> (arch_initcall()). Rather than moving the whole code, let us divide the
> code into two. First, which is needed to raise the swiotlb init request
> and second the rest. Define this first as an function in
> arch/powerpc/sysdev/fsl_pci.c and call this from platform init code of
> the SOCs.
>=20
> 2. All known devices, the lowest PCIe outbound range starts at 0x80000000=
,
> but there's nothing above 0xc0000000. So the inbound of size 0x8000_0000
> is always availbe on all devices. Hardcode the check in platform code to
> check memblock_end_of_DRAM() to 0x80000000.
>=20
> Something like this:
>=20
> diff --git a/arch/powerpc/platforms/85xx/corenet_ds.c
> b/arch/powerpc/platforms/85xx/corenet_ds.c
> index 1f7028e..ef4e215 100644
> --- a/arch/powerpc/platforms/85xx/corenet_ds.c
> +++ b/arch/powerpc/platforms/85xx/corenet_ds.c
> @@ -79,7 +79,7 @@ void __init corenet_ds_setup_arch(void)  #endif
>=20
> #ifdef CONFIG_SWIOTLB
> -       if (memblock_end_of_DRAM() > 0xffffffff)
> +       if (memblock_end_of_DRAM() > 0xff000000)
>                  ppc_swiotlb_enable =3D 1;  #endif
>          pr_info("%s board from Freescale Semiconductor\n", ppc_md.name);
>=20
> -------------
>=20
> 3. Always do swiotlb_init() in mem_init() and later after PCI init, if
> the swiotlb is not needed then free it (swiotlb_free()).
>=20
> 4. etc, please provide some other better way.
>=20
> Thanks
> -Bharat

Thanks.
In my point of view the 2nd solution is better for it does not treat PCI/PC=
Ie as
the special kind of devices from others.

-Jia Hongtao.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* RE: [PATCH 0/6] Description for PCI patches using platform driver
  2012-06-11 15:43     ` Scott Wood
@ 2012-06-12  2:27       ` Jia Hongtao-B38951
  0 siblings, 0 replies; 19+ messages in thread
From: Jia Hongtao-B38951 @ 2012-06-12  2:27 UTC (permalink / raw)
  To: Wood Scott-B07421; +Cc: Li Yang-R58472, linuxppc-dev, Bhushan Bharat-R65777



> -----Original Message-----
> From: Wood Scott-B07421
> Sent: Monday, June 11, 2012 11:43 PM
> To: Jia Hongtao-B38951
> Cc: Bhushan Bharat-R65777; linuxppc-dev@lists.ozlabs.org;
> galak@kernel.crashing.org; Li Yang-R58472; benh@kernel.crashing.org; Wood
> Scott-B07421
> Subject: Re: [PATCH 0/6] Description for PCI patches using platform
> driver
>=20
> On 06/10/2012 09:33 PM, Jia Hongtao-B38951 wrote:
> >> -----Original Message-----
> >> From: Bhushan Bharat-R65777
> >> Sent: Friday, June 08, 2012 6:47 PM
> >> To: Jia Hongtao-B38951; linuxppc-dev@lists.ozlabs.org;
> >> galak@kernel.crashing.org
> >> Cc: Li Yang-R58472; benh@kernel.crashing.org; Wood Scott-B07421
> >> Subject: RE: [PATCH 0/6] Description for PCI patches using platform
> >> driver
> >>
> >>
> >>> -----Original Message-----
> >>> From: Jia Hongtao-B38951
> >>> Sent: Friday, June 08, 2012 3:12 PM
> >>> To: linuxppc-dev@lists.ozlabs.org; galak@kernel.crashing.org
> >>> Cc: Li Yang-R58472; benh@kernel.crashing.org; Wood Scott-B07421;
> >> Bhushan Bharat-
> >>> R65777; Jia Hongtao-B38951
> >>> Subject: [PATCH 0/6] Description for PCI patches using platform
> driver
> >>>
> >>> This series of patches are to unify pci initialization code and add
> PM
> >> support
> >>> for all 85xx/86xx powerpc boards. But two side effects are introduced
> >> by this
> >>> mechanism which listed below:
> >>>
> >>> 1. of_platform_bus_probe() will be called twice but in some cases
> >> duplication
> >>>    warning occured. We fix this in [PATCH 5/6].
> >>>
> >>> 2. Edac driver failed to register pci nodes as platform devices. We
> fix
> >> this
> >>>    in [PATCH 6/6].
> >>
> >> With these patches will not the SWIOTLB will not be initialized even
> if
> >> PCI/PCIe demanded?
> >>
> >> Thanks
> >> -Bharat
> >>
> >
> > These patches still have the swiotlb init problem if
> "ppc_swiotlb_enable" is
> > only demanded by PCI/PCIe. One of the purposes of sending out these
> patches
> > is to let us start a discussion for this problem in upstream.
>=20
> When sending out a patchset like that, label it as [RFC PATCH] (request
> for comments), and mention all known problems to be resolved.
>=20
> -Scott

I got it.
Thanks for your remind.
-Jia Hongtao.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* RE: [PATCH 0/6] Description for PCI patches using platform driver
  2012-06-12  2:24       ` Jia Hongtao-B38951
@ 2012-06-14  9:52         ` Bhushan Bharat-R65777
  2012-06-20  2:33           ` Jia Hongtao-B38951
  0 siblings, 1 reply; 19+ messages in thread
From: Bhushan Bharat-R65777 @ 2012-06-14  9:52 UTC (permalink / raw)
  To: Jia Hongtao-B38951, linuxppc-dev, galak, benh
  Cc: Wood Scott-B07421, Li Yang-R58472

Hello Ben, Kumar, others

Please provide your comments/thoughts on this ?

Thanks
-Bharat

> > > >
> > > > > -----Original Message-----
> > > > > From: Jia Hongtao-B38951
> > > > > Sent: Friday, June 08, 2012 3:12 PM
> > > > > To: linuxppc-dev@lists.ozlabs.org; galak@kernel.crashing.org
> > > > > Cc: Li Yang-R58472; benh@kernel.crashing.org; Wood Scott-B07421;
> > > > Bhushan Bharat-
> > > > > R65777; Jia Hongtao-B38951
> > > > > Subject: [PATCH 0/6] Description for PCI patches using platform
> > > > > driver
> > > > >
> > > > > This series of patches are to unify pci initialization code and
> > > > > add PM
> > > > support
> > > > > for all 85xx/86xx powerpc boards. But two side effects are
> > > > > introduced
> > > > by this
> > > > > mechanism which listed below:
> > > > >
> > > > > 1. of_platform_bus_probe() will be called twice but in some
> > > > > cases
> > > > duplication
> > > > >    warning occured. We fix this in [PATCH 5/6].
> > > > >
> > > > > 2. Edac driver failed to register pci nodes as platform devices.
> > > > > We fix
> > > > this
> > > > >    in [PATCH 6/6].
> > > >
> > > > With these patches will not the SWIOTLB will not be initialized
> > > > even if PCI/PCIe demanded?
> > > >
> > > > Thanks
> > > > -Bharat
> > > >
> > >
> > > These patches still have the swiotlb init problem if
> > "ppc_swiotlb_enable" is
> > > only demanded by PCI/PCIe. One of the purposes of sending out these
> > patches is
> > > to let us start a discussion for this problem in upstream.
> >
> > Ok, I did not find any mention of that, so I thought that you have
> > resolved the issue by some means in these patches which I did not catch=
.
> >
> > So, these patches introduces the issue, that SWIOTLB will not be
> > initialized if requested by pci/pcie. The request is raised by setting
> > the flag ppc_swiotlb_enable. The swiotlb_init() will be called in
> > mem_init() if ppc_swiotlb_enable is set. Now with these patches, the
> > request is raised after mem_init() is called. So request not handled :)=
.
> >
> > Following are the solutions we have thought of during our internal
> > discussions (if I did not missed any):
> >
> > 1. These patches move the code from platform init to device init
> > (arch_initcall()). Rather than moving the whole code, let us divide
> > the code into two. First, which is needed to raise the swiotlb init
> > request and second the rest. Define this first as an function in
> > arch/powerpc/sysdev/fsl_pci.c and call this from platform init code of
> > the SOCs.
> >
> > 2. All known devices, the lowest PCIe outbound range starts at
> > 0x80000000, but there's nothing above 0xc0000000. So the inbound of
> > size 0x8000_0000 is always availbe on all devices. Hardcode the check
> > in platform code to check memblock_end_of_DRAM() to 0x80000000.
> >
> > Something like this:
> >
> > diff --git a/arch/powerpc/platforms/85xx/corenet_ds.c
> > b/arch/powerpc/platforms/85xx/corenet_ds.c
> > index 1f7028e..ef4e215 100644
> > --- a/arch/powerpc/platforms/85xx/corenet_ds.c
> > +++ b/arch/powerpc/platforms/85xx/corenet_ds.c
> > @@ -79,7 +79,7 @@ void __init corenet_ds_setup_arch(void)  #endif
> >
> > #ifdef CONFIG_SWIOTLB
> > -       if (memblock_end_of_DRAM() > 0xffffffff)
> > +       if (memblock_end_of_DRAM() > 0xff000000)
> >                  ppc_swiotlb_enable =3D 1;  #endif
> >          pr_info("%s board from Freescale Semiconductor\n",
> > ppc_md.name);
> >
> > -------------
> >
> > 3. Always do swiotlb_init() in mem_init() and later after PCI init, if
> > the swiotlb is not needed then free it (swiotlb_free()).
> >
> > 4. etc, please provide some other better way.
> >
> > Thanks
> > -Bharat
>=20
> Thanks.
> In my point of view the 2nd solution is better for it does not treat PCI/=
PCIe as
> the special kind of devices from others.
>=20
> -Jia Hongtao.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* RE: [PATCH 0/6] Description for PCI patches using platform driver
  2012-06-14  9:52         ` Bhushan Bharat-R65777
@ 2012-06-20  2:33           ` Jia Hongtao-B38951
  2012-06-26  2:33             ` Jia Hongtao-B38951
  0 siblings, 1 reply; 19+ messages in thread
From: Jia Hongtao-B38951 @ 2012-06-20  2:33 UTC (permalink / raw)
  To: Bhushan Bharat-R65777, linuxppc-dev, galak, benh
  Cc: Wood Scott-B07421, Li Yang-R58472

Hello Ben, Kumar, others:

This series of patches had been pending for a long time on upstream.
We fixed some issues we found and there still some issues should be
discussed like swiotlb init thing. Do you have time for a review?

Thanks.
-Jia Hongtao.

> -----Original Message-----
> From: Bhushan Bharat-R65777
> Sent: Thursday, June 14, 2012 5:52 PM
> To: Jia Hongtao-B38951; linuxppc-dev@lists.ozlabs.org;
> galak@kernel.crashing.org; benh@kernel.crashing.org
> Cc: Li Yang-R58472; Wood Scott-B07421
> Subject: RE: [PATCH 0/6] Description for PCI patches using platform
> driver
>=20
> Hello Ben, Kumar, others
>=20
> Please provide your comments/thoughts on this ?
>=20
> Thanks
> -Bharat
>=20
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Jia Hongtao-B38951
> > > > > > Sent: Friday, June 08, 2012 3:12 PM
> > > > > > To: linuxppc-dev@lists.ozlabs.org; galak@kernel.crashing.org
> > > > > > Cc: Li Yang-R58472; benh@kernel.crashing.org; Wood Scott-B07421=
;
> > > > > Bhushan Bharat-
> > > > > > R65777; Jia Hongtao-B38951
> > > > > > Subject: [PATCH 0/6] Description for PCI patches using platform
> > > > > > driver
> > > > > >
> > > > > > This series of patches are to unify pci initialization code and
> > > > > > add PM
> > > > > support
> > > > > > for all 85xx/86xx powerpc boards. But two side effects are
> > > > > > introduced
> > > > > by this
> > > > > > mechanism which listed below:
> > > > > >
> > > > > > 1. of_platform_bus_probe() will be called twice but in some
> > > > > > cases
> > > > > duplication
> > > > > >    warning occured. We fix this in [PATCH 5/6].
> > > > > >
> > > > > > 2. Edac driver failed to register pci nodes as platform devices=
.
> > > > > > We fix
> > > > > this
> > > > > >    in [PATCH 6/6].
> > > > >
> > > > > With these patches will not the SWIOTLB will not be initialized
> > > > > even if PCI/PCIe demanded?
> > > > >
> > > > > Thanks
> > > > > -Bharat
> > > > >
> > > >
> > > > These patches still have the swiotlb init problem if
> > > "ppc_swiotlb_enable" is
> > > > only demanded by PCI/PCIe. One of the purposes of sending out these
> > > patches is
> > > > to let us start a discussion for this problem in upstream.
> > >
> > > Ok, I did not find any mention of that, so I thought that you have
> > > resolved the issue by some means in these patches which I did not
> catch.
> > >
> > > So, these patches introduces the issue, that SWIOTLB will not be
> > > initialized if requested by pci/pcie. The request is raised by
> setting
> > > the flag ppc_swiotlb_enable. The swiotlb_init() will be called in
> > > mem_init() if ppc_swiotlb_enable is set. Now with these patches, the
> > > request is raised after mem_init() is called. So request not
> handled :).
> > >
> > > Following are the solutions we have thought of during our internal
> > > discussions (if I did not missed any):
> > >
> > > 1. These patches move the code from platform init to device init
> > > (arch_initcall()). Rather than moving the whole code, let us divide
> > > the code into two. First, which is needed to raise the swiotlb init
> > > request and second the rest. Define this first as an function in
> > > arch/powerpc/sysdev/fsl_pci.c and call this from platform init code
> of
> > > the SOCs.
> > >
> > > 2. All known devices, the lowest PCIe outbound range starts at
> > > 0x80000000, but there's nothing above 0xc0000000. So the inbound of
> > > size 0x8000_0000 is always availbe on all devices. Hardcode the check
> > > in platform code to check memblock_end_of_DRAM() to 0x80000000.
> > >
> > > Something like this:
> > >
> > > diff --git a/arch/powerpc/platforms/85xx/corenet_ds.c
> > > b/arch/powerpc/platforms/85xx/corenet_ds.c
> > > index 1f7028e..ef4e215 100644
> > > --- a/arch/powerpc/platforms/85xx/corenet_ds.c
> > > +++ b/arch/powerpc/platforms/85xx/corenet_ds.c
> > > @@ -79,7 +79,7 @@ void __init corenet_ds_setup_arch(void)  #endif
> > >
> > > #ifdef CONFIG_SWIOTLB
> > > -       if (memblock_end_of_DRAM() > 0xffffffff)
> > > +       if (memblock_end_of_DRAM() > 0xff000000)
> > >                  ppc_swiotlb_enable =3D 1;  #endif
> > >          pr_info("%s board from Freescale Semiconductor\n",
> > > ppc_md.name);
> > >
> > > -------------
> > >
> > > 3. Always do swiotlb_init() in mem_init() and later after PCI init,
> if
> > > the swiotlb is not needed then free it (swiotlb_free()).
> > >
> > > 4. etc, please provide some other better way.
> > >
> > > Thanks
> > > -Bharat
> >
> > Thanks.
> > In my point of view the 2nd solution is better for it does not treat
> PCI/PCIe as
> > the special kind of devices from others.
> >
> > -Jia Hongtao.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* RE: [PATCH 0/6] Description for PCI patches using platform driver
  2012-06-20  2:33           ` Jia Hongtao-B38951
@ 2012-06-26  2:33             ` Jia Hongtao-B38951
  2012-06-26  2:46               ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 19+ messages in thread
From: Jia Hongtao-B38951 @ 2012-06-26  2:33 UTC (permalink / raw)
  To: Bhushan Bharat-R65777, linuxppc-dev, galak, benh
  Cc: Wood Scott-B07421, Li Yang-R58472, Jia Hongtao-B38951

Hello Ben and Kumar,

Do you have any concerns or comments on these series of patches?
Would you please have a review?

Thanks.
-Jia Hongtao.

> -----Original Message-----
> From: Linuxppc-dev [mailto:linuxppc-dev-
> bounces+b38951=3Dfreescale.com@lists.ozlabs.org] On Behalf Of Jia Hongtao=
-
> B38951
> Sent: Wednesday, June 20, 2012 10:34 AM
> To: Bhushan Bharat-R65777; linuxppc-dev@lists.ozlabs.org;
> galak@kernel.crashing.org; benh@kernel.crashing.org
> Cc: Wood Scott-B07421; Li Yang-R58472
> Subject: RE: [PATCH 0/6] Description for PCI patches using platform
> driver
>=20
> Hello Ben, Kumar, others:
>=20
> This series of patches had been pending for a long time on upstream.
> We fixed some issues we found and there still some issues should be
> discussed like swiotlb init thing. Do you have time for a review?
>=20
> Thanks.
> -Jia Hongtao.
>=20
> > -----Original Message-----
> > From: Bhushan Bharat-R65777
> > Sent: Thursday, June 14, 2012 5:52 PM
> > To: Jia Hongtao-B38951; linuxppc-dev@lists.ozlabs.org;
> > galak@kernel.crashing.org; benh@kernel.crashing.org
> > Cc: Li Yang-R58472; Wood Scott-B07421
> > Subject: RE: [PATCH 0/6] Description for PCI patches using platform
> > driver
> >
> > Hello Ben, Kumar, others
> >
> > Please provide your comments/thoughts on this ?
> >
> > Thanks
> > -Bharat
> >
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Jia Hongtao-B38951
> > > > > > > Sent: Friday, June 08, 2012 3:12 PM
> > > > > > > To: linuxppc-dev@lists.ozlabs.org; galak@kernel.crashing.org
> > > > > > > Cc: Li Yang-R58472; benh@kernel.crashing.org; Wood Scott-
> B07421;
> > > > > > Bhushan Bharat-
> > > > > > > R65777; Jia Hongtao-B38951
> > > > > > > Subject: [PATCH 0/6] Description for PCI patches using
> platform
> > > > > > > driver
> > > > > > >
> > > > > > > This series of patches are to unify pci initialization code
> and
> > > > > > > add PM
> > > > > > support
> > > > > > > for all 85xx/86xx powerpc boards. But two side effects are
> > > > > > > introduced
> > > > > > by this
> > > > > > > mechanism which listed below:
> > > > > > >
> > > > > > > 1. of_platform_bus_probe() will be called twice but in some
> > > > > > > cases
> > > > > > duplication
> > > > > > >    warning occured. We fix this in [PATCH 5/6].
> > > > > > >
> > > > > > > 2. Edac driver failed to register pci nodes as platform
> devices.
> > > > > > > We fix
> > > > > > this
> > > > > > >    in [PATCH 6/6].
> > > > > >
> > > > > > With these patches will not the SWIOTLB will not be initialized
> > > > > > even if PCI/PCIe demanded?
> > > > > >
> > > > > > Thanks
> > > > > > -Bharat
> > > > > >
> > > > >
> > > > > These patches still have the swiotlb init problem if
> > > > "ppc_swiotlb_enable" is
> > > > > only demanded by PCI/PCIe. One of the purposes of sending out
> these
> > > > patches is
> > > > > to let us start a discussion for this problem in upstream.
> > > >
> > > > Ok, I did not find any mention of that, so I thought that you have
> > > > resolved the issue by some means in these patches which I did not
> > catch.
> > > >
> > > > So, these patches introduces the issue, that SWIOTLB will not be
> > > > initialized if requested by pci/pcie. The request is raised by
> > setting
> > > > the flag ppc_swiotlb_enable. The swiotlb_init() will be called in
> > > > mem_init() if ppc_swiotlb_enable is set. Now with these patches,
> the
> > > > request is raised after mem_init() is called. So request not
> > handled :).
> > > >
> > > > Following are the solutions we have thought of during our internal
> > > > discussions (if I did not missed any):
> > > >
> > > > 1. These patches move the code from platform init to device init
> > > > (arch_initcall()). Rather than moving the whole code, let us divide
> > > > the code into two. First, which is needed to raise the swiotlb init
> > > > request and second the rest. Define this first as an function in
> > > > arch/powerpc/sysdev/fsl_pci.c and call this from platform init code
> > of
> > > > the SOCs.
> > > >
> > > > 2. All known devices, the lowest PCIe outbound range starts at
> > > > 0x80000000, but there's nothing above 0xc0000000. So the inbound of
> > > > size 0x8000_0000 is always availbe on all devices. Hardcode the
> check
> > > > in platform code to check memblock_end_of_DRAM() to 0x80000000.
> > > >
> > > > Something like this:
> > > >
> > > > diff --git a/arch/powerpc/platforms/85xx/corenet_ds.c
> > > > b/arch/powerpc/platforms/85xx/corenet_ds.c
> > > > index 1f7028e..ef4e215 100644
> > > > --- a/arch/powerpc/platforms/85xx/corenet_ds.c
> > > > +++ b/arch/powerpc/platforms/85xx/corenet_ds.c
> > > > @@ -79,7 +79,7 @@ void __init corenet_ds_setup_arch(void)  #endif
> > > >
> > > > #ifdef CONFIG_SWIOTLB
> > > > -       if (memblock_end_of_DRAM() > 0xffffffff)
> > > > +       if (memblock_end_of_DRAM() > 0xff000000)
> > > >                  ppc_swiotlb_enable =3D 1;  #endif
> > > >          pr_info("%s board from Freescale Semiconductor\n",
> > > > ppc_md.name);
> > > >
> > > > -------------
> > > >
> > > > 3. Always do swiotlb_init() in mem_init() and later after PCI init,
> > if
> > > > the swiotlb is not needed then free it (swiotlb_free()).
> > > >
> > > > 4. etc, please provide some other better way.
> > > >
> > > > Thanks
> > > > -Bharat
> > >
> > > Thanks.
> > > In my point of view the 2nd solution is better for it does not treat
> > PCI/PCIe as
> > > the special kind of devices from others.
> > >
> > > -Jia Hongtao.
>=20
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

^ permalink raw reply	[flat|nested] 19+ messages in thread

* RE: [PATCH 0/6] Description for PCI patches using platform driver
  2012-06-26  2:33             ` Jia Hongtao-B38951
@ 2012-06-26  2:46               ` Benjamin Herrenschmidt
  2012-06-26  2:54                 ` Jia Hongtao-B38951
  2012-06-26 10:05                 ` Jia Hongtao-B38951
  0 siblings, 2 replies; 19+ messages in thread
From: Benjamin Herrenschmidt @ 2012-06-26  2:46 UTC (permalink / raw)
  To: Jia Hongtao-B38951
  Cc: Wood Scott-B07421, Li Yang-R58472, linuxppc-dev, Bhushan Bharat-R65777

On Tue, 2012-06-26 at 02:33 +0000, Jia Hongtao-B38951 wrote:
> Hello Ben and Kumar,
> 
> Do you have any concerns or comments on these series of patches?
> Would you please have a review?

My main concern is that currently the PCI code has some assumptions
about ordering of things that will get violated.

For example, the pci final fixups are an fs_initcall iirc, or something
like that. There's other similar oddities that might become problematic.
In addition, there might be locking issues if you start doing multiple
PHBs in parallel.

Now we do want to fix all that long run but it might take a while.

Cheers,
Ben.

> Thanks.
> -Jia Hongtao.
> 
> > -----Original Message-----
> > From: Linuxppc-dev [mailto:linuxppc-dev-
> > bounces+b38951=freescale.com@lists.ozlabs.org] On Behalf Of Jia Hongtao-
> > B38951
> > Sent: Wednesday, June 20, 2012 10:34 AM
> > To: Bhushan Bharat-R65777; linuxppc-dev@lists.ozlabs.org;
> > galak@kernel.crashing.org; benh@kernel.crashing.org
> > Cc: Wood Scott-B07421; Li Yang-R58472
> > Subject: RE: [PATCH 0/6] Description for PCI patches using platform
> > driver
> > 
> > Hello Ben, Kumar, others:
> > 
> > This series of patches had been pending for a long time on upstream.
> > We fixed some issues we found and there still some issues should be
> > discussed like swiotlb init thing. Do you have time for a review?
> > 
> > Thanks.
> > -Jia Hongtao.
> > 
> > > -----Original Message-----
> > > From: Bhushan Bharat-R65777
> > > Sent: Thursday, June 14, 2012 5:52 PM
> > > To: Jia Hongtao-B38951; linuxppc-dev@lists.ozlabs.org;
> > > galak@kernel.crashing.org; benh@kernel.crashing.org
> > > Cc: Li Yang-R58472; Wood Scott-B07421
> > > Subject: RE: [PATCH 0/6] Description for PCI patches using platform
> > > driver
> > >
> > > Hello Ben, Kumar, others
> > >
> > > Please provide your comments/thoughts on this ?
> > >
> > > Thanks
> > > -Bharat
> > >
> > > > > > >
> > > > > > > > -----Original Message-----
> > > > > > > > From: Jia Hongtao-B38951
> > > > > > > > Sent: Friday, June 08, 2012 3:12 PM
> > > > > > > > To: linuxppc-dev@lists.ozlabs.org; galak@kernel.crashing.org
> > > > > > > > Cc: Li Yang-R58472; benh@kernel.crashing.org; Wood Scott-
> > B07421;
> > > > > > > Bhushan Bharat-
> > > > > > > > R65777; Jia Hongtao-B38951
> > > > > > > > Subject: [PATCH 0/6] Description for PCI patches using
> > platform
> > > > > > > > driver
> > > > > > > >
> > > > > > > > This series of patches are to unify pci initialization code
> > and
> > > > > > > > add PM
> > > > > > > support
> > > > > > > > for all 85xx/86xx powerpc boards. But two side effects are
> > > > > > > > introduced
> > > > > > > by this
> > > > > > > > mechanism which listed below:
> > > > > > > >
> > > > > > > > 1. of_platform_bus_probe() will be called twice but in some
> > > > > > > > cases
> > > > > > > duplication
> > > > > > > >    warning occured. We fix this in [PATCH 5/6].
> > > > > > > >
> > > > > > > > 2. Edac driver failed to register pci nodes as platform
> > devices.
> > > > > > > > We fix
> > > > > > > this
> > > > > > > >    in [PATCH 6/6].
> > > > > > >
> > > > > > > With these patches will not the SWIOTLB will not be initialized
> > > > > > > even if PCI/PCIe demanded?
> > > > > > >
> > > > > > > Thanks
> > > > > > > -Bharat
> > > > > > >
> > > > > >
> > > > > > These patches still have the swiotlb init problem if
> > > > > "ppc_swiotlb_enable" is
> > > > > > only demanded by PCI/PCIe. One of the purposes of sending out
> > these
> > > > > patches is
> > > > > > to let us start a discussion for this problem in upstream.
> > > > >
> > > > > Ok, I did not find any mention of that, so I thought that you have
> > > > > resolved the issue by some means in these patches which I did not
> > > catch.
> > > > >
> > > > > So, these patches introduces the issue, that SWIOTLB will not be
> > > > > initialized if requested by pci/pcie. The request is raised by
> > > setting
> > > > > the flag ppc_swiotlb_enable. The swiotlb_init() will be called in
> > > > > mem_init() if ppc_swiotlb_enable is set. Now with these patches,
> > the
> > > > > request is raised after mem_init() is called. So request not
> > > handled :).
> > > > >
> > > > > Following are the solutions we have thought of during our internal
> > > > > discussions (if I did not missed any):
> > > > >
> > > > > 1. These patches move the code from platform init to device init
> > > > > (arch_initcall()). Rather than moving the whole code, let us divide
> > > > > the code into two. First, which is needed to raise the swiotlb init
> > > > > request and second the rest. Define this first as an function in
> > > > > arch/powerpc/sysdev/fsl_pci.c and call this from platform init code
> > > of
> > > > > the SOCs.
> > > > >
> > > > > 2. All known devices, the lowest PCIe outbound range starts at
> > > > > 0x80000000, but there's nothing above 0xc0000000. So the inbound of
> > > > > size 0x8000_0000 is always availbe on all devices. Hardcode the
> > check
> > > > > in platform code to check memblock_end_of_DRAM() to 0x80000000.
> > > > >
> > > > > Something like this:
> > > > >
> > > > > diff --git a/arch/powerpc/platforms/85xx/corenet_ds.c
> > > > > b/arch/powerpc/platforms/85xx/corenet_ds.c
> > > > > index 1f7028e..ef4e215 100644
> > > > > --- a/arch/powerpc/platforms/85xx/corenet_ds.c
> > > > > +++ b/arch/powerpc/platforms/85xx/corenet_ds.c
> > > > > @@ -79,7 +79,7 @@ void __init corenet_ds_setup_arch(void)  #endif
> > > > >
> > > > > #ifdef CONFIG_SWIOTLB
> > > > > -       if (memblock_end_of_DRAM() > 0xffffffff)
> > > > > +       if (memblock_end_of_DRAM() > 0xff000000)
> > > > >                  ppc_swiotlb_enable = 1;  #endif
> > > > >          pr_info("%s board from Freescale Semiconductor\n",
> > > > > ppc_md.name);
> > > > >
> > > > > -------------
> > > > >
> > > > > 3. Always do swiotlb_init() in mem_init() and later after PCI init,
> > > if
> > > > > the swiotlb is not needed then free it (swiotlb_free()).
> > > > >
> > > > > 4. etc, please provide some other better way.
> > > > >
> > > > > Thanks
> > > > > -Bharat
> > > >
> > > > Thanks.
> > > > In my point of view the 2nd solution is better for it does not treat
> > > PCI/PCIe as
> > > > the special kind of devices from others.
> > > >
> > > > -Jia Hongtao.
> > 
> > _______________________________________________
> > Linuxppc-dev mailing list
> > Linuxppc-dev@lists.ozlabs.org
> > https://lists.ozlabs.org/listinfo/linuxppc-dev
> 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* RE: [PATCH 0/6] Description for PCI patches using platform driver
  2012-06-26  2:46               ` Benjamin Herrenschmidt
@ 2012-06-26  2:54                 ` Jia Hongtao-B38951
  2012-06-26 10:05                 ` Jia Hongtao-B38951
  1 sibling, 0 replies; 19+ messages in thread
From: Jia Hongtao-B38951 @ 2012-06-26  2:54 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Wood Scott-B07421, Li Yang-R58472, linuxppc-dev, Bhushan Bharat-R65777

PiBNeSBtYWluIGNvbmNlcm4gaXMgdGhhdCBjdXJyZW50bHkgdGhlIFBDSSBjb2RlIGhhcyBzb21l
IGFzc3VtcHRpb25zDQo+IGFib3V0IG9yZGVyaW5nIG9mIHRoaW5ncyB0aGF0IHdpbGwgZ2V0IHZp
b2xhdGVkLg0KPiANCj4gRm9yIGV4YW1wbGUsIHRoZSBwY2kgZmluYWwgZml4dXBzIGFyZSBhbiBm
c19pbml0Y2FsbCBpaXJjLCBvciBzb21ldGhpbmcNCj4gbGlrZSB0aGF0LiBUaGVyZSdzIG90aGVy
IHNpbWlsYXIgb2RkaXRpZXMgdGhhdCBtaWdodCBiZWNvbWUgcHJvYmxlbWF0aWMuDQo+IEluIGFk
ZGl0aW9uLCB0aGVyZSBtaWdodCBiZSBsb2NraW5nIGlzc3VlcyBpZiB5b3Ugc3RhcnQgZG9pbmcg
bXVsdGlwbGUNCj4gUEhCcyBpbiBwYXJhbGxlbC4NCj4gDQo+IE5vdyB3ZSBkbyB3YW50IHRvIGZp
eCBhbGwgdGhhdCBsb25nIHJ1biBidXQgaXQgbWlnaHQgdGFrZSBhIHdoaWxlLg0KPiANCj4gQ2hl
ZXJzLA0KPiBCZW4uDQo+IA0KDQpUaGFua3MgZm9yIHlvdXIgYWR2aWNlLiBJIHdpbGwgZG8gc29t
ZSBpbnZlc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A+ID4gPiA+IC1KaWEgSG9uZ3Rhby4NCj4gPiA+DQo+
ID4gPiBfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXw0KPiA+
ID4gTGludXhwcGMtZGV2IG1haWxpbmcgbGlzdA0KPiA+ID4gTGludXhwcGMtZGV2QGxpc3RzLm96
bGFicy5vcmcNCj4gPiA+IGh0dHBzOi8vbGlzdHMub3psYWJzLm9yZy9saXN0aW5mby9saW51eHBw
Yy1kZXYNCj4gPg0KPiANCj4gDQoNCg==

^ permalink raw reply	[flat|nested] 19+ messages in thread

* RE: [PATCH 0/6] Description for PCI patches using platform driver
  2012-06-26  2:46               ` Benjamin Herrenschmidt
  2012-06-26  2:54                 ` Jia Hongtao-B38951
@ 2012-06-26 10:05                 ` Jia Hongtao-B38951
  1 sibling, 0 replies; 19+ messages in thread
From: Jia Hongtao-B38951 @ 2012-06-26 10:05 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Wood Scott-B07421, Li Yang-R58472, linuxppc-dev, Bhushan Bharat-R65777

PiANCj4gTXkgbWFpbiBjb25jZXJuIGlzIHRoYXQgY3VycmVudGx5IHRoZSBQQ0kgY29kZSBoYXMg
c29tZSBhc3N1bXB0aW9ucw0KPiBhYm91dCBvcmRlcmluZyBvZiB0aGluZ3MgdGhhdCB3aWxsIGdl
dCB2aW9sYXRlZC4NCj4gDQo+IEZvciBleGFtcGxlLCB0aGUgcGNpIGZpbmFsIGZpeHVwcyBhcmUg
YW4gZnNfaW5pdGNhbGwgaWlyYywgb3Igc29tZXRoaW5nDQo+IGxpa2UgdGhhdC4gVGhlcmUncyBv
dGhlciBzaW1pbGFyIG9kZGl0aWVzIHRoYXQgbWlnaHQgYmVjb21lIHByb2JsZW1hdGljLg0KPiBJ
biBhZGRpdGlvbiwgdGhlcmUgbWlnaHQgYmUgbG9ja2luZyBpc3N1ZXMgaWYgeW91IHN0YXJ0IGRv
aW5nIG11bHRpcGxlDQo+IFBIQnMga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gbm90IG5lZWRlZCB0aGVuIGZyZWUgaXQg
KHN3aW90bGJfZnJlZSgpKS4NCj4gPiA+ID4gPiA+DQo+ID4gPiA+ID4gPiA0LiBldGMsIHBsZWFz
ZSBwcm92aWRlIHNvbWUgb3RoZXIgYmV0dGVyIHdheS4NCj4gPiA+ID4gPiA+DQo+ID4gPiA+ID4g
PiBUaGFua3MNCj4gPiA+ID4gPiA+IC1CaGFyYXQNCj4gPiA+ID4gPg0KPiA+ID4gPiA+IFRoYW5r
cy4NCj4gPiA+ID4gPiBJbiBteSBwb2ludCBvZiB2aWV3IHRoZSAybmQgc29sdXRpb24gaXMgYmV0
dGVyIGZvciBpdCBkb2VzIG5vdA0KPiB0cmVhdA0KPiA+ID4gPiBQQ0kvUENJZSBhcw0KPiA+ID4g
PiA+IHRoZSBzcGVjaWFsIGtpbmQgb2YgZGV2aWNlcyBmcm9tIG90aGVycy4NCj4gPiA+ID4gPg0K
PiA+ID4gPiA+IC1KaWEgSG9uZ3Rhby4NCj4gPiA+DQo+ID4gPiBfX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fXw0KPiA+ID4gTGludXhwcGMtZGV2IG1haWxpbmcg
bGlzdA0KPiA+ID4gTGludXhwcGMtZGV2QGxpc3RzLm96bGFicy5vcmcNCj4gPiA+IGh0dHBzOi8v
bGlzdHMub3psYWJzLm9yZy9saXN0aW5mby9saW51eHBwYy1kZXYNCj4gPg0KPiANCj4gDQoNCg==

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2012-06-26 10:05 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-08  9:42 [PATCH 0/6] Description for PCI patches using platform driver Jia Hongtao
2012-06-08  9:42 ` [PATCH V3 1/6] powerpc/fsl-pci: Unify pci/pcie initialization code Jia Hongtao
2012-06-08  9:42 ` [PATCH V3 2/6] powerpc/fsl-pci: Using common pci/pcie initialization for all boards Jia Hongtao
2012-06-08  9:42 ` [PATCH V3 3/6] powerpc/fsl-pci: Only scan PCI bus if configured as a host Jia Hongtao
2012-06-08  9:42 ` [PATCH V3 4/6] powerpc/fsl-pci: Add pci inbound/outbound PM support Jia Hongtao
2012-06-08  9:42 ` [PATCH V3 5/6] Avoid duplicate probe for of platform devices Jia Hongtao
2012-06-08  9:42 ` [PATCH V3 6/6] Edac/85xx: Register mpc85xx_pci_err_driver by fsl_pci_driver Jia Hongtao
2012-06-08 10:47 ` [PATCH 0/6] Description for PCI patches using platform driver Bhushan Bharat-R65777
2012-06-11  2:33   ` Jia Hongtao-B38951
2012-06-11 13:24     ` Bhushan Bharat-R65777
2012-06-12  2:24       ` Jia Hongtao-B38951
2012-06-14  9:52         ` Bhushan Bharat-R65777
2012-06-20  2:33           ` Jia Hongtao-B38951
2012-06-26  2:33             ` Jia Hongtao-B38951
2012-06-26  2:46               ` Benjamin Herrenschmidt
2012-06-26  2:54                 ` Jia Hongtao-B38951
2012-06-26 10:05                 ` Jia Hongtao-B38951
2012-06-11 15:43     ` Scott Wood
2012-06-12  2:27       ` Jia Hongtao-B38951

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.