From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Tue, 01 Mar 2011 13:21:27 +0100 Subject: [U-Boot] [PATCH][v2] fsl_esdhc: Correcting esdhc timeout counter calculation In-Reply-To: <1298974358-16571-1-git-send-email-Priyanka.Jain@freescale.com> References: <1298974358-16571-1-git-send-email-Priyanka.Jain@freescale.com> Message-ID: <4D6CE4C7.4030508@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 03/01/2011 11:12 AM, Priyanka Jain wrote: > - Timeout counter value is set as DTOCV bits in SYSCTL register > For counter value set as timeout, > Timeout period = (2^(timeout + 13)) SD Clock cycles > > - As per 4.6.2.2 section of SD Card specification v2.00, host should > cofigure timeout period value to minimum 0.25 sec. > > - Number of SD Clock cycles for 0.25sec should be minimum > (SD Clock/sec * 0.25 sec) SD Clock cycles > = (mmc->tran_speed * 1/4) SD Clock cycles > > - Calculating timeout based on > (2^(timeout + 13)) >= mmc->tran_speed * 1/4 > Taking log2 both the sides and rounding up to next power of 2 > => timeout + 13 = log2(mmc->tran_speed/4) + 1 > > Signed-off-by: Priyanka Jain > Signed-off-by: Andy Fleming > Signed-off-by: Kumar Gala > Acked-by: Mingkai Hu > --- It seems to me that this patch is set on top of V1 of the same patch instead of top of u-boot. Changes are related only to comments and the new formula for timeout is already applied. Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================