Skip to content

Commit 2800852

Browse files
Rajendra NayakPaul Walmsley
authored andcommitted
ARM: OMAP2+: hwmod: Restore sysc after a reset
After a softreset, make sure the sysc settings are correctly restored. Reported-by: Anand Gadiyar <[email protected]> Signed-off-by: Rajendra Nayak <[email protected]> Cc: Benoit Cousson <[email protected]> Cc: Paul Walmsley <[email protected]> Cc: Shubhrajyoti D <[email protected]> [[email protected]: combined post-reset SYSCONFIG reload code into the _reset() function to avoid duplication and future mistakes] Signed-off-by: Paul Walmsley <[email protected]>
1 parent 2a1cc14 commit 2800852

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

arch/arm/mach-omap2/omap_hwmod.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,6 +1477,11 @@ static int _reset(struct omap_hwmod *oh)
14771477

14781478
ret = (oh->class->reset) ? oh->class->reset(oh) : _ocp_softreset(oh);
14791479

1480+
if (oh->class->sysc) {
1481+
_update_sysc_cache(oh);
1482+
_enable_sysc(oh);
1483+
}
1484+
14801485
return ret;
14811486
}
14821487

@@ -1786,20 +1791,9 @@ static int _setup(struct omap_hwmod *oh, void *data)
17861791
return 0;
17871792
}
17881793

1789-
if (!(oh->flags & HWMOD_INIT_NO_RESET)) {
1794+
if (!(oh->flags & HWMOD_INIT_NO_RESET))
17901795
_reset(oh);
17911796

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-
18031797
postsetup_state = oh->_postsetup_state;
18041798
if (postsetup_state == _HWMOD_STATE_UNKNOWN)
18051799
postsetup_state = _HWMOD_STATE_ENABLED;

0 commit comments

Comments
 (0)