aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/omap_hwmod.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/omap_hwmod.c')
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 2ceffd85dd3d..cd65ea4e9c54 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2161,6 +2161,37 @@ static int of_dev_hwmod_lookup(struct device_node *np,
2161} 2161}
2162 2162
2163/** 2163/**
2164 * omap_hwmod_fix_mpu_rt_idx - fix up mpu_rt_idx register offsets
2165 *
2166 * @oh: struct omap_hwmod *
2167 * @np: struct device_node *
2168 *
2169 * Fix up module register offsets for modules with mpu_rt_idx.
2170 * Only needed for cpsw with interconnect target module defined
2171 * in device tree while still using legacy hwmod platform data
2172 * for rev, sysc and syss registers.
2173 *
2174 * Can be removed when all cpsw hwmod platform data has been
2175 * dropped.
2176 */
2177static void omap_hwmod_fix_mpu_rt_idx(struct omap_hwmod *oh,
2178 struct device_node *np,
2179 struct resource *res)
2180{
2181 struct device_node *child = NULL;
2182 int error;
2183
2184 child = of_get_next_child(np, child);
2185 if (!child)
2186 return;
2187
2188 error = of_address_to_resource(child, oh->mpu_rt_idx, res);
2189 if (error)
2190 pr_err("%s: error mapping mpu_rt_idx: %i\n",
2191 __func__, error);
2192}
2193
2194/**
2164 * omap_hwmod_parse_module_range - map module IO range from device tree 2195 * omap_hwmod_parse_module_range - map module IO range from device tree
2165 * @oh: struct omap_hwmod * 2196 * @oh: struct omap_hwmod *
2166 * @np: struct device_node * 2197 * @np: struct device_node *
@@ -2220,7 +2251,13 @@ int omap_hwmod_parse_module_range(struct omap_hwmod *oh,
2220 size = be32_to_cpup(ranges); 2251 size = be32_to_cpup(ranges);
2221 2252
2222 pr_debug("omap_hwmod: %s %s at 0x%llx size 0x%llx\n", 2253 pr_debug("omap_hwmod: %s %s at 0x%llx size 0x%llx\n",
2223 oh->name, np->name, base, size); 2254 oh ? oh->name : "", np->name, base, size);
2255
2256 if (oh && oh->mpu_rt_idx) {
2257 omap_hwmod_fix_mpu_rt_idx(oh, np, res);
2258
2259 return 0;
2260 }
2224 2261
2225 res->start = base; 2262 res->start = base;
2226 res->end = base + size - 1; 2263 res->end = base + size - 1;