All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][v2] powerpc/pci: Fix IMMRBAR address
@ 2014-01-20 10:54 Minghuan Lian
  2014-01-20 15:39 ` Roy Zang
  0 siblings, 1 reply; 2+ messages in thread
From: Minghuan Lian @ 2014-01-20 10:54 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Scott Wood, Minghuan Lian, Zang Roy-R61911

For PEXCSRBAR, bit 3-0 indicate prefetchable and address type.
So when getting base address, these bits should be masked,
otherwise we may get incorrect base address.

Signed-off-by: Minghuan Lian <Minghuan.Lian@freescale.com>
---
Change log:
v2:
Use PCI_BASE_ADDRESS_MEM_MASK instead of 0xfffffff0

 arch/powerpc/sysdev/fsl_pci.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 4dfd61d..252716d 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -868,6 +868,14 @@ u64 fsl_pci_immrbar_base(struct pci_controller *hose)
 
 		pci_bus_read_config_dword(hose->bus,
 			PCI_DEVFN(0, 0), PCI_BASE_ADDRESS_0, &base);
+
+		/*
+		 * For PEXCSRBAR, bit 3-0 indicate prefetchable and
+		 * address type. So when getting base address, these
+		 * bits should be masked
+		 */
+		base &= PCI_BASE_ADDRESS_MEM_MASK;
+
 		return base;
 	}
 #endif
-- 
1.8.1.2

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

* RE: [PATCH][v2] powerpc/pci: Fix IMMRBAR address
  2014-01-20 10:54 [PATCH][v2] powerpc/pci: Fix IMMRBAR address Minghuan Lian
@ 2014-01-20 15:39 ` Roy Zang
  0 siblings, 0 replies; 2+ messages in thread
From: Roy Zang @ 2014-01-20 15:39 UTC (permalink / raw)
  To: Minghuan.Lian, linuxppc-dev; +Cc: Scott Wood, Minghuan.Lian



> -----Original Message-----
> From: Minghuan Lian [mailto:Minghuan.Lian@freescale.com]
> Sent: Monday, January 20, 2014 4:54 AM
> To: linuxppc-dev@lists.ozlabs.org
> Cc: Zang Roy-R61911; Wood Scott-B07421; Kumar Gala; Lian Minghuan-B31939
> Subject: [PATCH][v2] powerpc/pci: Fix IMMRBAR address
>=20
> For PEXCSRBAR, bit 3-0 indicate prefetchable and address type.
> So when getting base address, these bits should be masked,
> otherwise we may get incorrect base address.
>=20
> Signed-off-by: Minghuan Lian <Minghuan.Lian@freescale.com>
Acked.
Roy

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

end of thread, other threads:[~2014-01-20 15:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-20 10:54 [PATCH][v2] powerpc/pci: Fix IMMRBAR address Minghuan Lian
2014-01-20 15:39 ` Roy Zang

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