dsp5680xx - mark erase after unlocking flash
the unlocking procedure erases the flash mem (even if it wasn't locked), so it should be marked as erased after unlocking. Change-Id: I5cc6a1e1d6cf4e1f243de532eff54111ffd66187 Signed-off-by: Rodrigo L. Rosa <rodrigorosa.lg@gmail.com> Reviewed-on: http://openocd.zylin.com/222 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
This commit is contained in:
committed by
Øyvind Harboe
parent
e0c0810a8e
commit
c725167ba8
@@ -132,8 +132,15 @@ static int dsp5680xx_flash_protect(struct flash_bank *bank, int set, int first,
|
||||
int retval;
|
||||
if(set)
|
||||
retval = dsp5680xx_f_lock(bank->target);
|
||||
else
|
||||
retval = dsp5680xx_f_unlock(bank->target);
|
||||
else{
|
||||
retval = dsp5680xx_f_unlock(bank->target);
|
||||
if (retval == ERROR_OK) {
|
||||
/* mark all as erased */
|
||||
for (int i = 0; i <= (HFM_SECTOR_COUNT-1); i++)
|
||||
/* FM does not recognize it as erased if erased via JTAG. */
|
||||
bank->sectors[i].is_erased = 1;
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user