linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3 1/2] powerpc/fsl: Add PCI node in device tree of bsc9132qds
@ 2015-11-05  2:52 Zhiqiang Hou
  2015-11-05  2:52 ` [PATCH V3 2/2] powerpc/85xx: Add PCIe controller support for bsc9132qds Zhiqiang Hou
  2015-11-05  3:09 ` [PATCH V3 1/2] powerpc/fsl: Add PCI node in device tree of bsc9132qds Scott Wood
  0 siblings, 2 replies; 4+ messages in thread
From: Zhiqiang Hou @ 2015-11-05  2:52 UTC (permalink / raw)
  To: linuxppc-dev, scottwood, galak, benh, paulus, mpe, devicetree,
	robh+dt, pawel.moll, mark.rutland, ijc+devicetree, harninder.rai
  Cc: Minghuan.Lian, Mingkai.Hu, Hou Zhiqiang

From: Harninder Rai <harninder.rai@freescale.com>

Signed-off-by: Harninder Rai <harninder.rai@freescale.com>
Signed-off-by: Minghuan Lian <Minghuan.Lian@freescale.com>
Reviewed-by: Zang Tiefei-R61911 <tie-fei.zang@freescale.com>
Reviewed-by: Kushwaha Prabhakar-B32579 <prabhakar@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Signed-off-by: Hou Zhiqiang <B48286@freescale.com>
---
V3:
 - Remove gerrit stuff.
V2:
 - Remove property clock-frequency.

 arch/powerpc/boot/dts/bsc9132qds.dts          | 15 ++++++++++++++
 arch/powerpc/boot/dts/fsl/bsc9132si-post.dtsi | 28 +++++++++++++++++++++++++++
 arch/powerpc/boot/dts/fsl/bsc9132si-pre.dtsi  |  1 +
 3 files changed, 44 insertions(+)

diff --git a/arch/powerpc/boot/dts/bsc9132qds.dts b/arch/powerpc/boot/dts/bsc9132qds.dts
index 6cab106..940d719 100644
--- a/arch/powerpc/boot/dts/bsc9132qds.dts
+++ b/arch/powerpc/boot/dts/bsc9132qds.dts
@@ -29,6 +29,21 @@
 	soc: soc@ff700000 {
 		ranges = <0x0 0x0 0xff700000 0x100000>;
 	};
+
+	pci0: pcie@ff70a000 {
+		reg = <0 0xff70a000 0 0x1000>;
+		ranges = <0x2000000 0x0 0x90000000 0 0x90000000 0x0 0x20000000
+			  0x1000000 0x0 0x00000000 0 0xc0010000 0x0 0x10000>;
+		pcie@0 {
+			ranges = <0x2000000 0x0 0x90000000
+				  0x2000000 0x0 0x90000000
+				  0x0 0x20000000
+
+				  0x1000000 0x0 0x0
+				  0x1000000 0x0 0x0
+				  0x0 0x100000>;
+		};
+	};
 };
 
 /include/ "bsc9132qds.dtsi"
diff --git a/arch/powerpc/boot/dts/fsl/bsc9132si-post.dtsi b/arch/powerpc/boot/dts/fsl/bsc9132si-post.dtsi
index c723071..b5f0715 100644
--- a/arch/powerpc/boot/dts/fsl/bsc9132si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/bsc9132si-post.dtsi
@@ -40,6 +40,34 @@
 	interrupts = <16 2 0 0 20 2 0 0>;
 };
 
+/* controller at 0xa000 */
+&pci0 {
+	compatible = "fsl,bsc9132-pcie", "fsl,qoriq-pcie-v2.2";
+	device_type = "pci";
+	#size-cells = <2>;
+	#address-cells = <3>;
+	bus-range = <0 255>;
+	interrupts = <16 2 0 0>;
+
+	pcie@0 {
+		reg = <0 0 0 0 0>;
+		#interrupt-cells = <1>;
+		#size-cells = <2>;
+		#address-cells = <3>;
+		device_type = "pci";
+		interrupts = <16 2 0 0>;
+		interrupt-map-mask = <0xf800 0 0 7>;
+
+		interrupt-map = <
+			/* IDSEL 0x0 */
+			0000 0x0 0x0 0x1 &mpic 0x0 0x2 0x0 0x0
+			0000 0x0 0x0 0x2 &mpic 0x1 0x2 0x0 0x0
+			0000 0x0 0x0 0x3 &mpic 0x2 0x2 0x0 0x0
+			0000 0x0 0x0 0x4 &mpic 0x3 0x2 0x0 0x0
+			>;
+	};
+};
+
 &soc {
 	#address-cells = <1>;
 	#size-cells = <1>;
diff --git a/arch/powerpc/boot/dts/fsl/bsc9132si-pre.dtsi b/arch/powerpc/boot/dts/fsl/bsc9132si-pre.dtsi
index 301a9db..90f7949 100644
--- a/arch/powerpc/boot/dts/fsl/bsc9132si-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/bsc9132si-pre.dtsi
@@ -45,6 +45,7 @@
 		serial0 = &serial0;
 		ethernet0 = &enet0;
 		ethernet1 = &enet1;
+		pci0 = &pci0;
 	};
 
 	cpus {
-- 
2.1.0.27.g96db324

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

* [PATCH V3 2/2] powerpc/85xx: Add PCIe controller support for bsc9132qds
  2015-11-05  2:52 [PATCH V3 1/2] powerpc/fsl: Add PCI node in device tree of bsc9132qds Zhiqiang Hou
@ 2015-11-05  2:52 ` Zhiqiang Hou
  2015-11-05  3:09 ` [PATCH V3 1/2] powerpc/fsl: Add PCI node in device tree of bsc9132qds Scott Wood
  1 sibling, 0 replies; 4+ messages in thread
From: Zhiqiang Hou @ 2015-11-05  2:52 UTC (permalink / raw)
  To: linuxppc-dev, scottwood, galak, benh, paulus, mpe, devicetree,
	robh+dt, pawel.moll, mark.rutland, ijc+devicetree, harninder.rai
  Cc: Minghuan.Lian, Mingkai.Hu, Hou Zhiqiang

From: Harninder Rai <harninder.rai@freescale.com>

1. Use machine_arch_initcall to hook mpc85xx_common_publish_devices
This can ensure before pcibios_init() is called, pci controllers have
been probed and added to the hose_list.
2. Add a workaround for errata A-005434
For the BSC9132, PEX_PEXIWARn[TRGT] for all windows defaults to 0xF,
which is mapped to CCSRBAR. However, for other products, 0xF is
mapped to the local memory. Therefore, for the BSC9132, any default
PCI Express access to the local memory (DDR) will now access the
CCSRBAR. This patch changes the mapping of targets of inbound windows
PEX_PEXIWARn[TRGT] to the Local address space – 0x0 (from 0xF).

Signed-off-by: Harninder Rai <harninder.rai@freescale.com>
Signed-off-by: Minghuan Lian <Minghuan.Lian@freescale.com>
Reviewed-by: Zang Tiefei-R61911 <tie-fei.zang@freescale.com>
Reviewed-by: Kushwaha Prabhakar-B32579 <prabhakar@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Signed-off-by: Hou Zhiqiang <B48286@freescale.com>
---
V3:
 - Remove gerrit stuff.

 arch/powerpc/platforms/85xx/bsc913x_qds.c |  8 +++++++-
 arch/powerpc/sysdev/fsl_pci.c             | 13 +++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/85xx/bsc913x_qds.c b/arch/powerpc/platforms/85xx/bsc913x_qds.c
index f0927e5..dcfafd6 100644
--- a/arch/powerpc/platforms/85xx/bsc913x_qds.c
+++ b/arch/powerpc/platforms/85xx/bsc913x_qds.c
@@ -17,6 +17,7 @@
 #include <linux/pci.h>
 #include <asm/mpic.h>
 #include <sysdev/fsl_soc.h>
+#include <sysdev/fsl_pci.h>
 #include <asm/udbg.h>
 
 #include "mpc85xx.h"
@@ -46,10 +47,12 @@ static void __init bsc913x_qds_setup_arch(void)
 	mpc85xx_smp_init();
 #endif
 
+	fsl_pci_assign_primary();
+
 	pr_info("bsc913x board from Freescale Semiconductor\n");
 }
 
-machine_device_initcall(bsc9132_qds, mpc85xx_common_publish_devices);
+machine_arch_initcall(bsc9132_qds, mpc85xx_common_publish_devices);
 
 /*
  * Called very early, device-tree isn't unflattened
@@ -67,6 +70,9 @@ define_machine(bsc9132_qds) {
 	.probe			= bsc9132_qds_probe,
 	.setup_arch		= bsc913x_qds_setup_arch,
 	.init_IRQ		= bsc913x_qds_pic_init,
+#ifdef CONFIG_PCI
+	.pcibios_fixup_bus	= fsl_pcibios_fixup_bus,
+#endif
 	.get_irq		= mpic_get_irq,
 	.restart		= fsl_rstcr_restart,
 	.calibrate_decr		= generic_calibrate_decr,
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index ebc1f412..b8607f6 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -193,6 +193,19 @@ static void setup_pci_atmu(struct pci_controller *hose)
 	const u64 *reg;
 	int len;
 
+	if (of_device_is_compatible(hose->dn, "fsl,bsc9132-pcie")) {
+		/*
+		 * BSC9132 Rev1.0 has an issue where all the PEX inbound
+		 * windows have implemented the default target value as 0xf
+		 * for CCSR space.In all Freescale legacy devices the target
+		 * of 0xf is reserved for local memory space. 9132 Rev1.0
+		 * now has local mempry space mapped to target 0x0 instead of
+		 * 0xf. Hence adding a workaround to remove the target 0xf
+		 * defined for memory space from Inbound window attributes.
+		 */
+		piwar &= ~PIWAR_TGI_LOCAL;
+	}
+
 	if (early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP)) {
 		if (in_be32(&pci->block_rev1) >= PCIE_IP_REV_2_2) {
 			win_idx = 2;
-- 
2.1.0.27.g96db324

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

* Re: [PATCH V3 1/2] powerpc/fsl: Add PCI node in device tree of bsc9132qds
  2015-11-05  2:52 [PATCH V3 1/2] powerpc/fsl: Add PCI node in device tree of bsc9132qds Zhiqiang Hou
  2015-11-05  2:52 ` [PATCH V3 2/2] powerpc/85xx: Add PCIe controller support for bsc9132qds Zhiqiang Hou
@ 2015-11-05  3:09 ` Scott Wood
  2015-11-05  3:16   ` Hou Zhiqiang
  1 sibling, 1 reply; 4+ messages in thread
From: Scott Wood @ 2015-11-05  3:09 UTC (permalink / raw)
  To: Zhiqiang Hou
  Cc: linuxppc-dev, galak, benh, paulus, mpe, devicetree, robh+dt,
	pawel.moll, mark.rutland, ijc+devicetree, harninder.rai,
	Minghuan.Lian, Mingkai.Hu, Hou Zhiqiang

On Thu, 2015-11-05 at 10:52 +0800, Zhiqiang Hou wrote:
> From: Harninder Rai <harninder.rai@freescale.com>
> 
> Signed-off-by: Harninder Rai <harninder.rai@freescale.com>
> Signed-off-by: Minghuan Lian <Minghuan.Lian@freescale.com>
> Reviewed-by: Zang Tiefei-R61911 <tie-fei.zang@freescale.com>
> Reviewed-by: Kushwaha Prabhakar-B32579 <prabhakar@freescale.com>
> Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
> Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
> Signed-off-by: Hou Zhiqiang <B48286@freescale.com>
> ---
> V3:
>  - Remove gerrit stuff.

No, you didn't remove all of the Gerrit stuff.  Get rid of all the Reviewed-
by and Tested-by since they are not relevant to this context.  Hitting "+1" 
in Gerrit to allow a patch to go into the SDK tree a few years ago is not the 
same as reviewing it for inclusion in mainline Linux today.

-Scott

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

* RE: [PATCH V3 1/2] powerpc/fsl: Add PCI node in device tree of bsc9132qds
  2015-11-05  3:09 ` [PATCH V3 1/2] powerpc/fsl: Add PCI node in device tree of bsc9132qds Scott Wood
@ 2015-11-05  3:16   ` Hou Zhiqiang
  0 siblings, 0 replies; 4+ messages in thread
From: Hou Zhiqiang @ 2015-11-05  3:16 UTC (permalink / raw)
  To: Scott Wood, Zhiqiang Hou
  Cc: linuxppc-dev@lists.ozlabs.org, galak@kernel.crashing.org,
	benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au,
	devicetree@vger.kernel.org, robh+dt@kernel.org,
	pawel.moll@arm.com, mark.rutland@arm.com,
	ijc+devicetree@hellion.org.uk, Harninder Rai, Lian M.H.,
	Hu Vincent

DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogV29vZCBTY290dC1CMDc0
MjENCj4gU2VudDogMjAxNeW5tDEx5pyINeaXpSAxMTowOQ0KPiBUbzogWmhpcWlhbmcgSG91DQo+
IENjOiBsaW51eHBwYy1kZXZAbGlzdHMub3psYWJzLm9yZzsgZ2FsYWtAa2VybmVsLmNyYXNoaW5n
Lm9yZzsNCj4gYmVuaEBrZXJuZWwuY3Jhc2hpbmcub3JnOyBwYXVsdXNAc2FtYmEub3JnOyBtcGVA
ZWxsZXJtYW4uaWQuYX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5k
cmV3LUFGTEVNSU5HIDxBRkxFTUlOR0BmcmVlc2NhbGUuY29tPg0KPiA+IFNpZ25lZC1vZmYtYnk6
IEhvdSBaaGlxaWFuZyA8QjQ4Mjg2QGZyZWVzY2FsZS5jb20+DQo+ID4gLS0tDQo+ID4gVjM6DQo+
ID4gIC0gUmVtb3ZlIGdlcnJpdCBzdHVmZi4NCj4gDQo+IE5vLCB5b3UgZGlkbid0IHJlbW92ZSBh
bGwgb2YgdGhlIEdlcnJpdCBzdHVmZi4gIEdldCByaWQgb2YgYWxsIHRoZQ0KPiBSZXZpZXdlZC0g
YnkgYW5kIFRlc3RlZC1ieSBzaW5jZSB0aGV5IGFyZSBub3QgcmVsZXZhbnQgdG8gdGhpcyBjb250
ZXh0Lg0KPiBIaXR0aW5nICIrMSINCj4gaW4gR2Vycml0IHRvIGFsbG93IGEgcGF0Y2ggdG8gZ28g
aW50byB0aGUgU0RLIHRyZWUgYSBmZXcgeWVhcnMgYWdvIGlzIG5vdA0KPiB0aGUgc2FtZSBhcyBy
ZXZpZXdpbmcgaXQgZm9yIGluY2x1c2lvbiBpbiBtYWlubGluZSBMaW51eCB0b2RheS4NCiANCk9r
LCB0aGFua3MuDQoNClpoaXFpYW5nDQo=

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

end of thread, other threads:[~2015-11-05  3:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-05  2:52 [PATCH V3 1/2] powerpc/fsl: Add PCI node in device tree of bsc9132qds Zhiqiang Hou
2015-11-05  2:52 ` [PATCH V3 2/2] powerpc/85xx: Add PCIe controller support for bsc9132qds Zhiqiang Hou
2015-11-05  3:09 ` [PATCH V3 1/2] powerpc/fsl: Add PCI node in device tree of bsc9132qds Scott Wood
2015-11-05  3:16   ` Hou Zhiqiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).