Skip to contentSkip to conversation

Description for PCI patches using platform driver

PATCH In review Jia Hongtao 4 participants 19 messages Jun 8, 2012 – Jun 26, 2012

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

cover 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].

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

#1 lore raw

PATCH v3 1/6 powerpc/fsl-pci: Unify pci/pcie initialization code

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.

---
 arch/powerpc/sysdev/fsl_pci.c |   61 +++++++++++++++++++++++++++++++++++++++++
 arch/powerpc/sysdev/fsl_pci.h |    1 +
 2 files changed, 62 insertions(+), 0 deletions(-)
arch/powerpc/sysdev/fsl_pci.c +61 -0
index 6073288..4c3d130 100644
@@ -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
arch/powerpc/sysdev/fsl_pci.h +1 -0
index a39ed5c..df9fc44 100644
@@ -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);
Signature · 1 line
1.7.5.1
#2 lore raw

PATCH v3 2/6 powerpc/fsl-pci: Using common pci/pcie initialization for all boards

In reply to Jia Hongtao

Including all 85xx and 86xx platforms.

---
 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(-)
arch/powerpc/platforms/85xx/common.c +28 -0
index 9fef530..ae162ae 100644
@@ -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)
 {
arch/powerpc/platforms/85xx/corenet_ds.c +1 -26
index df69e99..a21a075 100644
@@ -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",
arch/powerpc/platforms/85xx/corenet_ds.h +1 -0
index ddd700b..89700e6 100644
@@ -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
arch/powerpc/platforms/85xx/ge_imp3a.c +2 -32
index d50056f..43f7142 100644
@@ -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);
arch/powerpc/platforms/85xx/mpc8536_ds.c +10 -30
index f588726..e9fc274 100644
@@ -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) {
arch/powerpc/platforms/85xx/mpc85xx.h +1 -0
index 2aa7c5d..4ebdbb7 100644
@@ -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);
arch/powerpc/platforms/85xx/mpc85xx_ads.c +9 -8
index d19f675..f590df8 100644
@@ -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) {
arch/powerpc/platforms/85xx/mpc85xx_cds.c +10 -14
index ab5f0bf1..2bb6b9c 100644
@@ -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",
arch/powerpc/platforms/85xx/mpc85xx_ds.c +5 -28
index 6e23e3e..e33a8cf 100644
@@ -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);
arch/powerpc/platforms/85xx/mpc85xx_mds.c +30 -32

102 lines not on this page · raw message

arch/powerpc/platforms/85xx/mpc85xx_rdb.c +4 -9
index 1a66c3d..453a935 100644
@@ -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
  */
arch/powerpc/platforms/85xx/p1010rdb.c +1 -12
index d8bd656..ad9987c 100644
@@ -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);
 
 /*
arch/powerpc/platforms/85xx/p1022_ds.c +2 -27
index e74b7cd..a8c4118 100644
@@ -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);
 
 /*
arch/powerpc/platforms/85xx/p1023_rds.c +1 -5
index 6b07398..c62303c 100644
@@ -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)
 {
arch/powerpc/platforms/85xx/p2041_rdb.c +1 -0
index eda6ed5..5123400 100644
@@ -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
arch/powerpc/platforms/85xx/p3041_ds.c +1 -0
index 96d99a3..aa0dd29 100644
@@ -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
arch/powerpc/platforms/85xx/p3060_qds.c +1 -0
index 081cf4a..51aece5 100644
@@ -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
arch/powerpc/platforms/85xx/p4080_ds.c +1 -0
index d1b21d7..e6b52e8 100644
@@ -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);
arch/powerpc/platforms/85xx/p5020_ds.c +1 -0
index e8cba50..77953cc 100644
@@ -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
arch/powerpc/platforms/85xx/sbc8548.c +9 -18
index 1677b8a..9049994 100644
@@ -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) {
arch/powerpc/platforms/85xx/sbc8560.c +9 -10
index 3c3bbcc..c62692d 100644
@@ -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
arch/powerpc/platforms/85xx/socrates.c +6 -10
index b719192..eb94e586 100644
@@ -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;
 }
arch/powerpc/platforms/85xx/stx_gp3.c +9 -10
index 27ca3a7..92d2c3b 100644
@@ -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) {
arch/powerpc/platforms/85xx/tqm85xx.c +9 -20
index d7504ce..c8e2599 100644
@@ -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) {
arch/powerpc/platforms/85xx/xes_mpc85xx.c +4 -21
index 503c215..f5ef6b5 100644
@@ -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
  */
arch/powerpc/platforms/86xx/gef_ppc9a.c +26 -8
index ed58b6c..4f75816 100644
@@ -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", },
arch/powerpc/platforms/86xx/gef_sbc310.c +26 -8
index 710db69..6be455b 100644
@@ -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", },
arch/powerpc/platforms/86xx/gef_sbc610.c +26 -8
index 4a13d2f..93e0f8d 100644
@@ -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", },
arch/powerpc/platforms/86xx/mpc8610_hpcd.c +26 -15

65 lines not on this page · raw message

arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +26 -29

85 lines not on this page · raw message

arch/powerpc/platforms/86xx/sbc8641d.c +21 -9
index 51c8f33..7cffe8c 100644
@@ -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", },
drivers/of/platform.c +2 -1
index 343ad29..a37330e 100644
@@ -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
include/linux/of_platform.h +4 -0
index b47d204..680e48d 100644
@@ -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 */
Signature · 1 line
1.7.5.1
#3 lore raw

PATCH v3 3/6 powerpc/fsl-pci: Only scan PCI bus if configured as a host

In reply to Jia Hongtao

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.

---
 arch/powerpc/sysdev/fsl_pci.c |   27 +++++++++++++++------------
 1 files changed, 15 insertions(+), 12 deletions(-)
arch/powerpc/sysdev/fsl_pci.c +15 -12
index 4c3d130..a5e573c 100644
@@ -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
 	}
Signature · 1 line
1.7.5.1
#4 lore raw

PATCH v3 4/6 powerpc/fsl-pci: Add pci inbound/outbound PM support

In reply to Jia Hongtao

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.

---
 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(-)
arch/powerpc/include/asm/pci-bridge.h +1 -1
index ac39e6a..823e000 100644
@@ -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
arch/powerpc/sysdev/fsl_pci.c +121 -0

133 lines not on this page · raw message

arch/powerpc/sysdev/fsl_pci.h +10 -0
index df9fc44..1093e24 100644
@@ -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);
Signature · 1 line
1.7.5.1
#5 lore raw

PATCH v3 5/6 Avoid duplicate probe for of platform devices

In reply to Jia Hongtao

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.

---
 drivers/of/platform.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)
drivers/of/platform.c +12 -6
index a37330e..3aab01f 100644
@@ -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);
Signature · 1 line
1.7.5.1
#6 lore raw

PATCH v3 6/6 Edac/85xx: Register mpc85xx_pci_err_driver by fsl_pci_driver

In reply to Jia Hongtao

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.

---
 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(-)
arch/powerpc/sysdev/fsl_pci.c +4 -0
index 287e630..1012bf7 100644
@@ -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;
 }
 
arch/powerpc/sysdev/fsl_pci.h +4 -0
index 1093e24..ea2e025 100644
@@ -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__ */
drivers/edac/mpc85xx_edac.c +12 -31

79 lines not on this page · raw message

Signature · 1 line
1.7.5.1
#7 lore raw
In reply to Jia Hongtao
Quoted 6 lines

-----Original Message-----
From: Jia Hongtao-B38951
Sent: Friday, June 08, 2012 3:12 PM
To: [email protected]; [email protected]
Cc: Li Yang-R58472; [email protected]; Wood Scott-B07421; Bhushan =

Bharat-

Quoted 4 lines

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

Quoted 1 line

for all 85xx/86xx powerpc boards. But two side effects are introduced by =

this

Quoted 3 lines

mechanism which listed below:
=20
1. of_platform_bus_probe() will be called twice but in some cases duplica=

tion

Quoted 3 lines

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

Quoted 1 line
   in [PATCH 6/6].

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

Thanks
-Bharat

Quoted 3 lines

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

#8 lore raw
Quoted 31 lines

-----Original Message-----
From: Bhushan Bharat-R65777
Sent: Friday, June 08, 2012 6:47 PM
To: Jia Hongtao-B38951; [email protected]; [email protected]
Cc: Li Yang-R58472; [email protected]; Wood Scott-B07421
Subject: RE: [PATCH 0/6] Description for PCI patches using platform driver
=20
=20

Quoted 5 lines

-----Original Message-----
From: Jia Hongtao-B38951
Sent: Friday, June 08, 2012 3:12 PM
To: [email protected]; [email protected]
Cc: Li Yang-R58472; [email protected]; Wood Scott-B07421;

Bhushan Bharat-

Quoted 4 lines

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

Quoted 1 line

for all 85xx/86xx powerpc boards. But two side effects are introduced

by this

Quoted 3 lines

mechanism which listed below:

1. of_platform_bus_probe() will be called twice but in some cases

duplication

Quoted 3 lines

warning occured. We fix this in [PATCH 5/6].

2. Edac driver failed to register pci nodes as platform devices. We fix

this

Quoted 8 lines
Quoted 1 line
   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.

#9 lore raw
Quoted 9 lines

-----Original Message-----
From: Jia Hongtao-B38951
Sent: Monday, June 11, 2012 8:03 AM
To: Bhushan Bharat-R65777; [email protected]; [email protected]
Cc: Li Yang-R58472; [email protected]; Wood Scott-B07421
Subject: RE: [PATCH 0/6] Description for PCI patches using platform drive=

r

Quoted 38 lines

=20

Quoted 37 lines

-----Original Message-----
From: Bhushan Bharat-R65777
Sent: Friday, June 08, 2012 6:47 PM
To: Jia Hongtao-B38951; [email protected]; [email protected]
Cc: Li Yang-R58472; [email protected]; Wood Scott-B07421
Subject: RE: [PATCH 0/6] Description for PCI patches using platform driver

Quoted 5 lines

-----Original Message-----
From: Jia Hongtao-B38951
Sent: Friday, June 08, 2012 3:12 PM
To: [email protected]; [email protected]
Cc: Li Yang-R58472; [email protected]; Wood Scott-B07421;

Bhushan Bharat-

Quoted 6 lines

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

Quoted 2 lines

for all 85xx/86xx powerpc boards. But two side effects are introduced

by this

Quoted 3 lines

mechanism which listed below:

1. of_platform_bus_probe() will be called twice but in some cases

duplication

Quoted 4 lines

warning occured. We fix this in [PATCH 5/6].

2. Edac driver failed to register pci nodes as platform devices. We fix

this

Quoted 1 line
   in [PATCH 6/6].
Quoted 8 lines
Quoted 6 lines

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

Quoted 1 line

only demanded by PCI/PCIe. One of the purposes of sending out these patch=

es is

Quoted 1 line

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:

(quoted diff) +0 -0

b/arch/powerpc/platforms/85xx/corenet_ds.c
index 1f7028e..ef4e215 100644

arch/powerpc/platforms/85xx/corenet_ds.c +0 -0
@@ -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

#10 lore raw
Quoted 84 lines

-----Original Message-----
From: Bhushan Bharat-R65777
Sent: Monday, June 11, 2012 9:25 PM
To: Jia Hongtao-B38951; [email protected]; [email protected]
Cc: Li Yang-R58472; [email protected]; Wood Scott-B07421
Subject: RE: [PATCH 0/6] Description for PCI patches using platform driver
=20
=20
=20

Quoted 7 lines

-----Original Message-----
From: Jia Hongtao-B38951
Sent: Monday, June 11, 2012 8:03 AM
To: Bhushan Bharat-R65777; [email protected]; [email protected]
Cc: Li Yang-R58472; [email protected]; Wood Scott-B07421
Subject: RE: [PATCH 0/6] Description for PCI patches using platform

driver

Quoted 38 lines
Quoted 38 lines

-----Original Message-----
From: Bhushan Bharat-R65777
Sent: Friday, June 08, 2012 6:47 PM
To: Jia Hongtao-B38951; [email protected]; [email protected]
Cc: Li Yang-R58472; [email protected]; Wood Scott-B07421
Subject: RE: [PATCH 0/6] Description for PCI patches using platform driver

Quoted 5 lines

-----Original Message-----
From: Jia Hongtao-B38951
Sent: Friday, June 08, 2012 3:12 PM
To: [email protected]; [email protected]
Cc: Li Yang-R58472; [email protected]; Wood Scott-B07421;

Bhushan Bharat-

Quoted 6 lines

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

Quoted 2 lines

for all 85xx/86xx powerpc boards. But two side effects are introduced

by this

Quoted 3 lines

mechanism which listed below:

1. of_platform_bus_probe() will be called twice but in some cases

duplication

Quoted 4 lines

warning occured. We fix this in [PATCH 5/6].

2. Edac driver failed to register pci nodes as platform devices. We fix

this

Quoted 1 line
   in [PATCH 6/6].
Quoted 8 lines
Quoted 6 lines

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

Quoted 1 line

only demanded by PCI/PCIe. One of the purposes of sending out these

patches is

Quoted 1 line

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

Quoted 8 lines

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=

,

Quoted 20 lines

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

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

=20
#ifdef CONFIG_SWIOTLB

arch/powerpc/platforms/85xx/corenet_ds.c +1 -1
-       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
-------------

Quoted 8 lines

=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.

#11 lore raw

Hello Ben, Kumar, others

Please provide your comments/thoughts on this ?

Thanks
-Bharat

Quoted 36 lines
Quoted 36 lines
Quoted 36 lines
Quoted 35 lines
Quoted 6 lines

-----Original Message-----
From: Jia Hongtao-B38951
Sent: Friday, June 08, 2012 3:12 PM
To: [email protected]; [email protected]
Cc: Li Yang-R58472; [email protected]; Wood Scott-B07421;

Bhushan Bharat-

Quoted 6 lines

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

Quoted 2 lines

for all 85xx/86xx powerpc boards. But two side effects are introduced

by this

Quoted 4 lines

mechanism which listed below:

1. of_platform_bus_probe() will be called twice but in some cases

duplication

Quoted 4 lines

warning occured. We fix this in [PATCH 5/6].

2. Edac driver failed to register pci nodes as platform devices. We fix

this

Quoted 1 line
   in [PATCH 6/6].

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

Thanks
-Bharat

Quoted 8 lines
Quoted 8 lines
Quoted 1 line

These patches still have the swiotlb init problem if

"ppc_swiotlb_enable" is

Quoted 1 line

only demanded by PCI/PCIe. One of the purposes of sending out these

patches is

Quoted 1 line

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=

.

Quoted 6 lines
Quoted 6 lines

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 :)=

.

Quoted 37 lines
Quoted 37 lines

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:

arch/powerpc/platforms/85xx/corenet_ds.c +1 -2
index 1f7028e..ef4e215 100644
@@ -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()).

Quoted 7 lines
Quoted 4 lines

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

Quoted 3 lines

the special kind of devices from others.
=20
-Jia Hongtao.

#12 lore raw

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.

Quoted 8 lines

-----Original Message-----
From: Bhushan Bharat-R65777
Sent: Thursday, June 14, 2012 5:52 PM
To: Jia Hongtao-B38951; [email protected]; [email protected]; [email protected]
Cc: Li Yang-R58472; Wood Scott-B07421
Subject: RE: [PATCH 0/6] Description for PCI patches using platform driver

Quoted 14 lines

=20
Hello Ben, Kumar, others
=20
Please provide your comments/thoughts on this ?
=20
Thanks
-Bharat
=20

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

-----Original Message-----
From: Jia Hongtao-B38951
Sent: Friday, June 08, 2012 3:12 PM
To: [email protected]; [email protected]
Cc: Li Yang-R58472; [email protected]; Wood Scott-B07421=

;

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

Bhushan Bharat-

Quoted 6 lines

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

Quoted 2 lines

for all 85xx/86xx powerpc boards. But two side effects are introduced

by this

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

mechanism which listed below:

1. of_platform_bus_probe() will be called twice but in some cases

duplication

Quoted 3 lines

warning occured. We fix this in [PATCH 5/6].

2. Edac driver failed to register pci nodes as platform devices=

.

Quoted 78 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
Quoted 1 line

We fix

this

Quoted 1 line
   in [PATCH 6/6].

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

Thanks
-Bharat

Quoted 8 lines
Quoted 8 lines
Quoted 1 line

These patches still have the swiotlb init problem if

"ppc_swiotlb_enable" is

Quoted 1 line

only demanded by PCI/PCIe. One of the purposes of sending out these

patches is

Quoted 1 line

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.

Quoted 3 lines
Quoted 3 lines

So, these patches introduces the issue, that SWIOTLB will not be initialized if requested by pci/pcie. The request is raised by

setting

Quoted 3 lines
Quoted 3 lines

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 :).

Quoted 9 lines
Quoted 9 lines

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

Quoted 23 lines
Quoted 23 lines

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:

arch/powerpc/platforms/85xx/corenet_ds.c +1 -1
index 1f7028e..ef4e215 100644
@@ -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);
 
Quoted 3 lines
Quoted 3 lines

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

3. Always do swiotlb_init() in mem_init() and later after PCI init,

if

Quoted 9 lines
Quoted 6 lines

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

Quoted 3 lines

the special kind of devices from others.

-Jia Hongtao.

#13 lore raw

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.

Quoted 3 lines

-----Original Message-----
From: Linuxppc-dev [mailto:linuxppc-dev- [email protected]] On Behalf Of Jia Hongtao=

-

Quoted 148 lines

B38951
Sent: Wednesday, June 20, 2012 10:34 AM
To: Bhushan Bharat-R65777; [email protected]; [email protected]; [email protected]
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

Quoted 9 lines

-----Original Message-----
From: Bhushan Bharat-R65777
Sent: Thursday, June 14, 2012 5:52 PM
To: Jia Hongtao-B38951; [email protected]; [email protected]; [email protected]
Cc: Li Yang-R58472; Wood Scott-B07421
Subject: RE: [PATCH 0/6] Description for PCI patches using platform driver

Quoted 13 lines

Hello Ben, Kumar, others

Please provide your comments/thoughts on this ?

Thanks
-Bharat

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

-----Original Message-----
From: Jia Hongtao-B38951
Sent: Friday, June 08, 2012 3:12 PM
To: [email protected]; [email protected]
Cc: Li Yang-R58472; [email protected]; Wood Scott-

B07421;

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Bhushan Bharat-

Quoted 2 lines

R65777; Jia Hongtao-B38951
Subject: [PATCH 0/6] Description for PCI patches using

platform

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

driver

This series of patches are to unify pci initialization code

and

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line

add PM

support

Quoted 2 lines

for all 85xx/86xx powerpc boards. But two side effects are introduced

by this

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

mechanism which listed below:

1. of_platform_bus_probe() will be called twice but in some cases

duplication

Quoted 3 lines

warning occured. We fix this in [PATCH 5/6].

2. Edac driver failed to register pci nodes as platform

devices.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 1 line

We fix

this

Quoted 1 line
   in [PATCH 6/6].

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

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Thanks
-Bharat

These patches still have the swiotlb init problem if

"ppc_swiotlb_enable" is

Quoted 1 line

only demanded by PCI/PCIe. One of the purposes of sending out

these

Quoted 12 lines
Quoted 5 lines
Quoted 5 lines

patches is

Quoted 1 line

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.

Quoted 3 lines
Quoted 3 lines

So, these patches introduces the issue, that SWIOTLB will not be initialized if requested by pci/pcie. The request is raised by

setting

Quoted 2 lines
Quoted 2 lines

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

Quoted 6 lines
Quoted 1 line
Quoted 1 line

request is raised after mem_init() is called. So request not

handled :).

Quoted 4 lines
Quoted 4 lines

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

Quoted 11 lines
Quoted 5 lines
Quoted 5 lines

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

Quoted 5 lines
Quoted 5 lines

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

Quoted 24 lines
Quoted 18 lines
Quoted 18 lines

in platform code to check memblock_end_of_DRAM() to 0x80000000.

Something like this:

arch/powerpc/platforms/85xx/corenet_ds.c +1 -1
index 1f7028e..ef4e215 100644
@@ -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);
 
Quoted 3 lines
Quoted 3 lines

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

3. Always do swiotlb_init() in mem_init() and later after PCI init,

if

Quoted 2 lines
Quoted 2 lines

the swiotlb is not needed then free it (swiotlb_free()).

Quoted 11 lines
Quoted 7 lines
Quoted 4 lines

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

Quoted 3 lines

the special kind of devices from others.

-Jia Hongtao.

=20
_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev

#14 lore raw
Quoted 4 lines · 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.

Quoted 155 lines

Thanks.
-Jia Hongtao.

Quoted 151 lines

-----Original Message-----
From: Linuxppc-dev [mailto:linuxppc-dev- [email protected]] On Behalf Of Jia Hongtao- B38951
Sent: Wednesday, June 20, 2012 10:34 AM
To: Bhushan Bharat-R65777; [email protected]; [email protected]; [email protected]
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.

Quoted 9 lines

-----Original Message-----
From: Bhushan Bharat-R65777
Sent: Thursday, June 14, 2012 5:52 PM
To: Jia Hongtao-B38951; [email protected]; [email protected]; [email protected]
Cc: Li Yang-R58472; Wood Scott-B07421
Subject: RE: [PATCH 0/6] Description for PCI patches using platform driver

Quoted 13 lines

Hello Ben, Kumar, others

Please provide your comments/thoughts on this ?

Thanks
-Bharat

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

-----Original Message-----
From: Jia Hongtao-B38951
Sent: Friday, June 08, 2012 3:12 PM
To: [email protected]; [email protected]
Cc: Li Yang-R58472; [email protected]; Wood Scott-

B07421;

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Bhushan Bharat-

Quoted 2 lines

R65777; Jia Hongtao-B38951
Subject: [PATCH 0/6] Description for PCI patches using

platform

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

driver

This series of patches are to unify pci initialization code

and

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line

add PM

support

Quoted 2 lines

for all 85xx/86xx powerpc boards. But two side effects are introduced

by this

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

mechanism which listed below:

1. of_platform_bus_probe() will be called twice but in some cases

duplication

Quoted 3 lines

warning occured. We fix this in [PATCH 5/6].

2. Edac driver failed to register pci nodes as platform

devices.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 1 line

We fix

this

Quoted 1 line
   in [PATCH 6/6].

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

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Thanks
-Bharat

These patches still have the swiotlb init problem if

"ppc_swiotlb_enable" is

Quoted 1 line

only demanded by PCI/PCIe. One of the purposes of sending out

these

Quoted 12 lines
Quoted 5 lines
Quoted 5 lines

patches is

Quoted 1 line

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.

Quoted 3 lines
Quoted 3 lines

So, these patches introduces the issue, that SWIOTLB will not be initialized if requested by pci/pcie. The request is raised by

setting

Quoted 2 lines
Quoted 2 lines

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

Quoted 6 lines
Quoted 1 line
Quoted 1 line

request is raised after mem_init() is called. So request not

handled :).

Quoted 4 lines
Quoted 4 lines

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

Quoted 11 lines
Quoted 5 lines
Quoted 5 lines

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

Quoted 5 lines
Quoted 5 lines

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

Quoted 24 lines
Quoted 18 lines
Quoted 18 lines

in platform code to check memblock_end_of_DRAM() to 0x80000000.

Something like this:

arch/powerpc/platforms/85xx/corenet_ds.c +1 -1
index 1f7028e..ef4e215 100644
@@ -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);
 
Quoted 3 lines
Quoted 3 lines

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

3. Always do swiotlb_init() in mem_init() and later after PCI init,

if

Quoted 2 lines
Quoted 2 lines

the swiotlb is not needed then free it (swiotlb_free()).

Quoted 11 lines
Quoted 7 lines
Quoted 4 lines

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

Quoted 3 lines

the special kind of devices from others.

-Jia Hongtao.

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev

#15 lore raw

PiBNeSBtYWluIGNvbmNlcm4gaXMgdGhhdCBjdXJyZW50bHkgdGhlIFBDSSBjb2RlIGhhcyBzb21l IGFzc3VtcHRpb25zDQo+IGFib3V0IG9yZGVyaW5nIG9mIHRoaW5ncyB0aGF0IHdpbGwgZ2V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5pdCgpIGluIG1lbV9pbml0KCkgYW5kIGxhdGVyIGFmdGVyIFBDSQ0KPiBpbml0LA0KPiA+ID4g PiBpZg0KPiA+ID4gPiA+ID4gdGhlIHN3aW90bGIgaXMgbm90IG5lZWRlZCB0aGVuIGZyZWUgaXQg 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==

#17 lore raw
In reply to Jia Hongtao-B38951
Quoted 36 lines · On 06/10/2012 09:33 PM, Jia Hongtao-B38951 wrote:
Quoted 36 lines

-----Original Message-----
From: Bhushan Bharat-R65777
Sent: Friday, June 08, 2012 6:47 PM
To: Jia Hongtao-B38951; [email protected]; [email protected]
Cc: Li Yang-R58472; [email protected]; Wood Scott-B07421
Subject: RE: [PATCH 0/6] Description for PCI patches using platform driver

Quoted 5 lines

-----Original Message-----
From: Jia Hongtao-B38951
Sent: Friday, June 08, 2012 3:12 PM
To: [email protected]; [email protected]
Cc: Li Yang-R58472; [email protected]; Wood Scott-B07421;

Bhushan Bharat-

Quoted 4 lines

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

Quoted 1 line

for all 85xx/86xx powerpc boards. But two side effects are introduced

by this

Quoted 3 lines

mechanism which listed below:

1. of_platform_bus_probe() will be called twice but in some cases

duplication

Quoted 3 lines

warning occured. We fix this in [PATCH 5/6].

2. Edac driver failed to register pci nodes as platform devices. We fix

this

Quoted 1 line
   in [PATCH 6/6].

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

Quoted 7 lines
Quoted 3 lines

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

#18 lore raw
Quoted 59 lines

-----Original Message-----
From: Wood Scott-B07421
Sent: Monday, June 11, 2012 11:43 PM
To: Jia Hongtao-B38951
Cc: Bhushan Bharat-R65777; [email protected]; [email protected]; Li Yang-R58472; [email protected]; Wood Scott-B07421
Subject: Re: [PATCH 0/6] Description for PCI patches using platform driver
=20

Quoted 10 lines · On 06/10/2012 09:33 PM, Jia Hongtao-B38951 wrote:
Quoted 10 lines

-----Original Message-----
From: Bhushan Bharat-R65777
Sent: Friday, June 08, 2012 6:47 PM
To: Jia Hongtao-B38951; [email protected]; [email protected]
Cc: Li Yang-R58472; [email protected]; Wood Scott-B07421
Subject: RE: [PATCH 0/6] Description for PCI patches using platform driver

Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

-----Original Message-----
From: Jia Hongtao-B38951
Sent: Friday, June 08, 2012 3:12 PM
To: [email protected]; [email protected]
Cc: Li Yang-R58472; [email protected]; Wood Scott-B07421;

Bhushan Bharat-

Quoted 2 lines

R65777; Jia Hongtao-B38951
Subject: [PATCH 0/6] Description for PCI patches using platform

driver

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

This series of patches are to unify pci initialization code and add

PM

Quoted 10 lines
Quoted 10 lines

support

Quoted 1 line

for all 85xx/86xx powerpc boards. But two side effects are introduced

by this

Quoted 3 lines

mechanism which listed below:

1. of_platform_bus_probe() will be called twice but in some cases

duplication

Quoted 3 lines

warning occured. We fix this in [PATCH 5/6].

2. Edac driver failed to register pci nodes as platform devices. We

fix

Quoted 4 lines
Quoted 4 lines

this

Quoted 1 line
   in [PATCH 6/6].

With these patches will not the SWIOTLB will not be initialized even

if

Quoted 7 lines
Quoted 5 lines

PCI/PCIe demanded?

Thanks
-Bharat

These patches still have the swiotlb init problem if

"ppc_swiotlb_enable" is

Quoted 8 lines
Quoted 1 line

only demanded by PCI/PCIe. One of the purposes of sending out these

patches

Quoted 1 line

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.