]> git.sur5r.net Git - u-boot/blobdiff - common/xyzModem.c
tpm: Add function to load keys via their parent's SHA1 hash
[u-boot] / common / xyzModem.c
index 5656aac48fb1b688a10247adf572444392779194..e0d87dbfec95af68bf72be382cc931aeb60c9ea5 100644 (file)
@@ -71,12 +71,12 @@ typedef int cyg_int32;
 static int
 CYGACC_COMM_IF_GETC_TIMEOUT (char chan, char *c)
 {
-#define DELAY 20
-  unsigned long counter = 0;
-  while (!tstc () && (counter < xyzModem_CHAR_TIMEOUT * 1000 / DELAY))
+
+  ulong now = get_timer(0);
+  while (!tstc ())
     {
-      udelay (DELAY);
-      counter++;
+      if (get_timer(now) > xyzModem_CHAR_TIMEOUT)
+        break;
     }
   if (tstc ())
     {