flash/nor: Do not update 'is_erased'

Remove useless setting of the 'is_erased' flag after a flash
modification. Also, remove code that erroneously depends on
this flag.

Keep the flag for now since it is still used by the
erase_check() functionality.

See commit 07da3b3913

Change-Id: Ia046905bc9e0cb2572145f19251c3e10c4e2d553
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: http://openocd.zylin.com/6279
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
Marc Schink
2021-05-07 12:02:23 +02:00
committed by Antonio Borneo
parent a555434c50
commit 38f94a2677
27 changed files with 35 additions and 175 deletions

View File

@@ -512,7 +512,6 @@ static int stm32x_erase(struct flash_bank *bank, unsigned int first,
LOG_ERROR("erase time-out or operation error sector %u", i);
goto flash_lock;
}
bank->sectors[i].is_erased = 1;
}
flash_lock:
@@ -1087,15 +1086,10 @@ COMMAND_HANDLER(stm32x_handle_mass_erase_command)
return retval;
retval = stm32x_mass_erase(bank);
if (retval == ERROR_OK) {
/* set all sectors as erased */
for (unsigned int i = 0; i < bank->num_sectors; i++)
bank->sectors[i].is_erased = 1;
if (retval == ERROR_OK)
command_print(CMD, "stm32h7x mass erase complete");
} else {
else
command_print(CMD, "stm32h7x mass erase failed");
}
return retval;
}