Wolfgang Denk had written, on 10/26/2010 10:17 AM, the following:
> Dear Nishanth Menon,
> 
> In message <4cc6efb1.9000...@ti.com> you wrote:
>> uint64_t etime; /* actually this could be u32 */
>>
>> etime = get_ticks() + usec2ticks(MAX_RETRY_US);
>> while (!(readl(&mmc_base->stat) & CC_MASK)) {
>>          if (get_ticks() <= etime) {
>>                  printf("%s: timedout waiting for cc2!\n", __func__);
>>                  return;
>>          }
>> }
>>
>> sounds right?
> 
> No. This code is always wrong. Please fix it as described.
Apologies on being a dudhead, I suppose you mean the following:

ulong start;
start = get_timer(0);
while (!(readl(&mmc_base->stat) & CC_MASK)) {
         if (get_timer(start) > usec2ticks(MAX_RETRY_US)) {
                 printf("%s: timedout waiting for cc2!\n", __func__);
                 return;
         }
}

would this be better?

-- 
Regards,
Nishanth Menon
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to