aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2014-08-08 19:40:45 -0400
committerScott Wood <scottwood@freescale.com>2014-09-03 18:58:22 -0400
commit84f44cc56c0994df7778bde55c8d5e9aa9fff8f5 (patch)
treec757d5564181fc2092e59fbb025cfb93eb86393d
parentcf5621032fbe7354c0c3fff17958b7029bbc9f30 (diff)
powerpc/fsl-pci: Limit ZONE_DMA32 to 2GiB on 64-bit platforms
FSL PCI cannot directly address the whole lower 4 GiB due to conflicts with PCICSRBAR and outbound windows. By the time max_direct_dma_addr is set to the precise limit, it will be too late to alter the zone limits, but we should always have at least 2 GiB mapped (unless RAM is smaller than that). Signed-off-by: Scott Wood <scottwood@freescale.com> Cc: Shaohui Xie <Shaohui.Xie@freescale.com>
-rw-r--r--arch/powerpc/platforms/85xx/corenet_generic.c11
-rw-r--r--arch/powerpc/platforms/85xx/qemu_e500.c10
2 files changed, 21 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c b/arch/powerpc/platforms/85xx/corenet_generic.c
index d22dd85e50bf..c2adb00228c5 100644
--- a/arch/powerpc/platforms/85xx/corenet_generic.c
+++ b/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -20,6 +20,7 @@
20#include <asm/time.h> 20#include <asm/time.h>
21#include <asm/machdep.h> 21#include <asm/machdep.h>
22#include <asm/pci-bridge.h> 22#include <asm/pci-bridge.h>
23#include <asm/pgtable.h>
23#include <asm/ppc-pci.h> 24#include <asm/ppc-pci.h>
24#include <mm/mmu_decl.h> 25#include <mm/mmu_decl.h>
25#include <asm/prom.h> 26#include <asm/prom.h>
@@ -67,6 +68,16 @@ void __init corenet_gen_setup_arch(void)
67 68
68 swiotlb_detect_4g(); 69 swiotlb_detect_4g();
69 70
71#if defined(CONFIG_FSL_PCI) && defined(CONFIG_ZONE_DMA32)
72 /*
73 * Inbound windows don't cover the full lower 4 GiB
74 * due to conflicts with PCICSRBAR and outbound windows,
75 * so limit the DMA32 zone to 2 GiB, to allow consistent
76 * allocations to succeed.
77 */
78 limit_zone_pfn(ZONE_DMA32, 1UL << (31 - PAGE_SHIFT));
79#endif
80
70 pr_info("%s board\n", ppc_md.name); 81 pr_info("%s board\n", ppc_md.name);
71 82
72 mpc85xx_qe_init(); 83 mpc85xx_qe_init();
diff --git a/arch/powerpc/platforms/85xx/qemu_e500.c b/arch/powerpc/platforms/85xx/qemu_e500.c
index 7f2673293549..8ad2fe6f200a 100644
--- a/arch/powerpc/platforms/85xx/qemu_e500.c
+++ b/arch/powerpc/platforms/85xx/qemu_e500.c
@@ -18,6 +18,7 @@
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/of_fdt.h> 19#include <linux/of_fdt.h>
20#include <asm/machdep.h> 20#include <asm/machdep.h>
21#include <asm/pgtable.h>
21#include <asm/time.h> 22#include <asm/time.h>
22#include <asm/udbg.h> 23#include <asm/udbg.h>
23#include <asm/mpic.h> 24#include <asm/mpic.h>
@@ -44,6 +45,15 @@ static void __init qemu_e500_setup_arch(void)
44 45
45 fsl_pci_assign_primary(); 46 fsl_pci_assign_primary();
46 swiotlb_detect_4g(); 47 swiotlb_detect_4g();
48#if defined(CONFIG_FSL_PCI) && defined(CONFIG_ZONE_DMA32)
49 /*
50 * Inbound windows don't cover the full lower 4 GiB
51 * due to conflicts with PCICSRBAR and outbound windows,
52 * so limit the DMA32 zone to 2 GiB, to allow consistent
53 * allocations to succeed.
54 */
55 limit_zone_pfn(ZONE_DMA32, 1UL << (31 - PAGE_SHIFT));
56#endif
47 mpc85xx_smp_init(); 57 mpc85xx_smp_init();
48} 58}
49 59