powerpc/fsl_pci: Size upper inbound window based on RAM size
authorScott Wood <oss@buserror.net>
Fri, 26 Aug 2016 06:38:25 +0000 (01:38 -0500)
committerScott Wood <oss@buserror.net>
Sun, 25 Sep 2016 07:38:54 +0000 (02:38 -0500)
commit63f1de882081919f2b548d04b6cf617398b8da12
tree733c1382660c8c339d0cd65d508529be53602653
parent834e5a692120cc25c3935e8652a1989c2bc1c9e9
powerpc/fsl_pci: Size upper inbound window based on RAM size

This allows PCI devices that can only address (e.g.) 36 or 40 bit DMA to
use direct DMA, at the cost of not being able to DMA to non-RAM addresses
(this doesn't affect MSIs as there is a separate dedicated window for
that) which we wouldn't have been able to do anyway if the RAM size didn't
trigger the creation of the second inbound window.

It also fixes an off-by-one error that set dma_direct_ops on PCI devices
whose dma mask could address all the space below the DMA offset
(previously 40 bits), but not the window that starts at the DMA offset.

Signed-off-by: Scott Wood <oss@buserror.net>
Cc: Tillmann Heidsieck <theidsieck@leenox.de>
Tested-by: Tillmann Heidsieck <theidsieck@leenox.de>
arch/powerpc/sysdev/fsl_pci.c