summaryrefslogtreecommitdiff
path: root/board/cobra5272/flash.c
diff options
context:
space:
mode:
authorGraeme Russ <graeme.russ@gmail.com>2011-06-28 01:40:55 +0000
committerWolfgang Denk <wd@denx.de>2011-07-26 14:51:13 +0200
commitdcac25a05e2bdf35be1e13c432d238007d1c3b9f (patch)
treef703ae09ae30402cebd41e98ec0c02367bba1d71 /board/cobra5272/flash.c
parent525728b41468c7b7155ad6d9b763d9a11a7cc737 (diff)
downloadu-boot-imx-dcac25a05e2bdf35be1e13c432d238007d1c3b9f.zip
u-boot-imx-dcac25a05e2bdf35be1e13c432d238007d1c3b9f.tar.gz
u-boot-imx-dcac25a05e2bdf35be1e13c432d238007d1c3b9f.tar.bz2
Remove calls to set_timer outside arch/
There is no need to use set_timer(). Replace with appropriate use of get_timer() Signed-off-by: Graeme Russ <graeme.russ@gmail.com> Acked-by: Wolfgang Denk <wd@denx.de>
Diffstat (limited to 'board/cobra5272/flash.c')
-rw-r--r--board/cobra5272/flash.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/board/cobra5272/flash.c b/board/cobra5272/flash.c
index 33c9361..e8f02eb 100644
--- a/board/cobra5272/flash.c
+++ b/board/cobra5272/flash.c
@@ -147,6 +147,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
int iflag, cflag, prot, sect;
int rc = ERR_OK;
int chip1;
+ ulong start;
/* first look for protection bits */
@@ -190,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 */
- set_timer (0);
+ start = get_timer(0);
if (info->protect[sect] == 0) { /* not protected */
volatile u16 *addr =
@@ -211,7 +212,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
result = *addr;
/* check timeout */
- if (get_timer (0) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
MEM_FLASH_ADDR1 = CMD_READ_ARRAY;
chip1 = TMO;
break;
@@ -264,6 +265,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
int rc = ERR_OK;
int cflag, iflag;
int chip1;
+ ulong start;
/*
* Check if Flash is (sufficiently) erased
@@ -291,7 +293,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
*addr = data;
/* arm simple, non interrupt dependent timer */
- set_timer (0);
+ start = get_timer(0);
/* wait until flash is ready */
chip1 = 0;
@@ -299,7 +301,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
result = *addr;
/* check timeout */
- if (get_timer (0) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+ if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
chip1 = ERR | TMO;
break;
}