aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Schichan <nschichan@freebox.fr>2015-05-28 04:40:12 -0400
committerGregory CLEMENT <gregory.clement@free-electrons.com>2015-05-28 05:14:19 -0400
commit8c9e06e64768665503e778088a39ecff3a6f2e0c (patch)
tree13b3c7667ec22cda21b276891222caf6bafb80b8
parent2ff9ab4c7b6d17c82a01e3449173465cf742e897 (diff)
bus: mvebu-mbus: do not set WIN_CTRL_SYNCBARRIER on non io-coherent platforms.
Commit a0b5cd4ac2d6 ("bus: mvebu-mbus: use automatic I/O synchronization barriers") enabled the usage of automatic I/O synchronization barriers by enabling bit WIN_CTRL_SYNCBARRIER in the control registers of MBus windows, but on non io-coherent platforms (orion5x, kirkwood and dove) the WIN_CTRL_SYNCBARRIER bit in the window control register is either reserved (all windows except 6 and 7) or enables read-only protection (windows 6 and 7). Signed-off-by: Nicolas Schichan <nschichan@freebox.fr> Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: <stable@vger.kernel.org> # v4.0+ Fixes: a0b5cd4ac2d6 ("bus: mvebu-mbus: use automatic I/O synchronization barriers") Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
-rw-r--r--drivers/bus/mvebu-mbus.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
index fb9ec6221730..7fa4510dfbe4 100644
--- a/drivers/bus/mvebu-mbus.c
+++ b/drivers/bus/mvebu-mbus.c
@@ -70,6 +70,7 @@
70 */ 70 */
71#define WIN_CTRL_OFF 0x0000 71#define WIN_CTRL_OFF 0x0000
72#define WIN_CTRL_ENABLE BIT(0) 72#define WIN_CTRL_ENABLE BIT(0)
73/* Only on HW I/O coherency capable platforms */
73#define WIN_CTRL_SYNCBARRIER BIT(1) 74#define WIN_CTRL_SYNCBARRIER BIT(1)
74#define WIN_CTRL_TGT_MASK 0xf0 75#define WIN_CTRL_TGT_MASK 0xf0
75#define WIN_CTRL_TGT_SHIFT 4 76#define WIN_CTRL_TGT_SHIFT 4
@@ -323,8 +324,9 @@ static int mvebu_mbus_setup_window(struct mvebu_mbus_state *mbus,
323 ctrl = ((size - 1) & WIN_CTRL_SIZE_MASK) | 324 ctrl = ((size - 1) & WIN_CTRL_SIZE_MASK) |
324 (attr << WIN_CTRL_ATTR_SHIFT) | 325 (attr << WIN_CTRL_ATTR_SHIFT) |
325 (target << WIN_CTRL_TGT_SHIFT) | 326 (target << WIN_CTRL_TGT_SHIFT) |
326 WIN_CTRL_SYNCBARRIER |
327 WIN_CTRL_ENABLE; 327 WIN_CTRL_ENABLE;
328 if (mbus->hw_io_coherency)
329 ctrl |= WIN_CTRL_SYNCBARRIER;
328 330
329 writel(base & WIN_BASE_LOW, addr + WIN_BASE_OFF); 331 writel(base & WIN_BASE_LOW, addr + WIN_BASE_OFF);
330 writel(ctrl, addr + WIN_CTRL_OFF); 332 writel(ctrl, addr + WIN_CTRL_OFF);