[U-Boot] [PATCH V2] mpc5200: reduce delays in i2c

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); }

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

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@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
participants (2)
-
Jon Smirl
-
Wolfgang Denk