From: Spencer Oliver Date: Thu, 10 May 2012 09:33:07 +0000 (+0100) Subject: flash: blank check use default_flash_blank_check X-Git-Tag: v0.6.0-rc1~88 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f9ea791e9b89bed91200f27202f9a95dd4e8640b;p=openocd flash: blank check use default_flash_blank_check 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 Reviewed-on: http://openocd.zylin.com/632 Tested-by: jenkins --- diff --git a/src/flash/nor/avrf.c b/src/flash/nor/avrf.c index 1dc5f07e..d436ea9c 100644 --- a/src/flash/nor/avrf.c +++ b/src/flash/nor/avrf.c @@ -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, }; diff --git a/src/flash/nor/core.c b/src/flash/nor/core.c index b2bbeb7d..14aa9755 100644 --- a/src/flash/nor/core.c +++ b/src/flash/nor/core.c @@ -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; diff --git a/src/flash/nor/core.h b/src/flash/nor/core.h index 90f4e614..3b6b2b5f 100644 --- a/src/flash/nor/core.h +++ b/src/flash/nor/core.h @@ -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 diff --git a/src/flash/nor/em357.c b/src/flash/nor/em357.c index 7c697f13..412c9def 100644 --- a/src/flash/nor/em357.c +++ b/src/flash/nor/em357.c @@ -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, }; diff --git a/src/flash/nor/fm3.c b/src/flash/nor/fm3.c index 583ba22c..0c6301d4 100644 --- a/src/flash/nor/fm3.c +++ b/src/flash/nor/fm3.c @@ -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, }; diff --git a/src/flash/nor/pic32mx.c b/src/flash/nor/pic32mx.c index 8cd0fe65..788a3b91 100644 --- a/src/flash/nor/pic32mx.c +++ b/src/flash/nor/pic32mx.c @@ -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, }; diff --git a/src/flash/nor/stellaris.c b/src/flash/nor/stellaris.c index b167fb78..0bb93693 100644 --- a/src/flash/nor/stellaris.c +++ b/src/flash/nor/stellaris.c @@ -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, }; diff --git a/src/flash/nor/stm32f1x.c b/src/flash/nor/stm32f1x.c index 91f7f1ff..f05a4aaa 100644 --- a/src/flash/nor/stm32f1x.c +++ b/src/flash/nor/stm32f1x.c @@ -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, }; diff --git a/src/flash/nor/stm32f2x.c b/src/flash/nor/stm32f2x.c index daa25465..c7e050d0 100644 --- a/src/flash/nor/stm32f2x.c +++ b/src/flash/nor/stm32f2x.c @@ -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, };