]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
bus: mvebu-mbus: make sure SDRAM CS for DMA don't overlap the MBus bridge window
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Fri, 9 Jan 2015 16:59:04 +0000 (10:59 -0600)
committerAndrew Lunn <andrew@lunn.ch>
Mon, 19 Jan 2015 22:09:16 +0000 (16:09 -0600)
commit1737cac6936938a9bc52c03c4a3ff2032c702fa5
tree7b9fe5e057ca940bab429cd17eaf9a1173494828
parent7fdf3d8a0316ce31f87513f903addcb8f3b0dfb2
bus: mvebu-mbus: make sure SDRAM CS for DMA don't overlap the MBus bridge window

The mvebu-mbus driver reads the SDRAM window registers, and make the
information about the DRAM CS configuration available to device
drivers using the mv_mbus_dram_info() API. This information is used by
the DMA-capable device drivers to program their address decoding
windows.

Until now, we were basically providing the SDRAM window register
details as is. However, it turns out that the DMA capability of the
CESA cryptographic engine consists in doing DMA being the DRAM and the
crypto SRAM mapped as a MBus window. For this case, it is very
important that the SDRAM CS information does not overlap with the MBus
bridge window.

Therefore, this commit improves the mvebu-mbus driver to make sure we
adjust the SDRAM CS information so that it doesn't overlap with the
MBus bridge window. This problem was reported by Boris Brezillon,
while working on the mv_cesa driver for Armada 37x/38x/XP. We use the
memblock memory information to know where the usable RAM is located,
as this information is guaranteed to be correct on all SoC variants.

We could have used the MBus bridge window registers on Armada 370/XP,
but they are not really used on Armada 375/38x (Cortex-A9 based),
since the PL310 L2 filtering is used instead to discriminate between
RAM accesses and I/O accesses. Therefore, using the memblock
information is more generic and works accross the different platforms.

Reported-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[Andrew Lunn <andrew@lunn.ch>: Fixed merge conflict]
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
drivers/bus/mvebu-mbus.c