]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Remove calls to set_timer outside arch/
authorGraeme Russ <graeme.russ@gmail.com>
Tue, 28 Jun 2011 01:40:55 +0000 (01:40 +0000)
committerWolfgang Denk <wd@denx.de>
Tue, 26 Jul 2011 12:51:13 +0000 (14:51 +0200)
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>
board/BuS/EB+MCF-EV123/flash.c
board/cobra5272/flash.c
board/idmr/flash.c

index 3c36367d742b630b634348e7f8cb29c0586e8bd1..8b7f9578fc8f659ff5581005af6759a5e84d2943 100644 (file)
@@ -157,6 +157,7 @@ int amd_flash_erase_sector(flash_info_t * info, int sector)
 {
        int state;
        ulong result;
+       ulong start;
 
        volatile u16 *addr =
                                (volatile u16 *) (info->start[sector]);
@@ -171,13 +172,13 @@ int amd_flash_erase_sector(flash_info_t * info, int sector)
 
        /* wait until flash is ready */
        state = 0;
-       set_timer (0);
+       start = get_timer(0);
 
        do {
                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;
                        state = ERR_TIMOUT;
                }
@@ -267,6 +268,7 @@ volatile static int amd_write_word (flash_info_t * info, ulong dest, u16 data)
        ulong result;
        int cflag, iflag;
        int state;
+       ulong start;
 
        /*
         * Check if Flash is (sufficiently) erased
@@ -295,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 */
-       set_timer (0);
+       start = get_timer(0);
 
        /* wait until flash is ready */
        state = 0;
@@ -303,7 +305,7 @@ volatile static int amd_write_word (flash_info_t * info, ulong dest, u16 data)
                result = *addr;
 
                /* check timeout */
-               if (get_timer (0) > CONFIG_SYS_FLASH_ERASE_TOUT) {
+               if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT) {
                                state = ERR_TIMOUT;
                }
                if (!state && ((result & BIT_RDY_MASK) == (data & BIT_RDY_MASK)))
index 33c936120ff965a5c4549888e3c0e16836414b08..e8f02eb8121b61953ada93e990c0184778b00cf5 100644 (file)
@@ -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;
                }
index 57c994863765b2d1fb63389bc58711204c80fe5c..9f4ff2b1806042609beebdf5846de2a7734cce91 100644 (file)
@@ -130,6 +130,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
        int iflag, prot, sect;
        int rc = ERR_OK;
        int chip1;
+       ulong start;
 
        /* first look for protection bits */
 
@@ -170,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 */
-               set_timer (0);
+               start = get_timer(0);
 
                if (info->protect[sect] == 0) { /* not protected */
                        volatile u16 *addr =
@@ -191,7 +192,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 * CONFIG_SYS_HZ / 1000) {
+                               if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT * CONFIG_SYS_HZ / 1000) {
                                        MEM_FLASH_ADDR1 = CMD_READ_ARRAY;
                                        chip1 = TMO;
                                        break;
@@ -248,6 +249,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
        int rc = ERR_OK;
        int iflag;
        int chip1;
+       ulong start;
 
        /*
         * Check if Flash is (sufficiently) erased
@@ -272,7 +274,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;
@@ -280,7 +282,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 * CONFIG_SYS_HZ / 1000) {
+               if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT * CONFIG_SYS_HZ / 1000) {
                        chip1 = ERR | TMO;
                        break;
                }