diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-09-18 16:04:33 +1000 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-09-18 16:04:33 +1000 |
commit | caa1d631fc99940f866480c2bb88a6f5a235e7a2 (patch) | |
tree | d09d648dbccaa7bf23deb336e8cf52acbc360b8d /arch/powerpc/kernel/dma-swiotlb.c | |
parent | 1e38b7140185e384da216aff66a711df09b5afc9 (diff) | |
parent | 905e75c46dba5f3061049277e4eb7110beedba43 (diff) |
Merge remote-tracking branch 'kumar/next' into next
Diffstat (limited to 'arch/powerpc/kernel/dma-swiotlb.c')
-rw-r--r-- | arch/powerpc/kernel/dma-swiotlb.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/dma-swiotlb.c b/arch/powerpc/kernel/dma-swiotlb.c index a720b54b971..bd1a2aba599 100644 --- a/arch/powerpc/kernel/dma-swiotlb.c +++ b/arch/powerpc/kernel/dma-swiotlb.c @@ -105,3 +105,23 @@ int __init swiotlb_setup_bus_notifier(void) &ppc_swiotlb_plat_bus_notifier); return 0; } + +void swiotlb_detect_4g(void) +{ + if ((memblock_end_of_DRAM() - 1) > 0xffffffff) + ppc_swiotlb_enable = 1; +} + +static int __init swiotlb_late_init(void) +{ + if (ppc_swiotlb_enable) { + swiotlb_print_info(); + set_pci_dma_ops(&swiotlb_dma_ops); + ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; + } else { + swiotlb_free(); + } + + return 0; +} +subsys_initcall(swiotlb_late_init); |