aboutsummaryrefslogtreecommitdiff
path: root/drivers/pci/fsl_pci_init.c
diff options
context:
space:
mode:
authorBecky Bruce <becky.bruce@freescale.com>2008-11-21 19:24:22 -0600
committerAndrew Fleming-AFLEMING <afleming@freescale.com>2008-12-03 22:48:50 -0600
commit35db1c6d34b57ae15e99cf03c8e8f8a6148d74f3 (patch)
tree1e353701305b54aea14b29f37e2fcf2f5b91025d /drivers/pci/fsl_pci_init.c
parent5a105a333dab6a23e92d763ce76d6f31d57f45df (diff)
drivers/fsl_pci_init: Fix inbound window mapping bug
The current code will cause the creation of a 4GB window starting at 0 if we have more than 4GB of RAM installed, which overlaps with PCI_MEM space and causes pci_bus_to_phys() to return erroneous information. Limit the size to 4GB - 1; which causes the code to create one 2GB and one 1GB window instead. Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org> Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Andy Fleming <afleming@freescale.com>
Diffstat (limited to 'drivers/pci/fsl_pci_init.c')
-rw-r--r--drivers/pci/fsl_pci_init.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/fsl_pci_init.c b/drivers/pci/fsl_pci_init.c
index 7625cccec..e57acba0d 100644
--- a/drivers/pci/fsl_pci_init.c
+++ b/drivers/pci/fsl_pci_init.c
@@ -58,7 +58,7 @@ void pciauto_config_init(struct pci_controller *hose);
int fsl_pci_setup_inbound_windows(struct pci_region *r)
{
struct pci_region *rgn_base = r;
- u64 sz = min((u64)gd->ram_size, 1ull << 32);
+ u64 sz = min((u64)gd->ram_size, (1ull << 32) - 1);
phys_addr_t phys_start = CONFIG_SYS_PCI_MEMORY_PHYS;
pci_addr_t bus_start = CONFIG_SYS_PCI_MEMORY_BUS;