[U-Boot] [PATCH v1 (WIP) 15/16] [Timer]Replace get_timer() usage in board/
Graeme Russ
graeme.russ at gmail.com
Tue Jun 28 13:41:08 CEST 2011
Signed-off-by: Graeme Russ <graeme.russ at gmail.com>
---
board/BuS/EB+MCF-EV123/flash.c | 8 +++---
board/LEOX/elpt860/flash.c | 12 +++++-----
board/Marvell/common/flash.c | 16 ++++++------
board/Marvell/common/intel_flash.c | 19 ++++++---------
board/RPXClassic/flash.c | 8 +++---
board/RPXlite/flash.c | 8 +++---
board/RPXlite_dw/flash.c | 8 +++---
board/RRvision/flash.c | 8 +++---
board/a3000/flash.c | 8 +++---
board/alaska/flash.c | 34 ++++++++++++++--------------
board/altera/common/AMDLV065D.c | 8 +++---
board/altera/common/flash.c | 10 ++++----
board/amcc/common/flash.c | 16 ++++++------
board/amcc/taihu/flash.c | 16 ++++++------
board/amcc/yucca/flash.c | 16 ++++++------
board/amirix/ap1000/flash.c | 4 +-
board/armadillo/flash.c | 4 +-
board/astro/mcf5373l/mcf5373l.c | 4 +-
board/atc/flash.c | 22 +++++++++---------
board/atmel/at91rm9200dk/flash.c | 8 +++---
board/atmel/atstk1000/flash.c | 2 +-
board/bmw/flash.c | 8 +++---
board/c2mon/flash.c | 8 +++---
board/cerf250/flash.c | 8 +++---
board/cm4008/flash.c | 8 +++---
board/cm41xx/flash.c | 8 +++---
board/cmc_pu2/flash.c | 8 +++---
board/cmi/flash.c | 12 +++++-----
board/cobra5272/flash.c | 8 +++---
board/cogent/flash.c | 14 ++++++------
board/cpc45/flash.c | 8 +++---
board/cpu86/flash.c | 16 ++++++------
board/cpu87/flash.c | 16 ++++++------
board/cradle/flash.c | 8 +++---
board/cray/L1/flash.c | 8 +++---
board/csb226/flash.c | 8 +++---
board/cu824/flash.c | 8 +++---
board/dave/common/flash.c | 8 +++---
board/dnp1110/flash.c | 8 +++---
board/earthlcd/favr-32-ezkit/flash.c | 2 +-
board/eltec/bab7xx/flash.c | 8 +++---
board/eltec/elppc/flash.c | 8 +++---
board/eltec/mhpc/flash.c | 8 +++---
board/emk/common/flash.c | 18 +++++++-------
board/ep7312/flash.c | 8 +++---
board/ep8260/flash.c | 8 +++---
board/esd/common/flash.c | 8 +++---
board/esd/cpci5200/strataflash.c | 4 +-
board/esd/pf5200/flash.c | 18 +++++++-------
board/esteem192e/flash.c | 18 +++++++-------
board/etin/debris/flash.c | 16 ++++++------
board/etx094/flash.c | 12 +++++-----
board/evb4510/flash.c | 4 +-
board/evb64260/flash.c | 8 +++---
board/evb64260/intel_flash.c | 18 ++++++--------
board/fads/flash.c | 8 +++---
board/flagadm/flash.c | 22 +++++++++---------
board/freescale/m5253demo/flash.c | 14 ++++++------
board/freescale/mpc8260ads/flash.c | 12 +++++-----
board/freescale/mpc8266ads/flash.c | 12 +++++-----
board/funkwerk/vovpn-gw/flash.c | 16 ++++++------
board/g2000/strataflash.c | 4 +-
board/gcplus/flash.c | 8 +++---
board/gen860t/flash.c | 16 ++++++------
board/genietv/flash.c | 8 +++---
board/gw8260/flash.c | 8 +++---
board/hermes/flash.c | 8 +++---
board/hidden_dragon/flash.c | 8 +++---
board/hymod/flash.c | 10 ++++----
board/icecube/flash.c | 18 +++++++-------
board/icu862/flash.c | 8 +++---
board/idmr/flash.c | 8 +++---
board/impa7/flash.c | 8 +++---
board/incaip/flash.c | 22 +++++++++---------
board/innokom/flash.c | 8 +++---
board/ip860/flash.c | 8 +++---
board/iphase4539/flash.c | 8 +++---
board/ivm/flash.c | 8 +++---
board/ixdp425/flash.c | 8 +++---
board/jse/flash.c | 8 +++---
board/kup/common/flash.c | 12 +++++-----
board/lantec/flash.c | 8 +++---
board/lart/flash.c | 8 +++---
board/linkstation/avr.c | 40 +++++++++++++++++-----------------
board/lpd7a40x/flash.c | 8 +++---
board/lubbock/flash.c | 8 +++---
board/lwmon/flash.c | 10 ++++----
board/mbx8xx/flash.c | 8 +++---
board/modnet50/flash.c | 12 +++++-----
board/mpl/common/flash.c | 16 ++++++------
board/mpl/mip405/mip405.c | 11 ++++-----
board/mpl/vcma9/flash.c | 8 +++---
board/musenki/flash.c | 8 +++---
board/mvblue/flash.c | 8 +++---
board/mx1ads/syncflash.c | 2 +-
board/mx1fs2/flash.c | 16 ++++++------
board/netphone/flash.c | 8 +++---
board/netta/flash.c | 8 +++---
board/netta2/flash.c | 8 +++---
board/netvia/flash.c | 8 +++---
board/ns9750dev/flash.c | 8 +++---
board/nx823/flash.c | 8 +++---
board/o2dnt/flash.c | 26 +++++++++++-----------
board/oxc/flash.c | 8 +++---
board/pcippc2/flash.c | 8 +++---
board/pcs440ep/flash.c | 12 +++++-----
board/pleb2/flash.c | 12 +++++-----
board/pm520/flash.c | 22 +++++++++---------
board/pm826/flash.c | 8 +++---
board/pm828/flash.c | 8 +++---
board/ppmc7xx/flash.c | 8 +++---
board/ppmc8260/strataflash.c | 4 +-
board/prodrive/common/flash.c | 12 +++++-----
board/psyent/common/AMDLV065D.c | 8 +++---
board/r360mpi/flash.c | 8 +++---
board/rbc823/flash.c | 8 +++---
board/rmu/flash.c | 8 +++---
board/rpxsuper/flash.c | 8 +++---
board/rsdproto/flash.c | 8 +++---
board/sacsng/flash.c | 8 +++---
board/samsung/smdk2400/flash.c | 8 +++---
board/sandburst/common/flash.c | 8 +++---
board/sandpoint/flash.c | 8 +++---
board/sbc2410x/flash.c | 8 +++---
board/sbc405/strataflash.c | 4 +-
board/sbc8240/flash.c | 8 +++---
board/sbc8260/flash.c | 8 +++---
board/scb9328/flash.c | 4 +-
board/shannon/flash.c | 8 +++---
board/siemens/IAD210/flash.c | 8 +++---
board/siemens/SCM/flash.c | 8 +++---
board/siemens/SMN42/flash.c | 8 +++---
board/sixnet/flash.c | 12 +++++-----
board/snmc/qs850/flash.c | 8 +++---
board/snmc/qs860t/flash.c | 18 +++++++-------
board/stx/stxgp3/flash.c | 12 +++++-----
board/svm_sc8xx/flash.c | 16 ++++++------
board/tb0229/flash.c | 18 +++++++-------
board/ti/omap1610inn/flash.c | 8 +++---
board/ti/omap730p2/flash.c | 8 +++---
board/tqc/tqm5200/cam5200_flash.c | 16 ++++++------
board/trab/cmd_trab.c | 6 ++--
board/trab/flash.c | 8 +++---
board/utx8245/flash.c | 8 +++---
board/v37/flash.c | 12 +++++-----
board/w7o/flash.c | 20 ++++++++--------
board/w7o/fpga.c | 10 ++++----
board/westel/amx860/flash.c | 8 +++---
board/xaeniax/flash.c | 8 +++---
board/xm250/flash.c | 16 ++++++------
board/zeus/zeus.c | 4 +-
board/zylonite/flash.c | 8 +++---
152 files changed, 781 insertions(+), 787 deletions(-)
diff --git a/board/BuS/EB+MCF-EV123/flash.c b/board/BuS/EB+MCF-EV123/flash.c
index 8b7f957..e2fb44b 100644
--- a/board/BuS/EB+MCF-EV123/flash.c
+++ b/board/BuS/EB+MCF-EV123/flash.c
@@ -172,13 +172,13 @@ int amd_flash_erase_sector(flash_info_t * info, int sector)
/* wait until flash is ready */
state = 0;
- start = get_timer(0);
+ start = time_now_ms();
do {
result = *addr;
/* check timeout */
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
MEM_FLASH_ADDR1 = CMD_READ_ARRAY;
state = ERR_TIMOUT;
}
@@ -297,7 +297,7 @@ volatile static int amd_write_word (flash_info_t * info, ulong dest, u16 data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait until flash is ready */
state = 0;
@@ -305,7 +305,7 @@ volatile static int amd_write_word (flash_info_t * info, ulong dest, u16 data)
result = *addr;
/* check timeout */
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
state = ERR_TIMOUT;
}
if (!state && ((result & BIT_RDY_MASK) == (data & BIT_RDY_MASK)))
diff --git a/board/LEOX/elpt860/flash.c b/board/LEOX/elpt860/flash.c
index 9a75aad..f8a86e6 100644
--- a/board/LEOX/elpt860/flash.c
+++ b/board/LEOX/elpt860/flash.c
@@ -378,12 +378,12 @@ flash_erase (flash_info_t *info,
if ( l_sect < 0 )
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (volatile unsigned char *)(info->start[l_sect]);
while ( (addr[0] & 0x80) != 0x80 )
{
- if ( (now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT )
+ if ( (now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT )
{
printf ("Timeout\n");
return ( 1 );
@@ -553,10 +553,10 @@ write_word (flash_info_t *info,
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ( (*((vu_long *)dest) & 0x00800080) != (data & 0x00800080) )
{
- if ( get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT )
+ if ( time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT )
{
return (1);
}
@@ -599,10 +599,10 @@ write_byte (flash_info_t *info,
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ( (*((volatile unsigned char *)dest) & 0x80) != (data & 0x80) )
{
- if ( get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT )
+ if ( time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT )
{
return (1);
}
diff --git a/board/Marvell/common/flash.c b/board/Marvell/common/flash.c
index 21eae0e..99acc1b 100644
--- a/board/Marvell/common/flash.c
+++ b/board/Marvell/common/flash.c
@@ -604,7 +604,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
mask = CHIP_STAT_RDY |
(CHIP_STAT_RDY << 16);
/* init. the timeout counter */
- start = get_timer (0);
+ start = time_now_ms();
/* keep looping while the flash is not ready */
/* exit the loop by timing out or the flash */
/* becomes ready again */
@@ -615,7 +615,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
start[sect] & mask) !=
mask) {
/* has the timeout limit been reached? */
- if (get_timer (start)
+ if (time_since_ms(start)
>
CONFIG_SYS_FLASH_ERASE_TOUT)
{
@@ -771,12 +771,12 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (volatile unsigned char *) (info->start[l_sect]);
/* broken for 2x16: TODO */
while ((addr[0] & 0x80) != 0x80) {
- if ((now = get_timer (start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -940,7 +940,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
flash_cmd (info->portwidth, addr, 0,
CHIP_CMD_RD_STAT);
/* init. the timeout counter */
- start = get_timer (0);
+ start = time_now_ms();
/* keep looping while the flash is not ready */
/* exit the loop by timing out or the flash */
/* becomes ready again */
@@ -955,7 +955,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
/* while (addr[0] & mask) != mask) */
{
/* has the timeout limit been reached? */
- if (get_timer (start) >
+ if (time_since_ms(start) >
CONFIG_SYS_FLASH_WRITE_TOUT) {
/* timeout limit reached */
printf ("Time out limit reached programming address %08lx with data %08lx\n", dest, data);
@@ -1062,9 +1062,9 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
enable_interrupts ();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*((vu_long *) dest) & 0x00800080) != (data & 0x00800080)) {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/Marvell/common/intel_flash.c b/board/Marvell/common/intel_flash.c
index 42b3ee1..d25c270 100644
--- a/board/Marvell/common/intel_flash.c
+++ b/board/Marvell/common/intel_flash.c
@@ -150,9 +150,9 @@ int write_word_intel (bank_addr_t addr, bank_word_t value)
retval = 0;
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
do {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
retval = 1;
goto done;
}
@@ -208,13 +208,12 @@ int flash_erase_intel (flash_info_t * info, int s_first, int s_last)
printf ("- Warning: %d protected sector%s will not be erased!\n", prot, (prot > 1 ? "s" : ""));
}
- start = get_timer (0);
- last = 0;
+ start = time_ms_now();
+ last = start;
haderr = 0;
for (sect = s_first; sect <= s_last; sect++) {
if (info->protect[sect] == 0) { /* not protected */
- ulong estart;
int sectdone;
bank_erase_init (info, sect);
@@ -222,21 +221,19 @@ int flash_erase_intel (flash_info_t * info, int s_first, int s_last)
/* wait at least 80us - let's wait 1 ms */
udelay (1000);
- estart = get_timer (start);
+ start = time_now_ms();
do {
- now = get_timer (start);
-
- if (now - estart > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout (sect %d)\n", sect);
haderr = 1;
break;
}
#ifndef FLASH_DEBUG
/* show that we're waiting */
- if ((now - last) > 1000) { /* every second */
+ if (time_since_ms(last) > 1000) { /* every second */
putc ('.');
- last = now;
+ last = time_now_ms();
}
#endif
diff --git a/board/RPXClassic/flash.c b/board/RPXClassic/flash.c
index f07d960..1fd2073 100644
--- a/board/RPXClassic/flash.c
+++ b/board/RPXClassic/flash.c
@@ -309,11 +309,11 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (vu_long *)(info->start[l_sect]);
while ((addr[0] & 0x80808080) != 0x80808080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -434,9 +434,9 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*((vu_long *)dest) & 0x80808080) != (data & 0x80808080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/RPXlite/flash.c b/board/RPXlite/flash.c
index 788fcdf..4032e11 100644
--- a/board/RPXlite/flash.c
+++ b/board/RPXlite/flash.c
@@ -386,11 +386,11 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (vu_long *)(info->start[l_sect]);
while ((addr[0] & 0x80808080) != 0x80808080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -511,9 +511,9 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*((vu_long *)dest) & 0x80808080) != (data & 0x80808080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/RPXlite_dw/flash.c b/board/RPXlite_dw/flash.c
index 91788af..9914a36 100644
--- a/board/RPXlite_dw/flash.c
+++ b/board/RPXlite_dw/flash.c
@@ -356,11 +356,11 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (vu_long *)(info->start[l_sect]);
while ((addr[0] & 0x80808080) != 0x80808080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -480,9 +480,9 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*((vu_long *)dest) & 0x80808080) != (data & 0x80808080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/RRvision/flash.c b/board/RRvision/flash.c
index fdbe928..2907d1f 100644
--- a/board/RRvision/flash.c
+++ b/board/RRvision/flash.c
@@ -384,11 +384,11 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (vu_long*)(info->start[l_sect]);
while ((addr[0] & 0x00800080) != 0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
puts ("Timeout\n");
return 1;
}
@@ -509,9 +509,9 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*((vu_long *)dest) & 0x00800080) != (data & 0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/a3000/flash.c b/board/a3000/flash.c
index b671ce7..7320c8d 100644
--- a/board/a3000/flash.c
+++ b/board/a3000/flash.c
@@ -332,7 +332,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf ("\n");
}
- start = get_timer (0);
+ start = time_now_ms();
last = start;
/* Start erase on unprotected sectors */
for (sect = s_first; sect<=s_last; sect++) {
@@ -356,7 +356,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
udelay (1000);
while (((status = BS(*addr)) & BYTEME(0x00800080)) != BYTEME(0x00800080)) {
- if ((now=get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now=time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr = BS(0xB0); /* suspend erase */
*addr = BS(0xFF); /* reset to read mode */
@@ -436,10 +436,10 @@ static int write_data (flash_info_t *info, uchar *dest, uchar data)
enable_interrupts();
}
- start = get_timer (0);
+ start = time_now_ms();
while (((status = BS(*addr)) & BYTEME(0x00800080)) != BYTEME(0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = BS(0xFF); /* restore read mode */
return 1;
}
diff --git a/board/alaska/flash.c b/board/alaska/flash.c
index aed3b6f..90f63c3 100644
--- a/board/alaska/flash.c
+++ b/board/alaska/flash.c
@@ -359,9 +359,9 @@ static unsigned char intel_sector_protected (flash_info_t *info, ushort sector)
addr = (FPWV *) info->start[sector];
*addr = (FPW) INTEL_STATUS;
- start = get_timer (0);
+ start = time_now_ms();
while ((*addr & (FPW) INTEL_FINISHED) != (FPW) INTEL_FINISHED) {
- if (get_timer (start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
*addr = (FPW) INTEL_RESET; /* restore read mode */
printf("WSM busy too long, can't get prot status\n");
return 1;
@@ -443,7 +443,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
printf ("\n");
}
- start = get_timer (0);
+ start = time_now_ms();
last = start;
/* Disable interrupts which might cause a timeout here */
@@ -458,7 +458,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
printf ("Erasing sector %2d ... ", sect);
/* arm simple, non interrupt dependent timer */
- start = get_timer (0);
+ start = time_now_ms();
if (intel) {
*addr = (FPW) 0x00500050; /* clear status register */
@@ -479,7 +479,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
while (((status =
*addr) & (FPW) 0x00800080) !=
(FPW) 0x00800080) {
- if (get_timer (start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
if (intel) {
*addr = (FPW) 0x00B000B0; /* suspend erase */
@@ -680,11 +680,11 @@ static int write_data (flash_info_t * info, ulong dest, FPW data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer (0);
+ start = time_now_ms();
/* wait while polling the status register */
while ((*addr & (FPW) 0x00800080) != (FPW) 0x00800080) {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = (FPW) 0x00FF00FF; /* restore read mode */
return (1);
}
@@ -724,11 +724,11 @@ static int write_data_block (flash_info_t * info, ulong src, ulong dest)
*dstaddr = (FPW) 0x00e800e8; /* write block setup */
/* arm simple, non interrupt dependent timer */
- start = get_timer (0);
+ start = time_now_ms();
/* wait while polling the status register */
while ((*dstaddr & (FPW) 0x00800080) != (FPW) 0x00800080) {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*dstaddr = (FPW) 0x00FF00FF; /* restore read mode */
return (1);
}
@@ -742,11 +742,11 @@ static int write_data_block (flash_info_t * info, ulong src, ulong dest)
*dstaddr = (FPW) 0x00d000d0; /* write 32 to buffer */
/* arm simple, non interrupt dependent timer */
- start = get_timer (0);
+ start = time_now_ms();
/* wait while polling the status register */
while ((*dstaddr & (FPW) 0x00800080) != (FPW) 0x00800080) {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*dstaddr = (FPW) 0x00FF00FF; /* restore read mode */
return (1);
}
@@ -794,12 +794,12 @@ static int write_word_amd (flash_info_t * info, FPWV * dest, FPW data)
if (flag)
enable_interrupts ();
- start = get_timer (0);
+ start = time_now_ms();
/* data polling for D7 */
while (res == 0
&& (*dest & (FPW) 0x00800080) != (data & (FPW) 0x00800080)) {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*dest = (FPW) 0x00F000F0; /* reset bank */
res = 1;
}
@@ -853,10 +853,10 @@ int flash_real_protect (flash_info_t * info, long sector, int prot)
*addr = INTEL_CONFIRM; /* clear */
}
- start = get_timer (0);
+ start = time_now_ms();
while ((*addr & INTEL_FINISHED) != INTEL_FINISHED) {
- if (get_timer (start) > CONFIG_SYS_FLASH_UNLOCK_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_UNLOCK_TOUT) {
printf ("Flash lock bit operation timed out\n");
rc = 1;
break;
@@ -903,13 +903,13 @@ int flash_real_protect (flash_info_t * info, long sector, int prot)
info = &flash_info[bank];
for (i = 0; i < info->sector_count; i++) {
if (info->protect[i]) {
- start = get_timer (0);
+ start = time_now_ms();
addr = (FPWV *) (info->start[i]);
*addr = INTEL_LOCKBIT; /* Sector lock bit */
*addr = INTEL_PROTECT; /* set */
while ((*addr & INTEL_FINISHED) !=
INTEL_FINISHED) {
- if (get_timer (start) >
+ if (time_since_ms(start) >
CONFIG_SYS_FLASH_UNLOCK_TOUT) {
printf ("Flash lock bit operation timed out\n");
rc = 1;
diff --git a/board/altera/common/AMDLV065D.c b/board/altera/common/AMDLV065D.c
index 7a1b4d3..416a4eb 100644
--- a/board/altera/common/AMDLV065D.c
+++ b/board/altera/common/AMDLV065D.c
@@ -131,11 +131,11 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
/* Now just wait for 0xff & provide some user
* feedback while we wait.
*/
- start = get_timer (0);
+ start = time_now_ms();
while ( readb (addr2) != 0xff) {
udelay (1000 * 1000);
putc ('.');
- if (get_timer (start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("timeout\n");
return 1;
}
@@ -175,9 +175,9 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
writeb (b, dst);
/* Verify write */
- start = get_timer (0);
+ start = time_now_ms();
while (readb (dst) != b) {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return 1;
}
}
diff --git a/board/altera/common/flash.c b/board/altera/common/flash.c
index 83bb7c2..53a713a 100644
--- a/board/altera/common/flash.c
+++ b/board/altera/common/flash.c
@@ -121,14 +121,14 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
*addr2 = 0x30;
/* Now just wait for 0xff & provide some user
* feedback while we wait. Here we have to grant
- * timer interrupts. Otherwise get_timer() can't
+ * timer interrupts. Otherwise time_*() can't
* work right. */
ipri(oldpri);
- start = get_timer (0);
+ start = time_now_ms();
while (*addr2 != 0xff) {
udelay (1000 * 1000);
putc ('.');
- if (get_timer (start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("timeout\n");
return 1;
}
@@ -179,9 +179,9 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
*dst = b;
/* Verify write */
- start = get_timer (0);
+ start = time_now_ms();
while (*dst != b) {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
ipri (oldpri);
return 1;
}
diff --git a/board/amcc/common/flash.c b/board/amcc/common/flash.c
index 8f23375..ba2df44 100644
--- a/board/amcc/common/flash.c
+++ b/board/amcc/common/flash.c
@@ -359,11 +359,11 @@ static int wait_for_DQ7_1(flash_info_t * info, int sect)
volatile CONFIG_SYS_FLASH_WORD_SIZE *addr =
(CONFIG_SYS_FLASH_WORD_SIZE *) (info->start[sect]);
- start = get_timer(0);
+ start = time_now_ms();
last = start;
while ((addr[0] & (CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080) !=
(CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf("Timeout\n");
return -1;
}
@@ -603,11 +603,11 @@ static int write_word(flash_info_t * info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer(0);
+ start = time_now_ms();
while ((dest2[i] & (CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080) !=
(data2[i] & (CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
@@ -804,11 +804,11 @@ static int wait_for_DQ7_2(flash_info_t * info, int sect)
volatile CONFIG_SYS_FLASH_WORD_SIZE *addr =
(CONFIG_SYS_FLASH_WORD_SIZE *) (info->start[sect]);
- start = get_timer(0);
+ start = time_now_ms();
last = start;
while ((addr[0] & (CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080) !=
(CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf("Timeout\n");
return -1;
}
@@ -941,11 +941,11 @@ static int write_word_2(flash_info_t * info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer(0);
+ start = time_now_ms();
while ((dest2[i] & (CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080) !=
(data2[i] & (CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/amcc/taihu/flash.c b/board/amcc/taihu/flash.c
index e9fbbb1..15651a9 100644
--- a/board/amcc/taihu/flash.c
+++ b/board/amcc/taihu/flash.c
@@ -473,11 +473,11 @@ static int wait_for_DQ7_1(flash_info_t * info, int sect)
volatile CONFIG_SYS_FLASH_WORD_SIZE *addr =
(CONFIG_SYS_FLASH_WORD_SIZE *) (info->start[sect]);
- start = get_timer(0);
+ start = time_now_ms();
last = start;
while ((addr[0] & (CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080) !=
(CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf("Timeout\n");
return -1;
}
@@ -720,11 +720,11 @@ static int write_word(flash_info_t * info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer(0);
+ start = time_now_ms();
while ((dest2[i] & (CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080) !=
(data2[i] & (CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return 1;
}
}
@@ -932,11 +932,11 @@ static int wait_for_DQ7_2(flash_info_t * info, int sect)
volatile CONFIG_SYS_FLASH_WORD_SIZE *addr =
(CONFIG_SYS_FLASH_WORD_SIZE *) (info->start[sect]);
- start = get_timer(0);
+ start = time_now_ms();
last = start;
while (((CONFIG_SYS_FLASH_WORD_SIZE)addr[0] & (CONFIG_SYS_FLASH_WORD_SIZE) 0x80808080) !=
(CONFIG_SYS_FLASH_WORD_SIZE) 0x80808080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf("Timeout\n");
return -1;
}
@@ -1069,11 +1069,11 @@ static int write_word_2(flash_info_t * info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer(0);
+ start = time_now_ms();
while ((dest2[i] & (CONFIG_SYS_FLASH_WORD_SIZE) 0x80808080) !=
(data2[i] & (CONFIG_SYS_FLASH_WORD_SIZE) 0x80808080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return 1;
}
}
diff --git a/board/amcc/yucca/flash.c b/board/amcc/yucca/flash.c
index 20b6af9..f7fbccb 100644
--- a/board/amcc/yucca/flash.c
+++ b/board/amcc/yucca/flash.c
@@ -385,11 +385,11 @@ static int wait_for_DQ7_1(flash_info_t * info, int sect)
volatile CONFIG_SYS_FLASH_WORD_SIZE *addr =
(CONFIG_SYS_FLASH_WORD_SIZE *) (info->start[sect]);
- start = get_timer(0);
+ start = time_now_ms();
last = start;
while ((addr[0] & (CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080) !=
(CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf("Timeout\n");
return -1;
}
@@ -620,11 +620,11 @@ static int write_word(flash_info_t * info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer(0);
+ start = time_now_ms();
while ((dest2[i] & (CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080) !=
(data2[i] & (CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT)
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT)
return (1);
}
}
@@ -810,11 +810,11 @@ static int wait_for_DQ7_2(flash_info_t * info, int sect)
volatile CONFIG_SYS_FLASH_WORD_SIZE *addr =
(CONFIG_SYS_FLASH_WORD_SIZE *) (info->start[sect]);
- start = get_timer(0);
+ start = time_now_ms();
last = start;
while ((addr[0] & (CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080) !=
(CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf("Timeout\n");
return -1;
}
@@ -942,11 +942,11 @@ static int write_word_2(flash_info_t * info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer(0);
+ start = time_now_ms();
while ((dest2[i] & (CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080) !=
(data2[i] & (CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT)
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT)
return (1);
}
}
diff --git a/board/amirix/ap1000/flash.c b/board/amirix/ap1000/flash.c
index 1e742e5..588cec6 100644
--- a/board/amirix/ap1000/flash.c
+++ b/board/amirix/ap1000/flash.c
@@ -481,9 +481,9 @@ static int flash_status_check (flash_info_t * info, ulong sector, ulong tout,
ulong start;
/* Wait for command completion */
- start = get_timer (0);
+ start = time_now_ms();
while (!flash_isset (info, sector, 0, FLASH_STATUS_DONE)) {
- if (get_timer (start) > info->erase_blk_tout) {
+ if (time_since_ms(start) > info->erase_blk_tout) {
printf ("Flash %s timeout at address %lx\n", prompt,
info->start[sector]);
flash_write_cmd (info, sector, 0, FLASH_CMD_RESET);
diff --git a/board/armadillo/flash.c b/board/armadillo/flash.c
index cf7d7f6..5219a6e 100644
--- a/board/armadillo/flash.c
+++ b/board/armadillo/flash.c
@@ -193,7 +193,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
/* Start erase on unprotected sectors */
for (sect = s_first; sect <= s_last && !ctrlc (); sect++) {
/* ARM simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
if (info->protect[sect] == 0) { /* not protected */
@@ -252,7 +252,7 @@ static int write_word (flash_info_t * info, ulong dest, ushort data)
flag = disable_interrupts ();
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
base = dest & 0xF0000000;
FL_WORD (base + (0x555 << 1)) = 0xAA;
diff --git a/board/astro/mcf5373l/mcf5373l.c b/board/astro/mcf5373l/mcf5373l.c
index 3c09a21..3829702 100644
--- a/board/astro/mcf5373l/mcf5373l.c
+++ b/board/astro/mcf5373l/mcf5373l.c
@@ -160,8 +160,8 @@ void astro_put_char(char ch)
* Wait for last character to go. Timeout of 6ms should
* be enough for our lowest baud rate of 2400.
*/
- timer = get_timer(0);
- while (get_timer(timer) < 6) {
+ timer = time_now_ms();
+ while (time_since_ms(timer) < 6) {
if (readb(&uart->usr) & UART_USR_TXRDY)
break;
}
diff --git a/board/atc/flash.c b/board/atc/flash.c
index fd76723..d6b8c3e 100644
--- a/board/atc/flash.c
+++ b/board/atc/flash.c
@@ -434,7 +434,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf ("\n");
}
- last = get_timer(0);
+ last = time_now_ms();
/* Start erase on unprotected sectors */
for (sect = s_first; sect<=s_last && rcode == 0; sect++) {
@@ -468,7 +468,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (flag)
enable_interrupts();
- start = get_timer(0);
+ start = time_now_ms();
/* wait at least 50us for AMD, 80us for Intel.
* Let's wait 1 ms.
@@ -476,7 +476,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
udelay (1000);
while ((*addr & (FPW)0x00800080) != (FPW)0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
if (intel) {
@@ -490,16 +490,16 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
}
/* show that we're waiting */
- if ((get_timer(last)) > CONFIG_SYS_HZ) {/* every second */
+ if ((time_since_ms(last)) > CONFIG_SYS_HZ) {/* every second */
putc ('.');
- last = get_timer(0);
+ last = time_now_ms();
}
}
/* show that we're waiting */
- if ((get_timer(last)) > CONFIG_SYS_HZ) { /* every second */
+ if ((time_since_ms(last)) > CONFIG_SYS_HZ) { /* every second */
putc ('.');
- last = get_timer(0);
+ last = time_now_ms();
}
flash_reset(info); /* reset to read mode */
@@ -597,11 +597,11 @@ static int write_word_amd (flash_info_t *info, FPWV *dest, FPW data)
if (flag)
enable_interrupts();
- start = get_timer (0);
+ start = time_now_ms();
/* data polling for D7 */
while (res == 0 && (*dest & (FPW)0x00800080) != (data & (FPW)0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*dest = (FPW)0x00F000F0; /* reset bank */
res = 1;
}
@@ -644,10 +644,10 @@ static int write_word_intel (flash_info_t *info, FPWV *dest, FPW data)
if (flag)
enable_interrupts();
- start = get_timer (0);
+ start = time_now_ms();
while (res == 0 && (*dest & (FPW)0x00800080) != (FPW)0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*dest = (FPW)0x00B000B0; /* Suspend program */
res = 1;
}
diff --git a/board/atmel/at91rm9200dk/flash.c b/board/atmel/at91rm9200dk/flash.c
index be22743..ff7f20c 100644
--- a/board/atmel/at91rm9200dk/flash.c
+++ b/board/atmel/at91rm9200dk/flash.c
@@ -326,7 +326,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
printf ("Erasing sector %2d ... ", sect);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
if (info->protect[sect] == 0) { /* not protected */
volatile u16 *addr = (volatile u16 *) (info->start[sect]);
@@ -346,7 +346,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
result = *addr;
/* check timeout */
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
MEM_FLASH_ADDR1 = CMD_READ_ARRAY;
chip1 = TMO;
break;
@@ -427,7 +427,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait until flash is ready */
chip1 = 0;
@@ -435,7 +435,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
result = *addr;
/* check timeout */
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
chip1 = ERR | TMO;
break;
}
diff --git a/board/atmel/atstk1000/flash.c b/board/atmel/atstk1000/flash.c
index 0ba06dd..0ecea9c 100644
--- a/board/atmel/atstk1000/flash.c
+++ b/board/atmel/atstk1000/flash.c
@@ -108,7 +108,7 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
flags = disable_interrupts();
- start_time = get_timer(0);
+ start_time = time_now_ms();
/* Unlock sector */
writew(0xaa, fb + 0x555);
diff --git a/board/bmw/flash.c b/board/bmw/flash.c
index 57ffe08..12eceaa 100644
--- a/board/bmw/flash.c
+++ b/board/bmw/flash.c
@@ -620,14 +620,14 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (FLASH_WORD_SIZE *) (info->start[0] + ((info->start[l_sect] -
info->
start[0]) << sh8b));
while ((addr[0] & (FLASH_WORD_SIZE) 0x00800080) !=
(FLASH_WORD_SIZE) 0x00800080) {
- if ((now = get_timer (start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -763,10 +763,10 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
enable_interrupts ();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((dest2[i << sh8b] & (FLASH_WORD_SIZE) 0x00800080) !=
(data2[i] & (FLASH_WORD_SIZE) 0x00800080)) {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/c2mon/flash.c b/board/c2mon/flash.c
index d33cb6c..e9dda80 100644
--- a/board/c2mon/flash.c
+++ b/board/c2mon/flash.c
@@ -432,11 +432,11 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (vu_long*)(info->start[l_sect]);
while ((addr[0] & 0x00800080) != 0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -557,9 +557,9 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*((vu_long *)dest) & 0x00800080) != (data & 0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/cerf250/flash.c b/board/cerf250/flash.c
index e1e7807..0055dcc 100644
--- a/board/cerf250/flash.c
+++ b/board/cerf250/flash.c
@@ -266,14 +266,14 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf ("Erasing sector %2d ... ", sect);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
*addr = (FPW) 0x00500050; /* clear status register */
*addr = (FPW) 0x00200020; /* erase setup */
*addr = (FPW) 0x00D000D0; /* erase confirm */
while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr = (FPW) 0x00B000B0; /* suspend erase */
*addr = (FPW) 0x00FF00FF; /* reset to read mode */
@@ -404,11 +404,11 @@ static int write_data (flash_info_t *info, ulong dest, FPW data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait while polling the status register */
while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = (FPW) 0x00FF00FF; /* restore read mode */
return (1);
}
diff --git a/board/cm4008/flash.c b/board/cm4008/flash.c
index d6fd519..459721e 100644
--- a/board/cm4008/flash.c
+++ b/board/cm4008/flash.c
@@ -251,7 +251,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
printf ("Erasing sector %2d ... ", sect);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
addr = (volatile unsigned char *) (info->start[sect]);
*addr = 0x50; /* clear status register */
@@ -259,7 +259,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
*addr = 0xD0; /* erase confirm */
while (((status = *addr) & 0x80) != 0x80) {
- if (get_timer(start) >
+ if (time_since_ms(start) >
CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr = 0xB0; /* suspend erase */
@@ -386,11 +386,11 @@ static int write_data (flash_info_t * info, ulong dest, unsigned char data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait while polling the status register */
while (((status = *addr) & 0x80) != 0x80) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = 0xFF; /* restore read mode */
return (1);
}
diff --git a/board/cm41xx/flash.c b/board/cm41xx/flash.c
index d6fd519..459721e 100644
--- a/board/cm41xx/flash.c
+++ b/board/cm41xx/flash.c
@@ -251,7 +251,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
printf ("Erasing sector %2d ... ", sect);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
addr = (volatile unsigned char *) (info->start[sect]);
*addr = 0x50; /* clear status register */
@@ -259,7 +259,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
*addr = 0xD0; /* erase confirm */
while (((status = *addr) & 0x80) != 0x80) {
- if (get_timer(start) >
+ if (time_since_ms(start) >
CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr = 0xB0; /* suspend erase */
@@ -386,11 +386,11 @@ static int write_data (flash_info_t * info, ulong dest, unsigned char data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait while polling the status register */
while (((status = *addr) & 0x80) != 0x80) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = 0xFF; /* restore read mode */
return (1);
}
diff --git a/board/cmc_pu2/flash.c b/board/cmc_pu2/flash.c
index d10faab..3209266 100644
--- a/board/cmc_pu2/flash.c
+++ b/board/cmc_pu2/flash.c
@@ -335,11 +335,11 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer(0);
+ start = time_now_ms();
last = 0;
addr = (vu_short *)(info->start[l_sect]);
while ((addr[0] & 0x0080) != 0x0080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -456,11 +456,11 @@ static int write_word_amd (flash_info_t *info, vu_short *dest, ushort data)
if (flag)
enable_interrupts();
- start = get_timer(0);
+ start = time_now_ms();
/* data polling for D7 */
while ((*dest & 0x0080) != (data & 0x0080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*dest = 0x00F0; /* reset bank */
return (1);
}
diff --git a/board/cmi/flash.c b/board/cmi/flash.c
index 630c330..cda5fda 100644
--- a/board/cmi/flash.c
+++ b/board/cmi/flash.c
@@ -317,7 +317,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf ("\n");
}
- start = get_timer (0);
+ start = time_now_ms();
last = start;
/* Start erase on unprotected sectors */
@@ -345,7 +345,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
udelay (1000);
while (((status = *addr) & FLASH_STATUS_DONE) != FLASH_STATUS_DONE) {
- if ((now=get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now=time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf("Flash erase timeout at address %lx\n", info->start[sect]);
*addr = FLASH_CMD_SUSPEND_ERASE;
*addr = FLASH_CMD_RESET;
@@ -469,11 +469,11 @@ static int write_short (flash_info_t *info, ulong dest, ushort data)
}
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
/* wait for error or finish */
while(!(addr[0] & FLASH_STATUS_DONE)){
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
addr[0] = FLASH_CMD_RESET;
return (1);
}
@@ -502,9 +502,9 @@ int flash_real_protect(flash_info_t *info, long sector, int prot)
}
/* wait for error or finish */
- start = get_timer (0);
+ start = time_now_ms();
while(!(addr[0] & FLASH_STATUS_DONE)){
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf("Flash protect timeout at address %lx\n", info->start[sector]);
addr[0] = FLASH_CMD_RESET;
return (1);
diff --git a/board/cobra5272/flash.c b/board/cobra5272/flash.c
index e8f02eb..b25da1c 100644
--- a/board/cobra5272/flash.c
+++ b/board/cobra5272/flash.c
@@ -191,7 +191,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
printf ("Erasing sector %2d ... ", sect);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
if (info->protect[sect] == 0) { /* not protected */
volatile u16 *addr =
@@ -212,7 +212,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
result = *addr;
/* check timeout */
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
MEM_FLASH_ADDR1 = CMD_READ_ARRAY;
chip1 = TMO;
break;
@@ -293,7 +293,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait until flash is ready */
chip1 = 0;
@@ -301,7 +301,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
result = *addr;
/* check timeout */
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
chip1 = ERR | TMO;
break;
}
diff --git a/board/cogent/flash.c b/board/cogent/flash.c
index e6c85b6..21660aa 100644
--- a/board/cogent/flash.c
+++ b/board/cogent/flash.c
@@ -262,9 +262,9 @@ c302f_write_word(c302f_addr_t addr, c302f_word_t value)
retval = 0;
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
do {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
retval = 1;
goto done;
}
@@ -453,7 +453,7 @@ flash_erase(flash_info_t *info, int s_first, int s_last)
prot, (prot > 1 ? "s" : ""));
}
- start = get_timer (0);
+ start = time_now_ms();
last = 0;
haderr = 0;
@@ -467,10 +467,10 @@ flash_erase(flash_info_t *info, int s_first, int s_last)
/* wait at least 80us - let's wait 1 ms */
udelay (1000);
- estart = get_timer(start);
+ estart = time_since_ms(start);
do {
- now = get_timer(start);
+ now = time_since_ms(start);
if (now - estart > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout (sect %d)\n", sect);
@@ -559,7 +559,7 @@ write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt)
/*
* handle word aligned part
*/
- start = get_timer (0);
+ start = time_now_ms();
last = 0;
while (cnt >= 4) {
data = 0;
@@ -573,7 +573,7 @@ write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt)
cnt -= 4;
/* show that we're waiting */
- now = get_timer(start);
+ now = time_since_ms(start);
if ((now - last) > 1000) { /* every second */
putc ('.');
last = now;
diff --git a/board/cpc45/flash.c b/board/cpc45/flash.c
index 8fe7584..5847f95 100644
--- a/board/cpc45/flash.c
+++ b/board/cpc45/flash.c
@@ -276,7 +276,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
printf ("\n");
}
- start = get_timer (0);
+ start = time_now_ms();
last = start;
/* Start erase on unprotected sectors */
for (sect = s_first; sect <= s_last; sect++) {
@@ -308,7 +308,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
while (((addr[0] & 0x00800080) != 0x00800080) ||
((addr[1] & 0x00800080) != 0x00800080)) {
- if ((now = get_timer (start)) >
+ if ((now = time_since_ms(start)) >
CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
addr[0] = 0x00B000B0; /* suspend erase */
@@ -482,11 +482,11 @@ static int write_data (flash_info_t * info, ulong dest, ulong * data)
if (flag)
enable_interrupts ();
- start = get_timer (0);
+ start = time_now_ms();
while (((addr[0] & 0x00800080) != 0x00800080) ||
((addr[1] & 0x00800080) != 0x00800080)) {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
addr[0] = 0x00FF00FF; /* restore read mode */
return (1);
}
diff --git a/board/cpu86/flash.c b/board/cpu86/flash.c
index 8135780..29cd5c6 100644
--- a/board/cpu86/flash.c
+++ b/board/cpu86/flash.c
@@ -378,11 +378,11 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
if (l_sect < 0)
goto AMD_DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (vu_char *)(info->start[l_sect]);
while ((addr[0] & 0x80) != 0x80) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -408,7 +408,7 @@ AMD_DONE:
volatile ulong *addr =
(volatile unsigned long *) info->start[sect];
- start = get_timer (0);
+ start = time_now_ms();
last = start;
if (info->protect[sect] == 0) {
/* Disable interrupts which might cause a timeout here
@@ -434,7 +434,7 @@ AMD_DONE:
last = start;
while ((addr[0] & 0x00800080) != 0x00800080 ||
(addr[1] & 0x00800080) != 0x00800080) {
- if ((now = get_timer (start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout (erase suspended!)\n");
/* Suspend erase
*/
@@ -547,9 +547,9 @@ static int write_word (flash_info_t * info, volatile unsigned long *addr,
if (flag)
enable_interrupts ();
- start = get_timer (0);
+ start = time_now_ms();
while ((*addr & 0x00800080) != 0x00800080) {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
/* Suspend program
*/
*addr = 0x00B000B0;
@@ -602,9 +602,9 @@ static int write_byte (flash_info_t *info, ulong dest, uchar data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*((vu_char *)dest) & 0x80) != (data & 0x80)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/cpu87/flash.c b/board/cpu87/flash.c
index c35757b..b315dfb 100644
--- a/board/cpu87/flash.c
+++ b/board/cpu87/flash.c
@@ -387,11 +387,11 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
if (l_sect < 0)
goto AMD_DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (vu_char *)(info->start[l_sect]);
while ((addr[0] & 0x80) != 0x80) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -417,7 +417,7 @@ AMD_DONE:
volatile ulong *addr =
(volatile unsigned long *) info->start[sect];
- start = get_timer (0);
+ start = time_now_ms();
last = start;
if (info->protect[sect] == 0) {
/* Disable interrupts which might cause a timeout here
@@ -443,7 +443,7 @@ AMD_DONE:
last = start;
while ((addr[0] & 0x00800080) != 0x00800080 ||
(addr[1] & 0x00800080) != 0x00800080) {
- if ((now = get_timer (start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout (erase suspended!)\n");
/* Suspend erase
*/
@@ -556,9 +556,9 @@ static int write_word (flash_info_t * info, volatile unsigned long *addr,
if (flag)
enable_interrupts ();
- start = get_timer (0);
+ start = time_now_ms();
while ((*addr & 0x00800080) != 0x00800080) {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
/* Suspend program
*/
*addr = 0x00B000B0;
@@ -611,9 +611,9 @@ static int write_byte (flash_info_t *info, ulong dest, uchar data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*((vu_char *)dest) & 0x80) != (data & 0x80)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/cradle/flash.c b/board/cradle/flash.c
index 1601782..bb188f7 100644
--- a/board/cradle/flash.c
+++ b/board/cradle/flash.c
@@ -174,7 +174,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
printf ("Erasing sector %2d ... ", sect);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
if (info->protect[sect] == 0) { /* not protected */
vu_short *addr = (vu_short *) (info->start[sect]);
@@ -183,7 +183,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
*addr = 0xD0; /* erase confirm */
while ((*addr & 0x80) != 0x80) {
- if (get_timer(start) >
+ if (time_since_ms(start) >
CONFIG_SYS_FLASH_ERASE_TOUT) {
*addr = 0xB0; /* suspend erase */
*addr = 0xFF; /* reset to read mode */
@@ -248,11 +248,11 @@ static int write_word (flash_info_t * info, ulong dest, ushort data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait while polling the status register */
while (((val = *addr) & 0x80) != 0x80) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
rc = ERR_TIMOUT;
/* suspend program command */
*addr = 0xB0;
diff --git a/board/cray/L1/flash.c b/board/cray/L1/flash.c
index a3d893e..8209bb1 100644
--- a/board/cray/L1/flash.c
+++ b/board/cray/L1/flash.c
@@ -250,10 +250,10 @@ int wait_for_DQ7(flash_info_t *info, int sect)
ulong start, now, last;
volatile FLASH_WORD_SIZE *addr = (FLASH_WORD_SIZE *)(info->start[sect]);
- start = get_timer (0);
+ start = time_now_ms();
last = start;
while ((addr[0] & (FLASH_WORD_SIZE)0x00800080) != (FLASH_WORD_SIZE)0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return -1;
}
@@ -454,10 +454,10 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((dest2[i] & (FLASH_WORD_SIZE)0x00800080) !=
(data2[i] & (FLASH_WORD_SIZE)0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/csb226/flash.c b/board/csb226/flash.c
index e103470..7a8e576 100644
--- a/board/csb226/flash.c
+++ b/board/csb226/flash.c
@@ -176,7 +176,7 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
printf("Erasing sector %2d ... ", sect);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
if (info->protect[sect] == 0) { /* not protected */
u32 * volatile addr = (u32 * volatile)(info->start[sect]);
@@ -190,7 +190,7 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
*addr = 0x00D000D0; /* erase confirm */
while ((*addr & 0x00800080) != 0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
*addr = 0x00B000B0; /* suspend erase*/
*addr = 0x00FF00FF; /* read mode */
rc = ERR_TIMOUT;
@@ -249,11 +249,11 @@ static int write_long (flash_info_t *info, ulong dest, ulong data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait while polling the status register */
while(((val = *addr) & 0x00800080) != 0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
rc = ERR_TIMOUT;
/* suspend program command */
*addr = 0x00B000B0;
diff --git a/board/cu824/flash.c b/board/cu824/flash.c
index bd0f8d3..22e7d0d 100644
--- a/board/cu824/flash.c
+++ b/board/cu824/flash.c
@@ -235,7 +235,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf ("\n");
}
- start = get_timer (0);
+ start = time_now_ms();
last = start;
/* Start erase on unprotected sectors */
for (sect = s_first; sect<=s_last; sect++) {
@@ -267,7 +267,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
while (((addr[0] & 0x00800080) != 0x00800080) ||
((addr[1] & 0x00800080) != 0x00800080) ) {
- if ((now=get_timer(start)) >
+ if ((now=time_since_ms(start)) >
CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
addr[0] = 0x00B000B0; /* suspend erase */
@@ -448,11 +448,11 @@ static int write_data (flash_info_t *info, ulong dest, ulong *data)
if (flag)
enable_interrupts();
- start = get_timer (0);
+ start = time_now_ms();
while (((addr[0] & 0x00800080) != 0x00800080) ||
((addr[1] & 0x00800080) != 0x00800080) ) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
addr[0] = 0x00FF00FF; /* restore read mode */
return (1);
}
diff --git a/board/dave/common/flash.c b/board/dave/common/flash.c
index 29caf47..1d3efc8 100644
--- a/board/dave/common/flash.c
+++ b/board/dave/common/flash.c
@@ -535,11 +535,11 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (CONFIG_SYS_FLASH_WORD_SIZE *)(info->start[l_sect]);
while ((addr[0] & (CONFIG_SYS_FLASH_WORD_SIZE)0x00800080) != (CONFIG_SYS_FLASH_WORD_SIZE)0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -691,10 +691,10 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((dest2[i] & (CONFIG_SYS_FLASH_WORD_SIZE)0x00800080) !=
(data2[i] & (CONFIG_SYS_FLASH_WORD_SIZE)0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/dnp1110/flash.c b/board/dnp1110/flash.c
index 53f89ee..8b9fe78 100644
--- a/board/dnp1110/flash.c
+++ b/board/dnp1110/flash.c
@@ -257,14 +257,14 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf("Erasing sector %2d ... ", sect);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
*addr = (FPW)0x00500050; /* clear status register */
*addr = (FPW)0x00200020; /* erase setup */
*addr = (FPW)0x00D000D0; /* erase confirm */
while (((status = *addr) & (FPW)0x00800080) != (FPW)0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr = (FPW)0x00B000B0; /* suspend erase */
*addr = (FPW)0x00FF00FF; /* reset to read mode */
@@ -396,11 +396,11 @@ static int write_data (flash_info_t *info, ulong dest, FPW data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait while polling the status register */
while (((status = *addr) & (FPW)0x00800080) != (FPW)0x00800080) {
- if (start = get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (start = time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = (FPW)0x00FF00FF; /* restore read mode */
return (1);
}
diff --git a/board/earthlcd/favr-32-ezkit/flash.c b/board/earthlcd/favr-32-ezkit/flash.c
index 0a26146..5cb5bf7 100644
--- a/board/earthlcd/favr-32-ezkit/flash.c
+++ b/board/earthlcd/favr-32-ezkit/flash.c
@@ -106,7 +106,7 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
flags = disable_interrupts();
- start_time = get_timer(0);
+ start_time = time_now_ms();
/* Unlock sector */
writew(0xaa, fb + 0x555);
diff --git a/board/eltec/bab7xx/flash.c b/board/eltec/bab7xx/flash.c
index 21ae098..89b4c0d 100644
--- a/board/eltec/bab7xx/flash.c
+++ b/board/eltec/bab7xx/flash.c
@@ -366,11 +366,11 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (FLASH_WORD_SIZE *)(info->start[l_sect]);
while ((addr[0] & (FLASH_WORD_SIZE)0x00800080) != (FLASH_WORD_SIZE)0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -497,10 +497,10 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((dest2[i] & (FLASH_WORD_SIZE)0x00800080) !=
(data2[i] & (FLASH_WORD_SIZE)0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/eltec/elppc/flash.c b/board/eltec/elppc/flash.c
index 21ae098..89b4c0d 100644
--- a/board/eltec/elppc/flash.c
+++ b/board/eltec/elppc/flash.c
@@ -366,11 +366,11 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (FLASH_WORD_SIZE *)(info->start[l_sect]);
while ((addr[0] & (FLASH_WORD_SIZE)0x00800080) != (FLASH_WORD_SIZE)0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -497,10 +497,10 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((dest2[i] & (FLASH_WORD_SIZE)0x00800080) !=
(data2[i] & (FLASH_WORD_SIZE)0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/eltec/mhpc/flash.c b/board/eltec/mhpc/flash.c
index 2fbdb27..8d1e3c9 100644
--- a/board/eltec/mhpc/flash.c
+++ b/board/eltec/mhpc/flash.c
@@ -254,7 +254,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf ("\n");
}
- start = get_timer (0);
+ start = time_now_ms();
last = start;
/* Start erase on unprotected sectors */
for (sect = s_first; sect<=s_last; sect++) {
@@ -277,7 +277,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
udelay (1000);
while (((status = SWAP(*addr)) & (FPW)0x00800080) != (FPW)0x00800080) {
- if ((now=get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now=time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr = (FPW)0xB000B000; /* suspend erase */
*addr = (FPW)0xFF00FF00; /* reset to read mode */
@@ -416,10 +416,10 @@ static int write_data (flash_info_t *info, ulong dest, FPW data)
if (flag)
enable_interrupts();
- start = get_timer (0);
+ start = time_now_ms();
while (((status = SWAP(*addr)) & (FPW)0x00800080) != (FPW)0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = (FPW)0xFF00FF00; /* restore read mode */
return (1);
}
diff --git a/board/emk/common/flash.c b/board/emk/common/flash.c
index 8579cfa..3ff2f9c 100644
--- a/board/emk/common/flash.c
+++ b/board/emk/common/flash.c
@@ -417,7 +417,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf ("\n");
}
- last = get_timer(0);
+ last = time_now_ms();
/* Start erase on unprotected sectors */
for (sect = s_first; sect<=s_last && rcode == 0; sect++) {
@@ -451,7 +451,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (flag)
enable_interrupts();
- start = get_timer(0);
+ start = time_now_ms();
/* wait at least 50us for AMD, 80us for Intel.
* Let's wait 1 ms.
@@ -459,7 +459,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
udelay (1000);
while ((*addr & (FPW)0x00800080) != (FPW)0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
if (intel) {
@@ -473,16 +473,16 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
}
/* show that we're waiting */
- if ((get_timer(last)) > CONFIG_SYS_HZ) {/* every second */
+ if ((time_since_ms(last)) > CONFIG_SYS_HZ) {/* every second */
putc ('.');
- last = get_timer(0);
+ last = time_now_ms();
}
}
/* show that we're waiting */
- if ((get_timer(last)) > CONFIG_SYS_HZ) { /* every second */
+ if ((time_since_ms(last)) > CONFIG_SYS_HZ) { /* every second */
putc ('.');
- last = get_timer(0);
+ last = time_now_ms();
}
flash_reset(info); /* reset to read mode */
@@ -577,11 +577,11 @@ static int write_word_amd (flash_info_t *info, FPWV *dest, FPW data)
if (flag)
enable_interrupts();
- start = get_timer (0);
+ start = time_now_ms();
/* data polling for D7 */
while (res == 0 && (*dest & (FPW)0x00800080) != (data & (FPW)0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*dest = (FPW)0x00F000F0; /* reset bank */
res = 1;
}
diff --git a/board/ep7312/flash.c b/board/ep7312/flash.c
index 2ed9c9a..9dec9b7 100644
--- a/board/ep7312/flash.c
+++ b/board/ep7312/flash.c
@@ -157,7 +157,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
printf ("Erasing sector %2d ... ", sect);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
if (info->protect[sect] == 0) { /* not protected */
vu_short *addr = (vu_short *) (info->start[sect]);
@@ -166,7 +166,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
*addr = 0xD0; /* erase confirm */
while ((*addr & 0x80) != 0x80) {
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
*addr = 0xB0; /* suspend erase */
*addr = 0xFF; /* reset to read mode */
rc = ERR_TIMOUT;
@@ -230,11 +230,11 @@ static int write_word (flash_info_t * info, ulong dest, ushort data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait while polling the status register */
while (((val = *addr) & 0x80) != 0x80) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
rc = ERR_TIMOUT;
/* suspend program command */
*addr = 0xB0;
diff --git a/board/ep8260/flash.c b/board/ep8260/flash.c
index 2a81de5..eb3cefc 100644
--- a/board/ep8260/flash.c
+++ b/board/ep8260/flash.c
@@ -279,12 +279,12 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
while ((V_ULONG( info->start[l_sect] ) & 0x00800080) != 0x00800080 ||
(V_ULONG( info->start[l_sect] + 4 ) & 0x00800080) != 0x00800080)
{
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -400,10 +400,10 @@ static int write_dword (flash_info_t *info, ulong dest, unsigned char * pdata)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while (((V_ULONG( dest ) & 0x00800080) != (ch & 0x00800080)) ||
((V_ULONG( dest + 4 ) & 0x00800080) != (cl & 0x00800080))) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/esd/common/flash.c b/board/esd/common/flash.c
index b9c7885..5ca9c02 100644
--- a/board/esd/common/flash.c
+++ b/board/esd/common/flash.c
@@ -527,11 +527,11 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (CONFIG_SYS_FLASH_WORD_SIZE *)(info->start[l_sect]);
while ((addr[0] & (CONFIG_SYS_FLASH_WORD_SIZE)0x00800080) != (CONFIG_SYS_FLASH_WORD_SIZE)0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -659,10 +659,10 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((dest2[i] & (CONFIG_SYS_FLASH_WORD_SIZE)0x00800080) !=
(data2[i] & (CONFIG_SYS_FLASH_WORD_SIZE)0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/esd/cpci5200/strataflash.c b/board/esd/cpci5200/strataflash.c
index 9b578b5..d90a2c9 100644
--- a/board/esd/cpci5200/strataflash.c
+++ b/board/esd/cpci5200/strataflash.c
@@ -408,9 +408,9 @@ static int flash_status_check(flash_info_t * info, ulong sector, ulong tout,
ulong start;
/* Wait for command completion */
- start = get_timer(0);
+ start = time_now_ms();
while (!flash_isset(info, sector, 0, FLASH_STATUS_DONE)) {
- if (get_timer(start) > info->erase_blk_tout) {
+ if (time_since_ms(start) > info->erase_blk_tout) {
printf("Flash %s timeout at address %lx\n", prompt,
info->start[sector]);
flash_write_cmd(info, sector, 0, FLASH_CMD_RESET);
diff --git a/board/esd/pf5200/flash.c b/board/esd/pf5200/flash.c
index 9850445..65ca214 100644
--- a/board/esd/pf5200/flash.c
+++ b/board/esd/pf5200/flash.c
@@ -297,7 +297,7 @@ int flash_erase(flash_info_t * info, int s_first, int s_last) {
printf("\n");
}
- last = get_timer(0);
+ last = time_now_ms();
/* Start erase on unprotected sectors */
for (sect = s_first; sect <= s_last && rcode == 0; sect++) {
@@ -329,14 +329,14 @@ int flash_erase(flash_info_t * info, int s_first, int s_last) {
if (flag) {
enable_interrupts();
}
- start = get_timer(0);
+ start = time_now_ms();
/* wait at least 50us for AMD, 80us for Intel. */
/* Let's wait 1 ms. */
udelay(1000);
while ((*addr & (FPW) 0x00800080) != (FPW) 0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf("Timeout\n");
if (intel) {
/* suspend erase */
@@ -347,17 +347,17 @@ int flash_erase(flash_info_t * info, int s_first, int s_last) {
break;
}
/* show that we're waiting */
- if ((get_timer(last)) > CONFIG_SYS_HZ) {
+ if ((time_since_ms(last)) > CONFIG_SYS_HZ) {
/* every second */
putc('.');
- last = get_timer(0);
+ last = time_now_ms();
}
}
/* show that we're waiting */
- if ((get_timer(last)) > CONFIG_SYS_HZ) {
+ if ((time_since_ms(last)) > CONFIG_SYS_HZ) {
/* every second */
putc('.');
- last = get_timer(0);
+ last = time_now_ms();
}
flash_reset(info); /* reset to read mode */
}
@@ -447,12 +447,12 @@ static int write_word_amd(flash_info_t * info, FPWV * dest, FPW data) {
if (flag) {
enable_interrupts();
}
- start = get_timer(0);
+ start = time_now_ms();
/* data polling for D7 */
while (res == 0
&& (*dest & (FPW) 0x00800080) != (data & (FPW) 0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*dest = (FPW) 0x00F000F0; /* reset bank */
res = 1;
}
diff --git a/board/esteem192e/flash.c b/board/esteem192e/flash.c
index cce73fa..bf8fa52 100644
--- a/board/esteem192e/flash.c
+++ b/board/esteem192e/flash.c
@@ -764,12 +764,12 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (volatile FLASH_WORD_SIZE *) (info->start[l_sect]);
while ((addr[0] & (0x00800080 & FLASH_ID_MASK)) !=
(0x00800080 & FLASH_ID_MASK)) {
- if ((now = get_timer (start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -1016,13 +1016,13 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
enable_interrupts ();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
if (info->flash_id > FLASH_AMD_COMP) {
while ((*((vu_long *) dest) & 0x00800080) !=
(data & 0x00800080)) {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
@@ -1030,7 +1030,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
} else {
while (!(addr[0] & 0x00800080)) { /* wait for error or finish */
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
@@ -1091,12 +1091,12 @@ static int write_short (flash_info_t * info, ulong dest, ushort data)
enable_interrupts ();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
if (info->flash_id < FLASH_AMD_COMP) {
/* AMD stuff */
while ((*((vu_short *) dest) & 0x0080) != (data & 0x0080)) {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
@@ -1104,7 +1104,7 @@ static int write_short (flash_info_t * info, ulong dest, ushort data)
} else {
/* intel stuff */
while (!(addr[0] & 0x0080)) { /* wait for error or finish */
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT)
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT)
return (1);
}
@@ -1123,7 +1123,7 @@ static int write_short (flash_info_t * info, ulong dest, ushort data)
*addr = 0x00B0;
*addr = 0x0070;
while (!(addr[0] & 0x0080)) { /* wait for error or finish */
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT)
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT)
return (1);
}
*addr = 0x00FF;
diff --git a/board/etin/debris/flash.c b/board/etin/debris/flash.c
index f9e8619..efecc03 100644
--- a/board/etin/debris/flash.c
+++ b/board/etin/debris/flash.c
@@ -94,13 +94,13 @@ static int cfi_write_dword(flash_info_t *flash, ulong dest, cfi_word data)
cfi_write(flash, data, dest);
udelay(10);
- start = get_timer (0);
+ start = time_now_ms();
for(;;) {
status = cfi_read(flash, dest);
status &= CMD(0x80);
if(status == CMD(0x80))
break;
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
cfi_cmd(flash, 0xff, 0);
return 1;
}
@@ -126,10 +126,10 @@ static int jedec_write_dword (flash_info_t *flash, ulong dest, cfi_word data)
cfi_write(flash, data, dest);
udelay(10);
- start = get_timer (0);
+ start = time_now_ms();
status = ~data;
while(status != data) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT)
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT)
return 1;
status = cfi_read(flash, dest);
udelay(1);
@@ -223,7 +223,7 @@ static int cfi_erase_oneblock(flash_info_t *flash, uint32_t sect)
enable_interrupts();
udelay(1000);
- start = get_timer (0);
+ start = time_now_ms();
last = start;
for (;;) {
@@ -231,7 +231,7 @@ static int cfi_erase_oneblock(flash_info_t *flash, uint32_t sect)
status &= CMD(0x80);
if (status == CMD(0x80))
break;
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
cfi_cmd(flash, 0xff, 0);
printf ("Timeout\n");
return ERR_TIMOUT;
@@ -290,14 +290,14 @@ static int jedec_erase(flash_info_t *flash, uint32_t s_first, uint32_t s_last)
goto DONE;
udelay (1000);
- start = get_timer (0);
+ start = time_now_ms();
last = start;
for(;;) {
status = cfi_read(flash, sa);
if (status == CMD(0xffff))
break;
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return ERR_TIMOUT;
}
diff --git a/board/etx094/flash.c b/board/etx094/flash.c
index fa51c90..9f9e9bb 100644
--- a/board/etx094/flash.c
+++ b/board/etx094/flash.c
@@ -506,7 +506,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf ("\n");
}
- start = get_timer (0);
+ start = time_now_ms();
last = start;
/* Start erase on unprotected sectors */
for (sect = s_first; sect<=s_last; sect++) {
@@ -548,7 +548,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
#else
while ((sect_addr[0] & 0x00800080) != 0x00800080) {
#endif
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -691,9 +691,9 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*((vu_short *)dest) & 0x0080) != (high_data & 0x0080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
@@ -725,7 +725,7 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
#ifdef CONFIG_FLASH_16BIT
while ((*((vu_short *)dest) & 0x0080) != (low_data & 0x0080)) {
@@ -733,7 +733,7 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
while ((*((vu_long *)dest) & 0x00800080) != (data & 0x00800080)) {
#endif
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/evb4510/flash.c b/board/evb4510/flash.c
index c9c6e02..d8c4393 100644
--- a/board/evb4510/flash.c
+++ b/board/evb4510/flash.c
@@ -200,8 +200,8 @@ static u16 _flash_poll (FLASH_DEV dev, u32 addr, u16 data, ulong timeOut)
volatile u16 flashData;
data = data & 0xFF;
- t0 = get_timer (0);
- while (get_timer (t0) < timeOut) {
+ t0 = time_now_ms();
+ while (time_since_ms(t0) < timeOut) {
/* for( i = 0; i < POLL_LOOPS; i++) { */
/* Read the Data */
flashData = GET__U8 (addr);
diff --git a/board/evb64260/flash.c b/board/evb64260/flash.c
index 825bbaf..8935883 100644
--- a/board/evb64260/flash.c
+++ b/board/evb64260/flash.c
@@ -676,12 +676,12 @@ flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (volatile unsigned char *)(info->start[l_sect]);
/* broken for 2x16: TODO */
while ((addr[0] & 0x80) != 0x80) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -843,9 +843,9 @@ write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*((vu_long *)dest) & 0x00800080) != (data & 0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/evb64260/intel_flash.c b/board/evb64260/intel_flash.c
index 994264a..289b989 100644
--- a/board/evb64260/intel_flash.c
+++ b/board/evb64260/intel_flash.c
@@ -155,9 +155,9 @@ write_word_intel(bank_addr_t addr, bank_word_t value)
retval = 0;
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
do {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_now_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
retval = 1;
goto done;
}
@@ -215,8 +215,8 @@ flash_erase_intel(flash_info_t *info, int s_first, int s_last)
prot, (prot > 1 ? "s" : ""));
}
- start = get_timer (0);
- last = 0;
+ start = time_now_ms();
+ last = start;
haderr = 0;
for (sect = s_first; sect <= s_last; sect++) {
@@ -229,12 +229,10 @@ flash_erase_intel(flash_info_t *info, int s_first, int s_last)
/* wait at least 80us - let's wait 1 ms */
udelay (1000);
- estart = get_timer(start);
+ start = time_now_ms();
do {
- now = get_timer(start);
-
- if (now - estart > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout (sect %d)\n", sect);
haderr = 1;
break;
@@ -242,9 +240,9 @@ flash_erase_intel(flash_info_t *info, int s_first, int s_last)
#ifndef FLASH_DEBUG
/* show that we're waiting */
- if ((now - last) > 1000) { /* every second */
+ if (time_since_ms(last) > 1000) { /* every second */
putc ('.');
- last = now;
+ last = time_now_ms();
}
#endif
diff --git a/board/fads/flash.c b/board/fads/flash.c
index b9afb75..d21e7aa 100644
--- a/board/fads/flash.c
+++ b/board/fads/flash.c
@@ -423,12 +423,12 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (vu_long *) (info->start[l_sect]);
while ((addr[0] & 0xFFFFFFFF) != 0xFFFFFFFF)
{
- if ((now = get_timer (start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return ERR_TIMOUT;
}
@@ -549,10 +549,10 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
enable_interrupts ();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*((vu_long *) dest) & 0x80808080) != (data & 0x80808080))
{
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return ERR_TIMOUT;
}
}
diff --git a/board/flagadm/flash.c b/board/flagadm/flash.c
index a69b1a4..6b41931 100644
--- a/board/flagadm/flash.c
+++ b/board/flagadm/flash.c
@@ -374,7 +374,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf ("\n");
}
- start = get_timer (0);
+ start = time_now_ms();
/* Start erase on unprotected sectors */
for (sect = s_first; sect<=s_last; sect++) {
@@ -400,7 +400,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
*addr = 0x70; /*Read status register command*/
tmp = (short)*addr & 0x00FF; /* Read the status */
while (!(tmp & INTEL_FLASH_STATUS_WSMS)) {
- if ((now=get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now=time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
*addr = 0x0050; /* Reset the status register */
*addr = 0xffff;
printf ("Timeout\n");
@@ -413,7 +413,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
udelay(100000); /* 100 ms */
*addr = 0x0070; /*Read status register command*/
tmp = (short)*addr & 0x00FF; /* Read status */
- start = get_timer(0);
+ start = time_now_ms();
}
if( tmp & INTEL_FLASH_STATUS_ES )
flash_decode_status_bits(tmp);
@@ -557,11 +557,11 @@ int write_word (flash_info_t *info, ulong dest, ulong da)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
flag = 0;
*addr = 0x0070; /*Read statusregister command */
while (((csr = *addr) & INTEL_FLASH_STATUS_WSMS)!=INTEL_FLASH_STATUS_WSMS) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
flag = 1;
break;
}
@@ -642,13 +642,13 @@ int _flash_real_protect(flash_info_t *info, long idx, int prot)
addr = (vu_short *)(info->start[idx]);
/* If chip is busy, wait for it */
- start = get_timer(0);
+ start = time_now_ms();
*addr = 0x0070; /*Read status register command*/
tmp = ((ushort)(*addr))&0x00ff; /*Read the status*/
while(!(tmp & INTEL_FLASH_STATUS_WSMS)) {
/*Write State Machine Busy*/
/*Wait untill done or timeout.*/
- if ((now=get_timer(start)) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if ((now=time_since_ms(start)) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = 0x0050; /* Reset the status register */
*addr = 0xffff; /* Reset the chip */
printf ("TTimeout\n");
@@ -656,7 +656,7 @@ int _flash_real_protect(flash_info_t *info, long idx, int prot)
}
*addr = 0x0070;
tmp = ((ushort)(*addr))&0x00ff; /*Read the status*/
- start = get_timer(0);
+ start = time_now_ms();
}
/* Disable interrupts which might cause a timeout here */
@@ -671,12 +671,12 @@ int _flash_real_protect(flash_info_t *info, long idx, int prot)
if (flag)
enable_interrupts();
- start = get_timer(0);
+ start = time_now_ms();
*addr = 0x0070; /*Read status register command*/
tmp = ((ushort)(*addr)) & 0x00FF; /* Read the status */
while (!(tmp & INTEL_FLASH_STATUS_WSMS)) {
/* Write State Machine Busy */
- if ((now=get_timer(start)) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if ((now=time_since_ms(start)) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = 0x0050; /* Reset the status register */
*addr = 0xffff;
printf ("Timeout\n");
@@ -689,7 +689,7 @@ int _flash_real_protect(flash_info_t *info, long idx, int prot)
udelay(100000); /* 100 ms */
*addr = 0x70; /*Read status register command*/
tmp = (short)*addr & 0x00FF; /* Read status */
- start = get_timer(0);
+ start = time_now_ms();
}
if( tmp & INTEL_FLASH_STATUS_PS )
flash_decode_status_bits(tmp);
diff --git a/board/freescale/m5253demo/flash.c b/board/freescale/m5253demo/flash.c
index 08f767d..976d38c 100644
--- a/board/freescale/m5253demo/flash.c
+++ b/board/freescale/m5253demo/flash.c
@@ -232,7 +232,7 @@ int flash_erase(flash_info_t * info, int s_first, int s_last)
flag = disable_interrupts();
- start = get_timer(0);
+ start = time_now_ms();
last = start;
if ((s_last - s_first) == (CONFIG_SYS_SST_SECT - 1)) {
@@ -247,7 +247,7 @@ int flash_erase(flash_info_t * info, int s_first, int s_last)
*addr = 0x0030; /* erase chip */
count = 0;
- start = get_timer(0);
+ start = time_now_ms();
while ((*addr & 0x0080) != 0x0080) {
if (count++ > 0x10000) {
@@ -255,7 +255,7 @@ int flash_erase(flash_info_t * info, int s_first, int s_last)
count = 0;
}
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf("Timeout\n");
*addr = 0x00F0; /* reset to read mode */
@@ -285,7 +285,7 @@ int flash_erase(flash_info_t * info, int s_first, int s_last)
printf(".");
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
switch (flashtype) {
case 1:
@@ -307,7 +307,7 @@ int flash_erase(flash_info_t * info, int s_first, int s_last)
enable_interrupts();
while ((*addr & 0x0080) != 0x0080) {
- if (get_timer(start) >
+ if (time_since_ms(start) >
CONFIG_SYS_FLASH_ERASE_TOUT) {
printf("Timeout\n");
*addr = 0x00F0; /* reset to read mode */
@@ -439,12 +439,12 @@ int write_word(flash_info_t * info, FPWV * dest, u16 data)
if (flag)
enable_interrupts();
- start = get_timer(0);
+ start = time_now_ms();
/* data polling for D7 */
while (res == 0
&& (*dest & (u8) 0x00800080) != (data & (u8) 0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*dest = (u8) 0x00F000F0; /* reset bank */
res = 1;
}
diff --git a/board/freescale/mpc8260ads/flash.c b/board/freescale/mpc8260ads/flash.c
index e03852f..1abd24d 100644
--- a/board/freescale/mpc8260ads/flash.c
+++ b/board/freescale/mpc8260ads/flash.c
@@ -252,7 +252,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (info->protect[sect] == 0) { /* not protected */
vu_long *addr = (vu_long *)(info->start[sect]);
- last = start = get_timer (0);
+ last = start = time_now_ms();
/* Disable interrupts which might cause a timeout here */
flag = disable_interrupts();
@@ -274,7 +274,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
enable_interrupts();
while ((*addr & INTEL_FINISHED) != INTEL_FINISHED) {
- if ((now=get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now=time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr = INTEL_RESET; /* reset bank */
return 1;
@@ -336,9 +336,9 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*addr & INTEL_FINISHED) != INTEL_FINISHED) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
printf("Write timed out\n");
rc = 1;
break;
@@ -452,9 +452,9 @@ int flash_real_protect(flash_info_t *info, long sector, int prot)
*addr = INTEL_CONFIRM; /* clear */
}
- start = get_timer(0);
+ start = time_now_ms();
while ((*addr & INTEL_FINISHED) != INTEL_FINISHED) {
- if (get_timer(start) > CONFIG_SYS_FLASH_UNLOCK_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_UNLOCK_TOUT) {
printf("Flash lock bit operation timed out\n");
rc = 1;
break;
diff --git a/board/freescale/mpc8266ads/flash.c b/board/freescale/mpc8266ads/flash.c
index 06dde36..f300515 100644
--- a/board/freescale/mpc8266ads/flash.c
+++ b/board/freescale/mpc8266ads/flash.c
@@ -304,7 +304,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (info->protect[sect] == 0) { /* not protected */
vu_long *addr = (vu_long *)(info->start[sect]);
- last = start = get_timer (0);
+ last = start = time_now_ms();
/* Disable interrupts which might cause a timeout here */
flag = disable_interrupts();
@@ -336,7 +336,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
*addr = 0xFFFFFFFF; /* reset bank */
return 1;
}
- if ((now=get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now=time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr = 0xFFFFFFFF; /* reset bank */
return 1;
@@ -458,10 +458,10 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
flag = 0;
while (((csr = *addr) & 0x80808080) != 0x80808080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
flag = 1;
break;
}
@@ -497,9 +497,9 @@ static int clear_block_lock_bit(vu_long * addr)
*addr = 0x60606060;
*addr = 0xd0d0d0d0;
- start = get_timer (0);
+ start = time_now_ms();
while(*addr != 0x80808080){
- if ((now=get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now=time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout on clearing Block Lock Bit\n");
*addr = 0xFFFFFFFF; /* reset bank */
return 1;
diff --git a/board/funkwerk/vovpn-gw/flash.c b/board/funkwerk/vovpn-gw/flash.c
index fd3b16e..b6f77f7 100644
--- a/board/funkwerk/vovpn-gw/flash.c
+++ b/board/funkwerk/vovpn-gw/flash.c
@@ -236,7 +236,7 @@ flash_erase(flash_info_t *info, int s_first, int s_last)
printf ("\n");
}
- start = get_timer (0);
+ start = time_now_ms();
last = start;
for (sect = s_first; sect<=s_last; sect++) {
@@ -265,7 +265,7 @@ flash_erase(flash_info_t *info, int s_first, int s_last)
udelay (1000);
while (((status = *addr) & FLASH_STATUS_DONE) != FLASH_STATUS_DONE) {
- if ((now=get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now=time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf("Flash erase timeout at address %lx\n", info->start[sect]);
*addr = FLASH_CMD_SUSPEND_ERASE;
*addr = FLASH_CMD_RESET;
@@ -293,7 +293,7 @@ write_buff2( volatile FLASH_WORD_SIZE *dst,
FLASH_WORD_SIZE status;
int flag, i;
- start = get_timer (0);
+ start = time_now_ms();
while (1) {
/* Disable interrupts which might cause a timeout here */
flag = disable_interrupts();
@@ -307,7 +307,7 @@ write_buff2( volatile FLASH_WORD_SIZE *dst,
enable_interrupts();
}
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (-1);
}
}
@@ -329,7 +329,7 @@ poll_status( volatile FLASH_WORD_SIZE *addr )
{
unsigned long start;
- start = get_timer (0);
+ start = time_now_ms();
/* wait for error or finish */
while (1) {
if (*addr == FLASH_STATUS_DONE) {
@@ -337,7 +337,7 @@ poll_status( volatile FLASH_WORD_SIZE *addr )
break;
}
}
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = FLASH_CMD_RESET;
return (-1);
}
@@ -433,9 +433,9 @@ flash_real_protect(flash_info_t *info, long sector, int prot)
}
/* wait for error or finish */
- start = get_timer (0);
+ start = time_now_ms();
while(!(addr[0] & FLASH_STATUS_DONE)){
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf("Flash protect timeout at address %lx\n", info->start[sector]);
addr[0] = FLASH_CMD_RESET;
return (1);
diff --git a/board/g2000/strataflash.c b/board/g2000/strataflash.c
index effe65a..2e8d8ed 100644
--- a/board/g2000/strataflash.c
+++ b/board/g2000/strataflash.c
@@ -432,9 +432,9 @@ static int flash_status_check(flash_info_t * info, ulong sector, ulong tout, cha
ulong start;
/* Wait for command completion */
- start = get_timer (0);
+ start = time_now_ms();
while(!flash_isset(info, sector, 0, FLASH_STATUS_DONE)) {
- if (get_timer(start) > info->erase_blk_tout) {
+ if (time_since_ms(start) > info->erase_blk_tout) {
printf("Flash %s timeout at address %lx\n", prompt, info->start[sector]);
flash_write_cmd(info, sector, 0, FLASH_CMD_RESET);
return ERR_TIMOUT;
diff --git a/board/gcplus/flash.c b/board/gcplus/flash.c
index ab567e8..0da5f13 100644
--- a/board/gcplus/flash.c
+++ b/board/gcplus/flash.c
@@ -270,7 +270,7 @@ flash_erase(flash_info_t * info, int s_first, int s_last)
printf("Erasing sector %2d ... ", sect);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
*addr = (FPW) 0x00500050; /* clear status register */
*addr = (FPW) 0x00200020; /* erase setup */
@@ -279,7 +279,7 @@ flash_erase(flash_info_t * info, int s_first, int s_last)
while (((status =
*addr) & (FPW) 0x00800080) !=
(FPW) 0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf("Timeout\n");
*addr = (FPW) 0x00B000B0; /* suspend erase */
*addr = (FPW) 0x00FF00FF; /* reset to read mode */
@@ -412,11 +412,11 @@ write_data(flash_info_t * info, ulong dest, FPW data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait while polling the status register */
while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = (FPW) 0x00FF00FF; /* restore read mode */
return (1);
}
diff --git a/board/gen860t/flash.c b/board/gen860t/flash.c
index 827d9e0..e418d76 100644
--- a/board/gen860t/flash.c
+++ b/board/gen860t/flash.c
@@ -353,7 +353,7 @@ flash_erase(flash_info_t *info, int s_first, int s_last)
printf ("\n");
}
- start = get_timer (0);
+ start = time_now_ms();
last = start;
/*
@@ -385,7 +385,7 @@ flash_erase(flash_info_t *info, int s_first, int s_last)
udelay (1000);
while (((status = *addr) & SCS_SR7) != SCS_SR7) {
- if ((now=get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now=time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr = SCS_BLOCK_ERASE_SUSPEND_CMD;
*addr = SCS_READ_CMD;
@@ -425,7 +425,7 @@ write_flash_buffer8(flash_info_t *info_p, vu_char *src_p, vu_char *dest_p,
ulong blocksize = info_p->size / (ulong)info_p->sector_count;
int i;
- uint time = get_timer(0);
+ uint time = time_now_ms();
PRINTF("%s:%d: src: 0x%p dest: 0x%p count: %d\n",
__FUNCTION__, __LINE__, src_p, dest_p, count);
@@ -451,7 +451,7 @@ write_flash_buffer8(flash_info_t *info_p, vu_char *src_p, vu_char *dest_p,
*/
*block_addr_p = SCS_WRITE_BUF_CMD;
while ((*block_addr_p & SCS_XSR7) != SCS_XSR7) {
- if (get_timer(time) > CONFIG_SYS_FLASH_ALLOC_BUFFER_TOUT) {
+ if (time_since_ms(time) > CONFIG_SYS_FLASH_ALLOC_BUFFER_TOUT) {
PRINTF("%s:%d: Buffer allocation timeout @ 0x%p (waited %d mS)\n",
__FUNCTION__, __LINE__, block_addr_p,
CONFIG_SYS_FLASH_ALLOC_BUFFER_TOUT);
@@ -476,9 +476,9 @@ write_flash_buffer8(flash_info_t *info_p, vu_char *src_p, vu_char *dest_p,
*/
*block_addr_p = SCS_PROGRAM_RESUME_CMD;
#if 1
- time = get_timer(0);
+ time = time_now_ms();
while ((*block_addr_p & SCS_SR7) != SCS_SR7) {
- if (get_timer(time) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(time) > CONFIG_SYS_FLASH_WRITE_TOUT) {
PRINTF("%s:%d: Write timeout @ 0x%p (waited %d mS)\n",
__FUNCTION__, __LINE__, block_addr_p, CONFIG_SYS_FLASH_WRITE_TOUT);
return 1;
@@ -629,10 +629,10 @@ write_data8 (flash_info_t *info, ulong dest, uchar data)
if (flag)
enable_interrupts();
- start = get_timer (0);
+ start = time_now_ms();
while (((status = *addr) & SCS_SR7) != SCS_SR7) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = SCS_READ_CMD;
return (1);
}
diff --git a/board/genietv/flash.c b/board/genietv/flash.c
index 5313ad8..e719381 100644
--- a/board/genietv/flash.c
+++ b/board/genietv/flash.c
@@ -316,13 +316,13 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (volatile unsigned char *)(info->start[l_sect]);
while ((addr[0] & 0xFF) != 0xFF)
{
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -451,10 +451,10 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*cdest ^ *cdata) & 0x80)
{
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/gw8260/flash.c b/board/gw8260/flash.c
index 6035f69..6ac7c64 100644
--- a/board/gw8260/flash.c
+++ b/board/gw8260/flash.c
@@ -353,11 +353,11 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (vu_long*)(info->start[l_sect]);
while ((addr[0] & 0x80808080) != 0x80808080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -510,9 +510,9 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*((vu_long *)dest) & 0x80808080) != (data & 0x80808080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/hermes/flash.c b/board/hermes/flash.c
index 888231c..a382ada 100644
--- a/board/hermes/flash.c
+++ b/board/hermes/flash.c
@@ -372,11 +372,11 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (vu_char*)(info->start[l_sect]);
while ((addr[0] & 0x80) != 0x80) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -447,9 +447,9 @@ static int write_byte (flash_info_t *info, ulong dest, uchar data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*((vu_char *)dest) & 0x80) != (data & 0x80)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/hidden_dragon/flash.c b/board/hidden_dragon/flash.c
index 2ce1dc4..0efce69 100644
--- a/board/hidden_dragon/flash.c
+++ b/board/hidden_dragon/flash.c
@@ -419,14 +419,14 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (FLASH_WORD_SIZE *) (info->start[0] + ((info->start[l_sect] -
info->
start[0]) << sh8b));
while ((addr[0] & (FLASH_WORD_SIZE) 0x00800080) !=
(FLASH_WORD_SIZE) 0x00800080) {
- if ((now = get_timer (start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -562,10 +562,10 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
enable_interrupts ();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((dest2[i << sh8b] & (FLASH_WORD_SIZE) 0x00800080) !=
(data2[i] & (FLASH_WORD_SIZE) 0x00800080)) {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/hymod/flash.c b/board/hymod/flash.c
index e2cf38c..f3e2484 100644
--- a/board/hymod/flash.c
+++ b/board/hymod/flash.c
@@ -196,9 +196,9 @@ bank_write_word (volatile bank_addr_t addr, bank_word_t value)
retval = 0;
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
do {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
retval = 1;
goto done;
}
@@ -349,7 +349,7 @@ flash_erase (flash_info_t *info, int s_first, int s_last)
prot, (prot > 1 ? "s" : ""));
}
- start = get_timer (0);
+ start = time_now_ms();
last = 0;
haderr = 0;
@@ -363,10 +363,10 @@ flash_erase (flash_info_t *info, int s_first, int s_last)
/* wait at least 80us - let's wait 1 ms */
udelay (1000);
- estart = get_timer (start);
+ estart = time_since_ms(start);
do {
- now = get_timer (start);
+ now = time_since_ms(start);
if (now - estart > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout (sect %d)\n", sect);
diff --git a/board/icecube/flash.c b/board/icecube/flash.c
index 7a433b3..ff3ad4a 100644
--- a/board/icecube/flash.c
+++ b/board/icecube/flash.c
@@ -318,7 +318,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf ("\n");
}
- last = get_timer(0);
+ last = time_now_ms();
/* Start erase on unprotected sectors */
for (sect = s_first; sect<=s_last && rcode == 0; sect++) {
@@ -352,7 +352,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (flag)
enable_interrupts();
- start = get_timer(0);
+ start = time_now_ms();
/* wait at least 50us for AMD, 80us for Intel.
* Let's wait 1 ms.
@@ -360,7 +360,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
udelay (1000);
while ((*addr & (FPW)0x00800080) != (FPW)0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
if (intel) {
@@ -374,16 +374,16 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
}
/* show that we're waiting */
- if ((get_timer(last)) > CONFIG_SYS_HZ) {/* every second */
+ if ((time_since_ms(last)) > CONFIG_SYS_HZ) {/* every second */
putc ('.');
- last = get_timer(0);
+ last = time_now_ms();
}
}
/* show that we're waiting */
- if ((get_timer(last)) > CONFIG_SYS_HZ) { /* every second */
+ if ((time_since_ms(last)) > CONFIG_SYS_HZ) { /* every second */
putc ('.');
- last = get_timer(0);
+ last = time_now_ms();
}
flash_reset(info); /* reset to read mode */
@@ -478,11 +478,11 @@ static int write_word_amd (flash_info_t *info, FPWV *dest, FPW data)
if (flag)
enable_interrupts();
- start = get_timer (0);
+ start = time_now_ms();
/* data polling for D7 */
while (res == 0 && (*dest & (FPW)0x00800080) != (data & (FPW)0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*dest = (FPW)0x00F000F0; /* reset bank */
res = 1;
}
diff --git a/board/icu862/flash.c b/board/icu862/flash.c
index 2afeff4..501213c 100644
--- a/board/icu862/flash.c
+++ b/board/icu862/flash.c
@@ -459,7 +459,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (vu_long*)(info->start[l_sect]);
#if 0
@@ -468,7 +468,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
while ((addr[0] & 0xFFFFFFFF) != 0xFFFFFFFF)
#endif
{
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
puts ("Timeout\n");
return 1;
}
@@ -599,14 +599,14 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
#if 0
while ((*((vu_long *)dest) & 0x00800080) != (data & 0x00800080))
#else
while ((*((vu_long *)dest) & 0x80808080) != (data & 0x80808080))
#endif
{
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/idmr/flash.c b/board/idmr/flash.c
index 9f4ff2b..07d2b48 100644
--- a/board/idmr/flash.c
+++ b/board/idmr/flash.c
@@ -171,7 +171,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
printf ("Erasing sector %2d ... ", sect);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
if (info->protect[sect] == 0) { /* not protected */
volatile u16 *addr =
@@ -192,7 +192,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
result = *addr;
/* check timeout */
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT * CONFIG_SYS_HZ / 1000) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT * CONFIG_SYS_HZ / 1000) {
MEM_FLASH_ADDR1 = CMD_READ_ARRAY;
chip1 = TMO;
break;
@@ -274,7 +274,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait until flash is ready */
chip1 = 0;
@@ -282,7 +282,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
result = *addr;
/* check timeout */
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT * CONFIG_SYS_HZ / 1000) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT * CONFIG_SYS_HZ / 1000) {
chip1 = ERR | TMO;
break;
}
diff --git a/board/impa7/flash.c b/board/impa7/flash.c
index 6eae428..54ba14f 100644
--- a/board/impa7/flash.c
+++ b/board/impa7/flash.c
@@ -166,7 +166,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
printf ("Erasing sector %2d ... ", sect);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
if (info->protect[sect] == 0) { /* not protected */
vu_long *addr = (vu_long *) (info->start[sect]);
@@ -175,7 +175,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
*addr = 0x00D000D0; /* erase confirm */
while ((*addr & 0x00800080) != 0x00800080) {
- if (get_timer(start) >
+ if (time_since_ms(start) >
CONFIG_SYS_FLASH_ERASE_TOUT) {
*addr = 0x00B000B0; /* suspend erase */
*addr = 0x00FF00FF; /* reset to read mode */
@@ -238,14 +238,14 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* read status register command */
*addr = 0x00700070;
/* wait while polling the status register */
while ((*addr & 0x00800080) != 0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
rc = ERR_TIMOUT;
/* suspend program command */
*addr = 0x00B000B0;
diff --git a/board/incaip/flash.c b/board/incaip/flash.c
index cc11e24..0f283ad 100644
--- a/board/incaip/flash.c
+++ b/board/incaip/flash.c
@@ -442,7 +442,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf ("\n");
}
- last = get_timer(0);
+ last = time_now_ms();
/* Start erase on unprotected sectors */
for (sect = s_first; sect<=s_last && rcode == 0; sect++) {
@@ -476,7 +476,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (flag)
enable_interrupts();
- start = get_timer(0);
+ start = time_now_ms();
/* wait at least 50us for AMD, 80us for Intel.
* Let's wait 1 ms.
@@ -484,7 +484,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
udelay (1000);
while ((*addr & (FPW)0x00800080) != (FPW)0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
if (intel) {
@@ -498,16 +498,16 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
}
/* show that we're waiting */
- if ((get_timer(last)) > CONFIG_SYS_HZ) {/* every second */
+ if ((time_since_ms(last)) > CONFIG_SYS_HZ) {/* every second */
putc ('.');
- last = get_timer(0);
+ last = time_now_ms();
}
}
/* show that we're waiting */
- if ((get_timer(last)) > CONFIG_SYS_HZ) { /* every second */
+ if ((time_since_ms(last)) > CONFIG_SYS_HZ) { /* every second */
putc ('.');
- last = get_timer(0);
+ last = time_now_ms();
}
flash_reset(info); /* reset to read mode */
@@ -605,11 +605,11 @@ static int write_word_amd (flash_info_t *info, FPWV *dest, FPW data)
if (flag)
enable_interrupts();
- start = get_timer (0);
+ start = time_now_ms();
/* data polling for D7 */
while (res == 0 && (*dest & (FPW)0x00800080) != (data & (FPW)0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*dest = (FPW)0x00F000F0; /* reset bank */
res = 1;
}
@@ -652,10 +652,10 @@ static int write_word_intel (flash_info_t *info, FPWV *dest, FPW data)
if (flag)
enable_interrupts();
- start = get_timer (0);
+ start = time_now_ms();
while (res == 0 && (*dest & (FPW)0x00800080) != (FPW)0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*dest = (FPW)0x00B000B0; /* Suspend program */
res = 1;
}
diff --git a/board/innokom/flash.c b/board/innokom/flash.c
index ed4b987..78d9ae4 100644
--- a/board/innokom/flash.c
+++ b/board/innokom/flash.c
@@ -219,7 +219,7 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
PRINTK("\n");
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
if (info->protect[sect] == 0) { /* not protected */
u16 * volatile addr = (u16 * volatile)(info->start[sect]);
@@ -236,7 +236,7 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
while ((*addr & 0x0080) != 0x0080) {
PRINTK(".");
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
*addr = 0x00B0; /* suspend erase*/
*addr = 0x00FF; /* read mode */
rc = ERR_TIMOUT;
@@ -304,11 +304,11 @@ static int write_word (flash_info_t *info, ulong dest, ushort data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait while polling the status register */
while(((val = *addr) & 0x80) != 0x80) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
rc = ERR_TIMOUT;
*addr = 0xB0; /* suspend program command */
goto outahere;
diff --git a/board/ip860/flash.c b/board/ip860/flash.c
index 6491af2..5f91cdc 100644
--- a/board/ip860/flash.c
+++ b/board/ip860/flash.c
@@ -283,7 +283,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf ("\n");
}
- start = get_timer (0);
+ start = time_now_ms();
last = start;
/* Start erase on unprotected sectors */
@@ -309,7 +309,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
udelay (1000);
while ((*addr & 0x00800080) != 0x00800080) {
- if ((now=get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now=time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr = 0xFFFFFFFF; /* reset bank */
return 1;
@@ -431,10 +431,10 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
flag = 0;
while (((csr = *addr) & 0x00800080) != 0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
flag = 1;
break;
}
diff --git a/board/iphase4539/flash.c b/board/iphase4539/flash.c
index 3dfee1f..710dd09 100644
--- a/board/iphase4539/flash.c
+++ b/board/iphase4539/flash.c
@@ -277,11 +277,11 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = info->start[l_sect];
while ((in8(addr) & 0x80) != 0x80) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -419,9 +419,9 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((in32(dest) & 0x80808080) != (data & 0x80808080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
iobarrier_rw();
diff --git a/board/ivm/flash.c b/board/ivm/flash.c
index cf309d7..bb3311c 100644
--- a/board/ivm/flash.c
+++ b/board/ivm/flash.c
@@ -431,7 +431,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf ("\n");
}
- start = get_timer (0);
+ start = time_now_ms();
last = start;
/* Start erase on unprotected sectors */
for (sect = s_first; sect<=s_last; sect++) {
@@ -454,7 +454,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
udelay (1000);
while (((status = *addr) & 0x0080) != 0x0080) {
- if ((now=get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now=time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr = 0x00FF; /* reset to read mode */
return 1;
@@ -580,10 +580,10 @@ static int write_data (flash_info_t *info, ulong dest, ulong data)
if (flag)
enable_interrupts();
- start = get_timer (0);
+ start = time_now_ms();
while (((status = *addr) & 0x0080) != 0x0080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = 0x00FF; /* restore read mode */
return (1);
}
diff --git a/board/ixdp425/flash.c b/board/ixdp425/flash.c
index 5e4e0e7..7174dd5 100644
--- a/board/ixdp425/flash.c
+++ b/board/ixdp425/flash.c
@@ -261,7 +261,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
printf ("Erasing sector %2d ... ", sect);
/* arm simple, non interrupt dependent timer */
- start = get_timer(start);
+ start = time_since_ms(start);
*addr = (FPW) 0x00500050; /* clear status register */
*addr = (FPW) 0x00200020; /* erase setup */
@@ -270,7 +270,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
while (((status =
*addr) & (FPW) 0x00800080) !=
(FPW) 0x00800080) {
- if (get_timer(start) >
+ if (time_since_ms(start) >
CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr = (FPW) 0x00B000B0; /* suspend erase */
@@ -404,11 +404,11 @@ static int write_data (flash_info_t * info, ulong dest, FPW data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait while polling the status register */
while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = (FPW) 0x00FF00FF; /* restore read mode */
return (1);
}
diff --git a/board/jse/flash.c b/board/jse/flash.c
index 5735f19..99e3f58 100644
--- a/board/jse/flash.c
+++ b/board/jse/flash.c
@@ -277,11 +277,11 @@ int wait_for_DQ7 (flash_info_t * info, int sect)
volatile FLASH_WORD_SIZE *addr =
(FLASH_WORD_SIZE *) (info->start[sect]);
- start = get_timer (0);
+ start = time_now_ms();
last = start;
while ((addr[0] & (FLASH_WORD_SIZE) 0x00800080) !=
(FLASH_WORD_SIZE) 0x00800080) {
- if ((now = get_timer (start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return -1;
}
@@ -506,11 +506,11 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
enable_interrupts ();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((dest2[i] & (FLASH_WORD_SIZE) 0x00800080) !=
(data2[i] & (FLASH_WORD_SIZE) 0x00800080)) {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/kup/common/flash.c b/board/kup/common/flash.c
index 134a9d5..c0f914c 100644
--- a/board/kup/common/flash.c
+++ b/board/kup/common/flash.c
@@ -283,7 +283,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf ("\n");
}
- start = get_timer (0);
+ start = time_now_ms();
last = start;
/* Start erase on unprotected sectors */
for (sect = s_first; sect<=s_last; sect++) {
@@ -325,7 +325,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
#else
while ((sect_addr[0] & 0x00800080) != 0x00800080) {
#endif
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -465,9 +465,9 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*((vu_short *)dest) & 0x0080) != (high_data & 0x0080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
@@ -499,7 +499,7 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
#ifdef CONFIG_FLASH_16BIT
while ((*((vu_short *)dest) & 0x0080) != (low_data & 0x0080)) {
@@ -507,7 +507,7 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
while ((*((vu_long *)dest) & 0x00800080) != (data & 0x00800080)) {
#endif
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/lantec/flash.c b/board/lantec/flash.c
index 97ed054..89f6cbd 100644
--- a/board/lantec/flash.c
+++ b/board/lantec/flash.c
@@ -487,11 +487,11 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (vu_long*)(info->start[l_sect]);
while ((addr[0] & 0x00800080) != 0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -612,9 +612,9 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*((vu_long *)dest) & 0x00800080) != (data & 0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/lart/flash.c b/board/lart/flash.c
index 408c884..e931fc0 100644
--- a/board/lart/flash.c
+++ b/board/lart/flash.c
@@ -292,7 +292,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf("Erasing sector %2d ... ", sect);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
if (info->protect[sect] == 0)
{ /* not protected */
@@ -306,7 +306,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
do
{
/* check timeout */
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT)
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT)
{
*addr = PUZZLE_TO_FLASH(CMD_SUSPEND);
result = BIT_TIMEOUT;
@@ -379,13 +379,13 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait until flash is ready */
do
{
/* check timeout */
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT)
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT)
{
*addr = PUZZLE_TO_FLASH(CMD_SUSPEND);
result = BIT_TIMEOUT;
diff --git a/board/linkstation/avr.c b/board/linkstation/avr.c
index ec6d400..7ecd1d4 100644
--- a/board/linkstation/avr.c
+++ b/board/linkstation/avr.c
@@ -115,8 +115,8 @@ static inline char avr_getc(void)
static int push_timeout(char button_code)
{
- ulong push_start = get_timer(0);
- while (get_timer(push_start) <= PUSHHOLD)
+ ulong push_start = time_now_ms();
+ while (time_since_ms(push_start) <= PUSHHOLD)
if (avr_tstc() && avr_getc() == button_code)
return 0;
return 1;
@@ -132,21 +132,21 @@ static void next_boot_choice(void)
char c;
button_on = 0;
- return_start = get_timer(0);
+ return_start = time_now_ms();
on_times = boot_choice;
led_state = 0;
miconCntl_SendCmd(HDDLEDOFF);
- pulse_start = get_timer(0);
+ pulse_start = time_now_ms();
- while (get_timer(return_start) <= NOBUTTON || button_on) {
+ while (time_since_ms(return_start) <= NOBUTTON || button_on) {
if (avr_tstc()) {
c = avr_getc();
if (c == PWRP)
button_on = 1;
else if (c == PWRR) {
button_on = 0;
- return_start = get_timer(0);
+ return_start = time_now_ms();
if (++boot_choice > MAX_BOOT_CHOICE)
boot_choice = 1;
sprintf(envbuffer, "bootcmd%d", boot_choice);
@@ -157,12 +157,12 @@ static void next_boot_choice(void)
on_times = boot_choice;
led_state = 1;
miconCntl_SendCmd(HDDLEDON);
- pulse_start = get_timer(0);
+ pulse_start = time_now_ms();
} else {
perror("Unexpected code: 0x%02X\n", c);
}
}
- if (on_times && get_timer(pulse_start) > PULSETIME) {
+ if (on_times && time_since_ms(pulse_start) > PULSETIME) {
if (led_state == 1) {
--on_times;
led_state = 0;
@@ -171,13 +171,13 @@ static void next_boot_choice(void)
led_state = 1;
miconCntl_SendCmd(HDDLEDON);
}
- pulse_start = get_timer(0);
+ pulse_start = time_now_ms();
}
- if (!on_times && get_timer(pulse_start) > LONGPAUSE) {
+ if (!on_times && time_since_ms(pulse_start) > LONGPAUSE) {
on_times = boot_choice;
led_state = 1;
miconCntl_SendCmd(HDDLEDON);
- pulse_start = get_timer(0);
+ pulse_start = time_now_ms();
}
}
if (led_state)
@@ -195,21 +195,21 @@ void next_cons_choice(int console)
button_on = 0;
cons_choice = console;
- return_start = get_timer(0);
+ return_start = time_now_ms();
on_times = cons_choice+1;
led_state = 1;
miconCntl_SendCmd(HDDLEDON);
- pulse_start = get_timer(0);
+ pulse_start = time_now_ms();
- while (get_timer(return_start) <= NOBUTTON || button_on) {
+ while (time_since_ms(return_start) <= NOBUTTON || button_on) {
if (avr_tstc()) {
c = avr_getc();
if (c == RESP)
button_on = 1;
else if (c == RESR) {
button_on = 0;
- return_start = get_timer(0);
+ return_start = time_now_ms();
cons_choice = (cons_choice + 1) % MAX_CONS_CHOICE;
console_assign(stdin, consoles[cons_choice]);
console_assign(stdout, consoles[cons_choice]);
@@ -217,12 +217,12 @@ void next_cons_choice(int console)
on_times = cons_choice+1;
led_state = 0;
miconCntl_SendCmd(HDDLEDOFF);
- pulse_start = get_timer(0);
+ pulse_start = time_now_ms();
} else {
perror("Unexpected code: 0x%02X\n", c);
}
}
- if (on_times && get_timer(pulse_start) > PULSETIME) {
+ if (on_times && time_since_ms(pulse_start) > PULSETIME) {
if (led_state == 0) {
--on_times;
led_state = 1;
@@ -231,13 +231,13 @@ void next_cons_choice(int console)
led_state = 0;
miconCntl_SendCmd(HDDLEDOFF);
}
- pulse_start = get_timer(0);
+ pulse_start = time_now_ms();
}
- if (!on_times && get_timer(pulse_start) > LONGPAUSE) {
+ if (!on_times && time_since_ms(pulse_start) > LONGPAUSE) {
on_times = cons_choice+1;
led_state = 0;
miconCntl_SendCmd(HDDLEDOFF);
- pulse_start = get_timer(0);
+ pulse_start = time_now_ms();
}
}
if (led_state);
diff --git a/board/lpd7a40x/flash.c b/board/lpd7a40x/flash.c
index f5c0713..65db949 100644
--- a/board/lpd7a40x/flash.c
+++ b/board/lpd7a40x/flash.c
@@ -285,7 +285,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
sect, info->start[sect]);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
if (info->protect[sect] == 0) { /* not protected */
vu_long *addr = (vu_long *) (info->start[sect]);
@@ -298,7 +298,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
/* wait until flash is ready */
do {
/* check timeout */
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
*addr = CMD_STATUS_RESET;
result = BIT_TIMEOUT;
break;
@@ -389,12 +389,12 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait until flash is ready */
do {
/* check timeout */
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
*addr = CMD_SUSPEND;
result = BIT_TIMEOUT;
break;
diff --git a/board/lubbock/flash.c b/board/lubbock/flash.c
index 1ea2893..8dac9c5 100644
--- a/board/lubbock/flash.c
+++ b/board/lubbock/flash.c
@@ -266,14 +266,14 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf ("Erasing sector %2d ... ", sect);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
*addr = (FPW) 0x00500050; /* clear status register */
*addr = (FPW) 0x00200020; /* erase setup */
*addr = (FPW) 0x00D000D0; /* erase confirm */
while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr = (FPW) 0x00B000B0; /* suspend erase */
*addr = (FPW) 0x00FF00FF; /* reset to read mode */
@@ -404,11 +404,11 @@ static int write_data (flash_info_t *info, ulong dest, FPW data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait while polling the status register */
while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
- if (get_timer(start)) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start)) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = (FPW) 0x00FF00FF; /* restore read mode */
return (1);
}
diff --git a/board/lwmon/flash.c b/board/lwmon/flash.c
index f71cc24..93d9e7b 100644
--- a/board/lwmon/flash.c
+++ b/board/lwmon/flash.c
@@ -392,7 +392,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf ("\n");
}
- start = get_timer (0);
+ start = time_now_ms();
last = start;
/* Start erase on unprotected sectors */
for (sect = s_first; sect<=s_last; sect++) {
@@ -409,7 +409,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
udelay (1000);
/* This takes awfully long - up to 50 ms and more */
while (((status = *addr) & 0x00800080) != 0x00800080) {
- if ((now=get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now=time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr = 0x00FF00FF; /* reset to read mode */
return 1;
@@ -435,7 +435,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
udelay (1000);
while (((status = *addr) & 0x00800080) != 0x00800080) {
- if ((now=get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now=time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr = 0x00B000B0; /* suspend erase */
*addr = 0x00FF00FF; /* reset to read mode */
@@ -558,9 +558,9 @@ static int flash_status_check(vu_long *addr, ulong tout, char * prompt)
ulong start;
/* Wait for command completion */
- start = get_timer (0);
+ start = time_now_ms();
while(((status = *addr) & 0x00800080) != 0x00800080) {
- if (get_timer(start) > tout) {
+ if (time_since_ms(start) > tout) {
printf("Flash %s timeout at address %p\n", prompt, addr);
*addr = 0x00FF00FF; /* restore read mode */
return (1);
diff --git a/board/mbx8xx/flash.c b/board/mbx8xx/flash.c
index 2ec420d..321a096 100644
--- a/board/mbx8xx/flash.c
+++ b/board/mbx8xx/flash.c
@@ -270,11 +270,11 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (vu_long*)(info->start[l_sect]);
while ((addr[0] & 0x80808080) != 0x80808080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -395,9 +395,9 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*((vu_long *)dest) & 0x80808080) != (data & 0x80808080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/modnet50/flash.c b/board/modnet50/flash.c
index 4834e21..668fcb7 100644
--- a/board/modnet50/flash.c
+++ b/board/modnet50/flash.c
@@ -339,14 +339,14 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
(__u16) SECERASE_CMD;
/* wait some time */
- start = get_timer(0);
- while (get_timer(start) < 1000) {
+ start = time_now_ms();
+ while (time_since_ms(start) < 1000) {
}
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
while (flash_check_erase_amd (info->start[sect])) {
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("timeout!\n");
/* OOPS: reach timeout,
* try to reset chip
@@ -448,10 +448,10 @@ static int write_word (flash_info_t * info, ulong dest, ushort data)
}
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
while (flash_check_write_amd (dest)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
printf ("timeout! @ %08lX\n", dest);
/* OOPS: reach timeout,
* try to reset chip */
diff --git a/board/mpl/common/flash.c b/board/mpl/common/flash.c
index 61f031a..1b81275 100644
--- a/board/mpl/common/flash.c
+++ b/board/mpl/common/flash.c
@@ -552,10 +552,10 @@ int wait_for_DQ7(flash_info_t *info, int sect)
ulong start, now, last;
volatile FLASH_WORD_SIZE *addr = (FLASH_WORD_SIZE *)(info->start[sect]);
- start = get_timer (0);
+ start = time_now_ms();
last = start;
while ((addr[0] & (FLASH_WORD_SIZE)0x00800080) != (FLASH_WORD_SIZE)0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return ERR_TIMOUT;
}
@@ -573,10 +573,10 @@ int intel_wait_for_DQ7(flash_info_t *info, int sect)
ulong start, now, last, status;
volatile FLASH_WORD_SIZE *addr = (FLASH_WORD_SIZE *)(info->start[sect]);
- start = get_timer (0);
+ start = time_now_ms();
last = start;
while ((addr[0] & (FLASH_WORD_SIZE)0x00800080) != (FLASH_WORD_SIZE)0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return ERR_TIMOUT;
}
@@ -848,11 +848,11 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
if (flag)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
udelay(10);
while ((dest2[i] & (FLASH_WORD_SIZE)0x00800080) != (FLASH_WORD_SIZE)0x00800080)
{
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT)
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT)
return (1);
}
dest2[i] = (FLASH_WORD_SIZE)0x00FF00FF; /* return to read mode */
@@ -870,10 +870,10 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
if (flag)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((dest2[i] & (FLASH_WORD_SIZE)0x00800080) !=
(data2[i] & (FLASH_WORD_SIZE)0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/mpl/mip405/mip405.c b/board/mpl/mip405/mip405.c
index e93d994..ad5299a 100644
--- a/board/mpl/mip405/mip405.c
+++ b/board/mpl/mip405/mip405.c
@@ -686,7 +686,7 @@ int misc_init_r (void)
/* check, if RTC is running */
rtc_get (&tm);
- start=get_timer(0);
+ start=time_now_ms();
/* if MIP405 has booted from PCI, reset CCR0[24] as described in errata PCI_18 */
if (mfdcr(CPC0_PSR) & PSR_ROM_LOC)
mtspr(SPRN_CCR0, (mfspr(SPRN_CCR0) & ~0x80));
@@ -711,7 +711,6 @@ extern int mk_date (char *, struct rtc_time *);
int last_stage_init (void)
{
- unsigned long stop;
struct rtc_time newtm;
char *s;
@@ -728,11 +727,11 @@ int last_stage_init (void)
stdio_print_current_devices ();
check_env ();
/* check if RTC time is valid */
- stop=get_timer(start);
- while(stop<1200) { /* we wait 1.2 sec to check if the RTC is running */
+
+ /* we wait 1.2 sec to check if the RTC is running */
+ while(time_since_ms(start) < 1200)
udelay(1000);
- stop=get_timer(start);
- }
+
rtc_get (&newtm);
if(tm.tm_sec==newtm.tm_sec) {
s=getenv("defaultdate");
diff --git a/board/mpl/vcma9/flash.c b/board/mpl/vcma9/flash.c
index 5d49204..6b8694b 100644
--- a/board/mpl/vcma9/flash.c
+++ b/board/mpl/vcma9/flash.c
@@ -216,7 +216,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
printf ("Erasing sector %2d ... ", sect);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
if (info->protect[sect] == 0) { /* not protected */
vu_short *addr = (vu_short *) (info->start[sect]);
@@ -236,7 +236,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
result = *addr;
/* check timeout */
- if (get_timer(start) >
+ if (time_since_ms(start) >
CONFIG_SYS_FLASH_ERASE_TOUT) {
MEM_FLASH_ADDR1 = CMD_READ_ARRAY;
chip = TMO;
@@ -325,7 +325,7 @@ static int write_hword (flash_info_t * info, ulong dest, ushort data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait until flash is ready */
chip = 0;
@@ -333,7 +333,7 @@ static int write_hword (flash_info_t * info, ulong dest, ushort data)
result = *addr;
/* check timeout */
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
chip = ERR | TMO;
break;
}
diff --git a/board/musenki/flash.c b/board/musenki/flash.c
index 40965be..f3470c9 100644
--- a/board/musenki/flash.c
+++ b/board/musenki/flash.c
@@ -390,7 +390,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf ("\n");
}
- start = get_timer (0);
+ start = time_now_ms();
last = start;
/* Start erase on unprotected sectors */
for (sect = s_first; sect<=s_last; sect++) {
@@ -414,7 +414,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
udelay (1000);
while (((status = BS(*addr)) & BYTEME(0x00800080)) != BYTEME(0x00800080)) {
- if ((now=get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now=time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr = BS(0xB0); /* suspend erase */
*addr = BS(0xFF); /* reset to read mode */
@@ -494,10 +494,10 @@ static int write_data (flash_info_t *info, uchar *dest, uchar data)
enable_interrupts();
}
- start = get_timer (0);
+ start = time_now_ms();
while (((status = BS(*addr)) & BYTEME(0x00800080)) != BYTEME(0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = BS(0xFF); /* restore read mode */
return 1;
}
diff --git a/board/mvblue/flash.c b/board/mvblue/flash.c
index 2d6acf5..107e8bc 100644
--- a/board/mvblue/flash.c
+++ b/board/mvblue/flash.c
@@ -411,12 +411,12 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (FDT *)(info->start[l_sect]);
while ((addr[0] & ERASE_CONFIRM_DATA) != ERASE_CONFIRM_DATA) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -551,10 +551,10 @@ static int write_char (flash_info_t *info, ulong dest, uchar data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
addr = (vu_char *)dest;
while (( (*addr) & WRITE_CONFIRM_DATA) != (data & WRITE_CONFIRM_DATA)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
printf(" *** ERROR: Flash write timeout !");
return (1);
}
diff --git a/board/mx1ads/syncflash.c b/board/mx1ads/syncflash.c
index 7331efa..e0dc105 100644
--- a/board/mx1ads/syncflash.c
+++ b/board/mx1ads/syncflash.c
@@ -276,7 +276,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last) {
/* arm simple, non interrupt dependent timer */
- get_timer(0);
+ time_now_ms();
SF_NvmodeErase();
SF_NvmodeWrite();
diff --git a/board/mx1fs2/flash.c b/board/mx1fs2/flash.c
index da4ebe6..246327f 100644
--- a/board/mx1fs2/flash.c
+++ b/board/mx1fs2/flash.c
@@ -488,7 +488,7 @@ flash_erase(flash_info_t * info, int s_first, int s_last)
printf("\n");
}
- start = get_timer(0);
+ start = time_now_ms();
last = start;
/* Start erase on unprotected sectors */
@@ -528,7 +528,7 @@ flash_erase(flash_info_t * info, int s_first, int s_last)
udelay(1000);
while ((*addr & (FPW) 0x00800080) != (FPW) 0x00800080) {
- if ((now = get_timer(0)) - start > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf("Timeout\n");
if (intel) {
@@ -542,9 +542,9 @@ flash_erase(flash_info_t * info, int s_first, int s_last)
}
/* show that we're waiting */
- if ((now - last) > 1000) { /* every second */
+ if (time_since_ms(last) > 1000) { /* every second */
putc('.');
- last = now;
+ last = time_now_ms();
}
}
@@ -715,12 +715,12 @@ write_word_amd(flash_info_t * info, FPWV * dest, FPW data)
if (flag)
enable_interrupts();
- start = get_timer(0);
+ start = time_now_ms();
/* data polling for D7 */
while (res == 0
&& (*dest & (FPW) 0x00800080) != (data & (FPW) 0x00800080)) {
- if (get_timer(0) - start > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*dest = (FPW) 0x00F000F0; /* reset bank */
printf("SHA timeout\n");
res = 1;
@@ -765,10 +765,10 @@ write_word_intel(flash_info_t * info, FPWV * dest, FPW data)
if (flag)
enable_interrupts();
- start = get_timer(0);
+ start = time_now_ms();
while (res == 0 && (*dest & (FPW) 0x00800080) != (FPW) 0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*dest = (FPW) 0x00B000B0; /* Suspend program */
res = 1;
}
diff --git a/board/netphone/flash.c b/board/netphone/flash.c
index 349d98e..47a3ac5 100644
--- a/board/netphone/flash.c
+++ b/board/netphone/flash.c
@@ -444,11 +444,11 @@ int flash_erase(flash_info_t * info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer(0);
+ start = time_now_ms();
last = start;
addr = (vu_char *) (info->start[l_sect]);
while ((addr[0] & 0x80) != 0x80) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf("Timeout\n");
return 1;
}
@@ -519,9 +519,9 @@ static int write_byte(flash_info_t * info, ulong dest, uchar data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer(0);
+ start = time_now_ms();
while ((*((vu_char *) dest) & 0x80) != (data & 0x80)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/netta/flash.c b/board/netta/flash.c
index 565fd67..fc00b29 100644
--- a/board/netta/flash.c
+++ b/board/netta/flash.c
@@ -423,11 +423,11 @@ int flash_erase(flash_info_t * info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer(0);
+ start = time_now_ms();
last = start;
addr = (vu_char *) (info->start[l_sect]);
while ((addr[0] & 0x80) != 0x80) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf("Timeout\n");
return 1;
}
@@ -498,9 +498,9 @@ static int write_byte(flash_info_t * info, ulong dest, uchar data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer(0);
+ start = time_now_ms();
while ((*((vu_char *) dest) & 0x80) != (data & 0x80)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/netta2/flash.c b/board/netta2/flash.c
index 53a4e1e..1bb5f30 100644
--- a/board/netta2/flash.c
+++ b/board/netta2/flash.c
@@ -421,11 +421,11 @@ int flash_erase(flash_info_t * info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer(0);
+ start = time_now_ms();
last = start;
addr = (vu_char *) (info->start[l_sect]);
while ((addr[0] & 0x80) != 0x80) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf("Timeout\n");
return 1;
}
@@ -496,9 +496,9 @@ static int write_byte(flash_info_t * info, ulong dest, uchar data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer(0);
+ start = time_now_ms();
while ((*((vu_char *) dest) & 0x80) != (data & 0x80)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/netvia/flash.c b/board/netvia/flash.c
index b987434..34dddd8 100644
--- a/board/netvia/flash.c
+++ b/board/netvia/flash.c
@@ -423,11 +423,11 @@ int flash_erase(flash_info_t * info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer(0);
+ start = time_now_ms();
last = start;
addr = (vu_char *) (info->start[l_sect]);
while ((addr[0] & 0x80) != 0x80) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf("Timeout\n");
return 1;
}
@@ -498,9 +498,9 @@ static int write_byte(flash_info_t * info, ulong dest, uchar data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer(0);
+ start = time_now_ms();
while ((*((vu_char *) dest) & 0x80) != (data & 0x80)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/ns9750dev/flash.c b/board/ns9750dev/flash.c
index 185bc2d..d3ca222 100644
--- a/board/ns9750dev/flash.c
+++ b/board/ns9750dev/flash.c
@@ -308,7 +308,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
flash_unprotect_sectors (addr);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
*addr = (FPW) 0x00500050;/* clear status register */
*addr = (FPW) 0x00200020;/* erase setup */
@@ -317,7 +317,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
while (((status =
*addr) & (FPW) 0x00800080) !=
(FPW) 0x00800080) {
- if (get_timer(start) >
+ if (time_since_ms(start) >
CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
/* suspend erase */
@@ -451,11 +451,11 @@ static int write_data (flash_info_t * info, ulong dest, FPW data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait while polling the status register */
while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = (FPW) 0x00FF00FF; /* restore read mode */
return (1);
}
diff --git a/board/nx823/flash.c b/board/nx823/flash.c
index 336e704..dee5b8b 100644
--- a/board/nx823/flash.c
+++ b/board/nx823/flash.c
@@ -272,7 +272,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf ("\n");
}
- start = get_timer (0);
+ start = time_now_ms();
last = start;
/* Start erase on unprotected sectors */
for (sect = s_first; sect<=s_last; sect++) {
@@ -295,7 +295,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
udelay (1000);
while (((status = *addr) & (FPW)0x00800080) != (FPW)0x00800080) {
- if ((now=get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now=time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr = (FPW)0x00B000B0; /* suspend erase */
*addr = (FPW)0x00FF00FF; /* reset to read mode */
@@ -450,10 +450,10 @@ static int write_data (flash_info_t *info, ulong dest, FPW data)
if (flag)
enable_interrupts();
- start = get_timer (0);
+ start = time_now_ms();
while (((status = *addr) & (FPW)0x00800080) != (FPW)0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = (FPW)0x00FF00FF; /* restore read mode */
return (1);
}
diff --git a/board/o2dnt/flash.c b/board/o2dnt/flash.c
index 9f30880..e7f2069 100644
--- a/board/o2dnt/flash.c
+++ b/board/o2dnt/flash.c
@@ -302,7 +302,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
prot);
printf ("\n");
- last = get_timer(0);
+ last = time_now_ms();
/* Start erase on unprotected sectors */
for (sect = s_first; sect <= s_last && rcode == 0; sect++) {
@@ -322,13 +322,13 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (flag)
enable_interrupts();
- start = get_timer(0);
+ start = time_now_ms();
/* wait at least 80us for Intel - let's wait 1 ms */
udelay (1000);
while ((*addr & (FPW) INTEL_FINISHED) != (FPW) INTEL_FINISHED) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr = (FPW) INTEL_SUSPEND;/* suspend erase */
flash_reset(info); /* reset to read mode */
@@ -337,9 +337,9 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
}
/* show that we're waiting */
- if ((get_timer(last)) > CONFIG_SYS_HZ) { /* every second */
+ if ((time_since_ms(last)) > CONFIG_SYS_HZ) { /* every second */
putc ('.');
- last = get_timer(0);
+ last = time_now_ms();
}
}
@@ -421,11 +421,11 @@ static int write_data (flash_info_t *info, FPWV *dest, FPW data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait while polling the status register */
while (((status = *addr) & (FPW) INTEL_FINISHED) != (FPW) INTEL_FINISHED) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = (FPW) INTEL_RESET; /* restore read mode */
return (1);
}
@@ -461,10 +461,10 @@ int flash_real_protect (flash_info_t * info, long sector, int prot)
*addr = INTEL_CONFIRM; /* clear */
}
- start = get_timer (0);
+ start = time_now_ms();
while ((*addr & INTEL_FINISHED) != INTEL_FINISHED) {
- if (get_timer (start) > CONFIG_SYS_FLASH_UNLOCK_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_UNLOCK_TOUT) {
printf ("Flash lock bit operation timed out\n");
rc = 1;
break;
@@ -487,13 +487,13 @@ int flash_real_protect (flash_info_t * info, long sector, int prot)
if (!prot) {
for (i = 0; i < info->sector_count; i++) {
if (info->protect[i]) {
- start = get_timer (0);
+ start = time_now_ms();
addr = (FPWV *) (info->start[i]);
*addr = INTEL_LOCKBIT; /* Sector lock bit */
*addr = INTEL_PROTECT; /* set */
while ((*addr & INTEL_FINISHED) !=
INTEL_FINISHED) {
- if (get_timer (start) >
+ if (time_since_ms(start) >
CONFIG_SYS_FLASH_UNLOCK_TOUT) {
printf ("Flash lock bit operation timed out\n");
rc = 1;
@@ -561,9 +561,9 @@ static unsigned char intel_sector_protected (flash_info_t *info, ushort sector)
addr = (FPWV *) info->start[sector];
*addr = (FPW) INTEL_STATUS;
- start = get_timer (0);
+ start = time_now_ms();
while ((*addr & (FPW) INTEL_FINISHED) != (FPW) INTEL_FINISHED) {
- if (get_timer (start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
*addr = (FPW) INTEL_RESET; /* restore read mode */
printf("WSM busy too long, can't get prot status\n");
return 1;
diff --git a/board/oxc/flash.c b/board/oxc/flash.c
index 36e0fca..1824bd1 100644
--- a/board/oxc/flash.c
+++ b/board/oxc/flash.c
@@ -282,11 +282,11 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (vu_char *)(info->start[l_sect]);
while ((addr[0] & 0x80) != 0x80) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -359,9 +359,9 @@ static int write_byte (flash_info_t *info, ulong dest, uchar data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*((vu_char *)dest) & 0x80) != (data & 0x80)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/pcippc2/flash.c b/board/pcippc2/flash.c
index ec604e0..0c094cf 100644
--- a/board/pcippc2/flash.c
+++ b/board/pcippc2/flash.c
@@ -352,14 +352,14 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = info->start[l_sect];
DEBUGF ("Start erase timeout: %d\n", CONFIG_SYS_FLASH_ERASE_TOUT);
while ((in8(addr) & 0x80) != 0x80) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
flash_reset (info->start[0]);
return 1;
@@ -486,9 +486,9 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((in8(dest+i) & 0x80) != (data_ch[i] & 0x80)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
flash_reset (addr);
return (1);
}
diff --git a/board/pcs440ep/flash.c b/board/pcs440ep/flash.c
index f90a221..1d41133 100644
--- a/board/pcs440ep/flash.c
+++ b/board/pcs440ep/flash.c
@@ -454,10 +454,10 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
}
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((addr2[0] & (CONFIG_SYS_FLASH_WORD_SIZE)0x00800080) !=
(CONFIG_SYS_FLASH_WORD_SIZE)0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT)
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT)
return (1);
}
} else {
@@ -487,11 +487,11 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (CONFIG_SYS_FLASH_WORD_SIZE *)(info->start[l_sect]);
while ((addr[0] & (CONFIG_SYS_FLASH_WORD_SIZE)0x00800080) != (CONFIG_SYS_FLASH_WORD_SIZE)0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -611,10 +611,10 @@ static int write_word(flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((dest2[i] & (CONFIG_SYS_FLASH_WORD_SIZE)0x00800080) !=
(data2[i] & (CONFIG_SYS_FLASH_WORD_SIZE)0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT)
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT)
return (1);
}
}
diff --git a/board/pleb2/flash.c b/board/pleb2/flash.c
index 2406c5f..64def77 100644
--- a/board/pleb2/flash.c
+++ b/board/pleb2/flash.c
@@ -525,7 +525,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
/* Disable interrupts which might cause a timeout here */
flag = disable_interrupts ();
- start = get_timer(0);
+ start = time_now_ms();
last = 0;
addr = (FPWV *) (info->start[sect]);
@@ -557,7 +557,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
while ((*addr & (FPW) 0x00800080) != (FPW) 0x00800080) {
if ((now =
- get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
if (intel) {
@@ -682,12 +682,12 @@ static int write_word_amd (flash_info_t * info, FPWV * dest, FPW data)
if (flag)
enable_interrupts ();
- start = get_timer(0);
+ start = time_now_ms();
/* data polling for D7 */
while (res == 0
&& (*dest & (FPW) 0x00800080) != (data & (FPW) 0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*dest = (FPW) 0x00F000F0; /* reset bank */
res = 1;
}
@@ -730,10 +730,10 @@ static int write_word_intel (flash_info_t * info, FPWV * dest, FPW data)
if (flag)
enable_interrupts ();
- start = get_timer(0);
+ start = time_now_ms();
while (res == 0 && (*dest & (FPW) 0x00800080) != (FPW) 0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*dest = (FPW) 0x00B000B0; /* Suspend program */
res = 1;
}
diff --git a/board/pm520/flash.c b/board/pm520/flash.c
index 64c8624..0576d43 100644
--- a/board/pm520/flash.c
+++ b/board/pm520/flash.c
@@ -339,9 +339,9 @@ static unsigned char intel_sector_protected (flash_info_t *info, ushort sector)
addr = (FPWV *) info->start[sector];
*addr = (FPW) INTEL_STATUS;
- start = get_timer (0);
+ start = time_now_ms();
while ((*addr & (FPW) INTEL_FINISHED) != (FPW) INTEL_FINISHED) {
- if (get_timer (start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
*addr = (FPW) INTEL_RESET; /* restore read mode */
printf("WSM busy too long, can't get prot status\n");
return 1;
@@ -403,7 +403,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf ("\n");
}
- start = get_timer (0);
+ start = time_now_ms();
last = start;
/* Disable interrupts which might cause a timeout here */
@@ -418,14 +418,14 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf ("Erasing sector %2d ... ", sect);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
*addr = (FPW) 0x00500050; /* clear status register */
*addr = (FPW) 0x00200020; /* erase setup */
*addr = (FPW) 0x00D000D0; /* erase confirm */
while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr = (FPW) 0x00B000B0; /* suspend erase */
*addr = (FPW) 0x00FF00FF; /* reset to read mode */
@@ -556,11 +556,11 @@ static int write_data (flash_info_t *info, ulong dest, FPW data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait while polling the status register */
while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = (FPW) 0x00FF00FF; /* restore read mode */
return (1);
}
@@ -603,10 +603,10 @@ int flash_real_protect (flash_info_t *info, long sector, int prot)
*addr = INTEL_CONFIRM; /* clear */
}
- start = get_timer(0);
+ start = time_now_ms();
while ((*addr & INTEL_FINISHED) != INTEL_FINISHED) {
- if (get_timer(start) > CONFIG_SYS_FLASH_UNLOCK_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_UNLOCK_TOUT) {
printf("Flash lock bit operation timed out\n");
rc = 1;
break;
@@ -637,13 +637,13 @@ int flash_real_protect (flash_info_t *info, long sector, int prot)
{
if (info->protect[i])
{
- start = get_timer(0);
+ start = time_now_ms();
addr = (vu_long *)(info->start[i]);
*addr = INTEL_LOCKBIT; /* Sector lock bit */
*addr = INTEL_PROTECT; /* set */
while ((*addr & INTEL_FINISHED) != INTEL_FINISHED)
{
- if (get_timer(start) > CONFIG_SYS_FLASH_UNLOCK_TOUT)
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_UNLOCK_TOUT)
{
printf("Flash lock bit operation timed out\n");
rc = 1;
diff --git a/board/pm826/flash.c b/board/pm826/flash.c
index 010f59a..e8881dd 100644
--- a/board/pm826/flash.c
+++ b/board/pm826/flash.c
@@ -241,7 +241,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
volatile ulong *addr =
(volatile unsigned long *) info->start[sect];
- start = get_timer (0);
+ start = time_now_ms();
last = start;
if (info->protect[sect] == 0) {
/* Disable interrupts which might cause a timeout here
@@ -267,7 +267,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
last = start;
while ((addr[0] & 0x00800080) != 0x00800080 ||
(addr[1] & 0x00800080) != 0x00800080) {
- if ((now = get_timer (start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout (erase suspended!)\n");
/* Suspend erase
*/
@@ -360,9 +360,9 @@ static int write_word (flash_info_t * info, volatile unsigned long *addr,
if (flag)
enable_interrupts ();
- start = get_timer (0);
+ start = time_now_ms();
while ((*addr & 0x00800080) != 0x00800080) {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
/* Suspend program
*/
*addr = 0x00B000B0;
diff --git a/board/pm828/flash.c b/board/pm828/flash.c
index 4958a95..5a6f01d 100644
--- a/board/pm828/flash.c
+++ b/board/pm828/flash.c
@@ -241,7 +241,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
volatile ulong *addr =
(volatile unsigned long *) info->start[sect];
- start = get_timer (0);
+ start = time_now_ms();
last = start;
if (info->protect[sect] == 0) {
/* Disable interrupts which might cause a timeout here
@@ -267,7 +267,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
last = start;
while ((addr[0] & 0x00800080) != 0x00800080 ||
(addr[1] & 0x00800080) != 0x00800080) {
- if ((now = get_timer (start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout (erase suspended!)\n");
/* Suspend erase
*/
@@ -360,9 +360,9 @@ static int write_word (flash_info_t * info, volatile unsigned long *addr,
if (flag)
enable_interrupts ();
- start = get_timer (0);
+ start = time_now_ms();
while ((*addr & 0x00800080) != 0x00800080) {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
/* Suspend program
*/
*addr = 0x00B000B0;
diff --git a/board/ppmc7xx/flash.c b/board/ppmc7xx/flash.c
index e724227..b13b71b 100644
--- a/board/ppmc7xx/flash.c
+++ b/board/ppmc7xx/flash.c
@@ -354,12 +354,12 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
while ((*(volatile DWORD*)info->start[l_sect] & 0x0080008000800080LL )
!= 0x0080008000800080LL )
{
- if ((now = get_timer (start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -475,9 +475,9 @@ static int write_dword (flash_info_t * info, ulong dest, unsigned char *pdata)
set_msr(msr);
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while (*(volatile DWORD*)dest != data ) {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/ppmc8260/strataflash.c b/board/ppmc8260/strataflash.c
index cc91627..4754a38 100644
--- a/board/ppmc8260/strataflash.c
+++ b/board/ppmc8260/strataflash.c
@@ -398,9 +398,9 @@ static int flash_status_check(flash_info_t * info, ulong sector, ulong tout, cha
ulong start;
/* Wait for command completion */
- start = get_timer (0);
+ start = time_now_ms();
while(!flash_isset(info, sector, 0, FLASH_STATUS_DONE)) {
- if (get_timer(start) > info->erase_blk_tout) {
+ if (time_since_ms(start) > info->erase_blk_tout) {
printf("Flash %s timeout at address %lx\n", prompt, info->start[sector]);
flash_write_cmd(info, sector, 0, FLASH_CMD_RESET);
return ERR_TIMOUT;
diff --git a/board/prodrive/common/flash.c b/board/prodrive/common/flash.c
index c42fa83..7013433 100644
--- a/board/prodrive/common/flash.c
+++ b/board/prodrive/common/flash.c
@@ -391,10 +391,10 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
}
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((addr2[0] & (CONFIG_SYS_FLASH_WORD_SIZE)0x00800080) !=
(CONFIG_SYS_FLASH_WORD_SIZE)0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT)
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT)
return (1);
}
} else {
@@ -424,11 +424,11 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (CONFIG_SYS_FLASH_WORD_SIZE *)(info->start[l_sect]);
while ((addr[0] & (CONFIG_SYS_FLASH_WORD_SIZE)0x00800080) != (CONFIG_SYS_FLASH_WORD_SIZE)0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -548,10 +548,10 @@ static int write_word(flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((dest2[i] & (CONFIG_SYS_FLASH_WORD_SIZE)0x00800080) !=
(data2[i] & (CONFIG_SYS_FLASH_WORD_SIZE)0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT)
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT)
return (1);
}
}
diff --git a/board/psyent/common/AMDLV065D.c b/board/psyent/common/AMDLV065D.c
index 72b0a9f..c2b6a37 100644
--- a/board/psyent/common/AMDLV065D.c
+++ b/board/psyent/common/AMDLV065D.c
@@ -131,11 +131,11 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
/* Now just wait for 0xff & provide some user
* feedback while we wait.
*/
- start = get_timer (0);
+ start = time_now_ms();
while ( readb (addr2) != 0xff) {
udelay (1000 * 1000);
putc ('.');
- if (get_timer (start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("timeout\n");
return 1;
}
@@ -175,9 +175,9 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
writeb (dst, b);
/* Verify write */
- start = get_timer (0);
+ start = time_now_ms();
while (readb (dst) != b) {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return 1;
}
}
diff --git a/board/r360mpi/flash.c b/board/r360mpi/flash.c
index 45cccf7..7062f69 100644
--- a/board/r360mpi/flash.c
+++ b/board/r360mpi/flash.c
@@ -312,7 +312,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
printf ("\n");
}
- start = get_timer (0);
+ start = time_now_ms();
last = start;
/* Start erase on unprotected sectors */
for (sect = s_first; sect <= s_last; sect++) {
@@ -335,7 +335,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
udelay (1000);
while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
- if ((now = get_timer (start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr = (FPW) 0x00B000B0; /* suspend erase */
*addr = (FPW) 0x00FF00FF; /* reset to read mode */
@@ -469,10 +469,10 @@ static int write_data (flash_info_t * info, ulong dest, FPW data)
if (flag)
enable_interrupts ();
- start = get_timer (0);
+ start = time_now_ms();
while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = (FPW) 0x00FF00FF; /* restore read mode */
return (1);
}
diff --git a/board/rbc823/flash.c b/board/rbc823/flash.c
index cb1e089..06c0925 100644
--- a/board/rbc823/flash.c
+++ b/board/rbc823/flash.c
@@ -316,13 +316,13 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (volatile unsigned char *)(info->start[l_sect]);
while ((addr[0] & 0xFF) != 0xFF)
{
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -451,10 +451,10 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*cdest ^ *cdata) & 0x80)
{
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/rmu/flash.c b/board/rmu/flash.c
index 283b19d..1ef8344 100644
--- a/board/rmu/flash.c
+++ b/board/rmu/flash.c
@@ -402,11 +402,11 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (vu_long *)(info->start[l_sect]);
while ((addr[0] & 0x80808080) != 0x80808080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -527,9 +527,9 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*((vu_long *)dest) & 0x80808080) != (data & 0x80808080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/rpxsuper/flash.c b/board/rpxsuper/flash.c
index be29b65..b9e9a6b 100644
--- a/board/rpxsuper/flash.c
+++ b/board/rpxsuper/flash.c
@@ -287,12 +287,12 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (vu_long*)(info->start[l_sect]);
while ( (addr[0] & 0x80808080) != 0x80808080 ||
(addr[1] & 0x80808080) != 0x80808080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -421,9 +421,9 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*((vu_long *)dest) & 0x80808080) != (data & 0x80808080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/rsdproto/flash.c b/board/rsdproto/flash.c
index e99c2a6..2e5722f 100644
--- a/board/rsdproto/flash.c
+++ b/board/rsdproto/flash.c
@@ -256,10 +256,10 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (flag)
enable_interrupts();
- start = get_timer (0);
+ start = time_now_ms();
do
{
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT)
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT)
{ /* write reset command, command address is unimportant */
/* this command turns the flash back to read mode */
f_addr =
@@ -384,10 +384,10 @@ static unsigned char write_ull(flash_info_t *info,
f_command = data;
ull_write(f_addr, &f_command);
- start = get_timer (0);
+ start = time_now_ms();
do
{
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT)
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT)
{
/* write reset command, command address is unimportant */
/* this command turns the flash back to read mode */
diff --git a/board/sacsng/flash.c b/board/sacsng/flash.c
index 8b30f50..94dd8df 100644
--- a/board/sacsng/flash.c
+++ b/board/sacsng/flash.c
@@ -370,11 +370,11 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (vu_short*)(info->start[l_sect]);
while ((addr[0] & 0x0080) != 0x0080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
addr[0] = 0xF0F0; /* reset bank */
__asm__ __volatile__(" sync\n ");
@@ -507,9 +507,9 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while (*(vu_short *)dest != (ushort)data) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/samsung/smdk2400/flash.c b/board/samsung/smdk2400/flash.c
index 47382fe..2ff9900 100644
--- a/board/samsung/smdk2400/flash.c
+++ b/board/samsung/smdk2400/flash.c
@@ -287,7 +287,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
sect, info->start[sect]);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
if (info->protect[sect] == 0) { /* not protected */
vu_long *addr = (vu_long *) (info->start[sect]);
@@ -300,7 +300,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
/* wait until flash is ready */
do {
/* check timeout */
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_me(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
*addr = CMD_STATUS_RESET;
result = BIT_TIMEOUT;
break;
@@ -391,12 +391,12 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait until flash is ready */
do {
/* check timeout */
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
*addr = CMD_SUSPEND;
result = BIT_TIMEOUT;
break;
diff --git a/board/sandburst/common/flash.c b/board/sandburst/common/flash.c
index c65cb96..74d8619 100644
--- a/board/sandburst/common/flash.c
+++ b/board/sandburst/common/flash.c
@@ -281,10 +281,10 @@ int wait_for_DQ7(flash_info_t *info, int sect)
ulong start, now, last;
volatile FLASH_WORD_SIZE *addr = (FLASH_WORD_SIZE *)(info->start[sect]);
- start = get_timer (0);
+ start = time_now_ms();
last = start;
while ((addr[0] & (FLASH_WORD_SIZE)0x00800080) != (FLASH_WORD_SIZE)0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return -1;
}
@@ -498,11 +498,11 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
enable_interrupts ();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((dest2[i] & (FLASH_WORD_SIZE) 0x00800080) !=
(data2[i] & (FLASH_WORD_SIZE) 0x00800080)) {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/sandpoint/flash.c b/board/sandpoint/flash.c
index e366cc6..dd9adbf 100644
--- a/board/sandpoint/flash.c
+++ b/board/sandpoint/flash.c
@@ -607,12 +607,12 @@ flash_erase(flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (FLASH_WORD_SIZE *)(info->start[0] + (
(info->start[l_sect] - info->start[0]) << sh8b));
while ((addr[0] & (FLASH_WORD_SIZE)0x00800080) != (FLASH_WORD_SIZE)0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -748,10 +748,10 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((dest2[i << sh8b] & (FLASH_WORD_SIZE)0x00800080) !=
(data2[i] & (FLASH_WORD_SIZE)0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/sbc2410x/flash.c b/board/sbc2410x/flash.c
index d209a6f..a65469c 100644
--- a/board/sbc2410x/flash.c
+++ b/board/sbc2410x/flash.c
@@ -214,7 +214,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
printf ("Erasing sector %2d ... ", sect);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
if (info->protect[sect] == 0) { /* not protected */
vu_short *addr = (vu_short *) (info->start[sect]);
@@ -234,7 +234,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
result = *addr;
/* check timeout */
- if (get_timer(start) >
+ if (time_since_ms(start) >
CONFIG_SYS_FLASH_ERASE_TOUT) {
MEM_FLASH_ADDR1 = CMD_READ_ARRAY;
chip = TMO;
@@ -324,7 +324,7 @@ static int write_hword (flash_info_t * info, ulong dest, ushort data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- get_timer(start);
+ time_now_ms(start);
/* wait until flash is ready */
chip = 0;
@@ -332,7 +332,7 @@ static int write_hword (flash_info_t * info, ulong dest, ushort data)
result = *addr;
/* check timeout */
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
chip = ERR | TMO;
break;
}
diff --git a/board/sbc405/strataflash.c b/board/sbc405/strataflash.c
index e5863d6..c8f32e1 100644
--- a/board/sbc405/strataflash.c
+++ b/board/sbc405/strataflash.c
@@ -436,9 +436,9 @@ static int flash_status_check(flash_info_t * info, ulong sector, ulong tout, cha
ulong start;
/* Wait for command completion */
- start = get_timer (0);
+ start = time_now_ms();
while(!flash_isset(info, sector, 0, FLASH_STATUS_DONE)) {
- if (get_timer(start) > info->erase_blk_tout) {
+ if (time_since_ms(start) > info->erase_blk_tout) {
printf("Flash %s timeout at address %lx\n", prompt, info->start[sector]);
flash_write_cmd(info, sector, 0, FLASH_CMD_RESET);
return ERR_TIMOUT;
diff --git a/board/sbc8240/flash.c b/board/sbc8240/flash.c
index a095753..ea4232b 100644
--- a/board/sbc8240/flash.c
+++ b/board/sbc8240/flash.c
@@ -395,11 +395,11 @@ int wait_for_DQ7 (flash_info_t * info, int sect)
volatile FLASH_WORD_SIZE *addr =
(FLASH_WORD_SIZE *) (info->start[sect]);
- start = get_timer (0);
+ start = time_now_ms();
last = start;
while ((addr[0] & (FLASH_WORD_SIZE) 0x00800080) !=
(FLASH_WORD_SIZE) 0x00800080) {
- if ((now = get_timer (start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return -1;
}
@@ -624,11 +624,11 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
enable_interrupts ();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((dest2[i] & (FLASH_WORD_SIZE) 0x00800080) !=
(data2[i] & (FLASH_WORD_SIZE) 0x00800080)) {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/sbc8260/flash.c b/board/sbc8260/flash.c
index 645c67f..f7d8e71 100644
--- a/board/sbc8260/flash.c
+++ b/board/sbc8260/flash.c
@@ -254,11 +254,11 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (vu_long*)(info->start[l_sect]);
while ((addr[0] & 0x80808080) != 0x80808080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -379,9 +379,9 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*((vu_long *)dest) & 0x80808080) != (data & 0x80808080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/scb9328/flash.c b/board/scb9328/flash.c
index 00c660a..67fb617 100644
--- a/board/scb9328/flash.c
+++ b/board/scb9328/flash.c
@@ -99,10 +99,10 @@ static int flash_ready (ulong timeout)
int ok = 1;
ulong start;
- start = get_timer(0);
+ start = time_now_ms();
while ((flash_status_reg () & FLASH_CMD (CFI_INTEL_SR_READY)) !=
FLASH_CMD (CFI_INTEL_SR_READY)) {
- if (get_timer(start) > timeout && timeout != 0) {
+ if (time_since_ms(start) > timeout && timeout != 0) {
ok = 0;
break;
}
diff --git a/board/shannon/flash.c b/board/shannon/flash.c
index 179ec5f..11f9ccc 100644
--- a/board/shannon/flash.c
+++ b/board/shannon/flash.c
@@ -232,7 +232,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf("Erasing sector %2d ... ", sect);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
if (info->protect[sect] == 0)
{ /* not protected */
@@ -254,7 +254,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
result = *addr;
/* check timeout */
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT)
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT)
{
MEM_FLASH_ADDR1 = CMD_READ_ARRAY;
chip1 = TMO;
@@ -351,7 +351,7 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait until flash is ready */
chip1 = chip2 = 0;
@@ -360,7 +360,7 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
result = *addr;
/* check timeout */
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT)
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT)
{
chip1 = ERR | TMO;
break;
diff --git a/board/siemens/IAD210/flash.c b/board/siemens/IAD210/flash.c
index c262e0f..96935c1 100644
--- a/board/siemens/IAD210/flash.c
+++ b/board/siemens/IAD210/flash.c
@@ -364,11 +364,11 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (vu_long*)(info->start[l_sect]);
while ((addr[0] & 0x00800080) != 0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -489,9 +489,9 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*((vu_long *)dest) & 0x00800080) != (data & 0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/siemens/SCM/flash.c b/board/siemens/SCM/flash.c
index 4a6d538..184abdb 100644
--- a/board/siemens/SCM/flash.c
+++ b/board/siemens/SCM/flash.c
@@ -359,12 +359,12 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
while ((V_ULONG (info->start[l_sect]) & 0x00800080) != 0x00800080 ||
(V_ULONG (info->start[l_sect] + 4) & 0x00800080) != 0x00800080)
{
- if ((now = get_timer (start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -477,10 +477,10 @@ static int write_dword (flash_info_t * info, ulong dest, unsigned char *pdata)
enable_interrupts ();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while (((V_ULONG (dest) & 0x00800080) != (ch & 0x00800080)) ||
((V_ULONG (dest + 4) & 0x00800080) != (cl & 0x00800080))) {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/siemens/SMN42/flash.c b/board/siemens/SMN42/flash.c
index fc91574..d16e154 100644
--- a/board/siemens/SMN42/flash.c
+++ b/board/siemens/SMN42/flash.c
@@ -180,11 +180,11 @@ static int wait_for_DQ7_32(flash_info_t * info, int sect)
volatile CONFIG_SYS_FLASH_WORD_SIZE *addr =
(CONFIG_SYS_FLASH_WORD_SIZE *) (info->start[sect]);
- start = get_timer(0);
+ start = time_now_ms();
last = start;
while ((addr[0] & (CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080) !=
(CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf("Timeout\n");
return -1;
}
@@ -408,11 +408,11 @@ static int write_word(flash_info_t * info, ulong dest, ushort data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer(0);
+ start = time_now_ms();
while ((*dest2 & (CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080) !=
(*data2 & (CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
printf("WRITE_TOUT\n");
return (1);
}
diff --git a/board/sixnet/flash.c b/board/sixnet/flash.c
index 2090802..4ccf063 100644
--- a/board/sixnet/flash.c
+++ b/board/sixnet/flash.c
@@ -503,7 +503,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf ("\n");
}
- start = get_timer(0);
+ start = time_now_ms();
last = start;
/* Start erase on unprotected sectors */
@@ -544,7 +544,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
udelay (1000);
while ((*addr & (FPW)0x00800080) != (FPW)0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
if (intel) {
@@ -659,11 +659,11 @@ static int write_word_amd (flash_info_t *info, FPWV *dest, FPW data)
if (flag)
enable_interrupts();
- start = get_timer (0);
+ start = time_now_ms();
/* data polling for D7 */
while (res == 0 && (*dest & (FPW)0x00800080) != (data & (FPW)0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*dest = (FPW)0x00F000F0; /* reset bank */
res = 1;
}
@@ -706,10 +706,10 @@ static int write_word_intel (flash_info_t *info, FPWV *dest, FPW data)
if (flag)
enable_interrupts();
- start = get_timer (0);
+ start = time_now_ms();
while (res == 0 && (*dest & (FPW)0x00800080) != (FPW)0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*dest = (FPW)0x00B000B0; /* Suspend program */
res = 1;
}
diff --git a/board/snmc/qs850/flash.c b/board/snmc/qs850/flash.c
index b592285..200260d 100644
--- a/board/snmc/qs850/flash.c
+++ b/board/snmc/qs850/flash.c
@@ -474,13 +474,13 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (volatile FLASH_WORD_SIZE*)(info->start[l_sect]);
while ((addr[0] & (0x00800080&FLASH_ID_MASK)) !=
(0x00800080&FLASH_ID_MASK) )
{
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -604,10 +604,10 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer(0);
+ start = time_now_ms();
while ((*((vu_long *)dest) & 0x00800080) != (data & 0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/snmc/qs860t/flash.c b/board/snmc/qs860t/flash.c
index e725115..63dedd7 100644
--- a/board/snmc/qs860t/flash.c
+++ b/board/snmc/qs860t/flash.c
@@ -685,12 +685,12 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (volatile FLASH_WORD_SIZE *) (info->start[l_sect]);
while ((addr[0] & (0x00800080 & FLASH_ID_MASK)) !=
(0x00800080 & FLASH_ID_MASK)) {
- if ((now = get_timer (start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -1011,17 +1011,17 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
if(info->flash_id > FLASH_AMD_COMP) {
while ((*((vu_long *)dest) & 0x00800080) != (data & 0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
} else {
while(!(addr[0] & 0x00800080)) { /* wait for error or finish */
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
@@ -1076,12 +1076,12 @@ static int write_short (flash_info_t *info, ulong dest, ushort data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
if(info->flash_id < FLASH_AMD_COMP) {
/* AMD stuff */
while ((*((vu_short *)dest) & 0x0080) != (data & 0x0080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
@@ -1089,7 +1089,7 @@ static int write_short (flash_info_t *info, ulong dest, ushort data)
} else {
/* intel stuff */
while(!(addr[0] & 0x0080)){ /* wait for error or finish */
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) return (1);
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) return (1);
}
if( addr[0] & 0x003A) { /* check for error */
@@ -1103,7 +1103,7 @@ static int write_short (flash_info_t *info, ulong dest, ushort data)
*addr = 0x00B0;
*addr = 0x0070;
while(!(addr[0] & 0x0080)){ /* wait for error or finish */
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) return (1);
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) return (1);
}
*addr = 0x00FF;
}
diff --git a/board/stx/stxgp3/flash.c b/board/stx/stxgp3/flash.c
index 61c9602..4d40246 100644
--- a/board/stx/stxgp3/flash.c
+++ b/board/stx/stxgp3/flash.c
@@ -291,7 +291,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
vu_long *addr = (vu_long *)(info->start[sect]);
asm("sync");
- last = start = get_timer (0);
+ last = start = time_now_ms();
/* Disable interrupts which might cause a timeout here */
flag = disable_interrupts();
@@ -329,7 +329,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
asm("sync");
return 1;
}
- if ((now=get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now=time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr = 0xFFFFFFFF; /* reset bank */
asm("sync");
@@ -454,11 +454,11 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
flag = 0;
while (((csr = *addr) & 0x00800080) != 0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
flag = 1;
break;
}
@@ -500,9 +500,9 @@ static int clear_block_lock_bit(vu_long * addr)
*addr = 0xd0d0d0d0;
asm("sync");
- start = get_timer (0);
+ start = time_now_ms();
while((*addr & 0x00800080) != 0x00800080){
- if ((now=get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now=time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout on clearing Block Lock Bit\n");
*addr = 0xFFFFFFFF; /* reset bank */
asm("sync");
diff --git a/board/svm_sc8xx/flash.c b/board/svm_sc8xx/flash.c
index db1f21a..088f73d 100644
--- a/board/svm_sc8xx/flash.c
+++ b/board/svm_sc8xx/flash.c
@@ -548,7 +548,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (vu_long*)(info->start[l_sect]);
#if defined (CONFIG_BOOT_8B)
@@ -561,7 +561,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
# error CONFIG_BOOT_(size)B missing.
#endif
{
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -707,10 +707,10 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
if (flag)
enable_interrupts();
- start = get_timer (0);
+ start = time_now_ms();
last = start;
while( ( my_in_8((unsigned char *) (dest+i)) ) != ( data_ch[i] ) ) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT ) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT ) {
return 1;
}
}
@@ -727,10 +727,10 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
/* re-enable interrupts if necessary */
if (flag)
enable_interrupts();
- start = get_timer (0);
+ start = time_now_ms();
last = start;
while( ( my_in_be16((unsigned short *) (dest+(i*2))) ) != ( data_short[i] ) ) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT ) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT ) {
return 1;
}
}
@@ -747,9 +747,9 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*((vu_long *)dest) & 0x00800080) != (data & 0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/tb0229/flash.c b/board/tb0229/flash.c
index 75d7769..42dc353 100644
--- a/board/tb0229/flash.c
+++ b/board/tb0229/flash.c
@@ -736,12 +736,12 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (volatile FLASH_WORD_SIZE *) (info->start[l_sect]);
while ((addr[0] & (0x00800080 & FLASH_ID_MASK)) !=
(0x00800080 & FLASH_ID_MASK)) {
- if ((now = get_timer (start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -1070,13 +1070,13 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
enable_interrupts ();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
if (info->flash_id < FLASH_AMD_COMP) {
while ((*((vu_long *) dest) & 0x00800080) !=
(data & 0x00800080)) {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
printf ("timeout\n");
return (1);
}
@@ -1085,7 +1085,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
} else {
while (!(addr[0] & 0x00800080)) { /* wait for error or finish */
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
printf ("timeout\n");
return (1);
}
@@ -1152,12 +1152,12 @@ static int write_short (flash_info_t * info, ulong dest, ushort data)
enable_interrupts ();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
if (info->flash_id < FLASH_AMD_COMP) {
/* AMD stuff */
while ((*((vu_short *) dest) & 0x0080) != (data & 0x0080)) {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
@@ -1165,7 +1165,7 @@ static int write_short (flash_info_t * info, ulong dest, ushort data)
} else {
/* intel stuff */
while (!(addr[0] & 0x0080)) { /* wait for error or finish */
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT)
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT)
return (1);
}
@@ -1184,7 +1184,7 @@ static int write_short (flash_info_t * info, ulong dest, ushort data)
*addr = 0x00B0;
*addr = 0x0070;
while (!(addr[0] & 0x0080)) { /* wait for error or finish */
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT)
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT)
return (1);
}
diff --git a/board/ti/omap1610inn/flash.c b/board/ti/omap1610inn/flash.c
index 1b67d08..23da1cf 100644
--- a/board/ti/omap1610inn/flash.c
+++ b/board/ti/omap1610inn/flash.c
@@ -325,7 +325,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
flash_unprotect_sectors (addr);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
*addr = (FPW) 0x00500050;/* clear status register */
*addr = (FPW) 0x00200020;/* erase setup */
@@ -334,7 +334,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
while (((status =
*addr) & (FPW) 0x00800080) !=
(FPW) 0x00800080) {
- if (get_timer(start) >
+ if (time_since_ms(start) >
CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
/* suspend erase */
@@ -467,11 +467,11 @@ static int write_data (flash_info_t * info, ulong dest, FPW data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait while polling the status register */
while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = (FPW) 0x00FF00FF; /* restore read mode */
return (1);
}
diff --git a/board/ti/omap730p2/flash.c b/board/ti/omap730p2/flash.c
index 185bc2d..d3ca222 100644
--- a/board/ti/omap730p2/flash.c
+++ b/board/ti/omap730p2/flash.c
@@ -308,7 +308,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
flash_unprotect_sectors (addr);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
*addr = (FPW) 0x00500050;/* clear status register */
*addr = (FPW) 0x00200020;/* erase setup */
@@ -317,7 +317,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
while (((status =
*addr) & (FPW) 0x00800080) !=
(FPW) 0x00800080) {
- if (get_timer(start) >
+ if (time_since_ms(start) >
CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
/* suspend erase */
@@ -451,11 +451,11 @@ static int write_data (flash_info_t * info, ulong dest, FPW data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait while polling the status register */
while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = (FPW) 0x00FF00FF; /* restore read mode */
return (1);
}
diff --git a/board/tqc/tqm5200/cam5200_flash.c b/board/tqc/tqm5200/cam5200_flash.c
index 4c8922f..a21eb57 100644
--- a/board/tqc/tqm5200/cam5200_flash.c
+++ b/board/tqc/tqm5200/cam5200_flash.c
@@ -245,11 +245,11 @@ static int wait_for_DQ7_32(flash_info_t * info, int sect)
volatile CONFIG_SYS_FLASH_WORD_SIZE *addr =
(CONFIG_SYS_FLASH_WORD_SIZE *) (info->start[sect]);
- start = get_timer(0);
+ start = time_now_ms();
last = start;
while ((addr[0] & (CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080) !=
(CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf("Timeout\n");
return -1;
}
@@ -465,11 +465,11 @@ static int write_word(flash_info_t * info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer(0);
+ start = time_now_ms();
while ((dest2[i] & (CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080) !=
(data2[i] & (CONFIG_SYS_FLASH_WORD_SIZE) 0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT)
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT)
return (1);
}
}
@@ -588,11 +588,11 @@ static int wait_for_DQ7_16(flash_info_t * info, int sect)
volatile CONFIG_SYS_FLASH_WORD_SIZE *addr =
(CONFIG_SYS_FLASH_WORD_SIZE *) (info->start[sect]);
- start = get_timer(0);
+ start = time_now_ms();
last = start;
while ((addr[0] & (CONFIG_SYS_FLASH_WORD_SIZE) 0x80008000) !=
(CONFIG_SYS_FLASH_WORD_SIZE) 0x80008000) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf("Timeout\n");
return -1;
}
@@ -712,11 +712,11 @@ static int write_word_16(flash_info_t * info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer(0);
+ start = time_now_ms();
while ((dest2[i] & (CONFIG_SYS_FLASH_WORD_SIZE) 0x80008000) !=
(swap16(data2[i]) & (CONFIG_SYS_FLASH_WORD_SIZE) 0x80008000)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/trab/cmd_trab.c b/board/trab/cmd_trab.c
index 17890d9..0b055a3 100644
--- a/board/trab/cmd_trab.c
+++ b/board/trab/cmd_trab.c
@@ -201,7 +201,7 @@ int do_burn_in (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
* avoid timestamp overflow problem after about 68 minutes of
* udelay() time.
*/
- get_timer(0);
+ time_now_ms();
for (i = 0; i < BIF_MAX; i++) {
/* call test function */
@@ -715,7 +715,7 @@ static void led_blink (void)
/* blink LED. This function does not return! */
while (1) {
- get_timer(0);
+ time_now_ms();
led_set (1);
udelay (1000000 / LED_BLINK_FREQ / 2);
led_set (0);
@@ -860,7 +860,7 @@ int do_temp_log (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
* reset timer to avoid timestamp overflow problem
* after about 68 minutes of udelay() time.
*/
- get_timer(0);
+ time_now_ms();
sdelay (delay);
}
diff --git a/board/trab/flash.c b/board/trab/flash.c
index bde1f77..22cd576 100644
--- a/board/trab/flash.c
+++ b/board/trab/flash.c
@@ -238,7 +238,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
sect, info->start[sect]);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
if (info->protect[sect] == 0) { /* not protected */
vu_long *addr = (vu_long *) (info->start[sect]);
@@ -258,7 +258,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
result = *addr;
/* check timeout */
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
MEM_FLASH_ADDR1 = CMD_READ_ARRAY;
chip1 = TMO;
break;
@@ -350,7 +350,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start= get_timer(0);
+ start= time_now_ms();
/* wait until flash is ready */
chip1 = chip2 = 0;
@@ -358,7 +358,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
result = *addr;
/* check timeout */
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
chip1 = ERR | TMO;
break;
}
diff --git a/board/utx8245/flash.c b/board/utx8245/flash.c
index aac8116..46eb9fd 100644
--- a/board/utx8245/flash.c
+++ b/board/utx8245/flash.c
@@ -376,14 +376,14 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (FLASH_WORD_SIZE *) (info->start[0] + ((info->start[l_sect] -
info->
start[0]) << sh8b));
while ((addr[0] & (FLASH_WORD_SIZE) 0x00800080) !=
(FLASH_WORD_SIZE) 0x00800080) {
- if ((now = get_timer (start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -521,10 +521,10 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
enable_interrupts ();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((dest2[i << sh8b] & (FLASH_WORD_SIZE) 0x00800080) !=
(data2[i] & (FLASH_WORD_SIZE) 0x00800080)) {
- if (get_timer (start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/v37/flash.c b/board/v37/flash.c
index 9b817ec..04ed244 100644
--- a/board/v37/flash.c
+++ b/board/v37/flash.c
@@ -391,11 +391,11 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (vu_short *)(info->start[l_sect]);
while ((addr[0] & 0x8080) != 0x8080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -522,9 +522,9 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*((vu_short *)dest) & 0x8080) != (sdata & 0x8080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
@@ -546,9 +546,9 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*((vu_short *)dest + 1) & 0x8080) != (sdata & 0x8080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/w7o/flash.c b/board/w7o/flash.c
index 184661b..913af9b 100644
--- a/board/w7o/flash.c
+++ b/board/w7o/flash.c
@@ -496,7 +496,7 @@ static int flash_erase32(flash_info_t *info, int s_first, int s_last)
else
printf ("\n");
- start = get_timer (0);
+ start = time_now_ms();
last = start;
/* Start erase on unprotected sectors */
for (sect = s_first; sect <= s_last; sect++) {
@@ -520,7 +520,7 @@ static int flash_erase32(flash_info_t *info, int s_first, int s_last)
udelay (1000);
while (((status = *addr) & 0x00800080) != 0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr = 0x00B000B0; /* suspend erase */
*addr = 0x00FF00FF; /* reset to read mode */
@@ -560,7 +560,7 @@ static int write_buff8(flash_info_t *info, uchar *src, ulong addr, ulong cnt)
ulong start;
int i, l, rc;
- start = get_timer (0);
+ start = time_now_ms();
wp = (addr & ~3); /* get lower word
aligned address */
@@ -601,10 +601,10 @@ static int write_buff8(flash_info_t *info, uchar *src, ulong addr, ulong cnt)
}
wp += 4;
cnt -= 4;
- if (get_timer(start) > 1000) { /* every second */
+ if (time_since_ms(start) > 1000) { /* every second */
WATCHDOG_RESET();
putc ('.');
- start = get_timer(0);
+ start = time_now_ms();
}
}
@@ -634,7 +634,7 @@ static int write_buff32 (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
int i, l, rc;
ulong start;
- start = get_timer (0);
+ start = time_now_ms();
if (info->flash_id == FLASH_UNKNOWN) {
return 4;
@@ -678,9 +678,9 @@ static int write_buff32 (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
}
wp += FLASH_WIDTH;
cnt -= FLASH_WIDTH;
- if (get_timer(start) > 990) { /* every second */
+ if (time_since_ms(start) > 990) { /* every second */
putc ('.');
- start = get_timer(0);
+ start = time_now_ms();
}
}
@@ -783,11 +783,11 @@ static int write_word32(flash_info_t *info, ulong dest, ulong data)
if (flag)
enable_interrupts();
- start = get_timer (0);
+ start = time_now_ms();
while (((status = *addr) & 0x00800080) != 0x00800080) {
WATCHDOG_RESET();
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = 0x00FF00FF; /* restore read mode */
return (1);
}
diff --git a/board/w7o/fpga.c b/board/w7o/fpga.c
index 100bce4..f6d39bb 100644
--- a/board/w7o/fpga.c
+++ b/board/w7o/fpga.c
@@ -84,12 +84,12 @@ fpgaDownload(unsigned char *saddr,
out32(PPC405GP_GPIO0_OR, grego);
/* Setup timeout timer */
- start = get_timer(0);
+ start = time_now_ms();
/* Wait for FPGA init line */
while(in32(PPC405GP_GPIO0_IR) & GPIO_XCV_INIT) { /* Wait INIT line low */
/* Check for timeout - 100us max, so use 3ms */
- if (get_timer(start) > 3) {
+ if (time_since_ms(start) > 3) {
printf(" failed to start init.\n");
log_warn(ERR_XINIT0); /* Don't halt */
@@ -106,7 +106,7 @@ fpgaDownload(unsigned char *saddr,
while(!(in32(PPC405GP_GPIO0_IR) & GPIO_XCV_INIT)) { /* Wait for INIT hi */
/* Check for timeout */
- if (get_timer(start) > 3) {
+ if (time_since_ms(start) > 3) {
printf(" failed to exit init.\n");
log_warn(ERR_XINIT1);
@@ -177,13 +177,13 @@ fpgaDownload(unsigned char *saddr,
}
/* Setup timer */
- start = get_timer(0);
+ start = time_now_ms();
/* Wait for FPGA end of programming period . */
while(!(in32(PPC405GP_GPIO0_IR) & GPIO_XCV_DONE)) { /* Test DONE low */
/* Check for timeout */
- if (get_timer(start) > 3) {
+ if (time_since_ms(start) > 3) {
printf(" done failed to come high.\n");
log_warn(ERR_XDONE1);
diff --git a/board/westel/amx860/flash.c b/board/westel/amx860/flash.c
index fe8bce4..f39b541 100644
--- a/board/westel/amx860/flash.c
+++ b/board/westel/amx860/flash.c
@@ -499,11 +499,11 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
if (l_sect < 0)
goto DONE;
- start = get_timer (0);
+ start = time_now_ms();
last = start;
addr = (vu_long*)(info->start[l_sect]);
while ((addr[0] & 0x00800080) != 0x00800080) {
- if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if ((now = time_since_ms(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
return 1;
}
@@ -624,9 +624,9 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
enable_interrupts();
/* data polling for D7 */
- start = get_timer (0);
+ start = time_now_ms();
while ((*((vu_long *)dest) & 0x00800080) != (data & 0x00800080)) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
return (1);
}
}
diff --git a/board/xaeniax/flash.c b/board/xaeniax/flash.c
index 6cb0aca..8201bfb 100644
--- a/board/xaeniax/flash.c
+++ b/board/xaeniax/flash.c
@@ -266,14 +266,14 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf ("Erasing sector %2d ... ", sect);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
*addr = (FPW) 0x00500050; /* clear status register */
*addr = (FPW) 0x00200020; /* erase setup */
*addr = (FPW) 0x00D000D0; /* erase confirm */
while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr = (FPW) 0x00B000B0; /* suspend erase */
*addr = (FPW) 0x00FF00FF; /* reset to read mode */
@@ -404,11 +404,11 @@ static int write_data (flash_info_t *info, ulong dest, FPW data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait while polling the status register */
while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = (FPW) 0x00FF00FF; /* restore read mode */
return (1);
}
diff --git a/board/xm250/flash.c b/board/xm250/flash.c
index e825aba..53fb67c 100644
--- a/board/xm250/flash.c
+++ b/board/xm250/flash.c
@@ -295,14 +295,14 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf ("Erasing sector %2d ... ", sect);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
*addr = (FPW) 0x00500050; /* clear status register */
*addr = (FPW) 0x00200020; /* erase setup */
*addr = (FPW) 0x00D000D0; /* erase confirm */
while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr = (FPW) 0x00B000B0; /* suspend erase */
*addr = (FPW) 0x00FF00FF; /* reset to read mode */
@@ -433,11 +433,11 @@ static int write_data (flash_info_t *info, ulong dest, FPW data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait while polling the status register */
while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = (FPW) 0x00FF00FF; /* restore read mode */
return (1);
}
@@ -480,10 +480,10 @@ int flash_real_protect(flash_info_t *info, long sector, int prot)
*addr = INTEL_CONFIRM; /* clear */
}
- start = get_timer(0);
+ start = time_now_ms();
while ((*addr & INTEL_FINISHED) != INTEL_FINISHED) {
- if (get_timer(start) > CONFIG_SYS_FLASH_UNLOCK_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_UNLOCK_TOUT) {
printf("Flash lock bit operation timed out\n");
rc = 1;
break;
@@ -509,13 +509,13 @@ int flash_real_protect(flash_info_t *info, long sector, int prot)
{
if (info->protect[i])
{
- start = get_timer(0);
+ start = time_now_ms();
addr = (vu_long *)(info->start[i]);
*addr = INTEL_LOCKBIT; /* Sector lock bit */
*addr = INTEL_PROTECT; /* set */
while ((*addr & INTEL_FINISHED) != INTEL_FINISHED)
{
- if (get_timer(start) > CONFIG_SYS_FLASH_UNLOCK_TOUT)
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_UNLOCK_TOUT)
{
printf("Flash lock bit operation timed out\n");
rc = 1;
diff --git a/board/zeus/zeus.c b/board/zeus/zeus.c
index 18cb85f..d92d717 100644
--- a/board/zeus/zeus.c
+++ b/board/zeus/zeus.c
@@ -97,7 +97,7 @@ int misc_init_r(void)
/*
* Get current time
*/
- start_time = get_timer(0);
+ start_time = time_now_ms();
/*
* FLASH stuff...
@@ -337,7 +337,7 @@ int do_chkreset(cmd_tbl_t* cmdtp, int flag, int argc, char * const argv[])
printf("Waiting for SW-Reset button to be released.");
while (1) {
- delta = get_timer(start_time);
+ delta = time_since_ms(start_time);
if (!sw_reset_pressed())
break;
diff --git a/board/zylonite/flash.c b/board/zylonite/flash.c
index 3ee0ab8..ee425b0 100644
--- a/board/zylonite/flash.c
+++ b/board/zylonite/flash.c
@@ -269,14 +269,14 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
printf ("Erasing sector %2d ... ", sect);
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
*addr = (FPW) 0x00500050; /* clear status register */
*addr = (FPW) 0x00200020; /* erase setup */
*addr = (FPW) 0x00D000D0; /* erase confirm */
while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
printf ("Timeout\n");
*addr = (FPW) 0x00B000B0; /* suspend erase */
*addr = (FPW) 0x00FF00FF; /* reset to read mode */
@@ -407,11 +407,11 @@ static int write_data (flash_info_t *info, ulong dest, FPW data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- start = get_timer(0);
+ start = time_now_ms();
/* wait while polling the status register */
while (((status = *addr) & (FPW) 0x00800080) != (FPW) 0x00800080) {
- if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
+ if (time_since_ms(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
*addr = (FPW) 0x00FF00FF; /* restore read mode */
return (1);
}
--
1.7.5.2.317.g391b14
More information about the U-Boot
mailing list