aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2012-04-18 21:10:02 -0400
committerPaul Walmsley <paul@pwsan.com>2012-04-18 21:10:02 -0400
commit9c8b0ec7a46c5840fddaa570933335f4ccbbd078 (patch)
tree4ba636cfb895f1a9ccf98e04825f52ad0c696c14 /arch/arm
parent1f5e6247ca99287bac87aff4971a7eee9c2b223a (diff)
ARM: OMAP2+: hwmod: control all hardreset lines attached to a hwmod
Parts of the hwmod code test to see if a module has one and only one hardreset line before taking an action. It seems more appropriate to control all hardreset lines associated with a hwmod, not just one. It so happens that with the current hwmod data, this patch will not change any behavior, since hwmods with hardreset lines have only one hardreset line associated with them, and 'pseudo-hwmods' are used to handle the other hardreset lines. But future hwmod data patches to remove the pseudo-hwmods will change this. Signed-off-by: Paul Walmsley <paul@pwsan.com> Cc: BenoƮt Cousson <b-cousson@ti.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 7144ae651d3d..4997c1a8b59d 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1480,6 +1480,11 @@ static int _reset(struct omap_hwmod *oh)
1480 1480
1481 pr_debug("omap_hwmod: %s: resetting\n", oh->name); 1481 pr_debug("omap_hwmod: %s: resetting\n", oh->name);
1482 1482
1483 /*
1484 * XXX We're not resetting modules with hardreset lines
1485 * automatically here. Should we do this also, or just expect
1486 * those modules to define custom reset functions?
1487 */
1483 ret = (oh->class->reset) ? oh->class->reset(oh) : _ocp_softreset(oh); 1488 ret = (oh->class->reset) ? oh->class->reset(oh) : _ocp_softreset(oh);
1484 1489
1485 if (oh->class->sysc) { 1490 if (oh->class->sysc) {
@@ -1500,7 +1505,7 @@ static int _reset(struct omap_hwmod *oh)
1500 */ 1505 */
1501static int _enable(struct omap_hwmod *oh) 1506static int _enable(struct omap_hwmod *oh)
1502{ 1507{
1503 int r; 1508 int r, i;
1504 int hwsup = 0; 1509 int hwsup = 0;
1505 1510
1506 pr_debug("omap_hwmod: %s: enabling\n", oh->name); 1511 pr_debug("omap_hwmod: %s: enabling\n", oh->name);
@@ -1532,15 +1537,15 @@ static int _enable(struct omap_hwmod *oh)
1532 return -EINVAL; 1537 return -EINVAL;
1533 } 1538 }
1534 1539
1535
1536 /* 1540 /*
1537 * If an IP contains only one HW reset line, then de-assert it in order 1541 * If an IP contains HW reset lines, then de-assert them in order
1538 * to allow the module state transition. Otherwise the PRCM will return 1542 * to allow the module state transition. Otherwise the PRCM will return
1539 * Intransition status, and the init will failed. 1543 * Intransition status, and the init will failed.
1540 */ 1544 */
1541 if ((oh->_state == _HWMOD_STATE_INITIALIZED || 1545 if (oh->_state == _HWMOD_STATE_INITIALIZED ||
1542 oh->_state == _HWMOD_STATE_DISABLED) && oh->rst_lines_cnt == 1) 1546 oh->_state == _HWMOD_STATE_DISABLED)
1543 _deassert_hardreset(oh, oh->rst_lines[0].name); 1547 for (i = 0; i < oh->rst_lines_cnt; i++)
1548 _deassert_hardreset(oh, oh->rst_lines[i].name);
1544 1549
1545 /* Mux pins for device runtime if populated */ 1550 /* Mux pins for device runtime if populated */
1546 if (oh->mux && (!oh->mux->enabled || 1551 if (oh->mux && (!oh->mux->enabled ||
@@ -1687,7 +1692,7 @@ int omap_hwmod_set_ocp_autoidle(struct omap_hwmod *oh, u8 autoidle)
1687 */ 1692 */
1688static int _shutdown(struct omap_hwmod *oh) 1693static int _shutdown(struct omap_hwmod *oh)
1689{ 1694{
1690 int ret; 1695 int ret, i;
1691 u8 prev_state; 1696 u8 prev_state;
1692 1697
1693 if (oh->_state != _HWMOD_STATE_IDLE && 1698 if (oh->_state != _HWMOD_STATE_IDLE &&
@@ -1728,12 +1733,8 @@ static int _shutdown(struct omap_hwmod *oh)
1728 } 1733 }
1729 /* XXX Should this code also force-disable the optional clocks? */ 1734 /* XXX Should this code also force-disable the optional clocks? */
1730 1735
1731 /* 1736 for (i = 0; i < oh->rst_lines_cnt; i++)
1732 * If an IP contains only one HW reset line, then assert it 1737 _assert_hardreset(oh, oh->rst_lines[i].name);
1733 * after disabling the clocks and before shutting down the IP.
1734 */
1735 if (oh->rst_lines_cnt == 1)
1736 _assert_hardreset(oh, oh->rst_lines[0].name);
1737 1738
1738 /* Mux pins to safe mode or use populated off mode values */ 1739 /* Mux pins to safe mode or use populated off mode values */
1739 if (oh->mux) 1740 if (oh->mux)
@@ -1786,7 +1787,7 @@ static int _setup(struct omap_hwmod *oh, void *data)
1786 * reset asserted. Exit without warning because that behavior is 1787 * reset asserted. Exit without warning because that behavior is
1787 * expected. 1788 * expected.
1788 */ 1789 */
1789 if ((oh->flags & HWMOD_INIT_NO_RESET) && oh->rst_lines_cnt == 1) 1790 if ((oh->flags & HWMOD_INIT_NO_RESET) && oh->rst_lines_cnt > 0)
1790 return 0; 1791 return 0;
1791 1792
1792 r = _enable(oh); 1793 r = _enable(oh);