From f19244cb82bf4c607465027e1cc7118ded40d10e Mon Sep 17 00:00:00 2001 From: Minghuan Lian Date: Thu, 16 Jan 2014 12:51:46 +0800 Subject: powerpc/pci: Fix IMMRBAR address For PEXCSRBAR, bits 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 Change-Id: I03ca7c1201cf0de1042173488e9e8dd4c48faf6e Reviewed-on: http://git.am.freescale.net:8181/9818 Tested-by: Review Code-CDREVIEW Reviewed-by: Tiefei Zang Reviewed-by: Jose Rivera diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index 65f38fc..c6581f1 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c @@ -929,6 +929,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, bits 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 -- cgit v0.10.2