diff options
author | Avinash.H.M <avinashhm@ti.com> | 2011-07-10 07:27:16 -0400 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2011-07-10 07:27:16 -0400 |
commit | 6d3c55fd4f0f94a9455d30df9414ddb0f755f402 (patch) | |
tree | 7b1838e66fa1a424db45c84855062df121b9506b /arch/arm/mach-omap2/omap_hwmod.c | |
parent | 4d4441a6221ca3a30290045b7b696e5134646449 (diff) |
OMAP: hwmod: fix the i2c-reset timeout during bootup
The sequence of _ocp_softreset doesn't work for i2c. The i2c module has a
special sequence to reset the module. The sequence is
- Disable the I2C.
- Write to SOFTRESET bit.
- Enable the I2C.
- Poll on the RESETDONE bit.
The sequence is implemented as a function and the i2c_class is updated with
the correct 'reset' pointer. omap_hwmod_softreset function is implemented
which triggers the softreset by writing into sysconfig register. On following
this sequence, i2c module resets properly and timeouts are not seen.
Cc: Rajendra Nayak <rnayak@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Benoit Cousson <b-cousson@ti.com>
Cc: Kevin Hilman <khilman@ti.com>
Signed-off-by: Avinash.H.M <avinashhm@ti.com>
[paul@pwsan.com: combined this patch with a patch to remove
HWMOD_INIT_NO_RESET from the 44xx hwmod flags; change register
offset conditional code to use the IP block revision; minor code
cleanup]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2/omap_hwmod.c')
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 7d242c9e2a2c..02b6016393a8 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -1656,6 +1656,33 @@ void omap_hwmod_write(u32 v, struct omap_hwmod *oh, u16 reg_offs) | |||
1656 | } | 1656 | } |
1657 | 1657 | ||
1658 | /** | 1658 | /** |
1659 | * omap_hwmod_softreset - reset a module via SYSCONFIG.SOFTRESET bit | ||
1660 | * @oh: struct omap_hwmod * | ||
1661 | * | ||
1662 | * This is a public function exposed to drivers. Some drivers may need to do | ||
1663 | * some settings before and after resetting the device. Those drivers after | ||
1664 | * doing the necessary settings could use this function to start a reset by | ||
1665 | * setting the SYSCONFIG.SOFTRESET bit. | ||
1666 | */ | ||
1667 | int omap_hwmod_softreset(struct omap_hwmod *oh) | ||
1668 | { | ||
1669 | u32 v; | ||
1670 | int ret; | ||
1671 | |||
1672 | if (!oh || !(oh->_sysc_cache)) | ||
1673 | return -EINVAL; | ||
1674 | |||
1675 | v = oh->_sysc_cache; | ||
1676 | ret = _set_softreset(oh, &v); | ||
1677 | if (ret) | ||
1678 | goto error; | ||
1679 | _write_sysconfig(v, oh); | ||
1680 | |||
1681 | error: | ||
1682 | return ret; | ||
1683 | } | ||
1684 | |||
1685 | /** | ||
1659 | * omap_hwmod_set_slave_idlemode - set the hwmod's OCP slave idlemode | 1686 | * omap_hwmod_set_slave_idlemode - set the hwmod's OCP slave idlemode |
1660 | * @oh: struct omap_hwmod * | 1687 | * @oh: struct omap_hwmod * |
1661 | * @idlemode: SIDLEMODE field bits (shifted to bit 0) | 1688 | * @idlemode: SIDLEMODE field bits (shifted to bit 0) |