]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
dma: mv_xor: clear the window override control registers
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Thu, 22 Nov 2012 17:16:37 +0000 (18:16 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Thu, 22 Nov 2012 17:16:37 +0000 (18:16 +0100)
The XOR channels on Marvell SoCs have a Window Override Control
register that allow to do some fancy things with addresses. Those
features are not used by the driver, but some U-Boot versions anyway
modify those registers.

For some reason, the U-Boot on OpenBlocks AX3-4 was setting an invalid
value in those registers when the addition 2 GB DRAM chip was plugged
into the board, causing the XOR driver to fail in using the XOR
engines.

By setting those registers to 0 during the driver initialization, we
ensure that the registers are configured according with the driver
operation model.

Thanks to Lior Amsalem <alior@marvell.com> for his help in debugging
this problem.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
drivers/dma/mv_xor.c
drivers/dma/mv_xor.h

index f450fe8cbd6136729c25658c48b52c96068d0c9b..2c69b89eac4f41029160e2224d4a9140bcc6667c 100644 (file)
@@ -1240,6 +1240,8 @@ mv_xor_conf_mbus_windows(struct mv_xor_device *xordev,
 
        writel(win_enable, base + WINDOW_BAR_ENABLE(0));
        writel(win_enable, base + WINDOW_BAR_ENABLE(1));
+       writel(0, base + WINDOW_OVERRIDE_CTRL(0));
+       writel(0, base + WINDOW_OVERRIDE_CTRL(1));
 }
 
 static int __devinit mv_xor_probe(struct platform_device *pdev)
index 17043287b71af5fa56e87236d33bb1053fd54abf..c632a4761fcff9836e6fbe9e59f90fa1f9080399 100644 (file)
@@ -53,6 +53,7 @@
 #define WINDOW_SIZE(w)         (0x270 + ((w) << 2))
 #define WINDOW_REMAP_HIGH(w)   (0x290 + ((w) << 2))
 #define WINDOW_BAR_ENABLE(chan)        (0x240 + ((chan) << 2))
+#define WINDOW_OVERRIDE_CTRL(chan)     (0x2A0 + ((chan) << 2))
 
 struct mv_xor_device {
        void __iomem         *xor_base;