aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/omap_hwmod.c
diff options
context:
space:
mode:
authorBenoit Cousson <b-cousson@ti.com>2010-09-21 12:57:59 -0400
committerPaul Walmsley <paul@pwsan.com>2010-09-21 17:28:30 -0400
commit2cb068149c365f1c2b10f2ece6786139527dcc16 (patch)
tree6644a1709a3e841134e79b3a97f537127aec0ea1 /arch/arm/mach-omap2/omap_hwmod.c
parentaee48e3c9cee3698d17b4cf4203551de0a804760 (diff)
OMAP: hwmod: Fix softreset status check for some new OMAP4 IPs
In OMAP3 a specific SYSSTATUS register was used to get the softreset status. Starting in OMAP4, some IPs does not have SYSSTATUS register and instead use the SYSC softreset bit to provide the status. Other cases might exist: - Some IPs like McBSP does have a softreset control but no reset status. - Some IPs that represent subsystem, like the DSS, can contains a reset status without softreset control. The status is the aggregation of all the sub modules reset status. - Add a new flag (SYSC_HAS_RESET_STATUS) to identify the new programming model and replace the previous SYSS_MISSING, that was used to flag IP with softreset control but without the SYSSTATUS register, with a specific SYSS_HAS_RESET_STATUS flag. - MCSPI and MMC contains both programming models, so the legacy one will be prevented by removing the syss offset field that become useless. Signed-off-by: Benoit Cousson <b-cousson@ti.com> Signed-off-by: Paul Walmsley <paul@pwsan.com> Cc: Kevin Hilman <khilman@deeprootsystems.com> Cc: Rajendra Nayak <rnayak@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/omap_hwmod.c')
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 8c279235ea8..5027879b062 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -967,6 +967,12 @@ static int _read_hardreset(struct omap_hwmod *oh, const char *name)
967 * enabled for this to work. Returns -EINVAL if the hwmod cannot be 967 * enabled for this to work. Returns -EINVAL if the hwmod cannot be
968 * reset this way or if the hwmod is in the wrong state, -ETIMEDOUT if 968 * reset this way or if the hwmod is in the wrong state, -ETIMEDOUT if
969 * the module did not reset in time, or 0 upon success. 969 * the module did not reset in time, or 0 upon success.
970 *
971 * In OMAP3 a specific SYSSTATUS register is used to get the reset status.
972 * Starting in OMAP4, some IPs does not have SYSSTATUS register and instead
973 * use the SYSCONFIG softreset bit to provide the status.
974 *
975 * Note that some IP like McBSP does have a reset control but no reset status.
970 */ 976 */
971static int _reset(struct omap_hwmod *oh) 977static int _reset(struct omap_hwmod *oh)
972{ 978{
@@ -974,8 +980,7 @@ static int _reset(struct omap_hwmod *oh)
974 int c = 0; 980 int c = 0;
975 981
976 if (!oh->class->sysc || 982 if (!oh->class->sysc ||
977 !(oh->class->sysc->sysc_flags & SYSC_HAS_SOFTRESET) || 983 !(oh->class->sysc->sysc_flags & SYSC_HAS_SOFTRESET))
978 (oh->class->sysc->sysc_flags & SYSS_MISSING))
979 return -EINVAL; 984 return -EINVAL;
980 985
981 /* clocks must be on for this operation */ 986 /* clocks must be on for this operation */
@@ -993,9 +998,16 @@ static int _reset(struct omap_hwmod *oh)
993 return r; 998 return r;
994 _write_sysconfig(v, oh); 999 _write_sysconfig(v, oh);
995 1000
996 omap_test_timeout((omap_hwmod_readl(oh, oh->class->sysc->syss_offs) & 1001 if (oh->class->sysc->sysc_flags & SYSS_HAS_RESET_STATUS)
997 SYSS_RESETDONE_MASK), 1002 omap_test_timeout((omap_hwmod_readl(oh,
998 MAX_MODULE_SOFTRESET_WAIT, c); 1003 oh->class->sysc->syss_offs)
1004 & SYSS_RESETDONE_MASK),
1005 MAX_MODULE_SOFTRESET_WAIT, c);
1006 else if (oh->class->sysc->sysc_flags & SYSC_HAS_RESET_STATUS)
1007 omap_test_timeout(!(omap_hwmod_readl(oh,
1008 oh->class->sysc->sysc_offs)
1009 & SYSC_TYPE2_SOFTRESET_MASK),
1010 MAX_MODULE_SOFTRESET_WAIT, c);
999 1011
1000 if (c == MAX_MODULE_SOFTRESET_WAIT) 1012 if (c == MAX_MODULE_SOFTRESET_WAIT)
1001 pr_warning("omap_hwmod: %s: softreset failed (waited %d usec)\n", 1013 pr_warning("omap_hwmod: %s: softreset failed (waited %d usec)\n",