linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] powerpc/pci: Add IP revision register define for Freescale PCIe controller
@ 2012-09-03  9:22 Roy Zang
  2012-09-03  9:22 ` [PATCH 2/2] powerpc/pci: Use PCIe IP block revision register instead of compatible Roy Zang
  2012-09-12 20:20 ` [PATCH 1/2] powerpc/pci: Add IP revision register define for Freescale PCIe controller Kumar Gala
  0 siblings, 2 replies; 4+ messages in thread
From: Roy Zang @ 2012-09-03  9:22 UTC (permalink / raw)
  To: linuxppc-dev

Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
---
 arch/powerpc/sysdev/fsl_pci.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_pci.h b/arch/powerpc/sysdev/fsl_pci.h
index baa0fd1..7192932 100644
--- a/arch/powerpc/sysdev/fsl_pci.h
+++ b/arch/powerpc/sysdev/fsl_pci.h
@@ -16,6 +16,7 @@
 
 #define PCIE_LTSSM	0x0404		/* PCIE Link Training and Status */
 #define PCIE_LTSSM_L0	0x16		/* L0 state */
+#define PCIE_IP_REV_2_2		0x02080202 /* PCIE IP block version Rev2.2 */
 #define PIWAR_EN		0x80000000	/* Enable */
 #define PIWAR_PF		0x20000000	/* prefetch */
 #define PIWAR_TGI_LOCAL		0x00f00000	/* target - local memory */
@@ -57,7 +58,9 @@ struct ccsr_pci {
 	__be32	pex_pme_mes_disr;	/* 0x.024 - PCIE PME and message disable register */
 	__be32	pex_pme_mes_ier;	/* 0x.028 - PCIE PME and message interrupt enable register */
 	__be32	pex_pmcr;		/* 0x.02c - PCIE power management command register */
-	u8	res3[3024];
+	u8	res3[3016];
+	__be32	block_rev1;	/* 0x.bf8 - PCIE Block Revision register 1 */
+	__be32	block_rev2;	/* 0x.bfc - PCIE Block Revision register 2 */
 
 /* PCI/PCI Express outbound window 0-4
  * Window 0 is the default window and is the only window enabled upon reset.
-- 
1.7.8.1

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

* [PATCH 2/2] powerpc/pci: Use PCIe IP block revision register instead of compatible
  2012-09-03  9:22 [PATCH 1/2] powerpc/pci: Add IP revision register define for Freescale PCIe controller Roy Zang
@ 2012-09-03  9:22 ` Roy Zang
  2012-09-12 20:20   ` Kumar Gala
  2012-09-12 20:20 ` [PATCH 1/2] powerpc/pci: Add IP revision register define for Freescale PCIe controller Kumar Gala
  1 sibling, 1 reply; 4+ messages in thread
From: Roy Zang @ 2012-09-03  9:22 UTC (permalink / raw)
  To: linuxppc-dev

Freescale PCIe IP block revision bigger than rev2.2 will also need
redefine the sequence of inbound windows. So change to use IP block
revision instead of compatible for the judgment.

Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
---

 arch/powerpc/sysdev/fsl_pci.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index a7b2a60..bce48e6 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -143,18 +143,20 @@ static void __init setup_pci_atmu(struct pci_controller *hose,
 	pr_debug("PCI memory map start 0x%016llx, size 0x%016llx\n",
 		 (u64)rsrc->start, (u64)resource_size(rsrc));
 
-	if (of_device_is_compatible(hose->dn, "fsl,qoriq-pcie-v2.2")) {
-		win_idx = 2;
-		start_idx = 0;
-		end_idx = 3;
-	}
-
 	pci = ioremap(rsrc->start, resource_size(rsrc));
 	if (!pci) {
 	    dev_err(hose->parent, "Unable to map ATMU registers\n");
 	    return;
 	}
 
+	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;
+			start_idx = 0;
+			end_idx = 3;
+		}
+	}
+
 	/* Disable all windows (except powar0 since it's ignored) */
 	for(i = 1; i < 5; i++)
 		out_be32(&pci->pow[i].powar, 0);
-- 
1.7.8.1

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

* Re: [PATCH 1/2] powerpc/pci: Add IP revision register define for Freescale PCIe controller
  2012-09-03  9:22 [PATCH 1/2] powerpc/pci: Add IP revision register define for Freescale PCIe controller Roy Zang
  2012-09-03  9:22 ` [PATCH 2/2] powerpc/pci: Use PCIe IP block revision register instead of compatible Roy Zang
@ 2012-09-12 20:20 ` Kumar Gala
  1 sibling, 0 replies; 4+ messages in thread
From: Kumar Gala @ 2012-09-12 20:20 UTC (permalink / raw)
  To: Roy Zang; +Cc: linuxppc-dev


On Sep 3, 2012, at 4:22 AM, Roy Zang wrote:

> Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
> ---
> arch/powerpc/sysdev/fsl_pci.h |    5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)

applied to next

- k

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

* Re: [PATCH 2/2] powerpc/pci: Use PCIe IP block revision register instead of compatible
  2012-09-03  9:22 ` [PATCH 2/2] powerpc/pci: Use PCIe IP block revision register instead of compatible Roy Zang
@ 2012-09-12 20:20   ` Kumar Gala
  0 siblings, 0 replies; 4+ messages in thread
From: Kumar Gala @ 2012-09-12 20:20 UTC (permalink / raw)
  To: Roy Zang; +Cc: linuxppc-dev


On Sep 3, 2012, at 4:22 AM, Roy Zang wrote:

> Freescale PCIe IP block revision bigger than rev2.2 will also need
> redefine the sequence of inbound windows. So change to use IP block
> revision instead of compatible for the judgment.
> 
> Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
> ---
> 
> arch/powerpc/sysdev/fsl_pci.c |   14 ++++++++------
> 1 files changed, 8 insertions(+), 6 deletions(-)

applied to next

- k

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

end of thread, other threads:[~2012-09-12 20:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-03  9:22 [PATCH 1/2] powerpc/pci: Add IP revision register define for Freescale PCIe controller Roy Zang
2012-09-03  9:22 ` [PATCH 2/2] powerpc/pci: Use PCIe IP block revision register instead of compatible Roy Zang
2012-09-12 20:20   ` Kumar Gala
2012-09-12 20:20 ` [PATCH 1/2] powerpc/pci: Add IP revision register define for Freescale PCIe controller Kumar Gala

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