]> git.sur5r.net Git - u-boot/blobdiff - drivers/mtd/cfi_flash.c
mmc: Fix mmc_spi error on cmd->flags field
[u-boot] / drivers / mtd / cfi_flash.c
index 97a4fd7cfaa7b6c342925167fa77a209afab60b4..43140f36479cbee9b0b894c567c4a9588fe8b36f 100644 (file)
@@ -1077,6 +1077,11 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
 
 
        for (sect = s_first; sect <= s_last; sect++) {
+               if (ctrlc()) {
+                       printf("\n");
+                       return 1;
+               }
+
                if (info->protect[sect] == 0) { /* not protected */
 #ifdef CONFIG_SYS_FLASH_CHECK_BLANK_BEFORE_ERASE
                        int k;
@@ -1379,6 +1384,9 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
                src += i;
                cnt -= i;
                FLASH_SHOW_PROGRESS(scale, dots, digit, i);
+               /* Only check every once in a while */
+               if ((cnt & 0xFFFF) < buffered_size && ctrlc())
+                       return ERR_ABORTED;
        }
 #else
        while (cnt >= info->portwidth) {
@@ -1391,6 +1399,9 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
                wp += info->portwidth;
                cnt -= info->portwidth;
                FLASH_SHOW_PROGRESS(scale, dots, digit, info->portwidth);
+               /* Only check every once in a while */
+               if ((cnt & 0xFFFF) < info->portwidth && ctrlc())
+                       return ERR_ABORTED;
        }
 #endif /* CONFIG_SYS_FLASH_USE_BUFFER_WRITE */