[U-Boot] [PATCH] fsl_esdhc: Correcting esdhc timeout counter calculation

Wolfgang Denk wd at denx.de
Fri Feb 25 14:56:06 CET 2011


Dear Fleming Andy-AFLEMING,

In message <D4848E4B-3C47-4D5C-A171-A69439660C42 at freescale.com> you wrote:
> 
> > Does this not depend on the units used for speed, and thus in the end
> > on CONFIC_SYS_HZ ?
> 
> No, but that wasn't apparent because I didn't mention the units of
> 2^(13+timeout). It is in units of sd clocks.
> 
> So: num sd clocks = (sd clocks per sec) * 0.25 sec =
> mmc->tran_speed/4 = 2^(13+regval).
> 
> Now, it is true that the actual speed of the sd clock is going to
> depend on CONFIG_SYS_HZ, in that a tran_speed of 25MHz may not be
> perfectly achievable with available dividers, but this code is not
> taking that into account, and the fact that it's rounding up to the
> next power of two should take care of that.

Fine.  Can we please add such explanation to the code?

Thanks.

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
The use of COBOL cripples the mind; its teaching  should,  therefore,
be regarded as a criminal offence.
          -- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5


More information about the U-Boot mailing list