[U-Boot-Users] PATCH for drivers/cfi_flash.c

Wolfgang Denk
2005-05-30T08:23:34Z

In message <c166aa9f0505281515495cf1c5@mail.gmail.com> you wrote:
>
> I tried this part of this patch out and aggravated some problems in
> the cfi_flash code.
>
> Several of the timeout parameters in the CFI query structure return units of
> microseconds. I use an AMD 29LV160 part. In the CFI parser code these
> microsecond values are converted to milliseconds by integer division. For
> the 29LV160 this leaves some of the timeout parameters in the info structure
> at zero.

I see.

> I can see a few ways to fix this:
>
> 1) adjust the info values after the scaling to millisecond values
> 2) force a one tick delay no matter what in flash_status_check()

1) and 2) sound similar to me - if you count in millisecs you will
have to round up any non-zero delay in any case.

> 3) modify the code to report everything in microseconds and use udelay

This would probably slow down execution, as you then will delay
always instead of actively waitingin a busy loop.

> 4) use set_timer() to make sure there is a full timer tick

This is just another variant of 1) and 2), right?

I recommend to implement correct rounding of the timeouts (i. e.
round up to fill lilliseconds); note that his does NOT slow down
normal operation.

Best regards,

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Everything should be made as simple as possible, but not simpler."
- Albert Einstein