From: Kevin Hilman <khilman@ti.com>
To: "Avinash.H.M" <avinashhm@ti.com>
Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
Rajendra Nayak <rnayak@ti.com>, Paul Walmsley <paul@pwsan.com>,
Benoit Cousson <b-cousson@ti.com>
Subject: Re: [PATCH 1/2 v2] OMAP2/3: hwmod: fix the i2c-reset timeout during bootup
Date: Tue, 05 Apr 2011 11:27:33 -0700 [thread overview]
Message-ID: <87mxk4zh7u.fsf@ti.com> (raw)
In-Reply-To: <1302018015-8858-2-git-send-email-avinashhm@ti.com> (Avinash H. M.'s message of "Tue, 5 Apr 2011 21:10:14 +0530")
"Avinash.H.M" <avinashhm@ti.com> writes:
> The i2c module has a special reset sequence. The sequence is
> - Disable the I2C.
> - Write to SOFTRESET bit.
> - Enable the I2C.
> - Poll on the RESETDONE bit.
> This sequence must be followed for i2c reset in omap2, omap3. The sequence is
> implemented as a function and the i2c_class is updated with the correct
> 'reset' pointer.
>
> 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>
[...]
> +
> +/**
> + * omap_i2c_reset- reset the omap i2c module.
> + * @oh: struct omap_hwmod *
> + *
> + * The i2c moudle in omap2, omap3 had a special sequence to reset. The
> + * sequence is:
> + * - Disable the I2C.
> + * - Write to SOFTRESET bit.
> + * - Enable the I2C.
> + * - Poll on the RESETDONE bit.
> + * The sequence is implemented in below function. This is called for 2420,
> + * 2430 and omap3.
> + */
> +int omap_i2c_reset(struct omap_hwmod *oh)
> +{
> + u32 v;
> + int c = 0;
> +
> + /* Disable I2C */
> + v = omap_hwmod_read(oh, I2C_CON_OFFSET);
> + v = v & ~I2C_EN;
> + omap_hwmod_write(v, oh, I2C_CON_OFFSET);
> +
> + /* Write to the SOFTRESET bit */
> + v = oh->_sysc_cache;
> + v |= (0x1 << oh->class->sysc->sysc_fields->srst_shift);
> +
> + oh->_sysc_cache = v;
> + omap_hwmod_write(v, oh, oh->class->sysc->sysc_offs);
Direct SYSCONFIG access isn't right here. This should go through
omap_hwmod.
What is probably needed is exposing _ocp_softreset to device code
via something like omap_hwmod_ocp_softreset() and calling that here.
Kevin
WARNING: multiple messages have this Message-ID (diff)
From: khilman@ti.com (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2 v2] OMAP2/3: hwmod: fix the i2c-reset timeout during bootup
Date: Tue, 05 Apr 2011 11:27:33 -0700 [thread overview]
Message-ID: <87mxk4zh7u.fsf@ti.com> (raw)
In-Reply-To: <1302018015-8858-2-git-send-email-avinashhm@ti.com> (Avinash H. M.'s message of "Tue, 5 Apr 2011 21:10:14 +0530")
"Avinash.H.M" <avinashhm@ti.com> writes:
> The i2c module has a special reset sequence. The sequence is
> - Disable the I2C.
> - Write to SOFTRESET bit.
> - Enable the I2C.
> - Poll on the RESETDONE bit.
> This sequence must be followed for i2c reset in omap2, omap3. The sequence is
> implemented as a function and the i2c_class is updated with the correct
> 'reset' pointer.
>
> 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>
[...]
> +
> +/**
> + * omap_i2c_reset- reset the omap i2c module.
> + * @oh: struct omap_hwmod *
> + *
> + * The i2c moudle in omap2, omap3 had a special sequence to reset. The
> + * sequence is:
> + * - Disable the I2C.
> + * - Write to SOFTRESET bit.
> + * - Enable the I2C.
> + * - Poll on the RESETDONE bit.
> + * The sequence is implemented in below function. This is called for 2420,
> + * 2430 and omap3.
> + */
> +int omap_i2c_reset(struct omap_hwmod *oh)
> +{
> + u32 v;
> + int c = 0;
> +
> + /* Disable I2C */
> + v = omap_hwmod_read(oh, I2C_CON_OFFSET);
> + v = v & ~I2C_EN;
> + omap_hwmod_write(v, oh, I2C_CON_OFFSET);
> +
> + /* Write to the SOFTRESET bit */
> + v = oh->_sysc_cache;
> + v |= (0x1 << oh->class->sysc->sysc_fields->srst_shift);
> +
> + oh->_sysc_cache = v;
> + omap_hwmod_write(v, oh, oh->class->sysc->sysc_offs);
Direct SYSCONFIG access isn't right here. This should go through
omap_hwmod.
What is probably needed is exposing _ocp_softreset to device code
via something like omap_hwmod_ocp_softreset() and calling that here.
Kevin
next prev parent reply other threads:[~2011-04-05 18:27 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-05 15:40 [PATCH 0/2 v2] OMAP2/3: fix the i2c,gpio reset timeouts during boot Avinash.H.M
2011-04-05 15:40 ` Avinash.H.M
2011-04-05 15:40 ` [PATCH 1/2 v2] OMAP2/3: hwmod: fix the i2c-reset timeout during bootup Avinash.H.M
2011-04-05 15:40 ` Avinash.H.M
2011-04-05 18:27 ` Kevin Hilman [this message]
2011-04-05 18:27 ` Kevin Hilman
2011-04-07 6:42 ` Mahadeva, Avinash
2011-04-07 6:42 ` Mahadeva, Avinash
2011-04-05 15:40 ` [PATCH 2/2 v2] OMAP2/3: hwmod: fix gpio-reset timeouts seen " Avinash.H.M
2011-04-05 15:40 ` Avinash.H.M
2011-04-06 5:58 ` Gulati, Shweta
2011-04-06 5:58 ` Gulati, Shweta
2011-04-07 6:45 ` Avinash.H.M.
2011-04-07 6:45 ` Avinash.H.M.
-- strict thread matches above, loose matches on Subject: below --
2011-04-07 7:03 [PATCH 1/2 v2] OMAP2/3: hwmod: fix the i2c-reset timeout " Avinash.H.M.
2011-04-07 7:03 ` Avinash.H.M.
2011-04-11 13:11 ` Avinash.H.M.
2011-04-11 13:11 ` Avinash.H.M.
2011-04-16 16:42 ` Kevin Hilman
2011-04-16 16:42 ` Kevin Hilman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mxk4zh7u.fsf@ti.com \
--to=khilman@ti.com \
--cc=avinashhm@ti.com \
--cc=b-cousson@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=paul@pwsan.com \
--cc=rnayak@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.