1 Now that we have DT bindings to specify which devices should not
2 be reset and idled during init, make hwmod extract the information
3 (and store them in internal flags) from Device tree.
5 Signed-off-by: Rajendra Nayak <rnayak@ti.com>
8 arch/arm/mach-omap2/omap_hwmod.c | 23 ++++++++++++++++-------
9 1 file changed, 16 insertions(+), 7 deletions(-)
11 diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
12 index d9ee0ff..b55923a 100644
13 --- a/arch/arm/mach-omap2/omap_hwmod.c
14 +++ b/arch/arm/mach-omap2/omap_hwmod.c
15 @@ -2363,11 +2363,11 @@ static struct device_node *of_dev_hwmod_lookup(struct device_node *np,
16 * are part of the device's address space can be ioremapped properly.
19 -static void __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data)
20 +static void __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data,
21 + struct device_node *np)
23 struct omap_hwmod_addr_space *mem;
24 void __iomem *va_start = NULL;
25 - struct device_node *np;
29 @@ -2383,12 +2383,10 @@ static void __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data)
32 /* Extract the IO space from device tree blob */
33 - if (!of_have_populated_dt())
37 - np = of_dev_hwmod_lookup(of_find_node_by_name(NULL, "ocp"), oh);
39 - va_start = of_iomap(np, oh->mpu_rt_idx);
40 + va_start = of_iomap(np, oh->mpu_rt_idx);
42 va_start = ioremap(mem->pa_start, mem->pa_end - mem->pa_start);
44 @@ -2420,12 +2418,16 @@ static void __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data)
45 static int __init _init(struct omap_hwmod *oh, void *data)
48 + struct device_node *np = NULL;
50 if (oh->_state != _HWMOD_STATE_REGISTERED)
53 + if (of_have_populated_dt())
54 + np = of_dev_hwmod_lookup(of_find_node_by_name(NULL, "ocp"), oh);
57 - _init_mpu_rt_base(oh, NULL);
58 + _init_mpu_rt_base(oh, NULL, np);
60 r = _init_clocks(oh, NULL);
62 @@ -2433,6 +2435,13 @@ static int __init _init(struct omap_hwmod *oh, void *data)
67 + if (of_find_property(np, "ti,no-reset-on-init", NULL))
68 + oh->flags |= HWMOD_INIT_NO_RESET;
69 + if (of_find_property(np, "ti,no-idle-on-init", NULL))
70 + oh->flags |= HWMOD_INIT_NO_IDLE;
73 oh->_state = _HWMOD_STATE_INITIALIZED;