linux/drivers/bus
Michal Mazur 7fdf3d8a03 bus: mvebu-mbus: fix support of MBus window 13 on Armada XP/375/38x
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.

To make things even more fun, the hardware designers have chosen to
put the window 13 remap registers in a completely custom location,
using a logic that differs from the one used for all other remappable
windows.

To solve this problem, this commit:

 * Adds a SoC specific function to calculate offset of remap registers
   to the mvebu_mbus_soc_data structure. This function,
   ->win_remap_offset(), returns the offset of the remap registers, or
   MVEBU_MBUS_NO_REMAP if the window does not have the remap
   capability. This new function replaces the previous integer field
   num_remappable_wins, which was insufficient to encode the special
   case of window 13.

 * Adds an implementation of the ->win_remap_offset() function for the
   various SoC families. Some have 2 first windows that are remapable,
   some the 4 first, some the 8 first, and then the Armada XP/375/38x
   case where the 8 first are remapable plus the special window
   13. This is implemented in functions
   generic_mbus_win_remap_2_offset(),
   generic_mbus_win_remap_4_offset(),
   generic_mbus_win_remap_8_offset() and
   armada_xp_mbus_win_remap_offset() respectively.

 * Change the code to use the ->win_remap_offset() function when
   accessing the remap registers, and also to use a newly introduced
   mvebu_mbus_window_is_remappable() helper function that tells
   whether a given window is remapable or not.

 * Separate Armada 370 from XP/375/38X because the window 13 of Armada
   370 does not support the remap capability.

[Thomas: adapted for the mainline kernel, minor clarifications in the
code, reword the commit log.]

Signed-off-by: Michal Mazur <arg@semihalf.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[Andrew Lunn <andrew@lunn.ch>: Undo the simple fix for stable]
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
2015-01-19 16:08:13 -06:00
..
arm-cci.c bus: cci: move away from arm_pmu framework 2014-10-30 12:16:57 +00:00
arm-ccn.c ARM: SoC driver updates for 3.18 2014-10-08 17:37:16 -04:00
brcmstb_gisb.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
imx-weim.c bus: drop owner assignment from platform_drivers 2014-10-20 16:20:19 +02:00
Kconfig bus: brcmstb_gisb: Make the driver buildable on MIPS 2014-11-28 15:44:42 -08:00
Makefile bus: ARM CCN PMU driver 2014-07-23 22:14:43 +02:00
mvebu-mbus.c bus: mvebu-mbus: fix support of MBus window 13 on Armada XP/375/38x 2015-01-19 16:08:13 -06:00
omap_l3_noc.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
omap_l3_noc.h bus: omap_l3_noc: Fix connID for OMAP4 2014-09-11 10:43:39 -07:00
omap_l3_smx.c ARM: OMAP3: Fix errors for omap_l3_smx when booted with device tree 2014-11-05 09:23:14 -08:00
omap_l3_smx.h drivers: bus: Move the OMAP interconnect driver to drivers/bus/ 2012-09-19 16:53:26 +02:00
omap-ocp2scp.c bus: drop owner assignment from platform_drivers 2014-10-20 16:20:19 +02:00
vexpress-config.c ARM: vexpress: refine dependencies for new code 2014-05-26 21:26:52 +02:00