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 <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/632 Tested-by: jenkins
This commit is contained in:
parent
e858451505
commit
f9ea791e9b
|
@ -479,7 +479,7 @@ struct flash_driver avr_flash = {
|
||||||
.read = default_flash_read,
|
.read = default_flash_read,
|
||||||
.probe = avrf_probe,
|
.probe = avrf_probe,
|
||||||
.auto_probe = avrf_auto_probe,
|
.auto_probe = avrf_auto_probe,
|
||||||
.erase_check = default_flash_mem_blank_check,
|
.erase_check = default_flash_blank_check,
|
||||||
.protect_check = avrf_protect_check,
|
.protect_check = avrf_protect_check,
|
||||||
.info = avrf_info,
|
.info = avrf_info,
|
||||||
};
|
};
|
||||||
|
|
|
@ -253,7 +253,7 @@ int get_flash_bank_by_addr(struct target *target,
|
||||||
return ERROR_OK;
|
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;
|
struct target *target = bank->target;
|
||||||
const int buffer_size = 1024;
|
const int buffer_size = 1024;
|
||||||
|
|
|
@ -152,13 +152,6 @@ int default_flash_read(struct flash_bank *bank,
|
||||||
* @returns ERROR_OK if successful; otherwise, an error code.
|
* @returns ERROR_OK if successful; otherwise, an error code.
|
||||||
*/
|
*/
|
||||||
int default_flash_blank_check(struct flash_bank *bank);
|
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
|
* Returns the flash bank specified by @a name, which matches the
|
||||||
|
|
|
@ -914,7 +914,7 @@ struct flash_driver em357_flash = {
|
||||||
.read = default_flash_read,
|
.read = default_flash_read,
|
||||||
.probe = em357_probe,
|
.probe = em357_probe,
|
||||||
.auto_probe = em357_auto_probe,
|
.auto_probe = em357_auto_probe,
|
||||||
.erase_check = default_flash_mem_blank_check,
|
.erase_check = default_flash_blank_check,
|
||||||
.protect_check = em357_protect_check,
|
.protect_check = em357_protect_check,
|
||||||
.info = get_em357_info,
|
.info = get_em357_info,
|
||||||
};
|
};
|
||||||
|
|
|
@ -822,6 +822,6 @@ struct flash_driver fm3_flash = {
|
||||||
.write = fm3_write_block,
|
.write = fm3_write_block,
|
||||||
.probe = fm3_probe,
|
.probe = fm3_probe,
|
||||||
.auto_probe = fm3_auto_probe,
|
.auto_probe = fm3_auto_probe,
|
||||||
.erase_check = default_flash_mem_blank_check,
|
.erase_check = default_flash_blank_check,
|
||||||
.info = fm3_info,
|
.info = fm3_info,
|
||||||
};
|
};
|
||||||
|
|
|
@ -892,7 +892,7 @@ struct flash_driver pic32mx_flash = {
|
||||||
.read = default_flash_read,
|
.read = default_flash_read,
|
||||||
.probe = pic32mx_probe,
|
.probe = pic32mx_probe,
|
||||||
.auto_probe = pic32mx_auto_probe,
|
.auto_probe = pic32mx_auto_probe,
|
||||||
.erase_check = default_flash_mem_blank_check,
|
.erase_check = default_flash_blank_check,
|
||||||
.protect_check = pic32mx_protect_check,
|
.protect_check = pic32mx_protect_check,
|
||||||
.info = pic32mx_info,
|
.info = pic32mx_info,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1398,7 +1398,7 @@ struct flash_driver stellaris_flash = {
|
||||||
.read = default_flash_read,
|
.read = default_flash_read,
|
||||||
.probe = stellaris_probe,
|
.probe = stellaris_probe,
|
||||||
.auto_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,
|
.protect_check = stellaris_protect_check,
|
||||||
.info = get_stellaris_info,
|
.info = get_stellaris_info,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1569,7 +1569,7 @@ struct flash_driver stm32f1x_flash = {
|
||||||
.read = default_flash_read,
|
.read = default_flash_read,
|
||||||
.probe = stm32x_probe,
|
.probe = stm32x_probe,
|
||||||
.auto_probe = stm32x_auto_probe,
|
.auto_probe = stm32x_auto_probe,
|
||||||
.erase_check = default_flash_mem_blank_check,
|
.erase_check = default_flash_blank_check,
|
||||||
.protect_check = stm32x_protect_check,
|
.protect_check = stm32x_protect_check,
|
||||||
.info = get_stm32x_info,
|
.info = get_stm32x_info,
|
||||||
};
|
};
|
||||||
|
|
|
@ -826,7 +826,7 @@ struct flash_driver stm32f2x_flash = {
|
||||||
.read = default_flash_read,
|
.read = default_flash_read,
|
||||||
.probe = stm32x_probe,
|
.probe = stm32x_probe,
|
||||||
.auto_probe = stm32x_auto_probe,
|
.auto_probe = stm32x_auto_probe,
|
||||||
.erase_check = default_flash_mem_blank_check,
|
.erase_check = default_flash_blank_check,
|
||||||
.protect_check = stm32x_protect_check,
|
.protect_check = stm32x_protect_check,
|
||||||
.info = get_stm32x_info,
|
.info = get_stm32x_info,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue