aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bus/mvebu-mbus.c
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2015-01-18 10:46:10 -0500
committerAndrew Lunn <andrew@lunn.ch>2015-01-19 16:40:53 -0500
commit38bdf45f4aa5cb6186d50a29e6cbbd9d486a1519 (patch)
treea395aee611aedffb8de17a9451f0d9f570664b31 /drivers/bus/mvebu-mbus.c
parent8f1e8ee28660018a935c7576b9af8ffe1feab54c (diff)
bus: mvebu-mbus: fix support of MBus window 13
On Armada XP, 375 and 38x the MBus window 13 has the remap capability, like windows 0 to 7. However, the mvebu-mbus driver isn't currently taking into account this special case, which means that when window 13 is actually used, the remap registers are left to 0, making the device using this MBus window unavailable. As a minimal fix for stable, don't use window 13. A full fix will follow later. Fixes: fddddb52a6c ("bus: introduce an Marvell EBU MBus driver") Cc: <stable@vger.kernel.org> # v3.10+ Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Diffstat (limited to 'drivers/bus/mvebu-mbus.c')
-rw-r--r--drivers/bus/mvebu-mbus.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
index eb7682dc123b..81bf297f1034 100644
--- a/drivers/bus/mvebu-mbus.c
+++ b/drivers/bus/mvebu-mbus.c
@@ -210,12 +210,25 @@ static void mvebu_mbus_disable_window(struct mvebu_mbus_state *mbus,
210} 210}
211 211
212/* Checks whether the given window number is available */ 212/* Checks whether the given window number is available */
213
214/* On Armada XP, 375 and 38x the MBus window 13 has the remap
215 * capability, like windows 0 to 7. However, the mvebu-mbus driver
216 * isn't currently taking into account this special case, which means
217 * that when window 13 is actually used, the remap registers are left
218 * to 0, making the device using this MBus window unavailable. The
219 * quick fix for stable is to not use window 13. A follow up patch
220 * will correctly handle this window.
221*/
213static int mvebu_mbus_window_is_free(struct mvebu_mbus_state *mbus, 222static int mvebu_mbus_window_is_free(struct mvebu_mbus_state *mbus,
214 const int win) 223 const int win)
215{ 224{
216 void __iomem *addr = mbus->mbuswins_base + 225 void __iomem *addr = mbus->mbuswins_base +
217 mbus->soc->win_cfg_offset(win); 226 mbus->soc->win_cfg_offset(win);
218 u32 ctrl = readl(addr + WIN_CTRL_OFF); 227 u32 ctrl = readl(addr + WIN_CTRL_OFF);
228
229 if (win == 13)
230 return false;
231
219 return !(ctrl & WIN_CTRL_ENABLE); 232 return !(ctrl & WIN_CTRL_ENABLE);
220} 233}
221 234