diff options
author | rodrigo_l_rosa <rodrigorosa.lg@gmail.com> | 2011-11-21 10:34:24 -0800 |
---|---|---|
committer | Øyvind Harboe <oyvindharboe@gmail.com> | 2011-11-24 23:26:50 +0000 |
commit | f80ef648586dc7eaa7e9b2a82b7ef4b841db3409 (patch) | |
tree | 26655af4f6f24024c5cc4fed795847cb221b9ecf | |
parent | 83be6cfc1602cb35cd2d90870d75e179074b17aa (diff) |
dsp5680xx - match page erase with mass erase
when last==first==0 then mass erase is executed, it's faster.
the page marking was wrong in this case.
Change-Id: I5c579d59b5c4778cf057cb5986e086abdd4209b2
Signed-off-by: Rodrigo L. Rosa <rodrigorosa.lg@gmail.com>
Reviewed-on: http://openocd.zylin.com/232
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
-rw-r--r-- | src/flash/nor/dsp5680xx_flash.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/flash/nor/dsp5680xx_flash.c b/src/flash/nor/dsp5680xx_flash.c index d804088f..dd32a2fa 100644 --- a/src/flash/nor/dsp5680xx_flash.c +++ b/src/flash/nor/dsp5680xx_flash.c @@ -198,6 +198,8 @@ static int dsp5680xx_flash_info(struct flash_bank *bank, char *buf, int buf_size static int dsp5680xx_flash_erase(struct flash_bank * bank, int first, int last){ int retval; retval = dsp5680xx_f_erase(bank->target, (uint32_t) first, (uint32_t) last); +if ((!(first|last)) || ((first == 0) && (last == (HFM_SECTOR_COUNT-1)))) + last = HFM_SECTOR_COUNT-1; if(retval == ERROR_OK) for(int i = first;i<=last;i++) bank->sectors[i].is_erased = 1; |