ARM: OMAP2+: Fix module address for modules using mpu_rt_idx
authorTony Lindgren <tony@atomide.com>
Wed, 8 Aug 2018 08:07:04 +0000 (01:07 -0700)
committerTony Lindgren <tony@atomide.com>
Fri, 17 Aug 2018 14:22:39 +0000 (07:22 -0700)
commit1dbcb97c656eed1a244c960b8b3a469c3d20ce7b
treeb4c89d8fd284d36f18afc99f849498cf01e1d8ab
parent4769c003e0fcff0ee001a9102e2605bdaa5880f0
ARM: OMAP2+: Fix module address for modules using mpu_rt_idx

If we use device tree data for a module interconnect target we want
to map the control registers from the module start. Legacy hwmod platform
data however is using child IP offsets for cpsw module with mpu_rt_idx.

In cases where we have the interconnect target module already using device
tree data with legacy hwmod platform data still around, the sysc register
area is not adjusted for mpu_rt_idx causing wrong registers being accessed.

Let's fix the issue for mixed dts and platform data mode by ioremapping
the module registers using child IP offset if mpu_rt_idx is set. For
device tree only data there's no reason to use mpu_rt_idx.

Fixes: 6c72b3550672 ("ARM: OMAP2+: Parse module IO range from dts for legacy
"ti,hwmods" support")
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/omap_hwmod.c