diff options
author | Rajendra Nayak <rnayak@ti.com> | 2012-03-13 13:25:23 -0400 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2012-04-05 04:59:32 -0400 |
commit | 2800852a079504f35f88e44faf5c9c96318c0cca (patch) | |
tree | d2c1866c606364105ff903c33d1c68d0b8de07e7 /arch/arm/mach-omap2 | |
parent | 2a1cc1445a51e3a81c10d294586756cdb9174469 (diff) |
ARM: OMAP2+: hwmod: Restore sysc after a reset
After a softreset, make sure the sysc settings are correctly
restored.
Reported-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Cc: Benoit Cousson <b-cousson@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Shubhrajyoti D <shubhrajyoti@ti.com>
[paul@pwsan.com: combined post-reset SYSCONFIG reload code into the
_reset() function to avoid duplication and future mistakes]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 5a680108195b..d32c1ce4f3ab 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -1477,6 +1477,11 @@ static int _reset(struct omap_hwmod *oh) | |||
1477 | 1477 | ||
1478 | ret = (oh->class->reset) ? oh->class->reset(oh) : _ocp_softreset(oh); | 1478 | ret = (oh->class->reset) ? oh->class->reset(oh) : _ocp_softreset(oh); |
1479 | 1479 | ||
1480 | if (oh->class->sysc) { | ||
1481 | _update_sysc_cache(oh); | ||
1482 | _enable_sysc(oh); | ||
1483 | } | ||
1484 | |||
1480 | return ret; | 1485 | return ret; |
1481 | } | 1486 | } |
1482 | 1487 | ||
@@ -1786,20 +1791,9 @@ static int _setup(struct omap_hwmod *oh, void *data) | |||
1786 | return 0; | 1791 | return 0; |
1787 | } | 1792 | } |
1788 | 1793 | ||
1789 | if (!(oh->flags & HWMOD_INIT_NO_RESET)) { | 1794 | if (!(oh->flags & HWMOD_INIT_NO_RESET)) |
1790 | _reset(oh); | 1795 | _reset(oh); |
1791 | 1796 | ||
1792 | /* | ||
1793 | * OCP_SYSCONFIG bits need to be reprogrammed after a softreset. | ||
1794 | * The _enable() function should be split to | ||
1795 | * avoid the rewrite of the OCP_SYSCONFIG register. | ||
1796 | */ | ||
1797 | if (oh->class->sysc) { | ||
1798 | _update_sysc_cache(oh); | ||
1799 | _enable_sysc(oh); | ||
1800 | } | ||
1801 | } | ||
1802 | |||
1803 | postsetup_state = oh->_postsetup_state; | 1797 | postsetup_state = oh->_postsetup_state; |
1804 | if (postsetup_state == _HWMOD_STATE_UNKNOWN) | 1798 | if (postsetup_state == _HWMOD_STATE_UNKNOWN) |
1805 | postsetup_state = _HWMOD_STATE_ENABLED; | 1799 | postsetup_state = _HWMOD_STATE_ENABLED; |