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.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 8a1b5e0bad40..1f33f5db10d5 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -686,6 +686,8 @@ static struct clockdomain *_get_clkdm(struct omap_hwmod *oh)
686 if (oh->clkdm) { 686 if (oh->clkdm) {
687 return oh->clkdm; 687 return oh->clkdm;
688 } else if (oh->_clk) { 688 } else if (oh->_clk) {
689 if (__clk_get_flags(oh->_clk) & CLK_IS_BASIC)
690 return NULL;
689 clk = to_clk_hw_omap(__clk_get_hw(oh->_clk)); 691 clk = to_clk_hw_omap(__clk_get_hw(oh->_clk));
690 return clk->clkdm; 692 return clk->clkdm;
691 } 693 }
@@ -1576,7 +1578,7 @@ static int _init_clkdm(struct omap_hwmod *oh)
1576 if (!oh->clkdm) { 1578 if (!oh->clkdm) {
1577 pr_warning("omap_hwmod: %s: could not associate to clkdm %s\n", 1579 pr_warning("omap_hwmod: %s: could not associate to clkdm %s\n",
1578 oh->name, oh->clkdm_name); 1580 oh->name, oh->clkdm_name);
1579 return -EINVAL; 1581 return 0;
1580 } 1582 }
1581 1583
1582 pr_debug("omap_hwmod: %s: associated to clkdm %s\n", 1584 pr_debug("omap_hwmod: %s: associated to clkdm %s\n",
@@ -1945,29 +1947,31 @@ static int _ocp_softreset(struct omap_hwmod *oh)
1945 goto dis_opt_clks; 1947 goto dis_opt_clks;
1946 1948
1947 _write_sysconfig(v, oh); 1949 _write_sysconfig(v, oh);
1948 ret = _clear_softreset(oh, &v);
1949 if (ret)
1950 goto dis_opt_clks;
1951
1952 _write_sysconfig(v, oh);
1953 1950
1954 if (oh->class->sysc->srst_udelay) 1951 if (oh->class->sysc->srst_udelay)
1955 udelay(oh->class->sysc->srst_udelay); 1952 udelay(oh->class->sysc->srst_udelay);
1956 1953
1957 c = _wait_softreset_complete(oh); 1954 c = _wait_softreset_complete(oh);
1958 if (c == MAX_MODULE_SOFTRESET_WAIT) 1955 if (c == MAX_MODULE_SOFTRESET_WAIT) {
1959 pr_warning("omap_hwmod: %s: softreset failed (waited %d usec)\n", 1956 pr_warning("omap_hwmod: %s: softreset failed (waited %d usec)\n",
1960 oh->name, MAX_MODULE_SOFTRESET_WAIT); 1957 oh->name, MAX_MODULE_SOFTRESET_WAIT);
1961 else 1958 ret = -ETIMEDOUT;
1959 goto dis_opt_clks;
1960 } else {
1962 pr_debug("omap_hwmod: %s: softreset in %d usec\n", oh->name, c); 1961 pr_debug("omap_hwmod: %s: softreset in %d usec\n", oh->name, c);
1962 }
1963
1964 ret = _clear_softreset(oh, &v);
1965 if (ret)
1966 goto dis_opt_clks;
1967
1968 _write_sysconfig(v, oh);
1963 1969
1964 /* 1970 /*
1965 * XXX add _HWMOD_STATE_WEDGED for modules that don't come back from 1971 * XXX add _HWMOD_STATE_WEDGED for modules that don't come back from
1966 * _wait_target_ready() or _reset() 1972 * _wait_target_ready() or _reset()
1967 */ 1973 */
1968 1974
1969 ret = (c == MAX_MODULE_SOFTRESET_WAIT) ? -ETIMEDOUT : 0;
1970
1971dis_opt_clks: 1975dis_opt_clks:
1972 if (oh->flags & HWMOD_CONTROL_OPT_CLKS_IN_RESET) 1976 if (oh->flags & HWMOD_CONTROL_OPT_CLKS_IN_RESET)
1973 _disable_optional_clocks(oh); 1977 _disable_optional_clocks(oh);
@@ -2791,9 +2795,7 @@ static int __init _alloc_links(struct omap_hwmod_link **ml,
2791 sz = sizeof(struct omap_hwmod_link) * LINKS_PER_OCP_IF; 2795 sz = sizeof(struct omap_hwmod_link) * LINKS_PER_OCP_IF;
2792 2796
2793 *sl = NULL; 2797 *sl = NULL;
2794 *ml = alloc_bootmem(sz); 2798 *ml = memblock_virt_alloc(sz, 0);
2795
2796 memset(*ml, 0, sz);
2797 2799
2798 *sl = (void *)(*ml) + sizeof(struct omap_hwmod_link); 2800 *sl = (void *)(*ml) + sizeof(struct omap_hwmod_link);
2799 2801
@@ -2912,9 +2914,7 @@ static int __init _alloc_linkspace(struct omap_hwmod_ocp_if **ois)
2912 pr_debug("omap_hwmod: %s: allocating %d byte linkspace (%d links)\n", 2914 pr_debug("omap_hwmod: %s: allocating %d byte linkspace (%d links)\n",
2913 __func__, sz, max_ls); 2915 __func__, sz, max_ls);
2914 2916
2915 linkspace = alloc_bootmem(sz); 2917 linkspace = memblock_virt_alloc(sz, 0);
2916
2917 memset(linkspace, 0, sz);
2918 2918
2919 return 0; 2919 return 0;
2920} 2920}
@@ -4235,6 +4235,7 @@ void __init omap_hwmod_init(void)
4235 soc_ops.assert_hardreset = _omap2_assert_hardreset; 4235 soc_ops.assert_hardreset = _omap2_assert_hardreset;
4236 soc_ops.deassert_hardreset = _omap2_deassert_hardreset; 4236 soc_ops.deassert_hardreset = _omap2_deassert_hardreset;
4237 soc_ops.is_hardreset_asserted = _omap2_is_hardreset_asserted; 4237 soc_ops.is_hardreset_asserted = _omap2_is_hardreset_asserted;
4238 soc_ops.init_clkdm = _init_clkdm;
4238 } else if (cpu_is_omap44xx() || soc_is_omap54xx() || soc_is_dra7xx()) { 4239 } else if (cpu_is_omap44xx() || soc_is_omap54xx() || soc_is_dra7xx()) {
4239 soc_ops.enable_module = _omap4_enable_module; 4240 soc_ops.enable_module = _omap4_enable_module;
4240 soc_ops.disable_module = _omap4_disable_module; 4241 soc_ops.disable_module = _omap4_disable_module;