[PATCH 1/2] powerpc/pci: Add IP revision register define for Freescale PCIe controller

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE5077d

4 messages, 2 authors, 2012-09-12 · open the first message on its own page

[PATCH 1/2] powerpc/pci: Add IP revision register define for Freescale PCIe controller

From: Roy Zang <hidden>
Date: 2012-09-03 08:21:53

Signed-off-by: Roy Zang <redacted>
---
 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

[PATCH 2/2] powerpc/pci: Use PCIe IP block revision register instead of compatible

From: Roy Zang <hidden>
Date: 2012-09-03 08:22:19

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 <redacted>
---

 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

Re: [PATCH 1/2] powerpc/pci: Add IP revision register define for Freescale PCIe controller

From: Kumar Gala <hidden>
Date: 2012-09-12 20:20:27

On Sep 3, 2012, at 4:22 AM, Roy Zang wrote:
Signed-off-by: Roy Zang <redacted>
---
arch/powerpc/sysdev/fsl_pci.h |    5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
applied to next

- k

Re: [PATCH 2/2] powerpc/pci: Use PCIe IP block revision register instead of compatible

From: Kumar Gala <hidden>
Date: 2012-09-12 20:20:35

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 <redacted>
---

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

- k
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help