* [U-Boot] [PATCH V2] mpc5200: reduce delays in i2c
@ 2009-03-31 1:03 Jon Smirl
2009-03-31 20:54 ` Wolfgang Denk
0 siblings, 1 reply; 3+ messages in thread
From: Jon Smirl @ 2009-03-31 1:03 UTC (permalink / raw)
To: u-boot
Make the i2c delays smaller. The measured delay is 55us at
100Khz. Set the delay to 15us which should work for 400Khz.
100Khz will loop four times and get a 60us delay. Previous
total delay was 100,000us new total delay is 150,000us before
timeout.
Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
---
cpu/mpc5xxx/i2c.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/cpu/mpc5xxx/i2c.c b/cpu/mpc5xxx/i2c.c
index e2506d8..48b6464 100644
--- a/cpu/mpc5xxx/i2c.c
+++ b/cpu/mpc5xxx/i2c.c
@@ -38,7 +38,7 @@ DECLARE_GLOBAL_DATA_PTR;
#error CONFIG_SYS_I2C_MODULE is not properly configured
#endif
-#define I2C_TIMEOUT 100
+#define I2C_TIMEOUT 10000
#define I2C_RETRIES 3
struct mpc5xxx_i2c_tap {
@@ -94,7 +94,7 @@ static int wait_for_bb(void)
mpc_reg_out(®s->mcr, 0, 0);
mpc_reg_out(®s->mcr, I2C_EN, 0);
#endif
- udelay(1000);
+ udelay(15);
status = mpc_reg_in(®s->msr);
}
@@ -109,7 +109,7 @@ static int wait_for_pin(int *status)
*status = mpc_reg_in(®s->msr);
while (timeout-- && !(*status & I2C_IF)) {
- udelay(1000);
+ udelay(15);
*status = mpc_reg_in(®s->msr);
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH V2] mpc5200: reduce delays in i2c
2009-03-31 1:03 [U-Boot] [PATCH V2] mpc5200: reduce delays in i2c Jon Smirl
@ 2009-03-31 20:54 ` Wolfgang Denk
2009-03-31 21:15 ` Jon Smirl
0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Denk @ 2009-03-31 20:54 UTC (permalink / raw)
To: u-boot
Dear Jon Smirl,
In message <20090331010330.20946.41742.stgit@localhost> you wrote:
> Make the i2c delays smaller. The measured delay is 55us at
> 100Khz. Set the delay to 15us which should work for 400Khz.
> 100Khz will loop four times and get a 60us delay. Previous
> total delay was 100,000us new total delay is 150,000us before
> timeout.
I think you did not even bother to read my comments to your previous
patch (foar from trying to understand and react on them).
Sorry, NAK. Please at least answer the questions you've been asked.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"I dislike companies that have a we-are-the-high-priests-of-hardware-
so-you'll-like-what-we-give-you attitude. I like commodity markets in
which iron-and-silicon hawkers know that they exist to provide fast
toys for software types like me to play with..." - Eric S. Raymond
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH V2] mpc5200: reduce delays in i2c
2009-03-31 20:54 ` Wolfgang Denk
@ 2009-03-31 21:15 ` Jon Smirl
0 siblings, 0 replies; 3+ messages in thread
From: Jon Smirl @ 2009-03-31 21:15 UTC (permalink / raw)
To: u-boot
On Tue, Mar 31, 2009 at 4:54 PM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Jon Smirl,
>
> In message <20090331010330.20946.41742.stgit@localhost> you wrote:
>> Make the i2c delays smaller. The measured delay is 55us at
>> 100Khz. Set the delay to 15us which should work for 400Khz.
>> 100Khz will loop four times and get a 60us delay. Previous
>> total delay was 100,000us new total delay is 150,000us before
>> timeout.
>
> I think you did not even bother to read my comments to your previous
> patch (foar from trying to understand and react on them).
>
> Sorry, NAK. ?Please at least answer the questions you've been asked.
You said:
"I agree that the change itself looks harmless, and I'm willing to
accept it, but at least make sure not to reduce the total timeout
values - that would require re-testing on some boards."
I made the total time out bigger just to be extra sure, but I could
lower it back to 100ms.
If this isn't ok. Just drop the patch and I'll keep it in my private tree.
>
> Best regards,
>
> Wolfgang Denk
>
> --
> DENX Software Engineering GmbH, ? ? MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> "I dislike companies that have a we-are-the-high-priests-of-hardware-
> so-you'll-like-what-we-give-you attitude. I like commodity markets in
> which iron-and-silicon hawkers know that they exist to ?provide ?fast
> toys for software types like me to play with..." ? ?- Eric S. Raymond
>
--
Jon Smirl
jonsmirl at gmail.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-03-31 21:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-31 1:03 [U-Boot] [PATCH V2] mpc5200: reduce delays in i2c Jon Smirl
2009-03-31 20:54 ` Wolfgang Denk
2009-03-31 21:15 ` Jon Smirl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox