]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/mvblue/flash.c
imported Ka-Ro specific additions to U-Boot 2009.08 for TX28
[karo-tx-uboot.git] / board / mvblue / flash.c
index 8df573aa0bb84418e527c5a77c4396fd7c5c7890..2d6acf5a7d396b3c950bc66eaf93568f44b5a860 100755 (executable)
@@ -31,7 +31,7 @@
        #define mvdebug(p)
 #endif
 
-flash_info_t   flash_info[CFG_MAX_FLASH_BANKS];
+flash_info_t   flash_info[CONFIG_SYS_MAX_FLASH_BANKS];
 
 #define FLASH_BUS_WIDTH                8
 
@@ -65,7 +65,7 @@ unsigned long flash_init (void)
        unsigned long size_b0;
        int i;
 
-       for (i=0; i<CFG_MAX_FLASH_BANKS; ++i) {
+       for (i=0; i<CONFIG_SYS_MAX_FLASH_BANKS; ++i) {
                flash_info[i].flash_id = FLASH_UNKNOWN;
        }
 
@@ -337,9 +337,9 @@ static ulong flash_get_size (vu_long *address, flash_info_t *info)
 #define ERASE_DATA4 ERASE_DATA1
 #define ERASE_DATA5 ERASE_DATA2
 
-#define ERASE_SECTOR_DATA      (0x00300030 & FLASH_DATA_MASK)
-#define ERASE_CHIP_DATA        (0x00100010 & FLASH_DATA_MASK)
-#define ERASE_CONFIRM_DATA     (0x00800080 & FLASH_DATA_MASK)
+#define ERASE_SECTOR_DATA      (0x00300030 & FLASH_DATA_MASK)
+#define ERASE_CHIP_DATA                (0x00100010 & FLASH_DATA_MASK)
+#define ERASE_CONFIRM_DATA     (0x00800080 & FLASH_DATA_MASK)
 
 int    flash_erase (flash_info_t *info, int s_first, int s_last)
 {
@@ -416,7 +416,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
        addr = (FDT *)(info->start[l_sect]);
 
        while ((addr[0] & ERASE_CONFIRM_DATA) != ERASE_CONFIRM_DATA) {
-               if ((now = get_timer(start)) > CFG_FLASH_ERASE_TOUT) {
+               if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) {
                        printf ("Timeout\n");
                        return 1;
                }
@@ -554,12 +554,12 @@ static int write_char (flash_info_t *info, ulong dest, uchar data)
        start = get_timer (0);
        addr = (vu_char *)dest;
        while (( (*addr) & WRITE_CONFIRM_DATA) != (data & WRITE_CONFIRM_DATA)) {
-               if (get_timer(start) > CFG_FLASH_WRITE_TOUT) {
+               if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) {
                        printf(" *** ERROR: Flash write timeout !");
                        return (1);
                }
        }
-       mvdebug (("-write_byte\n"));
+       mvdebug (("-write_byte\n"));
        return (0);
 }
 
@@ -577,7 +577,7 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
        mvdebug (("+write_word : 0x%08lx @ 0x%08lx\n", data, dest));
        for ( i=0; (i < 4) && (result == 0); i++, dest+=1 )
                result = write_char (info, dest, (data >> (8*(3-i))) & 0xff );
-       mvdebug (("-write_word\n"));
+       mvdebug (("-write_word\n"));
        return result;
 }
 /*---------------------------------------------------------------- */