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:
parent
a555434c50
commit
38f94a2677
|
@ -777,13 +777,9 @@ COMMAND_HANDLER(ambiqmicro_handle_mass_erase_command)
|
|||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
|
||||
if (ambiqmicro_mass_erase(bank) == ERROR_OK) {
|
||||
/* set all sectors as erased */
|
||||
for (unsigned int i = 0; i < bank->num_sectors; i++)
|
||||
bank->sectors[i].is_erased = 1;
|
||||
|
||||
if (ambiqmicro_mass_erase(bank) == ERROR_OK)
|
||||
command_print(CMD, "ambiqmicro mass erase complete");
|
||||
} else
|
||||
else
|
||||
command_print(CMD, "ambiqmicro mass erase failed");
|
||||
|
||||
return ERROR_OK;
|
||||
|
|
|
@ -480,9 +480,6 @@ static int sam4l_erase(struct flash_bank *bank, unsigned int first,
|
|||
return ERROR_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
/* This sector is definitely erased. */
|
||||
bank->sectors[i].is_erased = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -438,13 +438,9 @@ COMMAND_HANDLER(avrf_handle_mass_erase_command)
|
|||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
|
||||
if (avrf_mass_erase(bank) == ERROR_OK) {
|
||||
/* set all sectors as erased */
|
||||
for (unsigned int i = 0; i < bank->num_sectors; i++)
|
||||
bank->sectors[i].is_erased = 1;
|
||||
|
||||
if (avrf_mass_erase(bank) == ERROR_OK)
|
||||
command_print(CMD, "avr mass erase complete");
|
||||
} else
|
||||
else
|
||||
command_print(CMD, "avr mass erase failed");
|
||||
|
||||
LOG_DEBUG("%s", __func__);
|
||||
|
|
|
@ -870,9 +870,7 @@ static int cfi_intel_erase(struct flash_bank *bank, unsigned int first,
|
|||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
|
||||
if (status == 0x80)
|
||||
bank->sectors[i].is_erased = 1;
|
||||
else {
|
||||
if (status != 0x80) {
|
||||
retval = cfi_send_command(bank, 0xff, cfi_flash_address(bank, 0, 0x0));
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
|
@ -927,9 +925,7 @@ static int cfi_spansion_erase(struct flash_bank *bank, unsigned int first,
|
|||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
|
||||
if (cfi_spansion_wait_status_busy(bank, cfi_info->block_erase_timeout) == ERROR_OK)
|
||||
bank->sectors[i].is_erased = 1;
|
||||
else {
|
||||
if (cfi_spansion_wait_status_busy(bank, cfi_info->block_erase_timeout) != ERROR_OK) {
|
||||
retval = cfi_send_command(bank, 0xf0, cfi_flash_address(bank, 0, 0x0));
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
|
|
|
@ -130,15 +130,9 @@ static int dsp5680xx_flash_protect(struct flash_bank *bank, int set,
|
|||
|
||||
if (set)
|
||||
retval = dsp5680xx_f_lock(bank->target);
|
||||
else {
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -156,8 +150,6 @@ static int dsp5680xx_flash_protect(struct flash_bank *bank, int set,
|
|||
static int dsp5680xx_flash_write(struct flash_bank *bank, const uint8_t *buffer,
|
||||
uint32_t offset, uint32_t count)
|
||||
{
|
||||
int retval;
|
||||
|
||||
if ((offset + count / 2) > bank->size) {
|
||||
LOG_ERROR("%s: Flash bank cannot fit data.", __func__);
|
||||
return ERROR_FAIL;
|
||||
|
@ -171,17 +163,7 @@ static int dsp5680xx_flash_write(struct flash_bank *bank, const uint8_t *buffer,
|
|||
LOG_ERROR("%s: Writing to odd addresses not supported for this target", __func__);
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
retval = dsp5680xx_f_wr(bank->target, buffer, bank->base + offset / 2, count, 0);
|
||||
uint32_t addr_word;
|
||||
|
||||
for (addr_word = bank->base + offset / 2; addr_word < count / 2;
|
||||
addr_word += (HFM_SECTOR_SIZE / 2)) {
|
||||
if (retval == ERROR_OK)
|
||||
bank->sectors[addr_word / (HFM_SECTOR_SIZE / 2)].is_erased = 0;
|
||||
else
|
||||
bank->sectors[addr_word / (HFM_SECTOR_SIZE / 2)].is_erased = -1;
|
||||
}
|
||||
return retval;
|
||||
return dsp5680xx_f_wr(bank->target, buffer, bank->base + offset / 2, count, 0);
|
||||
}
|
||||
|
||||
static int dsp5680xx_probe(struct flash_bank *bank)
|
||||
|
@ -206,22 +188,7 @@ static int dsp5680xx_probe(struct flash_bank *bank)
|
|||
static int dsp5680xx_flash_erase(struct flash_bank *bank, unsigned int first,
|
||||
unsigned 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 (unsigned int i = first; i <= last; i++)
|
||||
bank->sectors[i].is_erased = 1;
|
||||
else
|
||||
/**
|
||||
* If an error occurred unknown status
|
||||
*is set even though some sector could have been correctly erased.
|
||||
*/
|
||||
for (unsigned int i = first; i <= last; i++)
|
||||
bank->sectors[i].is_erased = -1;
|
||||
return retval;
|
||||
return dsp5680xx_f_erase(bank->target, (uint32_t) first, (uint32_t) last);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -241,16 +208,14 @@ static int dsp5680xx_flash_erase_check(struct flash_bank *bank)
|
|||
uint32_t i;
|
||||
|
||||
for (i = 0; i < HFM_SECTOR_COUNT; i++) {
|
||||
if (bank->sectors[i].is_erased == -1) {
|
||||
retval = dsp5680xx_f_erase_check(bank->target, &erased, i);
|
||||
if (retval != ERROR_OK) {
|
||||
bank->sectors[i].is_erased = -1;
|
||||
} else {
|
||||
if (erased)
|
||||
bank->sectors[i].is_erased = 1;
|
||||
else
|
||||
bank->sectors[i].is_erased = 0;
|
||||
}
|
||||
retval = dsp5680xx_f_erase_check(bank->target, &erased, i);
|
||||
if (retval != ERROR_OK) {
|
||||
bank->sectors[i].is_erased = -1;
|
||||
} else {
|
||||
if (erased)
|
||||
bank->sectors[i].is_erased = 1;
|
||||
else
|
||||
bank->sectors[i].is_erased = 0;
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
|
|
|
@ -382,8 +382,6 @@ static int em357_erase(struct flash_bank *bank, unsigned int first,
|
|||
retval = em357_wait_status_busy(bank, 100);
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
|
||||
bank->sectors[i].is_erased = 1;
|
||||
}
|
||||
|
||||
retval = target_write_u32(target, EM357_FLASH_CR, FLASH_LOCK);
|
||||
|
@ -877,13 +875,9 @@ COMMAND_HANDLER(em357_handle_mass_erase_command)
|
|||
return retval;
|
||||
|
||||
retval = em357_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, "em357 mass erase complete");
|
||||
} else
|
||||
else
|
||||
command_print(CMD, "em357 mass erase failed");
|
||||
|
||||
return retval;
|
||||
|
|
|
@ -328,7 +328,6 @@ static int fm3_erase(struct flash_bank *bank, unsigned int first,
|
|||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
}
|
||||
bank->sectors[sector].is_erased = 1;
|
||||
}
|
||||
|
||||
target_free_working_area(target, write_algorithm);
|
||||
|
@ -953,10 +952,6 @@ COMMAND_HANDLER(fm3_handle_chip_erase_command)
|
|||
return retval;
|
||||
|
||||
if (fm3_chip_erase(bank) == ERROR_OK) {
|
||||
/* set all sectors as erased */
|
||||
for (unsigned int i = 0; i < bank->num_sectors; i++)
|
||||
bank->sectors[i].is_erased = 1;
|
||||
|
||||
command_print(CMD, "fm3 chip erase complete");
|
||||
} else {
|
||||
command_print(CMD, "fm3 chip erase failed");
|
||||
|
|
|
@ -177,8 +177,6 @@ static int fm4_flash_erase(struct flash_bank *bank, unsigned int first,
|
|||
goto err_run_ret;
|
||||
} else
|
||||
retval = ERROR_OK;
|
||||
|
||||
bank->sectors[sector].is_erased = 1;
|
||||
}
|
||||
|
||||
err_run_ret:
|
||||
|
|
|
@ -1000,8 +1000,6 @@ static int kinetis_ke_erase(struct flash_bank *bank, unsigned int first,
|
|||
return ERROR_FLASH_OPERATION_FAILED;
|
||||
}
|
||||
|
||||
bank->sectors[i].is_erased = 1;
|
||||
|
||||
if (i == 2)
|
||||
fcf_erased = true;
|
||||
}
|
||||
|
|
|
@ -302,8 +302,6 @@ static int max32xxx_erase(struct flash_bank *bank, unsigned int first,
|
|||
max32xxx_flash_op_post(bank);
|
||||
return ERROR_FLASH_OPERATION_FAILED;
|
||||
}
|
||||
|
||||
bank->sectors[banknr].is_erased = 1;
|
||||
}
|
||||
|
||||
if (!erased) {
|
||||
|
@ -771,13 +769,9 @@ COMMAND_HANDLER(max32xxx_handle_mass_erase_command)
|
|||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
|
||||
if (max32xxx_mass_erase(bank) == ERROR_OK) {
|
||||
/* set all sectors as erased */
|
||||
for (unsigned i = 0; i < bank->num_sectors; i++)
|
||||
bank->sectors[i].is_erased = 1;
|
||||
|
||||
if (max32xxx_mass_erase(bank) == ERROR_OK)
|
||||
command_print(CMD, "max32xxx mass erase complete");
|
||||
} else
|
||||
else
|
||||
command_print(CMD, "max32xxx mass erase failed");
|
||||
|
||||
return ERROR_OK;
|
||||
|
|
|
@ -197,7 +197,6 @@ static int mdr_erase(struct flash_bank *bank, unsigned int first,
|
|||
if (retval != ERROR_OK)
|
||||
goto reset_pg_and_lock;
|
||||
}
|
||||
bank->sectors[i].is_erased = 1;
|
||||
}
|
||||
|
||||
reset_pg_and_lock:
|
||||
|
|
|
@ -1206,8 +1206,6 @@ static int niietcm4_erase(struct flash_bank *bank, unsigned int first,
|
|||
retval = niietcm4_opstatus_check(bank);
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
|
||||
bank->sectors[i].is_erased = 1;
|
||||
}
|
||||
|
||||
return retval;
|
||||
|
|
|
@ -1532,8 +1532,6 @@ static int numicro_erase(struct flash_bank *bank, unsigned int first,
|
|||
retval = target_write_u32(target, NUMICRO_FLASH_ISPCON, (status | ISPCON_ISPFF));
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
} else {
|
||||
bank->sectors[i].is_erased = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -353,7 +353,6 @@ static int pic32mx_erase(struct flash_bank *bank, unsigned int first,
|
|||
return ERROR_FLASH_OPERATION_FAILED;
|
||||
if (status & NVMCON_LVDERR)
|
||||
return ERROR_FLASH_OPERATION_FAILED;
|
||||
bank->sectors[i].is_erased = 1;
|
||||
}
|
||||
|
||||
return ERROR_OK;
|
||||
|
|
|
@ -520,16 +520,9 @@ static int psoc4_mass_erase(struct flash_bank *bank)
|
|||
|
||||
/* Call "Erase All" system ROM API */
|
||||
uint32_t param = 0;
|
||||
retval = psoc4_sysreq(bank, PSOC4_CMD_ERASE_ALL,
|
||||
return psoc4_sysreq(bank, PSOC4_CMD_ERASE_ALL,
|
||||
0,
|
||||
¶m, sizeof(param), NULL);
|
||||
|
||||
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;
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -744,9 +744,6 @@ static int psoc6_erase(struct flash_bank *bank, unsigned int first,
|
|||
if (hr != ERROR_OK)
|
||||
goto exit_free_wa;
|
||||
|
||||
for (unsigned int i = first; i < first + rows_in_sector; i++)
|
||||
bank->sectors[i].is_erased = 1;
|
||||
|
||||
first += rows_in_sector;
|
||||
} else {
|
||||
/* Perform Row Erase otherwise */
|
||||
|
@ -754,7 +751,6 @@ static int psoc6_erase(struct flash_bank *bank, unsigned int first,
|
|||
if (hr != ERROR_OK)
|
||||
goto exit_free_wa;
|
||||
|
||||
bank->sectors[first].is_erased = 1;
|
||||
first += 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -886,8 +886,6 @@ static int stellaris_erase(struct flash_bank *bank, unsigned int first,
|
|||
target_write_u32(target, FLASH_CRIS, 0);
|
||||
return ERROR_FLASH_OPERATION_FAILED;
|
||||
}
|
||||
|
||||
bank->sectors[banknr].is_erased = 1;
|
||||
}
|
||||
|
||||
return ERROR_OK;
|
||||
|
@ -1318,13 +1316,9 @@ COMMAND_HANDLER(stellaris_handle_mass_erase_command)
|
|||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
|
||||
if (stellaris_mass_erase(bank) == ERROR_OK) {
|
||||
/* set all sectors as erased */
|
||||
for (unsigned int i = 0; i < bank->num_sectors; i++)
|
||||
bank->sectors[i].is_erased = 1;
|
||||
|
||||
if (stellaris_mass_erase(bank) == ERROR_OK)
|
||||
command_print(CMD, "stellaris mass erase complete");
|
||||
} else
|
||||
else
|
||||
command_print(CMD, "stellaris mass erase failed");
|
||||
|
||||
return ERROR_OK;
|
||||
|
|
|
@ -402,8 +402,6 @@ static int stm32x_erase(struct flash_bank *bank, unsigned int first,
|
|||
retval = stm32x_wait_status_busy(bank, FLASH_ERASE_TIMEOUT);
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
|
||||
bank->sectors[i].is_erased = 1;
|
||||
}
|
||||
|
||||
retval = target_write_u32(target, stm32x_get_flash_reg(bank, STM32_FLASH_CR), FLASH_LOCK);
|
||||
|
@ -1524,13 +1522,9 @@ 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, "stm32x mass erase complete");
|
||||
} else
|
||||
else
|
||||
command_print(CMD, "stm32x mass erase failed");
|
||||
|
||||
return retval;
|
||||
|
|
|
@ -649,8 +649,6 @@ static int stm32x_erase(struct flash_bank *bank, unsigned int first,
|
|||
retval = stm32x_wait_status_busy(bank, FLASH_ERASE_TIMEOUT);
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
|
||||
bank->sectors[i].is_erased = 1;
|
||||
}
|
||||
|
||||
retval = target_write_u32(target, stm32x_get_flash_reg(bank, STM32_FLASH_CR), FLASH_LOCK);
|
||||
|
@ -1561,10 +1559,6 @@ COMMAND_HANDLER(stm32x_handle_mass_erase_command)
|
|||
|
||||
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;
|
||||
|
||||
command_print(CMD, "stm32x mass erase complete");
|
||||
} else {
|
||||
command_print(CMD, "stm32x mass erase failed");
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -1002,8 +1002,6 @@ static int stm32l4_erase(struct flash_bank *bank, unsigned int first,
|
|||
retval = stm32l4_wait_status_busy(bank, FLASH_ERASE_TIMEOUT);
|
||||
if (retval != ERROR_OK)
|
||||
break;
|
||||
|
||||
bank->sectors[i].is_erased = 1;
|
||||
}
|
||||
|
||||
err_lock:
|
||||
|
@ -1713,15 +1711,10 @@ COMMAND_HANDLER(stm32l4_handle_mass_erase_command)
|
|||
return retval;
|
||||
|
||||
retval = stm32l4_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, "stm32l4x mass erase complete");
|
||||
} else {
|
||||
else
|
||||
command_print(CMD, "stm32l4x mass erase failed");
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
|
|
@ -317,15 +317,10 @@ COMMAND_HANDLER(stm32lx_handle_mass_erase_command)
|
|||
return retval;
|
||||
|
||||
retval = stm32lx_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, "stm32lx mass erase complete");
|
||||
} else {
|
||||
else
|
||||
command_print(CMD, "stm32lx mass erase failed");
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
|
|
@ -588,18 +588,13 @@ COMMAND_HANDLER(stmqspi_handle_mass_erase_command)
|
|||
retval = wait_till_ready(bank, SPI_MASS_ERASE_TIMEOUT);
|
||||
|
||||
duration_measure(&bench);
|
||||
if (retval == ERROR_OK) {
|
||||
/* set all sectors as erased */
|
||||
for (sector = 0; sector < bank->num_sectors; sector++)
|
||||
bank->sectors[sector].is_erased = 1;
|
||||
|
||||
if (retval == ERROR_OK)
|
||||
command_print(CMD, "stmqspi mass erase completed in %fs (%0.3f KiB/s)",
|
||||
duration_elapsed(&bench),
|
||||
duration_kbps(&bench, bank->size));
|
||||
} else {
|
||||
else
|
||||
command_print(CMD, "stmqspi mass erase not completed even after %fs",
|
||||
duration_elapsed(&bench));
|
||||
}
|
||||
|
||||
err:
|
||||
/* Switch to memory mapped mode before return to prompt */
|
||||
|
|
|
@ -376,9 +376,6 @@ static int str7x_erase(struct flash_bank *bank, unsigned int first,
|
|||
if (err != ERROR_OK)
|
||||
return err;
|
||||
|
||||
for (unsigned int i = first; i <= last; i++)
|
||||
bank->sectors[i].is_erased = 1;
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -300,9 +300,6 @@ static int str9x_erase(struct flash_bank *bank, unsigned int first,
|
|||
break;
|
||||
}
|
||||
|
||||
for (unsigned int i = first; i <= last; i++)
|
||||
bank->sectors[i].is_erased = 1;
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -141,9 +141,6 @@ static int xmc1xxx_erase(struct flash_bank *bank, unsigned int first,
|
|||
goto err_run;
|
||||
}
|
||||
|
||||
for (unsigned int sector = first; sector <= last; sector++)
|
||||
bank->sectors[sector].is_erased = 1;
|
||||
|
||||
err_run:
|
||||
for (i = 0; i < ARRAY_SIZE(reg_params); i++)
|
||||
destroy_reg_param(®_params[i]);
|
||||
|
|
|
@ -577,8 +577,6 @@ static int xmc4xxx_erase(struct flash_bank *bank, unsigned int first,
|
|||
|
||||
if (res != ERROR_OK)
|
||||
goto clear_status_and_exit;
|
||||
|
||||
bank->sectors[i].is_erased = 1;
|
||||
}
|
||||
|
||||
clear_status_and_exit:
|
||||
|
|
Loading…
Reference in New Issue