flash: blank check use default_flash_blank_check
authorSpencer Oliver <spen@spen-soft.co.uk>
Thu, 10 May 2012 09:33:07 +0000 (10:33 +0100)
committerSpencer Oliver <spen@spen-soft.co.uk>
Mon, 14 May 2012 09:38:26 +0000 (09:38 +0000)
Use default_flash_blank_check, this will use the much faster
blank_check_memory handler if supported - 15x quicker on stm32f4.

Otherwise it will fall back to using the slower default_flash_mem_blank_check.

Change-Id: Ia231b3e95468c9e92594dbdbe1fa2d69e1506fc3
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/632
Tested-by: jenkins
src/flash/nor/avrf.c
src/flash/nor/core.c
src/flash/nor/core.h
src/flash/nor/em357.c
src/flash/nor/fm3.c
src/flash/nor/pic32mx.c
src/flash/nor/stellaris.c
src/flash/nor/stm32f1x.c
src/flash/nor/stm32f2x.c

index 1dc5f07..d436ea9 100644 (file)
@@ -479,7 +479,7 @@ struct flash_driver avr_flash = {
        .read = default_flash_read,
        .probe = avrf_probe,
        .auto_probe = avrf_auto_probe,
-       .erase_check = default_flash_mem_blank_check,
+       .erase_check = default_flash_blank_check,
        .protect_check = avrf_protect_check,
        .info = avrf_info,
 };
index b2bbeb7..14aa975 100644 (file)
@@ -253,7 +253,7 @@ int get_flash_bank_by_addr(struct target *target,
        return ERROR_OK;
 }
 
-int default_flash_mem_blank_check(struct flash_bank *bank)
+static int default_flash_mem_blank_check(struct flash_bank *bank)
 {
        struct target *target = bank->target;
        const int buffer_size = 1024;
index 90f4e61..3b6b2b5 100644 (file)
@@ -152,13 +152,6 @@ int default_flash_read(struct flash_bank *bank,
  * @returns ERROR_OK if successful; otherwise, an error code.
  */
 int default_flash_blank_check(struct flash_bank *bank);
-/**
- * Provides a default blank flash memory check.  Ensures the contents
- * of the given bank have truly been erased.
- * @param bank The flash bank.
- * @returns ERROR_OK if successful; otherwise, an error code.
- */
-int default_flash_mem_blank_check(struct flash_bank *bank);
 
 /**
  * Returns the flash bank specified by @a name, which matches the
index 7c697f1..412c9de 100644 (file)
@@ -914,7 +914,7 @@ struct flash_driver em357_flash = {
        .read = default_flash_read,
        .probe = em357_probe,
        .auto_probe = em357_auto_probe,
-       .erase_check = default_flash_mem_blank_check,
+       .erase_check = default_flash_blank_check,
        .protect_check = em357_protect_check,
        .info = get_em357_info,
 };
index 583ba22..0c6301d 100644 (file)
@@ -822,6 +822,6 @@ struct flash_driver fm3_flash = {
        .write = fm3_write_block,
        .probe = fm3_probe,
        .auto_probe = fm3_auto_probe,
-       .erase_check = default_flash_mem_blank_check,
+       .erase_check = default_flash_blank_check,
        .info = fm3_info,
 };
index 8cd0fe6..788a3b9 100644 (file)
@@ -892,7 +892,7 @@ struct flash_driver pic32mx_flash = {
        .read = default_flash_read,
        .probe = pic32mx_probe,
        .auto_probe = pic32mx_auto_probe,
-       .erase_check = default_flash_mem_blank_check,
+       .erase_check = default_flash_blank_check,
        .protect_check = pic32mx_protect_check,
        .info = pic32mx_info,
 };
index b167fb7..0bb9369 100644 (file)
@@ -1398,7 +1398,7 @@ struct flash_driver stellaris_flash = {
        .read = default_flash_read,
        .probe = stellaris_probe,
        .auto_probe = stellaris_probe,
-       .erase_check = default_flash_mem_blank_check,
+       .erase_check = default_flash_blank_check,
        .protect_check = stellaris_protect_check,
        .info = get_stellaris_info,
 };
index 91f7f1f..f05a4aa 100644 (file)
@@ -1569,7 +1569,7 @@ struct flash_driver stm32f1x_flash = {
        .read = default_flash_read,
        .probe = stm32x_probe,
        .auto_probe = stm32x_auto_probe,
-       .erase_check = default_flash_mem_blank_check,
+       .erase_check = default_flash_blank_check,
        .protect_check = stm32x_protect_check,
        .info = get_stm32x_info,
 };
index daa2546..c7e050d 100644 (file)
@@ -826,7 +826,7 @@ struct flash_driver stm32f2x_flash = {
        .read = default_flash_read,
        .probe = stm32x_probe,
        .auto_probe = stm32x_auto_probe,
-       .erase_check = default_flash_mem_blank_check,
+       .erase_check = default_flash_blank_check,
        .protect_check = stm32x_protect_check,
        .info = get_stm32x_info,
 };