Skip to content
  • Tomas Vanek's avatar
    target, flash: prepare infrastructure for multi-block blank check · eb8912ec
    Tomas Vanek authored
    
    
    'flash erase_check' command runs a check algorithm on a target
    if possible. The algorithm is run repeatedly for each flash sector.
    Unfortunately every start and stop of the algorithm impose not negligible
    overhead.
    In practice it means checking is faster than plain read only for
    sectors of size approx 4 kByte or bigger. And checking sectors
    as short as 512 bytes runs approx 4 times slower than plain read.
    
    The patch changes API call target_blank_check_memory() and related
    to take an array of sectors (or arbitrary memory blocks).
    
    Changes in target-specific checking routines are kept minimal.
    They use only the first block from the array and process it by
    the unchanged algorithm.
    
    default_flash_blank_check() routine repeats target_blank_check_memory()
    until all blocks are checked, so it works with both multi-block
    and single-block based checkers.
    
    Change-Id: I0e6c60f2d71364c9c07c09416b04de9268807f5e
    Signed-off-by: default avatarTomas Vanek <vanekt@fbl.cz>
    Reviewed-on: http://openocd.zylin.com/4297
    
    
    Tested-by: jenkins
    Reviewed-by: default avatarAndreas Bolsch <hyphen0break@gmail.com>
    eb8912ec