aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/flash/nor/ambiqmicro.c8
-rw-r--r--src/flash/nor/at91sam4l.c3
-rw-r--r--src/flash/nor/avrf.c8
-rw-r--r--src/flash/nor/cfi.c8
-rw-r--r--src/flash/nor/dsp5680xx_flash.c59
-rw-r--r--src/flash/nor/em357.c10
-rw-r--r--src/flash/nor/fm3.c5
-rw-r--r--src/flash/nor/fm4.c2
-rw-r--r--src/flash/nor/kinetis_ke.c2
-rw-r--r--src/flash/nor/max32xxx.c10
-rw-r--r--src/flash/nor/mdr.c1
-rw-r--r--src/flash/nor/niietcm4.c2
-rw-r--r--src/flash/nor/numicro.c2
-rw-r--r--src/flash/nor/pic32mx.c1
-rw-r--r--src/flash/nor/psoc4.c9
-rw-r--r--src/flash/nor/psoc6.c4
-rw-r--r--src/flash/nor/stellaris.c10
-rw-r--r--src/flash/nor/stm32f1x.c10
-rw-r--r--src/flash/nor/stm32f2x.c6
-rw-r--r--src/flash/nor/stm32h7x.c10
-rw-r--r--src/flash/nor/stm32l4x.c11
-rw-r--r--src/flash/nor/stm32lx.c9
-rw-r--r--src/flash/nor/stmqspi.c9
-rw-r--r--src/flash/nor/str7x.c3
-rw-r--r--src/flash/nor/str9x.c3
-rw-r--r--src/flash/nor/xmc1xxx.c3
-rw-r--r--src/flash/nor/xmc4xxx.c2
27 files changed, 35 insertions, 175 deletions
diff --git a/src/flash/nor/ambiqmicro.c b/src/flash/nor/ambiqmicro.c
index 684d21d..6eda928 100644
--- a/src/flash/nor/ambiqmicro.c
+++ b/src/flash/nor/ambiqmicro.c
@@ -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;
diff --git a/src/flash/nor/at91sam4l.c b/src/flash/nor/at91sam4l.c
index d09414c..f8c6f64 100644
--- a/src/flash/nor/at91sam4l.c
+++ b/src/flash/nor/at91sam4l.c
@@ -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;
}
}
diff --git a/src/flash/nor/avrf.c b/src/flash/nor/avrf.c
index a5a2cbd..634f739 100644
--- a/src/flash/nor/avrf.c
+++ b/src/flash/nor/avrf.c
@@ -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__);
diff --git a/src/flash/nor/cfi.c b/src/flash/nor/cfi.c
index 830d3e3..e3fb6c8 100644
--- a/src/flash/nor/cfi.c
+++ b/src/flash/nor/cfi.c
@@ -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;
diff --git a/src/flash/nor/dsp5680xx_flash.c b/src/flash/nor/dsp5680xx_flash.c
index 4902282..5e8eec3 100644
--- a/src/flash/nor/dsp5680xx_flash.c
+++ b/src/flash/nor/dsp5680xx_flash.c
@@ -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;
diff --git a/src/flash/nor/em357.c b/src/flash/nor/em357.c
index 2597d8b..705c1b3 100644
--- a/src/flash/nor/em357.c
+++ b/src/flash/nor/em357.c
@@ -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;
diff --git a/src/flash/nor/fm3.c b/src/flash/nor/fm3.c
index dc7dd40..831f342 100644
--- a/src/flash/nor/fm3.c
+++ b/src/flash/nor/fm3.c
@@ -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");
diff --git a/src/flash/nor/fm4.c b/src/flash/nor/fm4.c
index 592ccb6..09865d2 100644
--- a/src/flash/nor/fm4.c
+++ b/src/flash/nor/fm4.c
@@ -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:
diff --git a/src/flash/nor/kinetis_ke.c b/src/flash/nor/kinetis_ke.c
index 0b5ba12..513b072 100644
--- a/src/flash/nor/kinetis_ke.c
+++ b/src/flash/nor/kinetis_ke.c
@@ -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;
}
diff --git a/src/flash/nor/max32xxx.c b/src/flash/nor/max32xxx.c
index 1327da6..d11af90 100644
--- a/src/flash/nor/max32xxx.c
+++ b/src/flash/nor/max32xxx.c
@@ -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;
diff --git a/src/flash/nor/mdr.c b/src/flash/nor/mdr.c
index 228d4bc..f3c8552 100644
--- a/src/flash/nor/mdr.c
+++ b/src/flash/nor/mdr.c
@@ -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:
diff --git a/src/flash/nor/niietcm4.c b/src/flash/nor/niietcm4.c
index b266803..6f9a5d3 100644
--- a/src/flash/nor/niietcm4.c
+++ b/src/flash/nor/niietcm4.c
@@ -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;
diff --git a/src/flash/nor/numicro.c b/src/flash/nor/numicro.c
index ce3973b..cb7c1df 100644
--- a/src/flash/nor/numicro.c
+++ b/src/flash/nor/numicro.c
@@ -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;
}
}
diff --git a/src/flash/nor/pic32mx.c b/src/flash/nor/pic32mx.c
index a1f2cdf..31433e0 100644
--- a/src/flash/nor/pic32mx.c
+++ b/src/flash/nor/pic32mx.c
@@ -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;
diff --git a/src/flash/nor/psoc4.c b/src/flash/nor/psoc4.c
index 609d3b9..0a2702a 100644
--- a/src/flash/nor/psoc4.c
+++ b/src/flash/nor/psoc4.c
@@ -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,
&param, 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;
}
diff --git a/src/flash/nor/psoc6.c b/src/flash/nor/psoc6.c
index c65411b..b8b5202 100644
--- a/src/flash/nor/psoc6.c
+++ b/src/flash/nor/psoc6.c
@@ -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;
}
}
diff --git a/src/flash/nor/stellaris.c b/src/flash/nor/stellaris.c
index 569c09b..d2638c1 100644
--- a/src/flash/nor/stellaris.c
+++ b/src/flash/nor/stellaris.c
@@ -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;
diff --git a/src/flash/nor/stm32f1x.c b/src/flash/nor/stm32f1x.c
index afc6ec9..3bda9bc 100644
--- a/src/flash/nor/stm32f1x.c
+++ b/src/flash/nor/stm32f1x.c
@@ -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;
diff --git a/src/flash/nor/stm32f2x.c b/src/flash/nor/stm32f2x.c
index c5adf09..e80928d 100644
--- a/src/flash/nor/stm32f2x.c
+++ b/src/flash/nor/stm32f2x.c
@@ -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");
diff --git a/src/flash/nor/stm32h7x.c b/src/flash/nor/stm32h7x.c
index 5c71d31..89ba75d 100644
--- a/src/flash/nor/stm32h7x.c
+++ b/src/flash/nor/stm32h7x.c
@@ -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;
}
diff --git a/src/flash/nor/stm32l4x.c b/src/flash/nor/stm32l4x.c
index e6d3a83..7d6c900 100644
--- a/src/flash/nor/stm32l4x.c
+++ b/src/flash/nor/stm32l4x.c
@@ -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;
}
diff --git a/src/flash/nor/stm32lx.c b/src/flash/nor/stm32lx.c
index 3bb986e..488dc97 100644
--- a/src/flash/nor/stm32lx.c
+++ b/src/flash/nor/stm32lx.c
@@ -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;
}
diff --git a/src/flash/nor/stmqspi.c b/src/flash/nor/stmqspi.c
index f6a4934..0abd844 100644
--- a/src/flash/nor/stmqspi.c
+++ b/src/flash/nor/stmqspi.c
@@ -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 */
diff --git a/src/flash/nor/str7x.c b/src/flash/nor/str7x.c
index 5f3ff00..9b977bf 100644
--- a/src/flash/nor/str7x.c
+++ b/src/flash/nor/str7x.c
@@ -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;
}
diff --git a/src/flash/nor/str9x.c b/src/flash/nor/str9x.c
index 5c3a9cb..8f39d75 100644
--- a/src/flash/nor/str9x.c
+++ b/src/flash/nor/str9x.c
@@ -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;
}
diff --git a/src/flash/nor/xmc1xxx.c b/src/flash/nor/xmc1xxx.c
index a519ab8..9e5f0a3 100644
--- a/src/flash/nor/xmc1xxx.c
+++ b/src/flash/nor/xmc1xxx.c
@@ -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(&reg_params[i]);
diff --git a/src/flash/nor/xmc4xxx.c b/src/flash/nor/xmc4xxx.c
index 04734d1..bd37537 100644
--- a/src/flash/nor/xmc4xxx.c
+++ b/src/flash/nor/xmc4xxx.c
@@ -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: